Skip to content
Snippets Groups Projects
Commit 20ddb972 authored by Benedikt's avatar Benedikt
Browse files

started with documentation notebook

parent b150cb2c
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ class dsiVector:
:param uncer:
:param quantity:
:param unit:
:param uncerType:
:param uncerType: ['absolute','rel','relPercent','relPPM']
'''
self.dataType = self.__class__.__name__
self.dsiToolsVersion=DSITOOLSVERSION
......@@ -61,7 +61,7 @@ class dsiVector:
uncer = np.array(uncer)
#__uncer__ handling
self.originalUncerType = str(uncerType)
if uncerType == "absolute":
if uncerType == 'absolute':
self.uncer = uncer
elif uncerType == 'rel':
self.uncer = uncer * values
......
%% Cell type:code id: tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
from pccDccTools import dsiVector,dsiMultiVector,DsiASCICOnversion
```
%% Cell type:markdown id: tags:
### Creatoin of DSI vectors
DSI sectors are created from numpy arrays with the values and uncertainties as well as strings for describing the units and quantities.
The Units are in strings [DSI-Format](https://www.ptb.de/empir2018/fileadmin/documents/empir/SmartCom/documents_for_download/Digital_System_of_Units_D-SI_2019-11-04_UK_NPL_SmartCom.pdf)
The Quatitiy information is a string naming the quantity.
the keyWord argument '''uncerType''' can be one of '''['absolute','rel','relPercent','relPPM']''' we will use ''' 'relPercent' ''' to specify that the uncer values are relative to the value Vector and in percent
%% Cell type:code id: tags:
``` python
length=20
magValues=np.arange(length)+1*0.5 #lets create an value vector
magUncer=np.ones(length)*0.1 #let's create an uncer vector having the same length
```
%% Cell type:code id: tags:
``` python
magDSIVector=dsiVector(magValues,magUncer,'Magnitude', r'\volt', uncerType="relPercent")
```
%% Cell type:code id: tags:
``` python
print(magDSIVector)
```
%% Output
Magnitude in \volt len=20 (0.5, 0.0005) (1.5, 0.0015) (2.5, 0.0025) (3.5, 0.0035) ... (19.5, 0.0195)(18.5, 0.0185)(17.5, 0.0175)(16.5, 0.0165)
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment