cloudnetpy 1.78.1__py3-none-any.whl → 1.78.2__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.
@@ -357,6 +357,16 @@ class Radar(DataSource):
357
357
  )
358
358
  # store this in the file
359
359
  self.append_data(max_folding_binned, "nyquist_velocity")
360
+
361
+ if "correction_bits" in self.dataset.variables:
362
+ bits = self.dataset.variables["correction_bits"][:]
363
+ dealiasing_bit = utils.isbit(bits, 0)
364
+ if ma.all(dealiasing_bit):
365
+ return utils.rebin_2d(self.time, data, time_new, "mean")[0]
366
+ if ma.any(dealiasing_bit):
367
+ msg = "Data are only party dealiased. Deal with this later."
368
+ raise NotImplementedError(msg)
369
+
360
370
  # with original shape (repeat maximum value for each point in every bin)
361
371
  max_folding_full, _ = utils.rebin_2d(
362
372
  self.time,
@@ -365,6 +375,7 @@ class Radar(DataSource):
365
375
  "max",
366
376
  keepdim=True,
367
377
  )
378
+
368
379
  data_scaled = data * (np.pi / max_folding_full)
369
380
  vel_x = ma.cos(data_scaled)
370
381
  vel_y = ma.sin(data_scaled)
@@ -1,6 +1,7 @@
1
1
  from os import PathLike
2
2
 
3
3
  import numpy as np
4
+ from numpy import ma
4
5
 
5
6
  from cloudnetpy import output
6
7
  from cloudnetpy.constants import G_TO_KG, MM_H_TO_M_S
@@ -8,6 +9,7 @@ from cloudnetpy.exceptions import ValidTimeStampError
8
9
  from cloudnetpy.instruments.instruments import FMCW94
9
10
  from cloudnetpy.instruments.nc_radar import NcRadar
10
11
  from cloudnetpy.metadata import MetaData
12
+ from cloudnetpy.utils import bit_field_definition
11
13
 
12
14
 
13
15
  def bowtie2nc(
@@ -63,6 +65,7 @@ def bowtie2nc(
63
65
  bowtie.convert_units()
64
66
  bowtie.fix_chirp_start_indices()
65
67
  bowtie.test_if_all_masked()
68
+ bowtie.add_correction_bits()
66
69
  attributes = output.add_time_attribute(ATTRIBUTES, bowtie.date)
67
70
  output.update_attributes(bowtie.data, attributes)
68
71
  return output.save_level1b(bowtie, output_file, uuid)
@@ -84,6 +87,11 @@ class Bowtie(NcRadar):
84
87
  self.data["chirp_start_indices"].data = np.array(array, dtype=np.int32)
85
88
  self.data["chirp_start_indices"].data_type = "int32"
86
89
 
90
+ def add_correction_bits(self):
91
+ bits = ma.ones(self.data["v"].data.shape, dtype=np.uint32)
92
+ bits.mask = self.data["v"].data.mask
93
+ self.append_data(bits, "correction_bits")
94
+
87
95
  def check_date(self, date: str):
88
96
  if "-".join(self.date) != date:
89
97
  raise ValidTimeStampError
@@ -100,4 +108,13 @@ ATTRIBUTES: dict = {
100
108
  "applied to it."
101
109
  ),
102
110
  ),
111
+ "correction_bits": MetaData(
112
+ long_name="Correction bits",
113
+ units="1",
114
+ definition=bit_field_definition({0: """Doppler velocity is dealiased."""}),
115
+ comment=(
116
+ "This parameter is a bit field that indicates which corrections have\n"
117
+ "been applied to radar measurements."
118
+ ),
119
+ ),
103
120
  }
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 78
3
- PATCH = 1
3
+ PATCH = 2
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudnetpy
3
- Version: 1.78.1
3
+ Version: 1.78.2
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=lO7BCbVAzFoH3Nq-VuezYX0f7MnbG1Zp11g5GSiuQwM,6189
9
9
  cloudnetpy/output.py,sha256=gupxt4f_-eUrFsWMto8tnknoV-p9QauC9L6CJAqBILU,15988
10
10
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cloudnetpy/utils.py,sha256=HdcSNIgdxoZlP_jHl66ItheHLw_cDYZb7u6mZ5dfMNE,31952
12
- cloudnetpy/version.py,sha256=3xCJ6Zv7LkLahqubKZWS5YDwui01I7yk-Z-3oUGO9Us,72
12
+ cloudnetpy/version.py,sha256=pp524YFzJKGdXw7WbYnhaSXBq2gUBdIJNxT7Vf-Xq8U,72
13
13
  cloudnetpy/categorize/__init__.py,sha256=s-SJaysvVpVVo5kidiruWQO6p3gv2TXwY1wEHYO5D6I,44
14
14
  cloudnetpy/categorize/atmos_utils.py,sha256=RcmbKxm2COkE7WEya0mK3yX5rzUbrewRVh3ekm01RtM,10598
15
15
  cloudnetpy/categorize/attenuation.py,sha256=Y_-fzmQTltWTqIZTulJhovC7a6ifpMcaAazDJcnMIOc,990
@@ -26,7 +26,7 @@ cloudnetpy/categorize/lidar.py,sha256=YQrM_LOz8NQrrD9l9HyujV1GSGwkQ8LMqXN13bEJRW
26
26
  cloudnetpy/categorize/melting.py,sha256=ZnLeL_qWmiCdjXVOm9iBYHdo29Brqxu_DEErZPqUloQ,6217
27
27
  cloudnetpy/categorize/model.py,sha256=QFRCY0TvM2fzGRyP8BNkqbvu13XcQjt7TsN5fhjI_Uc,6654
28
28
  cloudnetpy/categorize/mwr.py,sha256=F7cquERWL6mBkgboqeaCIPf9gOlKI-NWUQIBdQXGT_I,1635
29
- cloudnetpy/categorize/radar.py,sha256=z2bFF_wAKbzzXB3Pq1z33Y1RMv6NL-8CdZesU89qzpw,15502
29
+ cloudnetpy/categorize/radar.py,sha256=Bc-JkMpU3_wFBo7eMMtlF5oiyTaIwbs_BsAn4dufTsE,15953
30
30
  cloudnetpy/categorize/attenuations/__init__.py,sha256=CWFHVWeTIe2hrZtgkJaX2HGftbuffsFc39Mzv5B0Lw0,1037
31
31
  cloudnetpy/categorize/attenuations/gas_attenuation.py,sha256=emr-RCxQT0i2N8k6eBNhRsmsCBPHJzQsWJfjC4fVSTo,975
32
32
  cloudnetpy/categorize/attenuations/liquid_attenuation.py,sha256=0p0G79BPkw1itCXHMwbvkNHtJGBocJzow3gNHAirChI,3036
@@ -34,7 +34,7 @@ cloudnetpy/categorize/attenuations/melting_attenuation.py,sha256=9c9xoZHtGUbjFYJ
34
34
  cloudnetpy/categorize/attenuations/rain_attenuation.py,sha256=qazJzRyXf9vbjJhh4yiFmABI4L57j5W_6YZ-6qjRiBI,2839
35
35
  cloudnetpy/instruments/__init__.py,sha256=PEgrrQNoiOuN_ctYilmt4LV2QCLg1likPjJdWtuGlLs,528
36
36
  cloudnetpy/instruments/basta.py,sha256=Lb_EhQTI93S5Bd9osDbCE_tC8gZreRsHz7D2_dFOjmE,3793
37
- cloudnetpy/instruments/bowtie.py,sha256=GlWCxemeXrIvWnnQRvZa1ttl4J0NmLUdc7xngIH5WBI,3281
37
+ cloudnetpy/instruments/bowtie.py,sha256=EyE8HAE8rjO7JelJDbQte_rnwE3VoVJVc6TBpSNK3IU,3930
38
38
  cloudnetpy/instruments/ceilo.py,sha256=qM3AkQKHUblhRCD42HsB6lr82giBH-0g_VzoWHZDgeA,9535
39
39
  cloudnetpy/instruments/ceilometer.py,sha256=ati9-fUQ54K9tvynIPB-nlBYwtvBVaQtUCjVCLNB67w,12059
40
40
  cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoGGA,1990
@@ -117,10 +117,10 @@ cloudnetpy/products/lwc.py,sha256=sl6Al2tuH3KkCBrPbWTmuz3jlD5UQJ4D6qBsn1tt2CQ,18
117
117
  cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
118
118
  cloudnetpy/products/mwr_tools.py,sha256=8HPZpQMTojKZP1JS1S83IE0sxmbDE9bxlaWoqmGnUZE,6199
119
119
  cloudnetpy/products/product_tools.py,sha256=uu4l6reuGbPcW3TgttbaSrqIKbyYGhBVTdnC7opKvmg,11101
120
- cloudnetpy-1.78.1.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
120
+ cloudnetpy-1.78.2.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
121
121
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
122
- cloudnetpy-1.78.1.dist-info/METADATA,sha256=AznJgGBfGvD7cbWAieBBM5xVu3Wn9GQebLBXaAVFJUE,5796
123
- cloudnetpy-1.78.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
- cloudnetpy-1.78.1.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
125
- cloudnetpy-1.78.1.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
126
- cloudnetpy-1.78.1.dist-info/RECORD,,
122
+ cloudnetpy-1.78.2.dist-info/METADATA,sha256=yPrOxHBFcsn8Sifbaw_LmxgTrQ9fNgC1GAPDLgmRarM,5796
123
+ cloudnetpy-1.78.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
+ cloudnetpy-1.78.2.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
125
+ cloudnetpy-1.78.2.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
126
+ cloudnetpy-1.78.2.dist-info/RECORD,,