cloudnetpy 1.64.3__py3-none-any.whl → 1.64.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.
@@ -74,22 +74,28 @@ def ceilo2nc(
74
74
  range_corrected = site_meta.get("range_corrected", True)
75
75
  ceilo_obj.read_ceilometer_file(calibration_factor)
76
76
  ceilo_obj.check_beta_raw_shape()
77
+ n_negatives = _get_n_negatives(ceilo_obj)
77
78
  ceilo_obj.data["beta"] = ceilo_obj.calc_screened_product(
78
79
  ceilo_obj.data["beta_raw"],
79
80
  snr_limit,
80
81
  range_corrected=range_corrected,
82
+ n_negatives=n_negatives,
81
83
  )
82
84
  ceilo_obj.data["beta_smooth"] = ceilo_obj.calc_beta_smooth(
83
85
  ceilo_obj.data["beta"],
84
86
  snr_limit,
85
87
  range_corrected=range_corrected,
88
+ n_negatives=n_negatives,
86
89
  )
87
90
  if ceilo_obj.instrument is None or ceilo_obj.instrument.model is None:
88
91
  msg = "Failed to read ceilometer model"
89
92
  raise RuntimeError(msg)
90
- if any(
91
- model in ceilo_obj.instrument.model.lower()
92
- for model in ("cl61", "chm15k", "chm15kx", "cl51", "cl31")
93
+ if (
94
+ any(
95
+ model in ceilo_obj.instrument.model.lower()
96
+ for model in ("cl61", "chm15k", "chm15kx", "cl51", "cl31")
97
+ )
98
+ and range_corrected
93
99
  ):
94
100
  mask = ceilo_obj.data["beta_smooth"].mask
95
101
  ceilo_obj.data["beta"] = ma.masked_where(mask, ceilo_obj.data["beta_raw"])
@@ -107,6 +113,19 @@ def ceilo2nc(
107
113
  return output.save_level1b(ceilo_obj, output_file, uuid)
108
114
 
109
115
 
116
+ def _get_n_negatives(ceilo_obj: ClCeilo | Ct25k | LufftCeilo | Cl61d | Cs135) -> int:
117
+ is_old_chm_version = (
118
+ hasattr(ceilo_obj, "is_old_version") and ceilo_obj.is_old_version
119
+ )
120
+ is_ct25k = (
121
+ ceilo_obj.instrument is not None
122
+ and getattr(ceilo_obj.instrument, "model", "").lower() == "ct25k"
123
+ )
124
+ if is_old_chm_version or is_ct25k:
125
+ return 20
126
+ return 5
127
+
128
+
110
129
  def _initialize_ceilo(
111
130
  full_path: str,
112
131
  site_meta: dict,
@@ -38,6 +38,7 @@ class Ceilometer:
38
38
  self,
39
39
  array: np.ndarray,
40
40
  snr_limit: int = 5,
41
+ n_negatives: int = 5,
41
42
  *,
42
43
  range_corrected: bool = True,
43
44
  ) -> np.ndarray:
@@ -47,13 +48,6 @@ class Ceilometer:
47
48
  self.noise_param,
48
49
  range_corrected=range_corrected,
49
50
  )
50
- if (
51
- self.instrument is not None
52
- and getattr(self.instrument, "model", "").lower() == "ct25k"
53
- ):
54
- n_negatives = 20
55
- else:
56
- n_negatives = 5
57
51
  return noisy_data.screen_data(
58
52
  array,
59
53
  snr_limit=snr_limit,
@@ -64,6 +58,7 @@ class Ceilometer:
64
58
  self,
65
59
  beta: np.ndarray,
66
60
  snr_limit: int = 5,
61
+ n_negatives: int = 5,
67
62
  *,
68
63
  range_corrected: bool = True,
69
64
  ) -> np.ndarray:
@@ -82,6 +77,7 @@ class Ceilometer:
82
77
  beta_raw_smooth,
83
78
  is_smoothed=True,
84
79
  snr_limit=snr_limit,
80
+ n_negatives=n_negatives,
85
81
  )
86
82
 
87
83
  def prepare_data(self) -> None:
@@ -23,6 +23,7 @@ class LufftCeilo(NcLidar):
23
23
  self.file_name = file_name
24
24
  self.site_meta = site_meta
25
25
  self.expected_date = expected_date
26
+ self.is_old_version = False
26
27
 
27
28
  def read_ceilometer_file(self, calibration_factor: float | None = None) -> None:
28
29
  """Reads data and metadata from Jenoptik netCDF file."""
@@ -42,6 +43,7 @@ class LufftCeilo(NcLidar):
42
43
  beta_raw = ma.masked_array(beta_raw)
43
44
  old_version = self._get_old_software_version()
44
45
  if old_version is not None:
46
+ self.is_old_version = True
45
47
  logging.warning(
46
48
  "Software version %s. Assuming data not range corrected.",
47
49
  old_version,
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 64
3
- PATCH = 3
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.64.3
3
+ Version: 1.64.4
4
4
  Summary: Python package for Cloudnet processing
5
5
  Author: Simo Tukiainen
6
6
  License: MIT License
@@ -8,7 +8,7 @@ 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=GFFJFnt6oq0KFYsp4WMGGFDc1chnAA92fIy0n5IYMNM,72
11
+ cloudnetpy/version.py,sha256=i_Co9w-oOI_xRZZ9bnCQKB0KyueIqMaA3uFL0Llm6LY,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
@@ -28,15 +28,15 @@ cloudnetpy/categorize/radar.py,sha256=C4R74E_jmLOJqXLrfhdrAitHRHHA79UYuChz9VLxy5
28
28
  cloudnetpy/instruments/__init__.py,sha256=_jejVwi_viSZehmAOkEqTNI-0-exGgAJ_bHW1IRRwTI,398
29
29
  cloudnetpy/instruments/basta.py,sha256=_OTnySd36ktvxk_swWBzbv_H4AVGlkF_Ce3KtPGD1rE,3758
30
30
  cloudnetpy/instruments/campbell_scientific.py,sha256=2WHfBKQjtRSl0AqvtPeX7G8Hdi3Dn0WbvoAppFOMbA8,5270
31
- cloudnetpy/instruments/ceilo.py,sha256=vmKRY-NLB042BLpmJn4sfufEwK5xAI2vOXLRr7K85bU,8981
32
- cloudnetpy/instruments/ceilometer.py,sha256=-aPEZs_r0Gxeu53PHeWAkZMB2BUdauS47tkL7RFxo6k,12078
31
+ cloudnetpy/instruments/ceilo.py,sha256=xrI7iYNftKvGZf-3C_ESUNsu-QhXV43iWkDuKp3biZU,9552
32
+ cloudnetpy/instruments/ceilometer.py,sha256=P33UXVQl7hLLWZc3NyNfrz6hvTyUAZRIP-g6H5Dpe9Y,11967
33
33
  cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoGGA,1990
34
34
  cloudnetpy/instruments/cloudnet_instrument.py,sha256=RG5HJxGM6p0F-IGyr85fvOizcMmgx48OeD_XeIsrgSU,3367
35
35
  cloudnetpy/instruments/copernicus.py,sha256=nmgqGOjVQFngj7BNbpcuCwA-W3yksvBbqn__iq7MyDk,6469
36
36
  cloudnetpy/instruments/galileo.py,sha256=yQBedd7dmDnwuWi1MtXOsg4-RyRx0uRAXumCY4YuH9k,4686
37
37
  cloudnetpy/instruments/hatpro.py,sha256=PD2wLmzzbeOticvg44cT3aJzQYsRnLekW9pBPOzjFLc,8514
38
38
  cloudnetpy/instruments/instruments.py,sha256=jG5TYnZ8bdCZXnI303ZsaJBEdSKaIjKMbkGtnq6kQX0,3261
39
- cloudnetpy/instruments/lufft.py,sha256=tip8UPqm1pelvIL-KvVkj9tx4B52gOQZ73lgf6lmd6Q,3630
39
+ cloudnetpy/instruments/lufft.py,sha256=ugXF6pssHAAz1Y_hqPdpKuluAjxxHSR88xBmQuS6RlI,3705
40
40
  cloudnetpy/instruments/mira.py,sha256=EyzEBTpWfDlgaspZVuIfaP4l73GYSVnSzEzBZc0lZNg,9333
41
41
  cloudnetpy/instruments/mrr.py,sha256=efxqsxy0G-qj4uCWVZztgNwGxYooSxIpI6K2tYF36GA,5833
42
42
  cloudnetpy/instruments/nc_lidar.py,sha256=5gQG9PApnNPrHmS9_zanl8HEYIQuGRpbnzC3wfTcOyQ,1705
@@ -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.64.3.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
112
- cloudnetpy-1.64.3.dist-info/METADATA,sha256=RYIRnABCcnD8hAcyoXIvEHxLTJOuTHSmCUaCWaUUTVI,5784
113
- cloudnetpy-1.64.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
114
- cloudnetpy-1.64.3.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
115
- cloudnetpy-1.64.3.dist-info/RECORD,,
111
+ cloudnetpy-1.64.4.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
112
+ cloudnetpy-1.64.4.dist-info/METADATA,sha256=f_OMmWbN7kTFNYGnHhZuyoC2mqK3A_lZjojPxVYyrYc,5784
113
+ cloudnetpy-1.64.4.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
114
+ cloudnetpy-1.64.4.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
115
+ cloudnetpy-1.64.4.dist-info/RECORD,,