cloudnetpy 1.85.0__py3-none-any.whl → 1.85.1__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.
@@ -83,6 +83,10 @@ def rpg2nc(
83
83
  valid_ind = fmcw.add_zenith_angle()
84
84
  fmcw.screen_time_indices(valid_ind)
85
85
  fmcw.add_height()
86
+ if len(np.unique(fmcw.data["time"][:].astype("f4"))) != len(fmcw.data["time"][:]):
87
+ msg = "Convert time to f8 to keep values unique in netCDF"
88
+ logging.info(msg)
89
+ fmcw.data["time"].data_type = "f8"
86
90
  attributes = output.add_time_attribute(RPG_ATTRIBUTES, fmcw.date)
87
91
  output.update_attributes(fmcw.data, attributes)
88
92
  output.save_level1b(fmcw, output_file, uuid)
@@ -137,19 +141,17 @@ def _reduce_header(header: dict) -> dict:
137
141
  """Removes duplicate header data. Otherwise, we would need n_files dimension."""
138
142
  reduced_header = {}
139
143
  for key, data in header.items():
144
+ # Handle outliers in latitude and longitude (e.g. Galati 2024-02-11):
145
+ if key in ("latitude", "longitude"):
146
+ reduced_header[key] = ma.median(data)
147
+ continue
140
148
  first_profile_value = data[0]
141
149
  is_identical_value = bool(
142
150
  np.isclose(data, first_profile_value, rtol=1e-2).all(),
143
151
  )
144
152
  if is_identical_value is False:
145
153
  msg = f"Inconsistent header: {key}: {data}"
146
- if key in (
147
- "latitude",
148
- "longitude",
149
- "sample_duration",
150
- "calibration_interval",
151
- "noise_threshold",
152
- ):
154
+ if key in ("sample_duration", "calibration_interval", "noise_threshold"):
153
155
  logging.warning(msg)
154
156
  else:
155
157
  raise InconsistentDataError(msg)
@@ -138,12 +138,12 @@ def _horizontal_wind_from_doppler_lidar_file(
138
138
  t = np.broadcast_to(time[:, None], mask.shape)[~mask]
139
139
  h = np.broadcast_to(height[None, :], mask.shape)[~mask]
140
140
 
141
- if len(np.unique(t)) < 2 or len(np.unique(h)) < 2:
141
+ if len(np.unique(t)) < 3 or len(np.unique(h)) < 3:
142
142
  msg = "Not enough unique values for interpolation"
143
143
  raise ValidTimeStampError(msg)
144
144
 
145
- interp_linear = LinearNDInterpolator(list(zip(t, h, strict=False)), V[~mask])
146
- interp_nearest = NearestNDInterpolator(list(zip(t, h, strict=False)), V[~mask])
145
+ interp_linear = LinearNDInterpolator(list(zip(t, h, strict=True)), V[~mask])
146
+ interp_nearest = NearestNDInterpolator(list(zip(t, h, strict=True)), V[~mask])
147
147
  T, H = np.meshgrid(time, height, indexing="ij")
148
148
  V_linear = interp_linear(T, H)
149
149
  V_nearest = interp_nearest(T, H)
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 85
3
- PATCH = 0
3
+ PATCH = 1
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnetpy
3
- Version: 1.85.0
3
+ Version: 1.85.1
4
4
  Summary: Python package for Cloudnet processing
5
5
  Author: Simo Tukiainen
6
6
  License: MIT License
@@ -9,7 +9,7 @@ cloudnetpy/metadata.py,sha256=CFpXmdEkVPzvLPv2xHIR-aMMQ-TR26KfESYw-98j7sk,7213
9
9
  cloudnetpy/output.py,sha256=0bybnILsgKHWIuw2GYkqTz2iMCJDZLUN25IQ9o_v3Cg,14968
10
10
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cloudnetpy/utils.py,sha256=O5kEXMt03fFKabPxRiCfuahVfTqa4fWWZ11orQnQeXU,33530
12
- cloudnetpy/version.py,sha256=lLtOfbPTOgEcz4-gTcFPYaor-U52n66zRHoLKjGWJ30,72
12
+ cloudnetpy/version.py,sha256=GjZwZs7bZy6HUk3rTGReQNpsOlEtk2ZE9J9EGtHnVjs,72
13
13
  cloudnetpy/categorize/__init__.py,sha256=gtvzWr0IDRn2oA6yHBvinEhTGTuub-JkrOv93lBsgrE,61
14
14
  cloudnetpy/categorize/atmos_utils.py,sha256=uWc9TABVYPI0sn4H5Az9Jf6NVRaWyEKIi17f0pAJQxE,10679
15
15
  cloudnetpy/categorize/attenuation.py,sha256=Y_-fzmQTltWTqIZTulJhovC7a6ifpMcaAazDJcnMIOc,990
@@ -53,7 +53,7 @@ cloudnetpy/instruments/nc_radar.py,sha256=XFKxPLKivnhHTgjE5HFrxjWZ0oCifhDUAog051
53
53
  cloudnetpy/instruments/pollyxt.py,sha256=IFq_RJrhgJ79OVyuo48PwYQK_zZ6VZFB_S5bEirRyzs,10566
54
54
  cloudnetpy/instruments/radiometrics.py,sha256=QKfnrZlQ0sFcFjmv1ShnCMTJQv64w4akjK-JAIY4gCg,16116
55
55
  cloudnetpy/instruments/rain_e_h3.py,sha256=fjv3SgeUNx9GisYqLrBnX9AjnO17VtouyoPh12VE9uo,5465
56
- cloudnetpy/instruments/rpg.py,sha256=R1rUdeSADvB1IMkGOF1S0rUEJDGEI_19SPrmErZpn5M,18825
56
+ cloudnetpy/instruments/rpg.py,sha256=d7qlfez1Pe326d4xkQrTk2xRxvs3g68LEGehErdoBoc,19122
57
57
  cloudnetpy/instruments/rpg_reader.py,sha256=NaOtTxXx20PozNTj1xNvmbsEsAxuplFXRzBiM1_-Zg4,11651
58
58
  cloudnetpy/instruments/toa5.py,sha256=CfmmBMv5iMGaWHIGBK01Rw24cuXC1R1RMNTXkmsm340,1760
59
59
  cloudnetpy/instruments/vaisala.py,sha256=tu7aljkMKep0uCWz-Sd-GuBXF_Yy421a4nHy0ffpMoc,4725
@@ -111,17 +111,17 @@ cloudnetpy/products/der.py,sha256=UXdAxmmwChVVWSI4QSGAXphfMnbymGRTtGdKWEvh-J4,13
111
111
  cloudnetpy/products/drizzle.py,sha256=0h1N_WVjC2GgIkAN-4ydOwl7WJn3psxeqmPHfX8WHhQ,11935
112
112
  cloudnetpy/products/drizzle_error.py,sha256=QN98Io9UsBoEYxKBqfwoS88OGBiK5U5RYnVQjyTWHCI,6220
113
113
  cloudnetpy/products/drizzle_tools.py,sha256=xYMB8Qxp-_wKzMv_XC6u6iMfRnEhEtmDpCHSQAbDToo,11201
114
- cloudnetpy/products/epsilon.py,sha256=a796W_OuHxbSiG7yL2pcTArnaMNwYG8eAA8sQ93dIrY,7930
114
+ cloudnetpy/products/epsilon.py,sha256=EHrpfAbykQv4PYdi2yk7cQxOrg-kL-FhzGPVnPm98C0,7928
115
115
  cloudnetpy/products/ier.py,sha256=Eb5AK-6l5mN_7vWP1cxcXQzj886zAwDDsHXueUju0N0,6262
116
116
  cloudnetpy/products/iwc.py,sha256=pXl0xOFDD6AzGaAp_GzD2yapjOc7hXKTno9Q5G6HCOo,9826
117
117
  cloudnetpy/products/lwc.py,sha256=xsNiiG6dGKIkWaFk0xWTabc1bZ4ULf6SqcqHs7itAUk,19339
118
118
  cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
119
119
  cloudnetpy/products/mwr_tools.py,sha256=MMWnp68U7bv157-CPB2VeTQvaR6zl7sexbBT_kJ_pn8,6734
120
120
  cloudnetpy/products/product_tools.py,sha256=eyqIw_0KhlpmmYQE69RpGdRIAOW7JVPlEgkTBp2kdps,11302
121
- cloudnetpy-1.85.0.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
121
+ cloudnetpy-1.85.1.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
122
122
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
123
- cloudnetpy-1.85.0.dist-info/METADATA,sha256=RWZNjL4m1yNEhDoSpqzyUODXSsh3AULjma2QRrNd2HU,5836
124
- cloudnetpy-1.85.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
- cloudnetpy-1.85.0.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
126
- cloudnetpy-1.85.0.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
127
- cloudnetpy-1.85.0.dist-info/RECORD,,
123
+ cloudnetpy-1.85.1.dist-info/METADATA,sha256=AStEmoXYpgf5w6yU8IgcVP6V4SjaWo-IXrVohl6pWbA,5836
124
+ cloudnetpy-1.85.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
+ cloudnetpy-1.85.1.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
126
+ cloudnetpy-1.85.1.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
127
+ cloudnetpy-1.85.1.dist-info/RECORD,,