Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from pccDccTools import dsiVector,dsiMultiVector,DsiASCICOnversion"
]
},
{
"cell_type": "markdown",
"source": [
"### Creatoin of DSI vectors\n",
"DSI sectors are created from numpy arrays with the values and uncertainties as well as strings for describing the units and quantities.\n",
"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)\n",
"The Quatitiy information is a string naming the quantity.\n",
"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"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
},
{
"cell_type": "code",
"execution_count": 10,
"outputs": [],
"source": [
"length=20\n",
"magValues=np.arange(length)+1*0.5 #lets create an value vector\n",
"magUncer=np.ones(length)*0.1 #let's create an uncer vector having the same length"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": 11,
"outputs": [],
"source": [
"magDSIVector=dsiVector(magValues,magUncer,'Magnitude', r'\\volt', uncerType=\"relPercent\")"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": 12,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"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)\n"
]
}
],
"source": [
"print(magDSIVector)"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}