das2numpy 0.0.1__tar.gz → 0.0.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: das2numpy
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: A simple and universal package for loading large amounts of distributed acoustic sensing (DAS) data.
5
5
  Author-email: Erik Genthe <erik.genthe@desy.de>
6
6
  Project-URL: Homepage, https://git.physnet.uni-hamburg.de/wave/das2numpy
@@ -13,12 +13,17 @@ License-File: LICENSE
13
13
 
14
14
  # Module for loading Distributed Acoustic Sensing (DAS) data. SILIXA / OPTASENSE
15
15
 
16
- Python: If you want to get started quickly, have a look at the [examples](#example-python-script).
16
+ Python: If you want to get started quickly, have a look at the [example.py](src/example.py).
17
17
 
18
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.
19
+ ## Install
20
+
21
+ You can install via PIP.
22
+ ```
23
+ python -m pip install das2numpy
24
+ ```
25
+
26
+ If you want to run the source have a look at *install_dependencies.sh*.
22
27
 
23
28
 
24
29
  ## Use as python module
@@ -73,17 +78,14 @@ There are also lower level interfaces in the module.
73
78
  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
79
 
75
80
 
76
- ### Example python-script
77
-
78
- [example.py](example.py)
79
-
80
-
81
81
  ## Use as command line interface
82
82
 
83
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
84
+ ```
85
+ 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
  ```
86
87
 
87
88
  For more information:
88
- ```python -m idas2numpy -h
89
+ ```
90
+ python -m idas2numpy -h
89
91
  ```
@@ -1,11 +1,16 @@
1
1
  # Module for loading Distributed Acoustic Sensing (DAS) data. SILIXA / OPTASENSE
2
2
 
3
- Python: If you want to get started quickly, have a look at the [examples](#example-python-script).
3
+ Python: If you want to get started quickly, have a look at the [example.py](src/example.py).
4
4
 
5
5
 
6
- ## Install dependencies
7
- If you want to use pip for installing, you can just execute *install_dependencies.sh*.
8
- Otherwise, have a look into install_dependencies.sh and install the listed packages yourself.
6
+ ## Install
7
+
8
+ You can install via PIP.
9
+ ```
10
+ python -m pip install das2numpy
11
+ ```
12
+
13
+ If you want to run the source have a look at *install_dependencies.sh*.
9
14
 
10
15
 
11
16
  ## Use as python module
@@ -60,17 +65,14 @@ There are also lower level interfaces in the module.
60
65
  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.
61
66
 
62
67
 
63
- ### Example python-script
64
-
65
- [example.py](example.py)
66
-
67
-
68
68
  ## Use as command line interface
69
69
 
70
70
  Example call (make sure that the current working directory is not inside idas2numpy):
71
- ```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
71
+ ```
72
+ 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
72
73
  ```
73
74
 
74
75
  For more information:
75
- ```python -m idas2numpy -h
76
+ ```
77
+ python -m idas2numpy -h
76
78
  ```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "das2numpy"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  authors = [
9
9
  { name="Erik Genthe", email="erik.genthe@desy.de" },
10
10
  ]
@@ -9,7 +9,7 @@ import numpy as NP
9
9
  from ..filefinder import FileFinder, to_posix_timestamp_ms
10
10
  from ..chunk import Chunk
11
11
  from .light_tdms_reader import TdmsReader
12
-
12
+ from ..utils import bin
13
13
 
14
14
  CALIBRATE = True
15
15
 
@@ -53,10 +53,12 @@ def load_file(file_path, rel_t_start, rel_t_end, t_step, channel_start, channel_
53
53
  tdms = TdmsReader(file_path)
54
54
  data = tdms.get_mmap()
55
55
  data = data[rel_t_start:rel_t_end, channel_start:channel_end]
56
- if t_step != 1:
57
- data = data[::t_step]
58
- if channel_step != 1:
59
- data = data[:, ::channel_step]
56
+ if t_step != 1 or channel_step != 1:
57
+ data = bin(data, (t_step, channel_step))
58
+ #if t_step != 1:
59
+ # data = data[::t_step]
60
+ #if channel_step != 1:
61
+ # data = data[:, ::channel_step]
60
62
  assert len(data) > 0
61
63
 
62
64
  if CALIBRATE:
@@ -3,6 +3,7 @@ Everything, that modifies the signal.
3
3
  author: Erik Genthe
4
4
  """
5
5
 
6
+ import math as M
6
7
  import numpy as NP
7
8
  from numba import njit
8
9
  import scipy.signal as SS
@@ -102,7 +103,9 @@ def bin(arr: NP.ndarray, bin_factors:tuple):
102
103
  if bin_factors[0] == 1 and bin_factors[1] == 1:
103
104
  return arr
104
105
 
105
- newshape = NP.array(arr.shape) // NP.array(bin_factors)
106
+ #newshape = NP.array(arr.shape) // NP.array(bin_factors)
107
+ newshape = NP.array(arr.shape).astype(NP.float32) / NP.array(bin_factors)
108
+ newshape = NP.ceil(newshape).astype(NP.int32)
106
109
  newarr = NP.empty(newshape, dtype=arr.dtype)
107
110
  _bin_helper(arr, newarr, bin_factors)
108
111
  return newarr
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: das2numpy
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: A simple and universal package for loading large amounts of distributed acoustic sensing (DAS) data.
5
5
  Author-email: Erik Genthe <erik.genthe@desy.de>
6
6
  Project-URL: Homepage, https://git.physnet.uni-hamburg.de/wave/das2numpy
@@ -13,12 +13,17 @@ License-File: LICENSE
13
13
 
14
14
  # Module for loading Distributed Acoustic Sensing (DAS) data. SILIXA / OPTASENSE
15
15
 
16
- Python: If you want to get started quickly, have a look at the [examples](#example-python-script).
16
+ Python: If you want to get started quickly, have a look at the [example.py](src/example.py).
17
17
 
18
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.
19
+ ## Install
20
+
21
+ You can install via PIP.
22
+ ```
23
+ python -m pip install das2numpy
24
+ ```
25
+
26
+ If you want to run the source have a look at *install_dependencies.sh*.
22
27
 
23
28
 
24
29
  ## Use as python module
@@ -73,17 +78,14 @@ There are also lower level interfaces in the module.
73
78
  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
79
 
75
80
 
76
- ### Example python-script
77
-
78
- [example.py](example.py)
79
-
80
-
81
81
  ## Use as command line interface
82
82
 
83
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
84
+ ```
85
+ 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
  ```
86
87
 
87
88
  For more information:
88
- ```python -m idas2numpy -h
89
+ ```
90
+ python -m idas2numpy -h
89
91
  ```
File without changes
File without changes
File without changes