doppy 0.0.2__tar.gz → 0.0.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 (34) hide show
  1. {doppy-0.0.2 → doppy-0.0.3}/Cargo.lock +2 -2
  2. {doppy-0.0.2 → doppy-0.0.3}/Cargo.toml +1 -1
  3. {doppy-0.0.2 → doppy-0.0.3}/PKG-INFO +1 -1
  4. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/product/stare.py +34 -2
  5. {doppy-0.0.2 → doppy-0.0.3}/LICENSE +0 -0
  6. {doppy-0.0.2 → doppy-0.0.3}/README.md +0 -0
  7. {doppy-0.0.2 → doppy-0.0.3}/crates/doppy_rs/Cargo.toml +0 -0
  8. {doppy-0.0.2 → doppy-0.0.3}/crates/doppy_rs/src/lib.rs +0 -0
  9. {doppy-0.0.2 → doppy-0.0.3}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
  10. {doppy-0.0.2 → doppy-0.0.3}/crates/doppy_rs/src/raw.rs +0 -0
  11. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/.gitignore +0 -0
  12. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/Cargo.toml +0 -0
  13. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/src/lib.rs +0 -0
  14. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/src/raw/error.rs +0 -0
  15. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/src/raw/halo_hpl.rs +0 -0
  16. {doppy-0.0.2 → doppy-0.0.3}/crates/doprs/src/raw.rs +1 -1
  17. {doppy-0.0.2 → doppy-0.0.3}/pyproject.toml +0 -0
  18. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/__init__.py +0 -0
  19. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/__main__.py +0 -0
  20. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/bench.py +0 -0
  21. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/data/__init__.py +0 -0
  22. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/data/api.py +0 -0
  23. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/data/cache.py +0 -0
  24. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/data/exceptions.py +0 -0
  25. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/defaults.py +0 -0
  26. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/exceptions.py +0 -0
  27. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/netcdf.py +0 -0
  28. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/options.py +0 -0
  29. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/product/__init__.py +0 -0
  30. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/py.typed +0 -0
  31. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/raw/__init__.py +0 -0
  32. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/raw/halo_bg.py +0 -0
  33. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/raw/halo_hpl.py +0 -0
  34. {doppy-0.0.2 → doppy-0.0.3}/src/doppy/raw/halo_sys_params.py +0 -0
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
106
106
 
107
107
  [[package]]
108
108
  name = "doppy_rs"
109
- version = "0.0.2"
109
+ version = "0.0.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.0.2"
118
+ version = "0.0.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.0.2"
7
+ version = "0.0.3"
8
8
  authors = ["Niko Leskinen <niko.leskinen@fmi.fi>"]
9
9
  license-file = "LICENSE"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: doppy
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -507,8 +507,38 @@ def _select_raws_for_stare(
507
507
  if len(raws) == 0:
508
508
  raise doppy.exceptions.NoDataError("No data to select from")
509
509
 
510
- # Select files that stare vertically
511
- raws_stare = [raw for raw in raws if raw.elevation_angles == {90}]
510
+ # Select files that stare
511
+ raws_stare = [
512
+ raw
513
+ for raw in raws
514
+ if len(raw.azimuth_angles) == 1 or raw.azimuth_angles == {0, 360}
515
+ ]
516
+ if len(raws_stare) == 0:
517
+ raise doppy.exceptions.NoDataError(
518
+ "No data suitable for stare product. Data is probably from scans"
519
+ )
520
+ raws_stare = [raw for raw in raws if len(raw.elevation_angles) == 1]
521
+ if len(raws_stare) == 0:
522
+ raise doppy.exceptions.NoDataError(
523
+ "No data suitable for stare product. "
524
+ "Elevation angle does not remain constant"
525
+ )
526
+ elevation_angles = []
527
+ for raw in raws_stare:
528
+ elevation_angles += list(raw.elevation_angles)
529
+ max_elevation_angle = max(elevation_angles)
530
+
531
+ ELEVATION_ANGLE_FLUCTUATION_THRESHOLD = 2
532
+ ELEVATION_ANGLE_VERTICAL_OFFSET_THRESHOLD = 15
533
+
534
+ raws_stare = [
535
+ raw
536
+ for raw in raws
537
+ if abs(next(iter(raw.elevation_angles)) - max_elevation_angle)
538
+ < ELEVATION_ANGLE_FLUCTUATION_THRESHOLD
539
+ and abs(next(iter(raw.elevation_angles)) - 90)
540
+ < ELEVATION_ANGLE_VERTICAL_OFFSET_THRESHOLD
541
+ ]
512
542
 
513
543
  if len(raws_stare) == 0:
514
544
  raise doppy.exceptions.NoDataError("No data suitable for stare product")
@@ -554,6 +584,8 @@ def _cluster_background_profiles(
554
584
  background_signal: npt.NDArray[np.float64], radial_distance: npt.NDArray[np.float64]
555
585
  ) -> npt.NDArray[np.int64]:
556
586
  default_labels = np.zeros(len(background_signal), dtype=int)
587
+ if len(background_signal) < 2:
588
+ return default_labels
557
589
  radial_distance_mask = (90 < radial_distance) & (radial_distance < 1500)
558
590
 
559
591
  normalised_background_signal = background_signal / np.median(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,2 +1,2 @@
1
- pub mod halo_hpl;
2
1
  pub mod error;
2
+ pub mod halo_hpl;
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