doppy 0.0.2__cp310-abi3-macosx_11_0_arm64.whl → 0.0.3__cp310-abi3-macosx_11_0_arm64.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.

Potentially problematic release.


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

doppy/product/stare.py CHANGED
@@ -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(
doppy/rs.abi3.so CHANGED
Binary file
@@ -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
@@ -1,12 +1,12 @@
1
- doppy-0.0.2.dist-info/METADATA,sha256=4aQ594EyPD3__rvNn-ptVFg2C8Mii5c5mnUYzMyEktE,1583
2
- doppy-0.0.2.dist-info/WHEEL,sha256=lD_nV8vaA2uMWYS4vgMNGHE0f6_P8sTCC7Nx6jThods,103
3
- doppy-0.0.2.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
- doppy-0.0.2.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
- doppy-0.0.2.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
1
+ doppy-0.0.3.dist-info/METADATA,sha256=1ohcoPWtZ3frQhXFr64TY_jXkFZx7BwUmSK1pZ-Y3go,1583
2
+ doppy-0.0.3.dist-info/WHEEL,sha256=lD_nV8vaA2uMWYS4vgMNGHE0f6_P8sTCC7Nx6jThods,103
3
+ doppy-0.0.3.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
4
+ doppy-0.0.3.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
5
+ doppy-0.0.3.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
6
6
  doppy/options.py,sha256=73BDODO4OYHn2qOshhwz6u6G3J1kNd3uj6P0a3V4HBE,205
7
7
  doppy/__init__.py,sha256=Z9aEUlbPRWRUAoB8_-djkgrJuS4-6pjem4-mVSB6Z9I,191
8
8
  doppy/product/__init__.py,sha256=QtS5Eq0KGUYkaylDGAW8Oz6OIlab4WQYd5fTTUshTbc,59
9
- doppy/product/stare.py,sha256=04rAnG6bSsdyFSe43jONtthvtQn9S1RBsQ3DY8iqzjA,18581
9
+ doppy/product/stare.py,sha256=b-7P9NjP-KJKrDWcaXxM-fBNiBnHUB09ceosWXv7jPU,19664
10
10
  doppy/bench.py,sha256=iVNYveMVGGRES2oe3Orsn31jQFCKTXOmxRFuFiJ8_OA,248
11
11
  doppy/netcdf.py,sha256=NW5zTW2OY-M4ApMzgxwN7ysmL0LRRWOfyKFPinCw6gg,3403
12
12
  doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,5 +21,5 @@ doppy/raw/__init__.py,sha256=GrBbsTkoD2DH_Xwt6apZGwpT1cCIbfOWHzdQVjAPVh0,151
21
21
  doppy/raw/halo_bg.py,sha256=kO03yGlKS-DpMMGHYuy_BuidyeUL38TxT5vMn8H_8lE,4809
22
22
  doppy/raw/halo_hpl.py,sha256=GNAA3strYeukGKulZ432R8MOXw_JoH3KlRZ9SLDTnoA,17894
23
23
  doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
24
- doppy/rs.abi3.so,sha256=9K58AkzRZsXJHqMSYj6JG2dDjE0uKf4gMAAvNKPye5Q,2606093
25
- doppy-0.0.2.dist-info/RECORD,,
24
+ doppy/rs.abi3.so,sha256=-NFDTAQTwbRoFELYEYy2-5uiTmiY_yH_P5VjoHbsxvE,2661421
25
+ doppy-0.0.3.dist-info/RECORD,,
File without changes