cloudnetpy 1.84.1__py3-none-any.whl → 1.85.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.
@@ -14,11 +14,14 @@ from numpy import ma
14
14
 
15
15
  from cloudnetpy import output
16
16
  from cloudnetpy.instruments.cl61d import Cl61d
17
+ from cloudnetpy.instruments.da10 import Da10
17
18
  from cloudnetpy.instruments.lufft import LufftCeilo
18
19
  from cloudnetpy.instruments.vaisala import ClCeilo, Cs135, Ct25k
19
20
  from cloudnetpy.metadata import COMMON_ATTRIBUTES, MetaData
20
21
  from cloudnetpy.utils import get_uuid
21
22
 
23
+ CeiloObject = ClCeilo | Ct25k | LufftCeilo | Cl61d | Cs135 | Da10
24
+
22
25
 
23
26
  def ceilo2nc(
24
27
  full_path: str | PathLike,
@@ -30,7 +33,7 @@ def ceilo2nc(
30
33
  """Converts Vaisala, Lufft and Campbell Scientific ceilometer data into
31
34
  Cloudnet Level 1b netCDF file.
32
35
 
33
- This function reads raw Vaisala (CT25k, CL31, CL51, CL61), Lufft
36
+ This function reads raw Vaisala (CT25k, CL31, CL51, CL61, DA10), Lufft
34
37
  (CHM 15k, CHM 15k-x) and Campbell Scientific (CS135) ceilometer files and writes
35
38
  the data into netCDF file. Three variants of the backscatter are saved:
36
39
 
@@ -44,8 +47,8 @@ def ceilo2nc(
44
47
  2. SNR-screened depolarisation with smoothed weak background,
45
48
  `depolarisation_smooth`
46
49
 
47
- CL61 screened backscatter is screened using beta_smooth mask to improve detection
48
- of weak aerosol layers and supercooled liquid clouds.
50
+ With most instruments, screened backscatter is screened using beta_smooth
51
+ mask to improve detection of weak aerosol layers and supercooled liquid clouds.
49
52
 
50
53
  Args:
51
54
  full_path: Ceilometer file name.
@@ -118,7 +121,7 @@ def ceilo2nc(
118
121
  if (
119
122
  any(
120
123
  model in ceilo_obj.instrument.model.lower()
121
- for model in ("cl61", "chm15k", "chm15kx", "cl51", "cl31")
124
+ for model in ("cl61", "chm15k", "chm15kx", "cl51", "cl31", "da10")
122
125
  )
123
126
  and range_corrected
124
127
  ):
@@ -141,7 +144,7 @@ def ceilo2nc(
141
144
  return uuid
142
145
 
143
146
 
144
- def _get_n_negatives(ceilo_obj: ClCeilo | Ct25k | LufftCeilo | Cl61d | Cs135) -> int:
147
+ def _get_n_negatives(ceilo_obj: CeiloObject) -> int:
145
148
  is_old_chm_version = (
146
149
  hasattr(ceilo_obj, "is_old_version") and ceilo_obj.is_old_version
147
150
  )
@@ -157,7 +160,7 @@ def _initialize_ceilo(
157
160
  full_path: str | PathLike,
158
161
  site_meta: dict,
159
162
  date: datetime.date | None = None,
160
- ) -> ClCeilo | Ct25k | LufftCeilo | Cl61d | Cs135:
163
+ ) -> CeiloObject:
161
164
  if "model" in site_meta:
162
165
  if site_meta["model"] not in (
163
166
  "cl31",
@@ -166,6 +169,7 @@ def _initialize_ceilo(
166
169
  "ct25k",
167
170
  "chm15k",
168
171
  "cs135",
172
+ "da10",
169
173
  ):
170
174
  msg = f"Invalid ceilometer model: {site_meta['model']}"
171
175
  raise ValueError(msg)
@@ -181,6 +185,8 @@ def _initialize_ceilo(
181
185
  return Ct25k(full_path, site_meta, date)
182
186
  if model == "cl61d":
183
187
  return Cl61d(full_path, site_meta, date)
188
+ if model == "da10":
189
+ return Da10(full_path, site_meta, date)
184
190
  if model == "cs135":
185
191
  return Cs135(full_path, site_meta, date)
186
192
  return LufftCeilo(full_path, site_meta, date)
@@ -1,5 +1,3 @@
1
- """Module with a class for Lufft chm15k ceilometer."""
2
-
3
1
  import datetime
4
2
  import logging
5
3
  from os import PathLike
@@ -0,0 +1,54 @@
1
+ import datetime
2
+ import logging
3
+ from os import PathLike
4
+
5
+ import netCDF4
6
+
7
+ from cloudnetpy import utils
8
+ from cloudnetpy.exceptions import LidarDataError
9
+ from cloudnetpy.instruments import instruments
10
+ from cloudnetpy.instruments.nc_lidar import NcLidar
11
+
12
+
13
+ class Da10(NcLidar):
14
+ """Class for Vaisala DA10 differential absorption lidar."""
15
+
16
+ def __init__(
17
+ self,
18
+ file_name: str | PathLike,
19
+ site_meta: dict,
20
+ expected_date: datetime.date | None = None,
21
+ ) -> None:
22
+ super().__init__()
23
+ self.file_name = file_name
24
+ self.site_meta = site_meta
25
+ self.expected_date = expected_date
26
+ self.instrument = instruments.DA10
27
+
28
+ def read_ceilometer_file(self, calibration_factor: float | None = None) -> None:
29
+ with netCDF4.Dataset(self.file_name) as dataset:
30
+ self.dataset = dataset
31
+ self._fetch_attributes()
32
+ self._fetch_zenith_angle("tilt_angle", default=3.0)
33
+ self._fetch_range(reference="lower")
34
+ self._fetch_lidar_variables(calibration_factor)
35
+ self._fetch_time_and_date()
36
+ self.dataset = None
37
+
38
+ def _fetch_lidar_variables(self, calibration_factor: float | None = None) -> None:
39
+ if self.dataset is None:
40
+ msg = "No dataset found"
41
+ raise RuntimeError(msg)
42
+ beta_raw = self.dataset.variables["beta_att"][:]
43
+ if utils.is_all_masked(beta_raw):
44
+ msg = "All beta_raw values are masked. Check the input file(s)."
45
+ raise LidarDataError(msg)
46
+ if calibration_factor is None:
47
+ logging.warning("Using default calibration factor")
48
+ calibration_factor = 1
49
+ beta_raw *= calibration_factor
50
+ self.data["calibration_factor"] = float(calibration_factor)
51
+ self.data["beta_raw"] = beta_raw
52
+
53
+ def _fetch_attributes(self) -> None:
54
+ self.serial_number = getattr(self.dataset, "instrument_serial_number", None)
@@ -253,3 +253,11 @@ FD12P = Instrument(
253
253
  category="present weather sensor",
254
254
  model="FD12P",
255
255
  )
256
+
257
+ DA10 = Instrument(
258
+ manufacturer="Vaisala",
259
+ domain="lidar",
260
+ category="differential absorption lidar",
261
+ model="DA10",
262
+ wavelength=911.0,
263
+ )
@@ -113,6 +113,10 @@ class NcRadar(DataSource, CloudnetInstrument):
113
113
  self.append_data(azimuth_offset, "azimuth_offset")
114
114
  azimuth += azimuth_offset
115
115
 
116
+ if len(elevation) < 2 or len(azimuth) < 2:
117
+ msg = "Less than two profiles with valid zenith / azimuth angles"
118
+ raise ValidTimeStampError(msg)
119
+
116
120
  elevation_diff = ma.diff(elevation, prepend=elevation[1])
117
121
  azimuth_diff = ma.diff(azimuth, prepend=azimuth[1])
118
122
 
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
- MINOR = 84
3
- PATCH = 1
2
+ MINOR = 85
3
+ PATCH = 0
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnetpy
3
- Version: 1.84.1
3
+ Version: 1.85.0
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=Bu6a1uNfyNGLiB1RFZ8fIdr7uvx-Ng5jWbU9Y5hazl0,72
12
+ cloudnetpy/version.py,sha256=lLtOfbPTOgEcz4-gTcFPYaor-U52n66zRHoLKjGWJ30,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
@@ -35,20 +35,21 @@ cloudnetpy/categorize/attenuations/rain_attenuation.py,sha256=wJPyCiKWzsQDzMhqbA
35
35
  cloudnetpy/instruments/__init__.py,sha256=PEgrrQNoiOuN_ctYilmt4LV2QCLg1likPjJdWtuGlLs,528
36
36
  cloudnetpy/instruments/basta.py,sha256=N-kRgl5Vm52pXzr9umo4YsA0hn4zZCOa-0_zZTzhheY,4284
37
37
  cloudnetpy/instruments/bowtie.py,sha256=WZYB_o90I5QKOupCRjzZU4Mi54oX_3teyAPBDUogwRI,4301
38
- cloudnetpy/instruments/ceilo.py,sha256=GJ1ZVX6aEMAZw1cpTXcNy9imfuPAkoqmrLQyUc00UEo,8809
38
+ cloudnetpy/instruments/ceilo.py,sha256=scb3n0gLOZ1gPs_WdWw9KS5Ut_mtCvSdWFMKKCvXhBI,8979
39
39
  cloudnetpy/instruments/ceilometer.py,sha256=c37uteeuGnlE-o-Smu49H2qQJw6qZ0tc3Bzhyr1FoSo,13063
40
- cloudnetpy/instruments/cl61d.py,sha256=3YMisWZ-nTX29I8hFNXrKc73rMPolqAO0lPmqpGamjk,2294
40
+ cloudnetpy/instruments/cl61d.py,sha256=JsCHqVzFGhZi-5xcnsB507FDpyuw83uSWK3IFO3DhdI,2238
41
41
  cloudnetpy/instruments/cloudnet_instrument.py,sha256=B1UkiB0ytnT3MWYalEegql5QIPaMLg5bJy5xI50JEco,4503
42
42
  cloudnetpy/instruments/copernicus.py,sha256=ygEViERBSJdMeP9OxfLelZRDEbSRzY8n17ruYie2wm4,6970
43
+ cloudnetpy/instruments/da10.py,sha256=FcXEu6dfAVvYzMvauiJBSyEkYhGa8hBuwrrdo-3LwHE,1960
43
44
  cloudnetpy/instruments/fd12p.py,sha256=5TFyNO26VGpO4ts9UIJiuLo4LUwQPHO6aK2fTnOtaKY,7019
44
45
  cloudnetpy/instruments/galileo.py,sha256=f_-GkRxhNaQPbI8HpOwSmoKfGqyjmD16A0ZFgwLOIig,5137
45
46
  cloudnetpy/instruments/hatpro.py,sha256=TGOqwW0TfoPEYk13MFvFzwgJGzm6MVE5AsPavcIoj3I,10248
46
- cloudnetpy/instruments/instruments.py,sha256=z8Osjww3iQRxKvzXdISl-5vV6gShtji8Db5k-ZzDQ-0,4843
47
+ cloudnetpy/instruments/instruments.py,sha256=WZgH7HjzM9Ane1CSnYCSLidbST8hunUeSt2lPntq9As,4999
47
48
  cloudnetpy/instruments/lufft.py,sha256=G6KeJOeltLUlGCHHEk8ns2K7WJ9ImAr25rSB2JltawE,4286
48
49
  cloudnetpy/instruments/mira.py,sha256=XqmbytpeCJ2-hNugxdsXSBUDB8SAUc97_6lo5mHFG8E,11840
49
50
  cloudnetpy/instruments/mrr.py,sha256=z50VYLOBW2o7enU7FHZYNFQRW2goEQpeGe7-iCBRQtg,6020
50
51
  cloudnetpy/instruments/nc_lidar.py,sha256=PtZauDdI3bX3bv4gIVvV6N53e2Co-ehBL_tByHM9hj8,1713
51
- cloudnetpy/instruments/nc_radar.py,sha256=9npjF9xfMY5DkDPpesqAIhrmv1QqPlKB9J-cySI2UbU,7360
52
+ cloudnetpy/instruments/nc_radar.py,sha256=XFKxPLKivnhHTgjE5HFrxjWZ0oCifhDUAog051vkMiY,7533
52
53
  cloudnetpy/instruments/pollyxt.py,sha256=IFq_RJrhgJ79OVyuo48PwYQK_zZ6VZFB_S5bEirRyzs,10566
53
54
  cloudnetpy/instruments/radiometrics.py,sha256=QKfnrZlQ0sFcFjmv1ShnCMTJQv64w4akjK-JAIY4gCg,16116
54
55
  cloudnetpy/instruments/rain_e_h3.py,sha256=fjv3SgeUNx9GisYqLrBnX9AjnO17VtouyoPh12VE9uo,5465
@@ -117,10 +118,10 @@ cloudnetpy/products/lwc.py,sha256=xsNiiG6dGKIkWaFk0xWTabc1bZ4ULf6SqcqHs7itAUk,19
117
118
  cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
118
119
  cloudnetpy/products/mwr_tools.py,sha256=MMWnp68U7bv157-CPB2VeTQvaR6zl7sexbBT_kJ_pn8,6734
119
120
  cloudnetpy/products/product_tools.py,sha256=eyqIw_0KhlpmmYQE69RpGdRIAOW7JVPlEgkTBp2kdps,11302
120
- cloudnetpy-1.84.1.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
121
+ cloudnetpy-1.85.0.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
121
122
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
122
- cloudnetpy-1.84.1.dist-info/METADATA,sha256=6IQo1hk6eXK0J5wAS1OGOxkAT3JvJga3Z0QJhQ2N3z0,5836
123
- cloudnetpy-1.84.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
- cloudnetpy-1.84.1.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
125
- cloudnetpy-1.84.1.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
126
- cloudnetpy-1.84.1.dist-info/RECORD,,
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,,