cloudnetpy 1.72.3__py3-none-any.whl → 1.73.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.
@@ -1,4 +1,5 @@
1
1
  from .basta import basta2nc
2
+ from .bowtie import bowtie2nc
2
3
  from .ceilo import ceilo2nc
3
4
  from .copernicus import copernicus2nc
4
5
  from .disdrometer import parsivel2nc, thies2nc
@@ -0,0 +1,95 @@
1
+ from os import PathLike
2
+
3
+ from cloudnetpy import output
4
+ from cloudnetpy.constants import G_TO_KG, MM_H_TO_M_S
5
+ from cloudnetpy.exceptions import ValidTimeStampError
6
+ from cloudnetpy.instruments.instruments import FMCW94
7
+ from cloudnetpy.instruments.nc_radar import NcRadar
8
+ from cloudnetpy.metadata import MetaData
9
+
10
+
11
+ def bowtie2nc(
12
+ bowtie_file: str | PathLike,
13
+ output_file: str,
14
+ site_meta: dict,
15
+ uuid: str | None = None,
16
+ date: str | None = None,
17
+ ) -> str:
18
+ """Converts data from 'BOW-TIE' campaign cloud radar on RV-Meteor into
19
+ Cloudnet Level 1b netCDF file.
20
+
21
+ Args:
22
+ bowtie_file: Input filename.
23
+ output_file: Output filename.
24
+ site_meta: Dictionary containing information about the site. Required key
25
+ value pair is `name`. Optional are `latitude`, `longitude`, `altitude`.
26
+ uuid: Set specific UUID for the file.
27
+ date: Expected date as YYYY-MM-DD of all profiles in the file.
28
+
29
+ Returns:
30
+ UUID of the generated file.
31
+
32
+ Raises:
33
+ ValidTimeStampError: No valid timestamps found.
34
+
35
+ """
36
+ keymap = {
37
+ "Zh": "Zh",
38
+ "v": "v",
39
+ "width": "width",
40
+ "ldr": "ldr",
41
+ "kurt": "kurtosis",
42
+ "Skew": "skewness",
43
+ "SNR": "SNR",
44
+ "time": "time",
45
+ "range": "range",
46
+ "lwp": "lwp",
47
+ "SurfRelHum": "relative_humidity",
48
+ "rain": "rainfall_rate",
49
+ "Nyquist_velocity": "nyquist_velocity",
50
+ "range_offsets": "chirp_start_indices",
51
+ }
52
+
53
+ with Bowtie(bowtie_file, site_meta) as bowtie:
54
+ bowtie.init_data(keymap)
55
+ bowtie.add_time_and_range()
56
+ if date is not None:
57
+ bowtie.check_date(date)
58
+ bowtie.add_radar_specific_variables()
59
+ bowtie.add_site_geolocation()
60
+ bowtie.add_height()
61
+ bowtie.convert_units()
62
+ bowtie.test_if_all_masked()
63
+ attributes = output.add_time_attribute(ATTRIBUTES, bowtie.date)
64
+ output.update_attributes(bowtie.data, attributes)
65
+ return output.save_level1b(bowtie, output_file, uuid)
66
+
67
+
68
+ class Bowtie(NcRadar):
69
+ def __init__(self, full_path: str | PathLike, site_meta: dict):
70
+ super().__init__(full_path, site_meta)
71
+ self.instrument = FMCW94
72
+ self.date = self.get_date()
73
+
74
+ def convert_units(self):
75
+ self.data["lwp"].data *= G_TO_KG
76
+ self.data["rainfall_rate"].data *= MM_H_TO_M_S
77
+ self.data["relative_humidity"].data /= 100
78
+
79
+ def check_date(self, date: str):
80
+ if "-".join(self.date) != date:
81
+ raise ValidTimeStampError
82
+
83
+
84
+ ATTRIBUTES: dict = {
85
+ "v": MetaData(
86
+ long_name="Doppler velocity",
87
+ units="m s-1",
88
+ comment=(
89
+ "This parameter is the radial component of the velocity, with positive\n"
90
+ "velocities are away from the radar. It was corrected for the heave\n"
91
+ "motion of the ship. A rolling average over 3 time steps has been\n"
92
+ "applied to it."
93
+ ),
94
+ ),
95
+ }
@@ -445,10 +445,6 @@ RPG_ATTRIBUTES = {
445
445
  long_name="Number of spectral samples in each chirp sequence",
446
446
  units="1",
447
447
  ),
448
- "chirp_start_indices": MetaData(
449
- long_name="Chirp sequences start indices",
450
- units="1",
451
- ),
452
448
  "number_of_averaged_chirps": MetaData(
453
449
  long_name="Number of averaged chirps in sequence",
454
450
  units="1",
@@ -517,10 +513,6 @@ RPG_ATTRIBUTES = {
517
513
  long_name="PC temperature",
518
514
  units="K",
519
515
  ),
520
- "skewness": MetaData(
521
- long_name="Skewness of spectra",
522
- units="1",
523
- ),
524
516
  "kurtosis": MetaData(
525
517
  long_name="Kurtosis of spectra",
526
518
  units="1",
cloudnetpy/metadata.py CHANGED
@@ -93,6 +93,10 @@ COMMON_ATTRIBUTES = {
93
93
  long_name="Kurtosis of spectra",
94
94
  units="1",
95
95
  ),
96
+ "skewness": MetaData(
97
+ long_name="Skewness of spectra",
98
+ units="1",
99
+ ),
96
100
  "nyquist_velocity": MetaData(long_name="Nyquist velocity", units="m s-1"),
97
101
  "radar_frequency": MetaData(long_name="Radar transmit frequency", units="GHz"),
98
102
  "beta": MetaData(
@@ -190,4 +194,8 @@ COMMON_ATTRIBUTES = {
190
194
  units="dB",
191
195
  comment="SNR threshold used in data screening.",
192
196
  ),
197
+ "chirp_start_indices": MetaData(
198
+ long_name="Chirp sequences start indices",
199
+ units="1",
200
+ ),
193
201
  }
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
- MINOR = 72
3
- PATCH = 3
2
+ MINOR = 73
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.72.3
3
+ Version: 1.73.0
4
4
  Summary: Python package for Cloudnet processing
5
5
  Author: Simo Tukiainen
6
6
  License: MIT License
@@ -5,11 +5,11 @@ cloudnetpy/concat_lib.py,sha256=jcLppqAmVHVkykcXBcpwUr8MS_k8v2Xl2xBLmVRE_DI,1262
5
5
  cloudnetpy/constants.py,sha256=YnoSzZm35NDooJfhlulSJBc7g0eSchT3yGytRaTaJEI,845
6
6
  cloudnetpy/datasource.py,sha256=FcWS77jz56gIzwnbafDLdj-HjAyu0P_VtY7gkeVZThU,7952
7
7
  cloudnetpy/exceptions.py,sha256=hYbUtBwjCIfxnPe_5mELDEw87AWITBrwuo7WYIEKmJ8,1579
8
- cloudnetpy/metadata.py,sha256=BDEpgwZ58PHznc1gi11gtNNV4kFiMAmlHnF4huTy7nw,5982
8
+ cloudnetpy/metadata.py,sha256=lO7BCbVAzFoH3Nq-VuezYX0f7MnbG1Zp11g5GSiuQwM,6189
9
9
  cloudnetpy/output.py,sha256=l0LoOhcGCBrg2EJ4NT1xZ7-UKWdV7X7yQ0fJmhkwJVc,15829
10
10
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cloudnetpy/utils.py,sha256=U0iMIKPiKLrLVAfs_u9pPuoWYW1RJHcM8dbLF9a4yIA,29796
12
- cloudnetpy/version.py,sha256=VZyDjYqkZF5bawPUyoO9efabZW4A0aKtVUmrLqcEnGE,72
12
+ cloudnetpy/version.py,sha256=3tb7RR3Otpei74n8G_komkzbUlDjdwa11eUTBVCQFw0,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
@@ -32,8 +32,9 @@ cloudnetpy/categorize/attenuations/gas_attenuation.py,sha256=emr-RCxQT0i2N8k6eBN
32
32
  cloudnetpy/categorize/attenuations/liquid_attenuation.py,sha256=0p0G79BPkw1itCXHMwbvkNHtJGBocJzow3gNHAirChI,3036
33
33
  cloudnetpy/categorize/attenuations/melting_attenuation.py,sha256=9c9xoZHtGUbjFYJxkVc3UUDHLDy0UbNUZ32ITtnsj5w,2333
34
34
  cloudnetpy/categorize/attenuations/rain_attenuation.py,sha256=qazJzRyXf9vbjJhh4yiFmABI4L57j5W_6YZ-6qjRiBI,2839
35
- cloudnetpy/instruments/__init__.py,sha256=2vAdceXCNxZhTujhArLf4NjYOfUdkhLpGM-NQa_LXdg,470
35
+ cloudnetpy/instruments/__init__.py,sha256=sbJZBYWynZbGAWb8VMMaT5qXuCyzG1LwEdHhVxFXVMk,500
36
36
  cloudnetpy/instruments/basta.py,sha256=Lb_EhQTI93S5Bd9osDbCE_tC8gZreRsHz7D2_dFOjmE,3793
37
+ cloudnetpy/instruments/bowtie.py,sha256=Hp4mzjGqvYw5bhgAy_LvScYrf3Xm3ULbtPjhG9GnAJ8,2977
37
38
  cloudnetpy/instruments/ceilo.py,sha256=rkP6Vo90eS5ZhnKxZpnkuiG5ZEP86lDK8zRqoMY1aqg,9498
38
39
  cloudnetpy/instruments/ceilometer.py,sha256=pdmLVljsuciyKpaGxWxJ_f1IrJK-UrkBC0lSeuirLlU,12095
39
40
  cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoGGA,1990
@@ -50,7 +51,7 @@ cloudnetpy/instruments/nc_radar.py,sha256=HlaZeH5939R86ukF8K-P4Kfzb5-CpLB15LU2u9
50
51
  cloudnetpy/instruments/pollyxt.py,sha256=ra7sYQ_cmkC0T9TBYrMN6iiQEZimmWGdW9Ilv61JB-Q,10027
51
52
  cloudnetpy/instruments/radiometrics.py,sha256=ySG4a042XkgjMTG8d20oAPNvFvw9bMwwiqS3zv-JF_w,11825
52
53
  cloudnetpy/instruments/rain_e_h3.py,sha256=9TdpP4UzMBNIt2iE2GL6K9dFldzTHPLOrU8Q3tcosCU,5317
53
- cloudnetpy/instruments/rpg.py,sha256=gEQd-yICUoikQnHVpikpHppUrwekdTuIf9Mk1jGxgCY,17566
54
+ cloudnetpy/instruments/rpg.py,sha256=gjvDomyoqSaeS3-X4EuesvWBp32BNoD-CeuvBOP19AI,17359
54
55
  cloudnetpy/instruments/rpg_reader.py,sha256=ThztFuVrWxhmWVAfZTfQDeUiKK1XMTbtv08IBe8GK98,11364
55
56
  cloudnetpy/instruments/toa5.py,sha256=CfmmBMv5iMGaWHIGBK01Rw24cuXC1R1RMNTXkmsm340,1760
56
57
  cloudnetpy/instruments/vaisala.py,sha256=RKAw_fVry4YOUF0i2_-2jLIc6_H85oL8USA4ji9rh0o,4583
@@ -115,10 +116,10 @@ cloudnetpy/products/lwc.py,sha256=sl6Al2tuH3KkCBrPbWTmuz3jlD5UQJ4D6qBsn1tt2CQ,18
115
116
  cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe55y9ob58,16637951
116
117
  cloudnetpy/products/mwr_tools.py,sha256=rd7UC67O4fsIE5SaHVZ4qWvUJTj41ZGwgQWPwZzOM14,5377
117
118
  cloudnetpy/products/product_tools.py,sha256=uu4l6reuGbPcW3TgttbaSrqIKbyYGhBVTdnC7opKvmg,11101
118
- cloudnetpy-1.72.3.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
119
+ cloudnetpy-1.73.0.dist-info/licenses/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
119
120
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
120
- cloudnetpy-1.72.3.dist-info/METADATA,sha256=eKefOUz7gfLWg1dMP0-2GqIkWGPzjinAVmdzO05iNOs,5796
121
- cloudnetpy-1.72.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
122
- cloudnetpy-1.72.3.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
123
- cloudnetpy-1.72.3.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
124
- cloudnetpy-1.72.3.dist-info/RECORD,,
121
+ cloudnetpy-1.73.0.dist-info/METADATA,sha256=t2jW8No5Pzbx9iAxD0rhFytFG10fpylqlM5QVgauUN4,5796
122
+ cloudnetpy-1.73.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
123
+ cloudnetpy-1.73.0.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
124
+ cloudnetpy-1.73.0.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
125
+ cloudnetpy-1.73.0.dist-info/RECORD,,