cloudnetpy 1.86.3__py3-none-any.whl → 1.86.5__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.

Potentially problematic release.


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

@@ -12,7 +12,7 @@ import numpy as np
12
12
  from cloudnetpy import concat_lib, output, utils
13
13
  from cloudnetpy.instruments.instruments import COPERNICUS
14
14
  from cloudnetpy.instruments.nc_radar import ChilboltonRadar
15
- from cloudnetpy.metadata import MetaData
15
+ from cloudnetpy.metadata import COMMON_ATTRIBUTES, MetaData
16
16
 
17
17
 
18
18
  def copernicus2nc(
@@ -105,7 +105,7 @@ def copernicus2nc(
105
105
  copernicus.add_site_geolocation()
106
106
  valid_indices = copernicus.add_zenith_and_azimuth_angles(
107
107
  elevation_threshold=1.1,
108
- elevation_diff_threshold=0.1,
108
+ elevation_diff_threshold=0.5,
109
109
  azimuth_diff_threshold=0.1,
110
110
  )
111
111
  copernicus.screen_time_indices(valid_indices)
@@ -131,10 +131,12 @@ class Copernicus(ChilboltonRadar):
131
131
  self.instrument = COPERNICUS
132
132
 
133
133
  def calibrate_reflectivity(self) -> None:
134
- default_offset = -146.8 # TODO: check this value
135
- calibration_factor = self.site_meta.get("calibration_offset", default_offset)
136
- self.data["Zh"].data[:] += calibration_factor
137
- self.append_data(np.array(calibration_factor), "calibration_offset")
134
+ default_offset = (
135
+ -141.5
136
+ ) # Taken from 2016-01 raw files where this was already applied
137
+ zh_offset = self.site_meta.get("Zh_offset", default_offset)
138
+ self.data["Zh"].data[:] += zh_offset
139
+ self.append_data(np.array(zh_offset, dtype=np.float32), "Zh_offset")
138
140
 
139
141
  def mask_corrupted_values(self) -> None:
140
142
  """Experimental masking of corrupted Copernicus data.
@@ -169,12 +171,13 @@ class Copernicus(ChilboltonRadar):
169
171
 
170
172
 
171
173
  ATTRIBUTES = {
172
- "calibration_offset": MetaData(
174
+ "Zh_offset": MetaData(
173
175
  long_name="Radar reflectivity calibration offset",
174
176
  units="dBZ",
175
177
  comment="Calibration offset applied.",
176
178
  dimensions=None,
177
179
  ),
180
+ "Zh": COMMON_ATTRIBUTES["Zh"]._replace(ancillary_variables="Zh_offset"),
178
181
  "range_offset": MetaData(
179
182
  long_name="Radar range offset",
180
183
  units="m",
@@ -92,6 +92,7 @@ def galileo2nc(
92
92
  galileo.check_date(date)
93
93
  galileo.sort_timestamps()
94
94
  galileo.remove_duplicate_timestamps()
95
+ galileo.screen_negative_altitudes()
95
96
  snr_limit = site_meta.get("snr_limit", 3)
96
97
  galileo.screen_by_snr(snr_limit=snr_limit)
97
98
  galileo.mask_clutter()
@@ -128,7 +129,6 @@ class Galileo(ChilboltonRadar):
128
129
  self.instrument = GALILEO
129
130
 
130
131
  def mask_clutter(self) -> None:
131
- """Masks clutter."""
132
132
  # Only strong Z values are valid
133
133
  n_low_gates = 15
134
134
  ind = np.where(self.data["Zh"][:, :n_low_gates] < -15) and np.where(
@@ -136,6 +136,20 @@ class Galileo(ChilboltonRadar):
136
136
  )
137
137
  self.data["v"].mask_indices(ind)
138
138
 
139
+ def screen_negative_altitudes(self) -> None:
140
+ range_var = self.data["range"][:]
141
+ valid_idx = np.where(range_var > 0)[0]
142
+ if valid_idx.size == 0:
143
+ msg = "No valid altitudes found."
144
+ raise ValueError(msg)
145
+ if valid_idx.size == range_var.shape[0]:
146
+ return
147
+ for arr in self.data.values():
148
+ if utils.isscalar(arr.data):
149
+ continue
150
+ if arr[:].shape[-1] == range_var.shape[0]:
151
+ arr.data = arr[..., valid_idx]
152
+
139
153
 
140
154
  ATTRIBUTES = {
141
155
  "antenna_diameter": MetaData(
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 86
3
- PATCH = 3
3
+ PATCH = 5
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnetpy
3
- Version: 1.86.3
3
+ Version: 1.86.5
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=qqLXSUVhIi6H_Z1zlfXeEkc9qBqA1XO-UwsCVxjIcfk,7317
9
9
  cloudnetpy/output.py,sha256=NpuxmtLk2JLTdubCupdL4rFbx30YqgeU6vwAe_v8thc,15133
10
10
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cloudnetpy/utils.py,sha256=9MMYok1A7oJS2XBkIFhaiDWt_MYLo8tLzF3_880masM,34321
12
- cloudnetpy/version.py,sha256=fFMhfzPgAQTnH4EcNXqfMkShM7r1U4B56xzlJp8XWrQ,72
12
+ cloudnetpy/version.py,sha256=Va6HjzCd42qubMOwHV5hz8UCWeFMp6EzRf_6g1bNCNA,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
@@ -39,10 +39,10 @@ cloudnetpy/instruments/ceilo.py,sha256=scb3n0gLOZ1gPs_WdWw9KS5Ut_mtCvSdWFMKKCvXh
39
39
  cloudnetpy/instruments/ceilometer.py,sha256=c37uteeuGnlE-o-Smu49H2qQJw6qZ0tc3Bzhyr1FoSo,13063
40
40
  cloudnetpy/instruments/cl61d.py,sha256=JsCHqVzFGhZi-5xcnsB507FDpyuw83uSWK3IFO3DhdI,2238
41
41
  cloudnetpy/instruments/cloudnet_instrument.py,sha256=B1UkiB0ytnT3MWYalEegql5QIPaMLg5bJy5xI50JEco,4503
42
- cloudnetpy/instruments/copernicus.py,sha256=ygEViERBSJdMeP9OxfLelZRDEbSRzY8n17ruYie2wm4,6970
42
+ cloudnetpy/instruments/copernicus.py,sha256=AuGvPjn6hofzSKlh2M7knb5zBgzY3xfDvu3WF6KGlp8,7091
43
43
  cloudnetpy/instruments/da10.py,sha256=FcXEu6dfAVvYzMvauiJBSyEkYhGa8hBuwrrdo-3LwHE,1960
44
44
  cloudnetpy/instruments/fd12p.py,sha256=M5yJDsPi0tHWMDUYOsoqciyKdRQ-zHEq2t19KnpZ6Io,6915
45
- cloudnetpy/instruments/galileo.py,sha256=f_-GkRxhNaQPbI8HpOwSmoKfGqyjmD16A0ZFgwLOIig,5137
45
+ cloudnetpy/instruments/galileo.py,sha256=pJ5WaB-Nwzs5zgj8c2oaH7HieYxq4HF0aUilYTSRhYE,5682
46
46
  cloudnetpy/instruments/hatpro.py,sha256=TGOqwW0TfoPEYk13MFvFzwgJGzm6MVE5AsPavcIoj3I,10248
47
47
  cloudnetpy/instruments/instruments.py,sha256=WZgH7HjzM9Ane1CSnYCSLidbST8hunUeSt2lPntq9As,4999
48
48
  cloudnetpy/instruments/lufft.py,sha256=G6KeJOeltLUlGCHHEk8ns2K7WJ9ImAr25rSB2JltawE,4286
@@ -118,10 +118,10 @@ cloudnetpy/products/lwc.py,sha256=xsNiiG6dGKIkWaFk0xWTabc1bZ4ULf6SqcqHs7itAUk,19
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.86.3.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
121
+ cloudnetpy-1.86.5.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
122
122
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
123
- cloudnetpy-1.86.3.dist-info/METADATA,sha256=QQLkcSX05Op0Lks5K_uNbwteImRdke5u9CUjLkAR63I,5836
124
- cloudnetpy-1.86.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
- cloudnetpy-1.86.3.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
126
- cloudnetpy-1.86.3.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
127
- cloudnetpy-1.86.3.dist-info/RECORD,,
123
+ cloudnetpy-1.86.5.dist-info/METADATA,sha256=tF3Zehy97hcHHsGatoLodQPTYVWUrMkQdjGzdOmEyDU,5836
124
+ cloudnetpy-1.86.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
+ cloudnetpy-1.86.5.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
126
+ cloudnetpy-1.86.5.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
127
+ cloudnetpy-1.86.5.dist-info/RECORD,,