cloudnetpy 1.46.2__py3-none-any.whl → 1.46.4__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.
@@ -62,7 +62,6 @@ def find_melting_layer(obs: ClassData, smooth: bool = True) -> np.ndarray:
62
62
  t_range = _find_model_temperature_range(obs.model_type)
63
63
 
64
64
  for ind, t_prof in enumerate(obs.tw):
65
-
66
65
  temp_indices = _get_temp_indices(t_prof, t_range)
67
66
  if len(temp_indices) <= 1:
68
67
  continue
@@ -127,7 +127,7 @@ class Radar(DataSource):
127
127
  data, 0, min_coverage=0.3, z_limit=-30, distance=3, n_blocks=20
128
128
  )
129
129
  if n_vertical > 0 or n_horizontal > 0:
130
- logging.info(
130
+ logging.debug(
131
131
  f"Filtered {n_vertical} vertical and {n_horizontal} horizontal stripes "
132
132
  f"from radar data using {variable}"
133
133
  )
@@ -141,7 +141,6 @@ class Radar(DataSource):
141
141
  distance: float,
142
142
  n_blocks: int,
143
143
  ) -> int:
144
-
145
144
  if axis == 0:
146
145
  data = data.T
147
146
  echo = self.data["Z"][:].T
@@ -94,7 +94,6 @@ class CloudnetArray:
94
94
  setattr(self, key, data)
95
95
 
96
96
  def _init_data(self) -> np.ndarray:
97
-
98
97
  if isinstance(self.variable, netCDF4.Variable):
99
98
  return self.variable[:]
100
99
  if isinstance(self.variable, np.ndarray):
@@ -144,7 +144,7 @@ class NoisyData:
144
144
  else self.noise_param.noise_min
145
145
  )
146
146
  noise_below_threshold = noise < noise_min
147
- logging.info(f"Adjusted noise of {sum(noise_below_threshold)} profiles")
147
+ logging.debug(f"Adjusted noise of {sum(noise_below_threshold)} profiles")
148
148
  noise[noise_below_threshold] = noise_min
149
149
  return noise
150
150
 
@@ -164,7 +164,7 @@ class NoisyData:
164
164
  profile = data[time_ind, alt_ind:]
165
165
  profile[profile < threshold] = ma.masked
166
166
  cleaned_time_indices = np.unique(time_indices)
167
- logging.info(
167
+ logging.debug(
168
168
  f"Cleaned {len(cleaned_time_indices)} profiles with negative filter"
169
169
  )
170
170
  return cleaned_time_indices
@@ -181,7 +181,7 @@ class NoisyData:
181
181
  )
182
182
  variance = _calc_var_from_top_gates(self.data["beta_raw"])
183
183
  is_fog = (signal_sum > signal_sum_threshold) | (variance < variance_threshold)
184
- logging.info(f"Cleaned {sum(is_fog)} profiles with fog filter")
184
+ logging.debug(f"Cleaned {sum(is_fog)} profiles with fog filter")
185
185
  return is_fog
186
186
 
187
187
  def _remove_noise(
@@ -24,7 +24,7 @@ class CloudnetInstrument:
24
24
  elif isinstance(self.dataset, netCDF4.Dataset) and hasattr(
25
25
  self.dataset, key.capitalize()
26
26
  ):
27
- value = float(getattr(self.dataset, key.capitalize()).split()[0])
27
+ value = self.parse_global_attribute_numeral(key.capitalize())
28
28
  # From source data (BASTA / RPG):
29
29
  elif (
30
30
  isinstance(self.dataset, netCDF4.Dataset)
@@ -35,6 +35,13 @@ class CloudnetInstrument:
35
35
  value = float(ma.mean(value))
36
36
  self.data[key] = CloudnetArray(value, key)
37
37
 
38
+ def parse_global_attribute_numeral(self, key: str) -> float:
39
+ new_str = ""
40
+ for char in getattr(self.dataset, key):
41
+ if char.isdigit() or char == ".":
42
+ new_str += char
43
+ return float(new_str)
44
+
38
45
  def add_height(self) -> None:
39
46
  try:
40
47
  zenith_angle = ma.median(self.data["zenith_angle"].data)
@@ -69,7 +69,7 @@ def mira2nc(
69
69
  valid_filenames,
70
70
  mmclx_filename,
71
71
  variables=variables,
72
- allow_difference=["nave"],
72
+ allow_difference=["nave", "ovl"],
73
73
  )
74
74
  else:
75
75
  mmclx_filename = raw_mira
@@ -71,7 +71,10 @@ class NcRadar(DataSource, CloudnetInstrument):
71
71
  time indices."""
72
72
  if "azimuth_velocity" in self.data:
73
73
  azimuth = self.data["azimuth_velocity"].data
74
- azimuth_reference = 0
74
+ if np.all(azimuth == azimuth[0]):
75
+ azimuth_reference = azimuth[0]
76
+ else:
77
+ azimuth_reference = 0
75
78
  azimuth_tolerance = 1e-6
76
79
  else:
77
80
  azimuth = self.data["azimuth_angle"].data
@@ -85,6 +88,8 @@ class NcRadar(DataSource, CloudnetInstrument):
85
88
  azimuth, azimuth_reference, atol=azimuth_tolerance
86
89
  )
87
90
  is_stable_profile = is_stable_zenith & is_stable_azimuth
91
+ if ma.isMaskedArray(is_stable_profile):
92
+ is_stable_profile[is_stable_profile.mask] = False
88
93
  n_removed = np.count_nonzero(~is_stable_profile)
89
94
  if n_removed >= len(zenith) - 1:
90
95
  raise ValidTimeStampError(
@@ -109,7 +109,7 @@ class PollyXt(Ceilometer):
109
109
  calibration_factors: np.ndarray = np.array([])
110
110
  beta_channel = self._get_valid_beta_channel(bsc_files)
111
111
  bsc_key = f"attenuated_backscatter_{beta_channel}nm"
112
- for (bsc_file, depol_file) in zip(bsc_files, depol_files):
112
+ for bsc_file, depol_file in zip(bsc_files, depol_files):
113
113
  with (
114
114
  netCDF4.Dataset(bsc_file, "r") as nc_bsc,
115
115
  netCDF4.Dataset(depol_file, "r") as nc_depol,
cloudnetpy/output.py CHANGED
@@ -312,7 +312,6 @@ def update_attributes(cloudnet_variables: dict, attributes: dict) -> None:
312
312
  def _write_vars2nc(nc: netCDF4.Dataset, cloudnet_variables: dict) -> None:
313
313
  """Iterates over Cloudnet instances and write to netCDF file."""
314
314
  for obj in cloudnet_variables.values():
315
-
316
315
  if ma.isMaskedArray(obj.data):
317
316
  fill_value = netCDF4.default_fillvals[obj.data_type]
318
317
  else:
cloudnetpy/utils.py CHANGED
@@ -180,7 +180,7 @@ def rebin_2d(
180
180
  masked_result[ind, :] = ma.masked
181
181
  empty_indices.append(ind)
182
182
  if len(empty_indices) > 0:
183
- logging.info(f"No radar data in {len(empty_indices)} bins")
183
+ logging.debug(f"No radar data in {len(empty_indices)} bins")
184
184
 
185
185
  return masked_result, empty_indices
186
186
 
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 46
3
- PATCH = 2
3
+ PATCH = 4
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudnetpy
3
- Version: 1.46.2
3
+ Version: 1.46.4
4
4
  Summary: Python package for Cloudnet processing
5
5
  Home-page: https://github.com/actris-cloudnet/cloudnetpy
6
6
  Author: Finnish Meteorological Institute
@@ -1,14 +1,14 @@
1
1
  cloudnetpy/__init__.py,sha256=4dlz-_2LvmdE4HHhrRlWyN1CkNjXlApxi_z-TebIxAY,74
2
- cloudnetpy/cloudnetarray.py,sha256=A36Ktmpdqp0Xjn9LfNST27QD4W5CPNbdQjzj3zxcUgQ,6639
2
+ cloudnetpy/cloudnetarray.py,sha256=OLlH66AzFuEZYy4orR2WwF9WYS03ApO9OZ0VQm7khB4,6638
3
3
  cloudnetpy/concat_lib.py,sha256=3HmHXSIGPkm4yDlNg6TKFQYtsDs7fvcO3dG0Pwt-Jd8,9517
4
4
  cloudnetpy/constants.py,sha256=CC6qwVMcznFY6H4j3wz4mxUFnSn81QbScGi-PjF_3i4,402
5
5
  cloudnetpy/datasource.py,sha256=TB0AZDjRWahROfBkn9drtGmeEqKW469n2Tv6SgdBMcg,7107
6
6
  cloudnetpy/exceptions.py,sha256=sXcxhlyz_8ICLa1eliujfescrUuK1UM0aAEXexx91Gw,981
7
7
  cloudnetpy/metadata.py,sha256=4stvQT5oxNdxu6Bh7NbT5LH65CIpzhfGA_Cey5Ai6m4,5022
8
- cloudnetpy/output.py,sha256=d1_UBiu1KxwpeUxBQDDx4kTW5Uucc3307wTI9dDKe38,12338
8
+ cloudnetpy/output.py,sha256=GjGGAJAKE-MNE0lwUoTborApn-LEru7vtdPXmtMDOoE,12337
9
9
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- cloudnetpy/utils.py,sha256=X7ZKsilyoIvPYsVi_mMajaULuRkzk9QZ9BMsZvLsXfw,26972
11
- cloudnetpy/version.py,sha256=hIx2qs7PpRNjpr141lTXDMckumko1lv1ksLTu_BNibY,72
10
+ cloudnetpy/utils.py,sha256=Rsh_ojLNMH5ps7fWLKvF74Xd9B1yC9JqL507eRljyDQ,26973
11
+ cloudnetpy/version.py,sha256=OeZaTiXmB4jO5q3MIlz_LjgWry5B_IOBT7fkSktDlOY,72
12
12
  cloudnetpy/categorize/__init__.py,sha256=gP5q3Vis1y9u9OWgA_idlbjfWXYN_S0IBSWdwBhL_uU,69
13
13
  cloudnetpy/categorize/atmos.py,sha256=-Z1y1Eaju7pG2yOIgUeIf-xH21HRxzWfJ9AOIrVL4A8,12389
14
14
  cloudnetpy/categorize/atmos_utils.py,sha256=6WdfGqzOvnaDW7vlMMrZBJIxW_eHQdjH-Xl_iPv1TTI,3716
@@ -20,26 +20,26 @@ cloudnetpy/categorize/falling.py,sha256=k21J-lsN07YxtMkIIwEnQmJjgqaw4dpNMMVDqzWd
20
20
  cloudnetpy/categorize/freezing.py,sha256=sNt02CK45QkOCrWymgOQIrdo0E4C3rqmJQo1h_A74AE,3538
21
21
  cloudnetpy/categorize/insects.py,sha256=gDZWMyNJ6sV9RS5xr38KoHlqEJIKptHHtP9L7GsLCQ0,5153
22
22
  cloudnetpy/categorize/lidar.py,sha256=Ev5dMg8X-CHLR2xVJCyqgyQEoyBJsUgj7B3lkOHkpc8,2521
23
- cloudnetpy/categorize/melting.py,sha256=pstRC2bMnHB1TmijajtAqJe9HK0FYevNVWp2Y3dE2pk,6033
23
+ cloudnetpy/categorize/melting.py,sha256=DFlIHYgOjyIj3KNopgrTf2mC8awGa6tQWLvkbRG1lL8,6032
24
24
  cloudnetpy/categorize/model.py,sha256=euC5JpccsfcUOuyzj1jFNncRxXZnKsylJpsg2QHKAF0,5034
25
25
  cloudnetpy/categorize/mwr.py,sha256=mr16Du3lgzw1WQVIDYEyZKl-3r6G78phwvIPwUjd5rA,1383
26
- cloudnetpy/categorize/radar.py,sha256=POPzZX2BbO9ofXc5cX0pESx83gX35DfuQtNn8cYaCzg,12425
26
+ cloudnetpy/categorize/radar.py,sha256=3Or3_jWxs9rbwJ3XKzl4hPilg0bFdCRMrbkIAuS3H08,12425
27
27
  cloudnetpy/instruments/__init__.py,sha256=1QuE0QQx2Q96Q_sZy2Vof7qahBYzK1KI1U4MWc-oZQM,355
28
28
  cloudnetpy/instruments/basta.py,sha256=9KeP65uxOTUH1YavaI8sp35n-VcM-WgtqMfB3bxKSPo,3714
29
29
  cloudnetpy/instruments/ceilo.py,sha256=Tow4hQFhTxZ84pqqIIUMPNS-yYDsDISNXfqQKPjDmRQ,7341
30
- cloudnetpy/instruments/ceilometer.py,sha256=5ZIsJh8TekXQWzaXZoqngV7b3ceK7a8zmd9DrPQaseI,10495
30
+ cloudnetpy/instruments/ceilometer.py,sha256=j3Wb2wJlSGLaZkguPe3nv4751TfGd-hJjithKYNOsO4,10498
31
31
  cloudnetpy/instruments/cl61d.py,sha256=Qk2YQRrRkivc6nW2gOI7KKLt9rR4JAWF0bfbj8Hd_lY,1653
32
- cloudnetpy/instruments/cloudnet_instrument.py,sha256=ayBkzNpjzqckh8_dsIgt-pRQCP5mODaUTMO_EdiGsUI,3029
32
+ cloudnetpy/instruments/cloudnet_instrument.py,sha256=vZgwGJx0Ky7h1ThY3O7lRmj3PD6vutwpvfEUXleOP24,3268
33
33
  cloudnetpy/instruments/copernicus.py,sha256=FDS7Rsunp4ieTPFh_T_LXvreNi5_HTv4ZzR3OnTcAX8,5013
34
34
  cloudnetpy/instruments/disdrometer.py,sha256=zzzdA4mwgZLSk9HfbVUQpaq7gDCWkQBArafrpbRnj1A,22754
35
35
  cloudnetpy/instruments/galileo.py,sha256=F_XyoAb9PR-ifGhqhXziKnv0KfyOh-yEBaE1NgRMzNg,4318
36
36
  cloudnetpy/instruments/hatpro.py,sha256=ftXVbYx2xtQcRZ2zVF82jUP7R96YV5Wdgcz_PUNZTXM,4824
37
37
  cloudnetpy/instruments/instruments.py,sha256=L4w5a87IBJngmfqIBaXEbHCdVco0dn9Aydz7MURoIUk,2873
38
38
  cloudnetpy/instruments/lufft.py,sha256=o6sY1L82EgfaBXBwFpomHmIz37cP8WHu0WDoiUROvyQ,3226
39
- cloudnetpy/instruments/mira.py,sha256=dfrQqoZ-G8AJiE6f1PNkzU-vRCQQq7NKCnrqe0aDexw,4881
39
+ cloudnetpy/instruments/mira.py,sha256=wtcgTR_nqL_BPZ5yqvBYXpI9Qtwdvc_1v6N_r3hCEPc,4888
40
40
  cloudnetpy/instruments/nc_lidar.py,sha256=9FSsInEM8fdyyhgNXb2INBjb5OEGFE5ZaVSowHjzoCA,1386
41
- cloudnetpy/instruments/nc_radar.py,sha256=GDBoPN2rXjBTk80ydW3Gc3F974X4wzimWOtPKsf53Fc,5269
42
- cloudnetpy/instruments/pollyxt.py,sha256=QktbbsNHbSb2umd6KhbzpKRlXKB24B6e_1BAQXgc-p0,7849
41
+ cloudnetpy/instruments/nc_radar.py,sha256=MsNHIlCVzQZyAjI9zSAHSMtt-F_4xzNcodqVoscu-1Y,5494
42
+ cloudnetpy/instruments/pollyxt.py,sha256=Ezuq9rJxQREKz5ed1sdMsuqHZwlKMQC_w5CZSpzQQko,7847
43
43
  cloudnetpy/instruments/radiometrics.py,sha256=d9SYWq7YvPdmIPwVCbIrKimBvl0oRXFvT7D2JDBIzic,4335
44
44
  cloudnetpy/instruments/rpg.py,sha256=2ecgqgCAkwMQpBxypin-N62M1nNHmjH47KhjHxQF-7g,15656
45
45
  cloudnetpy/instruments/rpg_reader.py,sha256=GLvaMm6Zn-oOg4capCMh3j4UUDZcGXsdMAbbI7Fdjj0,10457
@@ -100,9 +100,9 @@ cloudnetpy/products/lwc.py,sha256=CqvV7iqxUbk2YekaocBActmZuhF1BhWkfc-y6MDej-0,18
100
100
  cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
101
101
  cloudnetpy/products/product_tools.py,sha256=9eKvr-zGEK2ARN2DmJN--KbynKdT08DhfT1GB8Rfoe4,9616
102
102
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
- tests/e2e_test.py,sha256=hp3exUZnAX8x2kEi8e1QY6ffgTij8UboPAZNITkF07w,3857
104
- cloudnetpy-1.46.2.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
105
- cloudnetpy-1.46.2.dist-info/METADATA,sha256=PW3SdYdWfGcfB9x11JR5BnO_jLySlkMuT_sdQRUzgPc,4135
106
- cloudnetpy-1.46.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
107
- cloudnetpy-1.46.2.dist-info/top_level.txt,sha256=-csBTtA3agkdZVDLjsdCzwh_9tKGWag53JTwpWVCvSo,17
108
- cloudnetpy-1.46.2.dist-info/RECORD,,
103
+ tests/e2e_test.py,sha256=yd2dqFa0N7EAib6BuZuSRLHp1bZh5cta8I85B7DEaFA,3856
104
+ cloudnetpy-1.46.4.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
105
+ cloudnetpy-1.46.4.dist-info/METADATA,sha256=-2oIRdXeQ5ZizdWyxZSpSgvBG89VDP9_QkpkqlDpXd8,4135
106
+ cloudnetpy-1.46.4.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
107
+ cloudnetpy-1.46.4.dist-info/top_level.txt,sha256=-csBTtA3agkdZVDLjsdCzwh_9tKGWag53JTwpWVCvSo,17
108
+ cloudnetpy-1.46.4.dist-info/RECORD,,
tests/e2e_test.py CHANGED
@@ -20,7 +20,6 @@ def _process_product_file(product_type: str, path: str, categorize_file: str) ->
20
20
 
21
21
 
22
22
  def main():
23
-
24
23
  test_path = Path(__file__).parent
25
24
  source_path = f"{test_path}/source_data/"
26
25