das2numpy 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- das2numpy/__init__.py +28 -0
- das2numpy/__main__.py +99 -0
- das2numpy/chunk.py +239 -0
- das2numpy/filefinder.py +115 -0
- das2numpy/setups/light_tdms_reader.py +479 -0
- das2numpy/setups/optasense_b35idefix.py +91 -0
- das2numpy/setups/optasense_b35idefix_fast.py +111 -0
- das2numpy/setups/silixa.py +87 -0
- das2numpy/test.py +158 -0
- das2numpy/utils.py +136 -0
- das2numpy-0.0.1.dist-info/LICENSE +674 -0
- das2numpy-0.0.1.dist-info/METADATA +89 -0
- das2numpy-0.0.1.dist-info/RECORD +16 -0
- das2numpy-0.0.1.dist-info/WHEEL +5 -0
- das2numpy-0.0.1.dist-info/top_level.txt +2 -0
- example.py +39 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: das2numpy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A simple and universal package for loading large amounts of distributed acoustic sensing (DAS) data.
|
|
5
|
+
Author-email: Erik Genthe <erik.genthe@desy.de>
|
|
6
|
+
Project-URL: Homepage, https://git.physnet.uni-hamburg.de/wave/das2numpy
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
|
|
14
|
+
# Module for loading Distributed Acoustic Sensing (DAS) data. SILIXA / OPTASENSE
|
|
15
|
+
|
|
16
|
+
Python: If you want to get started quickly, have a look at the [examples](#example-python-script).
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Install dependencies
|
|
20
|
+
If you want to use pip for installing, you can just execute *install_dependencies.sh*.
|
|
21
|
+
Otherwise, have a look into install_dependencies.sh and install the listed packages yourself.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Use as python module
|
|
25
|
+
### API
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#### Recommended: simplest interface
|
|
29
|
+
```python
|
|
30
|
+
def load_array(t_start:datetime, t_end:datetime, channel_start:int, channel_end:int) -> NP.ndarray:
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Loads data and returns it as a numpy array.
|
|
35
|
+
Args:
|
|
36
|
+
t_start (datetime): datetime object which defines the start of the data to load.
|
|
37
|
+
t_end (datetime): datetime object which defines the end of the data to load.
|
|
38
|
+
channel_start (int): The starting index of sensor in the data (inclusive).
|
|
39
|
+
channel_end (int): The ending index of sensors in the data (exclusive).
|
|
40
|
+
Returns:
|
|
41
|
+
A 2d-numpy-array containing the data.
|
|
42
|
+
The first axis corresponds to the time, the second, to the channel
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
#### More detailed interface
|
|
47
|
+
```python
|
|
48
|
+
def load_array(t_start:datetime, t_end:datetime, t_step:int, channel_start:int, channel_end:int, channel_step:int) -> NP.ndarray:
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
``` Loading data into numpy array.
|
|
52
|
+
Returns nothing, the data can be accessed by accessing the data field of this instance.
|
|
53
|
+
Warning: using a different value then 1 for t_step or channel_step can result in a high cpu-usage.
|
|
54
|
+
Consider using multithreaded=True in the constructor and a high amount of workers if needed.
|
|
55
|
+
Constraints:
|
|
56
|
+
t_start has to be less or equal t_end,
|
|
57
|
+
same for channel_start and channel_end.
|
|
58
|
+
t_step and channel_step have to be greater then 0
|
|
59
|
+
Args:
|
|
60
|
+
t_start (datetime): datetime object which defines the start of the data to load.
|
|
61
|
+
t_end (datetime): datetime object which defines the end of the data to load.
|
|
62
|
+
t_step (int): If you, for example only want to load the data of every fourth timestep use t_end=4
|
|
63
|
+
channel_start (int): The starting index of sensor in the data (inclusive).
|
|
64
|
+
channel_end (int): The ending index of sensors in the data (exclusive).
|
|
65
|
+
channel_step (int): Like t_step, but for the sensor position.
|
|
66
|
+
Returns:
|
|
67
|
+
A 2d-numpy-array containing the data.
|
|
68
|
+
The first axis corresponds to the time, the second, to the channel
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Lower level interfaces
|
|
72
|
+
There are also lower level interfaces in the module.
|
|
73
|
+
For example, the above interfaces also exist with POSIX timestamps in milliseconds instead of datetime objects. These timestamps have exactly the same resolution as the time axis of the resulting array.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Example python-script
|
|
77
|
+
|
|
78
|
+
[example.py](example.py)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Use as command line interface
|
|
82
|
+
|
|
83
|
+
Example call (make sure that the current working directory is not inside idas2numpy):
|
|
84
|
+
```python -m idas2numpy "SILIXA" ~/iDAS/work/2024-05-10-desy/ 2024-05-10T10:01:00 2024-05-10T10:02:00 10 0 1000 10 default
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For more information:
|
|
88
|
+
```python -m idas2numpy -h
|
|
89
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
example.py,sha256=PHPB62mrEP3AT0ykTxr89IOoXY_U2-ZUJ1Kovf2g9Qs,1175
|
|
2
|
+
das2numpy/__init__.py,sha256=L9A_nHlQC_jpcQpTfFpHPlulpik0gr3jzZUbxETj8kM,785
|
|
3
|
+
das2numpy/__main__.py,sha256=UhJ7jyS4iT39aWaNTspNHaROKaIkY7pPssVcqAwVmdE,2832
|
|
4
|
+
das2numpy/chunk.py,sha256=FgtA1Sd8oYOydcFBoWMm8qg3Pg9yYhyopohG_6fgxas,10951
|
|
5
|
+
das2numpy/filefinder.py,sha256=dOoN2nNpjKRpdV_1fWqFFgnwJWmphDgpENv2hcKsU9A,4466
|
|
6
|
+
das2numpy/test.py,sha256=UZ93sWuPoIYxpjHW7FBzWUZP4wi9LKGIZ48NOKXrZvo,5812
|
|
7
|
+
das2numpy/utils.py,sha256=07wnRfwPvZFmZftxcsf4utTfBMIyAQFox1MzH4i0jU4,4512
|
|
8
|
+
das2numpy/setups/light_tdms_reader.py,sha256=0rWl56Sb-4h_6j5CmpJqUtPrW53nhdEE4N02mpqRVIQ,20909
|
|
9
|
+
das2numpy/setups/optasense_b35idefix.py,sha256=MxYxSBNy6vZMMu6Is53o0xy6d_STatPqIKlhV2ukMwI,3329
|
|
10
|
+
das2numpy/setups/optasense_b35idefix_fast.py,sha256=qanSrfXRnE6txdA8XAah-UUE819t2td97rFaBt6z31k,4087
|
|
11
|
+
das2numpy/setups/silixa.py,sha256=MH1rC6DxsKt3qHFJlnr79rpoaEFKukCleS2ll_jthJI,2679
|
|
12
|
+
das2numpy-0.0.1.dist-info/LICENSE,sha256=va7uzkBxuvq1TlSHpdrjOEqKO8RAciSGbcR9Z55LoyU,35132
|
|
13
|
+
das2numpy-0.0.1.dist-info/METADATA,sha256=bn4euK2-BhM0KveqzQsu4YeCgj69jE5-Ji_OTtBlN1E,3538
|
|
14
|
+
das2numpy-0.0.1.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
|
15
|
+
das2numpy-0.0.1.dist-info/top_level.txt,sha256=uJ4_X_a22JACdRAOHOcCqCtm8ciFMlWZ9om2zFQi9h4,18
|
|
16
|
+
das2numpy-0.0.1.dist-info/RECORD,,
|
example.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
import matplotlib.pyplot as PP
|
|
4
|
+
from das2numpy import loader, utils
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
print("Load data to numpy-array")
|
|
8
|
+
t_start = datetime(2024, 5, 11, 1, 0, 0)
|
|
9
|
+
t_end = datetime(2024, 5, 11, 1, 0, 5)
|
|
10
|
+
channel_start = 0
|
|
11
|
+
channel_end = -1
|
|
12
|
+
loader = loader("/pnfs/desy.de/m/project/iDAS/work/2024-05-11-desy", "SILIXA", 1)
|
|
13
|
+
data = loader.load_array(t_start, t_end, channel_start, channel_end)
|
|
14
|
+
|
|
15
|
+
print("Reduce data by binning (mean averaging)")
|
|
16
|
+
bin_factors = (10, 10)
|
|
17
|
+
data = utils.bin(data, bin_factors) # Reduce time sampling and spatial sampling by a factor of 10 by averaging each.
|
|
18
|
+
sampling_hz = 1000.0 / bin_factors[0]
|
|
19
|
+
channel_spacing = 1.0 * bin_factors[1]
|
|
20
|
+
|
|
21
|
+
print("Create plot with pyplot")
|
|
22
|
+
PP.title(f"{t_start.isoformat()}")
|
|
23
|
+
PP.imshow(
|
|
24
|
+
data,
|
|
25
|
+
cmap = "seismic",
|
|
26
|
+
aspect = "auto",
|
|
27
|
+
interpolation = "nearest",
|
|
28
|
+
origin = "lower",
|
|
29
|
+
vmin = -2e-6,
|
|
30
|
+
vmax = +2e-6,
|
|
31
|
+
extent = (
|
|
32
|
+
channel_start, channel_start + (data.shape[1] * channel_spacing),
|
|
33
|
+
data.shape[0] / sampling_hz, 0
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
PP.xlabel("Position [m]")
|
|
37
|
+
PP.ylabel("Time [s]")
|
|
38
|
+
PP.colorbar(label="Strain-rate [$\\frac{m}{m \\cdot s}$]")
|
|
39
|
+
PP.savefig("waterfall.png")
|