cloudnetpy 1.62.1__py3-none-any.whl → 1.63.0__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.
@@ -74,13 +74,28 @@ class ClassData:
74
74
 
75
75
  def _find_rain_from_radar_echo(self) -> np.ndarray:
76
76
  gate_number = 3
77
- threshold = 0
77
+ threshold = {"z": 3, "v": 0, "ldr": -15}
78
78
  z = self.z[:, gate_number]
79
- return np.where((~ma.getmaskarray(z)) & (z > threshold), 1, 0)
79
+ v = self.v[:, gate_number]
80
+ if hasattr(self, "ldr"):
81
+ ldr = self.ldr[:, gate_number]
82
+ elif hasattr(self, "sldr"):
83
+ ldr = self.sldr[:, gate_number]
84
+ else:
85
+ ldr = np.full(self.time.shape, threshold["ldr"] - 1)
86
+
87
+ return np.where(
88
+ (~ma.getmaskarray(z))
89
+ & (z > threshold["z"])
90
+ & (v < threshold["v"])
91
+ & (ldr < threshold["ldr"]),
92
+ 1,
93
+ 0,
94
+ )
80
95
 
81
96
  def _find_rain_from_disdrometer(self) -> ma.MaskedArray:
82
97
  threshold_mm_h = 0.25 # Standard threshold for drizzle -> rain
83
- threshold_particles = 10 # This is arbitrary and should be better tested
98
+ threshold_particles = 30 # This is arbitrary and should be better tested
84
99
  threshold_rate = threshold_mm_h * MM_H_TO_M_S
85
100
  try:
86
101
  rainfall_rate = self.data["disdrometer"].data["rainfall_rate"].data
@@ -148,8 +148,7 @@ def _screen_insects(
148
148
  prob[(above_liquid == 1) & (insect_prob_no_ldr > 0)] = 0
149
149
 
150
150
  def _screen_rainy_profiles() -> None:
151
- rain_smoothed = _smooth_rain(obs.time, obs.is_rain)
152
- prob[rain_smoothed == 1, :] = 0
151
+ prob[obs.is_rain == 1, :] = 0
153
152
 
154
153
  prob = np.copy(insect_prob)
155
154
  _screen_liquid_layers()
@@ -157,15 +156,3 @@ def _screen_insects(
157
156
  _screen_above_liquid()
158
157
  _screen_rainy_profiles()
159
158
  return prob
160
-
161
-
162
- def _smooth_rain(time: np.ndarray, is_rain: np.ndarray) -> np.ndarray:
163
- is_rain_smoothed = np.copy(is_rain)
164
- time_buffer = 5 # minutes
165
- n_profiles = len(is_rain)
166
- n_steps = utils.n_elements(time, time_buffer, "time")
167
- for rain_idx in np.where(is_rain)[0]:
168
- idx_start = max(0, rain_idx - n_steps)
169
- idx_end = min(rain_idx + n_steps, n_profiles)
170
- is_rain_smoothed[idx_start : idx_end + 1] = True
171
- return is_rain_smoothed
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
- MINOR = 62
3
- PATCH = 1
2
+ MINOR = 63
3
+ PATCH = 0
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudnetpy
3
- Version: 1.62.1
3
+ Version: 1.63.0
4
4
  Summary: Python package for Cloudnet processing
5
5
  Author: Simo Tukiainen
6
6
  License: MIT License
@@ -8,18 +8,18 @@ cloudnetpy/metadata.py,sha256=v_VDo2vbdTxB0zIsfP69IcrwSKiRlLpsGdq6JPI4CoA,5306
8
8
  cloudnetpy/output.py,sha256=YkCaxVkG_Mt2hng_IVnhygHteV4UMKzKALkeFZwFJL8,14822
9
9
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  cloudnetpy/utils.py,sha256=JV0Fawnme1HoZgoiidV3eIzsn6vx0AEjBNmI1CcrBsA,28517
11
- cloudnetpy/version.py,sha256=wheZa4Kklouj0BjH963Wn0-elHVUt16TN53szDdSzNc,72
11
+ cloudnetpy/version.py,sha256=GhxxijGZ9PY_rQPI6Ua2oP0ZPSns0Itu-guZ-RIqT2Q,72
12
12
  cloudnetpy/categorize/__init__.py,sha256=gP5q3Vis1y9u9OWgA_idlbjfWXYN_S0IBSWdwBhL_uU,69
13
13
  cloudnetpy/categorize/atmos.py,sha256=G4DmEJCt1FAPYyt7oXzBH47JTeb5lUOGDakkviOXblE,12390
14
14
  cloudnetpy/categorize/atmos_utils.py,sha256=64uenj2uxj3P3Blaq_pBN1pBjcF-X4LYNt-uTOjvevg,3778
15
15
  cloudnetpy/categorize/categorize.py,sha256=aoIxbBEwUFO-Xx_oofKM68aL0KEJuGi3OaWMKCCuUK8,17827
16
16
  cloudnetpy/categorize/classify.py,sha256=a-0bVCtynGfORnDGTsPuzqkuDeOOR_OMz5ai9NsMuic,9870
17
- cloudnetpy/categorize/containers.py,sha256=aL_55tTDYjICS_TnG1u0FwBeXDS0S4mfDMU0kY_DUbs,4312
17
+ cloudnetpy/categorize/containers.py,sha256=L4UaihDfeMCADZiKdII5NCP49ZNlodCoM9X3yxEfJ_A,4748
18
18
  cloudnetpy/categorize/disdrometer.py,sha256=keU3pFvKtk840A0oLwAyNDuqOCswBPJEKf2bV0YWyA8,2004
19
19
  cloudnetpy/categorize/droplet.py,sha256=894VHdL9ScaB8f1oxXwM2la4ShXd-uWywQDINoaoiD8,8687
20
20
  cloudnetpy/categorize/falling.py,sha256=aI09_6H24x34lYr3vnKIgjWB0wzTkxOA6wE-gkdf6bs,4386
21
21
  cloudnetpy/categorize/freezing.py,sha256=c4k5AIgfBpvw64EaVVVYPi2Fx4SpHk1cyfceE1ydD28,3755
22
- cloudnetpy/categorize/insects.py,sha256=0pHJ-T-j3G9dbDU82xe8gsnVRyww3-ljdZ1SMAP9UKQ,5765
22
+ cloudnetpy/categorize/insects.py,sha256=9J5agmktit8Or66GGNue-bThiaG9rB2SuPNZBXI7FCE,5243
23
23
  cloudnetpy/categorize/lidar.py,sha256=YQrM_LOz8NQrrD9l9HyujV1GSGwkQ8LMqXN13bEJRW4,2605
24
24
  cloudnetpy/categorize/melting.py,sha256=mYdOKxfTC2InB8NdOPwr_7NpbouQMm-9f2Q1kfTqIJE,6262
25
25
  cloudnetpy/categorize/model.py,sha256=hSmE-3hCzbpA26AcMtSeDUVlLHvtmODy_37b2kJO2eA,5536
@@ -108,8 +108,8 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
108
108
  cloudnetpy/products/mwr_tools.py,sha256=3esU5cG5GI2WVmOENqrJ0FbMuxLegADv7q8TB0RorGg,4674
109
109
  cloudnetpy/products/product_tools.py,sha256=VNw2diJj30POz68-3qNVkJP7r9AUspT_d1Fp0BbeIx8,10414
110
110
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
111
- cloudnetpy-1.62.1.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
112
- cloudnetpy-1.62.1.dist-info/METADATA,sha256=3HgHFWQOFDZ4zxvdTjICRhRbGgW2ODI4hxvPJPm9158,5784
113
- cloudnetpy-1.62.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
114
- cloudnetpy-1.62.1.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
115
- cloudnetpy-1.62.1.dist-info/RECORD,,
111
+ cloudnetpy-1.63.0.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
112
+ cloudnetpy-1.63.0.dist-info/METADATA,sha256=fGcMgVg7krXMQBLH8jQdmj4uzyaHdW-aLvwpLny-R50,5784
113
+ cloudnetpy-1.63.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
114
+ cloudnetpy-1.63.0.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
115
+ cloudnetpy-1.63.0.dist-info/RECORD,,