|
5 | 5 | "metadata": {},
|
6 | 6 | "source": [
|
7 | 7 | "# A3. Loading AP Sensing files\n",
|
8 |
| - "This example loads AP sensing files. Only single-ended files are currently supported. Just like with Silixa's devices, the AP Sensing data is in .xml files" |
| 8 | + "This example loads AP sensing files. Only single-ended files are currently supported. \n", |
| 9 | + "\n", |
| 10 | + "The currently supported AP Sensing N4386B device has two data logging options to log into .xml files and .tra files. Only .xml files contain the stokes and anti-stokes intensities needed for this calibration. Unfortunately, these .xml files are scarce on metadata and do not contain the additionally connected sensors e.g. PT100 from the device. The latter are contained inside the .tra file.\n", |
| 11 | + "\n", |
| 12 | + "If you did not connect any additional sensors, you can use .xml files only and add your own logged temperature data to the datastore for calibration. (Hint: The .xml file export is well hidden in your AP Sensing software *DTS Configurator* and not documented in the user manual. Inside your *Configuration* turn *POSC export* on - this will export the .xml file.)\n", |
| 13 | + "\n", |
| 14 | + "If you want to additionally use data exported to .tra files (e.g. PT100 data) use the .tra logging make sure to enable *Auto Save Traces* in under *Program Options* and make sure *Create Multitrace files* and *Use Binary Format* are both disabled. Make sure to place the .tra files into the identical directory as the .xml files. Then they will be imported automatically with the *read_apsensing_files* commmand.\n", |
| 15 | + "\n", |
| 16 | + "The current implementation of .tra file parsing is limited to in-memory reading only." |
9 | 17 | ]
|
10 | 18 | },
|
11 | 19 | {
|
12 | 20 | "cell_type": "code",
|
13 |
| - "execution_count": null, |
| 21 | + "execution_count": 12, |
14 | 22 | "metadata": {
|
15 | 23 | "execution": {
|
16 | 24 | "iopub.execute_input": "2022-04-06T08:12:29.520519Z",
|
|
36 | 44 | },
|
37 | 45 | {
|
38 | 46 | "cell_type": "code",
|
39 |
| - "execution_count": null, |
| 47 | + "execution_count": 13, |
40 | 48 | "metadata": {
|
41 | 49 | "execution": {
|
42 | 50 | "iopub.execute_input": "2022-04-06T08:12:31.219744Z",
|
|
45 | 53 | "shell.execute_reply": "2022-04-06T08:12:31.224123Z"
|
46 | 54 | }
|
47 | 55 | },
|
48 |
| - "outputs": [], |
| 56 | + "outputs": [ |
| 57 | + { |
| 58 | + "name": "stdout", |
| 59 | + "output_type": "stream", |
| 60 | + "text": [ |
| 61 | + "..\\..\\tests\\data\\ap_sensing\n" |
| 62 | + ] |
| 63 | + } |
| 64 | + ], |
49 | 65 | "source": [
|
50 | 66 | "filepath = os.path.join(\"..\", \"..\", \"tests\", \"data\", \"ap_sensing\")\n",
|
| 67 | + "filepath_with_tra = os.path.join(\"..\", \"..\", \"tests\", \"data\", \"ap_sensing_2\", \"CH1_SE\")\n", |
51 | 68 | "print(filepath)"
|
52 | 69 | ]
|
53 | 70 | },
|
54 | 71 | {
|
55 | 72 | "cell_type": "code",
|
56 |
| - "execution_count": null, |
| 73 | + "execution_count": 14, |
57 | 74 | "metadata": {
|
58 | 75 | "execution": {
|
59 | 76 | "iopub.execute_input": "2022-04-06T08:12:31.254656Z",
|
|
62 | 79 | "shell.execute_reply": "2022-04-06T08:12:31.258995Z"
|
63 | 80 | }
|
64 | 81 | },
|
65 |
| - "outputs": [], |
| 82 | + "outputs": [ |
| 83 | + { |
| 84 | + "name": "stdout", |
| 85 | + "output_type": "stream", |
| 86 | + "text": [ |
| 87 | + "_AP Sensing_N4386B_3_20180118201727.xml\n", |
| 88 | + "_AP Sensing_N4386B_3_20180118202957.xml\n", |
| 89 | + "_AP Sensing_N4386B_3_20180118205357.xml\n" |
| 90 | + ] |
| 91 | + } |
| 92 | + ], |
66 | 93 | "source": [
|
67 | 94 | "filepathlist = sorted(glob.glob(os.path.join(filepath, \"*.xml\")))\n",
|
68 | 95 | "filenamelist = [os.path.basename(path) for path in filepathlist]\n",
|
|
80 | 107 | },
|
81 | 108 | {
|
82 | 109 | "cell_type": "code",
|
83 |
| - "execution_count": null, |
| 110 | + "execution_count": 15, |
84 | 111 | "metadata": {
|
85 | 112 | "execution": {
|
86 | 113 | "iopub.execute_input": "2022-04-06T08:12:31.262782Z",
|
|
89 | 116 | "shell.execute_reply": "2022-04-06T08:12:31.692317Z"
|
90 | 117 | }
|
91 | 118 | },
|
92 |
| - "outputs": [], |
| 119 | + "outputs": [ |
| 120 | + { |
| 121 | + "name": "stdout", |
| 122 | + "output_type": "stream", |
| 123 | + "text": [ |
| 124 | + "3 files were found, each representing a single timestep\n", |
| 125 | + "4 recorded vars were found: LAF, TEMP, ST, AST\n", |
| 126 | + "Recorded at 7101 points along the cable\n", |
| 127 | + "The measurement is single ended\n", |
| 128 | + "Reading the data from disk\n", |
| 129 | + "3 files were found, each representing a single timestep\n", |
| 130 | + "4 recorded vars were found: LAF, TEMP, ST, AST\n", |
| 131 | + "Recorded at 1201 points along the cable\n", |
| 132 | + "The measurement is single ended\n", |
| 133 | + "Reading the data from disk\n", |
| 134 | + ".tra files exist and will be read\n" |
| 135 | + ] |
| 136 | + }, |
| 137 | + { |
| 138 | + "name": "stderr", |
| 139 | + "output_type": "stream", |
| 140 | + "text": [ |
| 141 | + "C:\\Users\\David Lah\\Documents\\dts-data-processing\\extern\\python-dts-calibration\\src\\dtscalibration\\io\\apsensing.py:480: UserWarning: Not all .xml files have a matching .tra file.\n", |
| 142 | + " Missing are time following timestamps {'20180118202957', '20180118201727', '20180118205357'}. Not loading .tra data.\n", |
| 143 | + " warnings.warn(msg)\n" |
| 144 | + ] |
| 145 | + } |
| 146 | + ], |
93 | 147 | "source": [
|
94 |
| - "ds = read_apsensing_files(directory=filepath)" |
| 148 | + "ds = read_apsensing_files(directory=filepath)\n", |
| 149 | + "ds_with_tra = read_apsensing_files(directory=filepath_with_tra)" |
95 | 150 | ]
|
96 | 151 | },
|
97 | 152 | {
|
98 | 153 | "cell_type": "markdown",
|
99 | 154 | "metadata": {},
|
100 | 155 | "source": [
|
101 | 156 | "The object tries to gather as much metadata from the measurement files as possible (temporal and spatial coordinates, filenames, temperature probes measurements). All other configuration settings are loaded from the first files and stored as attributes of the `xarray.Dataset`.\n",
|
102 |
| - "\n", |
| 157 | + "y\n", |
103 | 158 | "Calibration follows as usual (see the other notebooks)."
|
104 | 159 | ]
|
105 | 160 | },
|
106 | 161 | {
|
107 | 162 | "cell_type": "code",
|
108 |
| - "execution_count": null, |
| 163 | + "execution_count": 16, |
109 | 164 | "metadata": {
|
110 | 165 | "execution": {
|
111 | 166 | "iopub.execute_input": "2022-04-06T08:12:31.695872Z",
|
|
114 | 169 | "shell.execute_reply": "2022-04-06T08:12:31.705163Z"
|
115 | 170 | }
|
116 | 171 | },
|
117 |
| - "outputs": [], |
| 172 | + "outputs": [ |
| 173 | + { |
| 174 | + "name": "stdout", |
| 175 | + "output_type": "stream", |
| 176 | + "text": [ |
| 177 | + "<xarray.Dataset> Size: 569kB\n", |
| 178 | + "Dimensions: (x: 7101, time: 3)\n", |
| 179 | + "Coordinates:\n", |
| 180 | + " * x (x) float64 57kB 0.0 0.5 1.0 ... 3.549e+03 3.55e+03 3.55e+03\n", |
| 181 | + " filename (time) <U39 468B '_AP Sensing_N4386B_3_20180118201727.xml' ...\n", |
| 182 | + " * time (time) datetime64[ns] 24B 2018-01-18T20:17:27 ... 2018-01-1...\n", |
| 183 | + "Data variables:\n", |
| 184 | + " tmp (x, time) float64 170kB 12.16 11.32 12.26 ... 15.08 17.83\n", |
| 185 | + " st (x, time) float64 170kB 1.098 1.105 ... 3.39e-18 3.409e-18\n", |
| 186 | + " ast (x, time) float64 170kB 0.1888 0.1891 ... 4.838e-19 4.945e-19\n", |
| 187 | + " creationDate (time) datetime64[ns] 24B 2018-01-18T20:17:27 ... 2018-01-1...\n", |
| 188 | + "Attributes: (12/51)\n", |
| 189 | + " wellbore:uid: ...\n", |
| 190 | + " wellbore:name: ...\n", |
| 191 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:uid: ...\n", |
| 192 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:name: ...\n", |
| 193 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:fiberInformation:fiber:...\n", |
| 194 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:fiberInformation:fiber:...\n", |
| 195 | + " ... ...\n", |
| 196 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_2:columnIndex: ...\n", |
| 197 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_3:curveId: ...\n", |
| 198 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_3:columnIndex: ...\n", |
| 199 | + " isDoubleEnded: ...\n", |
| 200 | + " forwardMeasurementChannel: ...\n", |
| 201 | + " backwardMeasurementChannel: ...\n" |
| 202 | + ] |
| 203 | + } |
| 204 | + ], |
118 | 205 | "source": [
|
119 | 206 | "print(ds)"
|
120 | 207 | ]
|
| 208 | + }, |
| 209 | + { |
| 210 | + "cell_type": "code", |
| 211 | + "execution_count": 17, |
| 212 | + "metadata": {}, |
| 213 | + "outputs": [ |
| 214 | + { |
| 215 | + "name": "stdout", |
| 216 | + "output_type": "stream", |
| 217 | + "text": [ |
| 218 | + "<xarray.DataArray 'probe1Temperature' (time: 3)> Size: 24B\n", |
| 219 | + "array([19.60636, 19.62306, 19.62306])\n", |
| 220 | + "Coordinates:\n", |
| 221 | + " filename (time) <U45 540B 'CH1_SE_AP Sensing_N4386B_1_20240130141820.xml...\n", |
| 222 | + " * time (time) datetime64[ns] 24B 2024-01-30T14:18:20 ... 2024-01-30T14...\n", |
| 223 | + "<xarray.Dataset> Size: 97kB\n", |
| 224 | + "Dimensions: (x: 1201, time: 3)\n", |
| 225 | + "Coordinates:\n", |
| 226 | + " * x (x) float64 10kB -50.0 -49.75 -49.5 ... 249.5 249.8 250.0\n", |
| 227 | + " filename (time) <U45 540B 'CH1_SE_AP Sensing_N4386B_1_202401301...\n", |
| 228 | + " * time (time) datetime64[ns] 24B 2024-01-30T14:18:20 ... 2024...\n", |
| 229 | + "Data variables:\n", |
| 230 | + " tmp (x, time) float64 29kB 22.49 22.85 23.14 ... 20.3 19.71\n", |
| 231 | + " st (x, time) float64 29kB 1.254 1.256 ... 0.8482 0.8397\n", |
| 232 | + " ast (x, time) float64 29kB 0.2453 0.2461 ... 0.163 0.1609\n", |
| 233 | + " creationDate (time) datetime64[ns] 24B 2024-01-30T14:18:20 ... 2024...\n", |
| 234 | + " probe1Temperature (time) float64 24B 19.61 19.62 19.62\n", |
| 235 | + " probe2Temperature (time) float64 24B 50.18 50.17 50.18\n", |
| 236 | + " probe3Temperature (time) float64 24B 18.57 18.6 18.56\n", |
| 237 | + " probe4Temperature (time) float64 24B 18.53 18.55 18.56\n", |
| 238 | + "Attributes: (12/51)\n", |
| 239 | + " wellbore:uid: ...\n", |
| 240 | + " wellbore:name: ...\n", |
| 241 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:uid: ...\n", |
| 242 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:name: ...\n", |
| 243 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:fiberInformation:fiber:...\n", |
| 244 | + " wellbore:dtsInstalledSystemSet:dtsInstalledSystem:fiberInformation:fiber:...\n", |
| 245 | + " ... ...\n", |
| 246 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_2:columnIndex: ...\n", |
| 247 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_3:curveId: ...\n", |
| 248 | + " wellbore:wellLogSet:wellLog:blockInfo:blockCurveInfo_3:columnIndex: ...\n", |
| 249 | + " isDoubleEnded: ...\n", |
| 250 | + " forwardMeasurementChannel: ...\n", |
| 251 | + " backwardMeasurementChannel: ...\n" |
| 252 | + ] |
| 253 | + } |
| 254 | + ], |
| 255 | + "source": [ |
| 256 | + "print(ds_with_tra.probe1Temperature)\n", |
| 257 | + "print(ds_with_tra)" |
| 258 | + ] |
121 | 259 | }
|
122 | 260 | ],
|
123 | 261 | "metadata": {
|
|
136 | 274 | "name": "python",
|
137 | 275 | "nbconvert_exporter": "python",
|
138 | 276 | "pygments_lexer": "ipython3",
|
139 |
| - "version": "3.9.11" |
| 277 | + "version": "3.10.4" |
140 | 278 | }
|
141 | 279 | },
|
142 | 280 | "nbformat": 4,
|
|
0 commit comments