doppy 0.2.2__tar.gz → 0.2.3__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.

Potentially problematic release.


This version of doppy might be problematic. Click here for more details.

Files changed (42) hide show
  1. {doppy-0.2.2 → doppy-0.2.3}/Cargo.lock +2 -2
  2. {doppy-0.2.2 → doppy-0.2.3}/Cargo.toml +1 -1
  3. doppy-0.2.3/PKG-INFO +137 -0
  4. doppy-0.2.3/README.md +97 -0
  5. {doppy-0.2.2 → doppy-0.2.3}/crates/doppy_rs/src/raw/wls70.rs +1 -0
  6. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/src/raw/wls70.rs +24 -1
  7. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/wls70.py +11 -1
  8. doppy-0.2.2/PKG-INFO +0 -44
  9. doppy-0.2.2/README.md +0 -4
  10. {doppy-0.2.2 → doppy-0.2.3}/LICENSE +0 -0
  11. {doppy-0.2.2 → doppy-0.2.3}/crates/doppy_rs/Cargo.toml +0 -0
  12. {doppy-0.2.2 → doppy-0.2.3}/crates/doppy_rs/src/lib.rs +0 -0
  13. {doppy-0.2.2 → doppy-0.2.3}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
  14. {doppy-0.2.2 → doppy-0.2.3}/crates/doppy_rs/src/raw.rs +0 -0
  15. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/.gitignore +0 -0
  16. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/Cargo.toml +0 -0
  17. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/src/lib.rs +0 -0
  18. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/src/raw/error.rs +0 -0
  19. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/src/raw/halo_hpl.rs +0 -0
  20. {doppy-0.2.2 → doppy-0.2.3}/crates/doprs/src/raw.rs +0 -0
  21. {doppy-0.2.2 → doppy-0.2.3}/pyproject.toml +0 -0
  22. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/__init__.py +0 -0
  23. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/__main__.py +0 -0
  24. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/bench.py +0 -0
  25. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/data/__init__.py +0 -0
  26. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/data/api.py +0 -0
  27. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/data/cache.py +0 -0
  28. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/data/exceptions.py +0 -0
  29. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/defaults.py +0 -0
  30. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/exceptions.py +0 -0
  31. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/netcdf.py +0 -0
  32. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/options.py +0 -0
  33. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/product/__init__.py +0 -0
  34. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/product/stare.py +0 -0
  35. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/product/wind.py +0 -0
  36. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/py.typed +0 -0
  37. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/__init__.py +0 -0
  38. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/halo_bg.py +0 -0
  39. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/halo_hpl.py +0 -0
  40. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/halo_sys_params.py +0 -0
  41. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/raw/windcube.py +0 -0
  42. {doppy-0.2.2 → doppy-0.2.3}/src/doppy/utils.py +0 -0
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
106
106
 
107
107
  [[package]]
108
108
  name = "doppy_rs"
109
- version = "0.2.2"
109
+ version = "0.2.3"
110
110
  dependencies = [
111
111
  "doprs",
112
112
  "numpy",
@@ -115,7 +115,7 @@ dependencies = [
115
115
 
116
116
  [[package]]
117
117
  name = "doprs"
118
- version = "0.2.2"
118
+ version = "0.2.3"
119
119
  dependencies = [
120
120
  "chrono",
121
121
  "rayon",
@@ -4,6 +4,6 @@ resolver = "2"
4
4
 
5
5
  [workspace.package]
6
6
  edition = "2021"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  authors = ["Niko Leskinen <niko.leskinen@fmi.fi>"]
9
9
  license-file = "LICENSE"
doppy-0.2.3/PKG-INFO ADDED
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.3
2
+ Name: doppy
3
+ Version: 0.2.3
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Programming Language :: Python :: 3.10
7
+ Classifier: Programming Language :: Python :: 3.11
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Dist: requests
13
+ Requires-Dist: urllib3
14
+ Requires-Dist: numpy
15
+ Requires-Dist: netcdf4
16
+ Requires-Dist: typer
17
+ Requires-Dist: matplotlib
18
+ Requires-Dist: scikit-learn
19
+ Requires-Dist: scipy
20
+ Requires-Dist: mypy ; extra == 'dev'
21
+ Requires-Dist: ruff ; extra == 'dev'
22
+ Requires-Dist: pytest ; extra == 'dev'
23
+ Requires-Dist: types-requests ; extra == 'dev'
24
+ Requires-Dist: py-spy ; extra == 'dev'
25
+ Requires-Dist: maturin ==1.4 ; extra == 'dev'
26
+ Requires-Dist: release-version ; extra == 'dev'
27
+ Requires-Dist: pre-commit ; extra == 'dev'
28
+ Provides-Extra: dev
29
+ License-File: LICENSE
30
+ License-File: LICENSE
31
+ Author: Niko Leskinen <niko.leskinen@fmi.fi>
32
+ Author-email: Niko Leskinen <niko.leskinen@fmi.fi>
33
+ Requires-Python: >=3.10
34
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
35
+ Project-URL: Homepage, https://github.com/actris-cloudnet/doppy
36
+ Project-URL: Repository, https://github.com/actris-cloudnet/doppy
37
+ Project-URL: Changelog, https://github.com/actris-cloudnet/doppy/blob/main/CHANGELOG.md
38
+ Project-URL: Bug Tracker, https://github.com/actris-cloudnet/doppy/issues
39
+
40
+ # Doppy - Wind doppler lidar processing
41
+
42
+ [![CI](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml/badge.svg)](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml)
43
+ [![PyPI version](https://badge.fury.io/py/doppy.svg)](https://badge.fury.io/py/doppy)
44
+
45
+ ## Products
46
+
47
+ - [Stare](https://github.com/actris-cloudnet/doppy/blob/main/src/doppy/product/stare.py): [Examples](https://cloudnet.fmi.fi/search/visualizations?experimental=true&product=doppler-lidar&dateFrom=2024-06-05&dateTo=2024-06-05)
48
+ - [Wind](https://github.com/actris-cloudnet/doppy/blob/main/src/doppy/product/wind.py): [Examples](https://cloudnet.fmi.fi/search/visualizations?experimental=true&product=doppler-lidar-wind&dateFrom=2024-06-05&dateTo=2024-06-05)
49
+
50
+ ## Instruments
51
+
52
+ - HALO Photonics Streamline lidars (stare, wind)
53
+ - Leosphere WindCube WLS200S (wind)
54
+ - Leosphere WindCube WLS70 (wind)
55
+
56
+ ## Install
57
+
58
+ ```sh
59
+ pip install doppy
60
+ ```
61
+
62
+ ## Usage
63
+
64
+ ```python
65
+ import doppy
66
+
67
+ stare = doppy.product.Stare.from_halo_data(
68
+ data=LIST_OF_STARE_FILE_PATHS,
69
+ data_bg=LIST_OF_BACKGROUND_FILE_PATHS,
70
+ bg_correction_method=doppy.options.BgCorrectionMethod.FIT,
71
+ )
72
+
73
+
74
+ (
75
+ doppy.netcdf.Dataset(FILENAME)
76
+ .add_dimension("time")
77
+ .add_dimension("range")
78
+ .add_time(
79
+ name="time",
80
+ dimensions=("time",),
81
+ standard_name="time",
82
+ long_name="Time UTC",
83
+ data=stare.time,
84
+ dtype="f8",
85
+ )
86
+ .add_variable(
87
+ name="range",
88
+ dimensions=("range",),
89
+ units="m",
90
+ data=stare.radial_distance,
91
+ dtype="f4",
92
+ )
93
+ .add_variable(
94
+ name="elevation",
95
+ dimensions=("time",),
96
+ units="degrees",
97
+ data=stare.elevation,
98
+ dtype="f4",
99
+ long_name="elevation from horizontal",
100
+ )
101
+ .add_variable(
102
+ name="beta_raw",
103
+ dimensions=("time", "range"),
104
+ units="sr-1 m-1",
105
+ data=stare.beta,
106
+ dtype="f4",
107
+ )
108
+ .add_variable(
109
+ name="beta",
110
+ dimensions=("time", "range"),
111
+ units="sr-1 m-1",
112
+ data=stare.beta,
113
+ dtype="f4",
114
+ mask=stare.mask,
115
+ )
116
+ .add_variable(
117
+ name="v",
118
+ dimensions=("time", "range"),
119
+ units="m s-1",
120
+ long_name="Doppler velocity",
121
+ data=stare.radial_velocity,
122
+ dtype="f4",
123
+ mask=stare.mask,
124
+ )
125
+ .add_scalar_variable(
126
+ name="wavelength",
127
+ units="m",
128
+ standard_name="radiation_wavelength",
129
+ data=stare.wavelength,
130
+ dtype="f4",
131
+ )
132
+ .add_atribute("serial_number", stare.system_id)
133
+ .add_atribute("doppy_version", doppy.__version__)
134
+ ).close()
135
+
136
+ ```
137
+
doppy-0.2.3/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Doppy - Wind doppler lidar processing
2
+
3
+ [![CI](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml/badge.svg)](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml)
4
+ [![PyPI version](https://badge.fury.io/py/doppy.svg)](https://badge.fury.io/py/doppy)
5
+
6
+ ## Products
7
+
8
+ - [Stare](https://github.com/actris-cloudnet/doppy/blob/main/src/doppy/product/stare.py): [Examples](https://cloudnet.fmi.fi/search/visualizations?experimental=true&product=doppler-lidar&dateFrom=2024-06-05&dateTo=2024-06-05)
9
+ - [Wind](https://github.com/actris-cloudnet/doppy/blob/main/src/doppy/product/wind.py): [Examples](https://cloudnet.fmi.fi/search/visualizations?experimental=true&product=doppler-lidar-wind&dateFrom=2024-06-05&dateTo=2024-06-05)
10
+
11
+ ## Instruments
12
+
13
+ - HALO Photonics Streamline lidars (stare, wind)
14
+ - Leosphere WindCube WLS200S (wind)
15
+ - Leosphere WindCube WLS70 (wind)
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ pip install doppy
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ import doppy
27
+
28
+ stare = doppy.product.Stare.from_halo_data(
29
+ data=LIST_OF_STARE_FILE_PATHS,
30
+ data_bg=LIST_OF_BACKGROUND_FILE_PATHS,
31
+ bg_correction_method=doppy.options.BgCorrectionMethod.FIT,
32
+ )
33
+
34
+
35
+ (
36
+ doppy.netcdf.Dataset(FILENAME)
37
+ .add_dimension("time")
38
+ .add_dimension("range")
39
+ .add_time(
40
+ name="time",
41
+ dimensions=("time",),
42
+ standard_name="time",
43
+ long_name="Time UTC",
44
+ data=stare.time,
45
+ dtype="f8",
46
+ )
47
+ .add_variable(
48
+ name="range",
49
+ dimensions=("range",),
50
+ units="m",
51
+ data=stare.radial_distance,
52
+ dtype="f4",
53
+ )
54
+ .add_variable(
55
+ name="elevation",
56
+ dimensions=("time",),
57
+ units="degrees",
58
+ data=stare.elevation,
59
+ dtype="f4",
60
+ long_name="elevation from horizontal",
61
+ )
62
+ .add_variable(
63
+ name="beta_raw",
64
+ dimensions=("time", "range"),
65
+ units="sr-1 m-1",
66
+ data=stare.beta,
67
+ dtype="f4",
68
+ )
69
+ .add_variable(
70
+ name="beta",
71
+ dimensions=("time", "range"),
72
+ units="sr-1 m-1",
73
+ data=stare.beta,
74
+ dtype="f4",
75
+ mask=stare.mask,
76
+ )
77
+ .add_variable(
78
+ name="v",
79
+ dimensions=("time", "range"),
80
+ units="m s-1",
81
+ long_name="Doppler velocity",
82
+ data=stare.radial_velocity,
83
+ dtype="f4",
84
+ mask=stare.mask,
85
+ )
86
+ .add_scalar_variable(
87
+ name="wavelength",
88
+ units="m",
89
+ standard_name="radiation_wavelength",
90
+ data=stare.wavelength,
91
+ dtype="f4",
92
+ )
93
+ .add_atribute("serial_number", stare.system_id)
94
+ .add_atribute("doppy_version", doppy.__version__)
95
+ ).close()
96
+
97
+ ```
@@ -69,6 +69,7 @@ fn convert_to_python(py: Python, raw: doprs::raw::wls70::Wls70) -> PyResult<PyRe
69
69
  let info_dict = PyDict::new(py);
70
70
  info_dict.set_item("altitude", raw.info.altitude.as_slice().to_pyarray(py))?;
71
71
  info_dict.set_item("system_id", raw.info.system_id)?;
72
+ info_dict.set_item("cnr_threshold", raw.info.cnr_threshold)?;
72
73
  Ok((
73
74
  info_dict,
74
75
  PyList::new(py, raw.data_columns),
@@ -17,6 +17,7 @@ pub struct Wls70 {
17
17
  pub struct Info {
18
18
  pub altitude: Vec<f64>,
19
19
  pub system_id: String,
20
+ pub cnr_threshold: f64,
20
21
  }
21
22
 
22
23
  pub fn from_file_src(mut file: &File) -> Result<Wls70, RawParseError> {
@@ -72,7 +73,9 @@ pub fn from_bytes_src(content: &[u8]) -> Result<Wls70, RawParseError> {
72
73
  let line = line?;
73
74
  match phase {
74
75
  Phase::Info => {
75
- if line.starts_with(b"Timestamp\tPosition\tTemperature") {
76
+ if line.starts_with(b"Timestamp\tPosition\tTemperature")
77
+ || line.starts_with(b"Date\tPosition\tTemperature")
78
+ {
76
79
  header.extend_from_slice(&line);
77
80
  header.push(b'\n');
78
81
  phase = Phase::Data;
@@ -141,6 +144,17 @@ fn parse_info(info_str: &[u8]) -> Result<Info, RawParseError> {
141
144
  })?
142
145
  .to_string();
143
146
  }
147
+ b if b.starts_with(b"CNRThreshold=") => {
148
+ info.cnr_threshold = std::str::from_utf8(&line[13..])
149
+ .map_err(|_| RawParseError {
150
+ message: "UTF-8 conversion error".into(),
151
+ })?
152
+ .trim()
153
+ .parse::<f64>()
154
+ .map_err(|_| RawParseError {
155
+ message: "Parse float error".into(),
156
+ })?;
157
+ }
144
158
  _ => (),
145
159
  }
146
160
  }
@@ -227,6 +241,15 @@ mod tests {
227
241
  let file = File::open(file_path)?;
228
242
  assert!(from_file_src(&file).is_ok());
229
243
 
244
+ Ok(())
245
+ }
246
+ #[test]
247
+ fn test_from_file_src_with_old_format() -> Result<(), Box<dyn std::error::Error>> {
248
+ let file_path =
249
+ "../../data/palaiseau/2012-01-01/wlscerea_0a_windLz1R10s-HR_v01_20120101_000000.rtd";
250
+ let file = File::open(file_path)?;
251
+ assert!(from_file_src(&file).is_ok());
252
+
230
253
  Ok(())
231
254
  }
232
255
  }
@@ -33,6 +33,7 @@ class Wls70:
33
33
  ] # v := meridional wind?, dim: (time, altitude)
34
34
  vertical_wind: npt.NDArray[np.float64] # w := vertical wind?, dim: (time, altitude)
35
35
  system_id: str
36
+ cnr_threshold: float
36
37
 
37
38
  @classmethod
38
39
  def from_srcs(
@@ -111,6 +112,7 @@ class Wls70:
111
112
  meridional_wind=self.meridional_wind[index],
112
113
  vertical_wind=self.vertical_wind[index],
113
114
  system_id=self.system_id,
115
+ cnr_threshold=self.cnr_threshold,
114
116
  )
115
117
  raise TypeError
116
118
 
@@ -137,6 +139,9 @@ class Wls70:
137
139
  meridional_wind=np.concatenate(tuple(r.meridional_wind for r in raws)),
138
140
  vertical_wind=np.concatenate(tuple(r.vertical_wind for r in raws)),
139
141
  system_id=merge_all_equal("system_id", [r.system_id for r in raws]),
142
+ cnr_threshold=merge_all_equal(
143
+ "cnr_threshold", [r.cnr_threshold for r in raws]
144
+ ),
140
145
  )
141
146
 
142
147
  def non_strictly_increasing_timesteps_removed(self) -> Wls70:
@@ -158,6 +163,7 @@ def _raw_rs_to_wls70(
158
163
  info, cols, data = raw_rs
159
164
  altitude = info["altitude"]
160
165
  system_id = info["system_id"]
166
+ cnr_threshold = float(info["cnr_threshold"])
161
167
  data = data.reshape(-1, len(cols))
162
168
  time_ts = data[:, 0]
163
169
  time = np.array([datetime64(datetime.utcfromtimestamp(ts)) for ts in time_ts])
@@ -173,7 +179,10 @@ def _raw_rs_to_wls70(
173
179
  u = data[:, 9::8]
174
180
  v = data[:, 10::8]
175
181
  w = data[:, 11::8]
176
-
182
+ mask = (np.abs(u) > 90) | (np.abs(v) > 90) | (np.abs(w) > 90)
183
+ u[mask] = np.nan
184
+ v[mask] = np.nan
185
+ w[mask] = np.nan
177
186
  return Wls70(
178
187
  time=time,
179
188
  altitude=altitude,
@@ -189,4 +198,5 @@ def _raw_rs_to_wls70(
189
198
  meridional_wind=v,
190
199
  vertical_wind=w,
191
200
  system_id=system_id,
201
+ cnr_threshold=cnr_threshold,
192
202
  )
doppy-0.2.2/PKG-INFO DELETED
@@ -1,44 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: doppy
3
- Version: 0.2.2
4
- Classifier: Development Status :: 4 - Beta
5
- Classifier: Programming Language :: Python :: 3
6
- Classifier: Programming Language :: Python :: 3.10
7
- Classifier: Programming Language :: Python :: 3.11
8
- Classifier: Programming Language :: Python :: 3.12
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Intended Audience :: Science/Research
11
- Classifier: Operating System :: OS Independent
12
- Requires-Dist: requests
13
- Requires-Dist: urllib3
14
- Requires-Dist: numpy
15
- Requires-Dist: netcdf4
16
- Requires-Dist: typer
17
- Requires-Dist: matplotlib
18
- Requires-Dist: scikit-learn
19
- Requires-Dist: scipy
20
- Requires-Dist: mypy ; extra == 'dev'
21
- Requires-Dist: ruff ; extra == 'dev'
22
- Requires-Dist: pytest ; extra == 'dev'
23
- Requires-Dist: types-requests ; extra == 'dev'
24
- Requires-Dist: py-spy ; extra == 'dev'
25
- Requires-Dist: maturin ==1.4 ; extra == 'dev'
26
- Requires-Dist: release-version ; extra == 'dev'
27
- Requires-Dist: pre-commit ; extra == 'dev'
28
- Provides-Extra: dev
29
- License-File: LICENSE
30
- License-File: LICENSE
31
- Author: Niko Leskinen <niko.leskinen@fmi.fi>
32
- Author-email: Niko Leskinen <niko.leskinen@fmi.fi>
33
- Requires-Python: >=3.10
34
- Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
35
- Project-URL: Homepage, https://github.com/actris-cloudnet/doppy
36
- Project-URL: Repository, https://github.com/actris-cloudnet/doppy
37
- Project-URL: Changelog, https://github.com/actris-cloudnet/doppy/blob/main/CHANGELOG.md
38
- Project-URL: Bug Tracker, https://github.com/actris-cloudnet/doppy/issues
39
-
40
- # Doppy - Wind doppler lidar processing
41
-
42
- [![CI](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml/badge.svg)](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml)
43
- [![PyPI version](https://badge.fury.io/py/doppy.svg)](https://badge.fury.io/py/doppy)
44
-
doppy-0.2.2/README.md DELETED
@@ -1,4 +0,0 @@
1
- # Doppy - Wind doppler lidar processing
2
-
3
- [![CI](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml/badge.svg)](https://github.com/actris-cloudnet/doppy/actions/workflows/ci.yml)
4
- [![PyPI version](https://badge.fury.io/py/doppy.svg)](https://badge.fury.io/py/doppy)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes