cloudnetpy 1.69.6__py3-none-any.whl → 1.69.8__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.
@@ -31,7 +31,7 @@ def hatpro2l1c(
31
31
  output_file: str,
32
32
  site_meta: dict,
33
33
  uuid: str | None = None,
34
- date: str | None = None,
34
+ date: datetime.date | str | None = None,
35
35
  ) -> str:
36
36
  """Converts RPG HATPRO microwave radiometer data into Cloudnet Level 1c netCDF file.
37
37
 
@@ -45,7 +45,11 @@ def hatpro2l1c(
45
45
  Returns:
46
46
  UUID of the generated file.
47
47
  """
48
+ if isinstance(date, str):
49
+ date = datetime.date.fromisoformat(date)
50
+
48
51
  coeff_files = site_meta.get("coefficientFiles")
52
+ time_offset = site_meta.get("time_offset")
49
53
 
50
54
  try:
51
55
  hatpro_raw = lev1_to_nc(
@@ -54,6 +58,8 @@ def hatpro2l1c(
54
58
  output_file=output_file,
55
59
  coeff_files=coeff_files,
56
60
  instrument_config=site_meta,
61
+ date=date,
62
+ time_offset=time_offset,
57
63
  )
58
64
  except MissingInputData as err:
59
65
  raise HatproDataError(str(err)) from err
@@ -73,7 +79,7 @@ def hatpro2l1c(
73
79
  msg = "Timestamps are not increasing"
74
80
  raise RuntimeError(msg)
75
81
  dates = [
76
- str(datetime.datetime.fromtimestamp(t, tz=datetime.timezone.utc).date())
82
+ datetime.datetime.fromtimestamp(t, tz=datetime.timezone.utc).date()
77
83
  for t in timestamps
78
84
  ]
79
85
  if len(set(dates)) != 1:
@@ -119,7 +125,7 @@ class HatproL1c:
119
125
  def __init__(self, hatpro, site_meta: dict):
120
126
  self.raw_data = hatpro.raw_data
121
127
  self.data = hatpro.data
122
- self.date = hatpro.date.split("-")
128
+ self.date = hatpro.date.isoformat().split("-")
123
129
  self.site_meta = site_meta
124
130
  self.instrument = HATPRO
125
131
 
@@ -59,6 +59,8 @@ def ws2nc(
59
59
  ws = GalatiWS(weather_station_file, site_meta)
60
60
  elif site_meta["name"] == "Jülich":
61
61
  ws = JuelichWS(weather_station_file, site_meta)
62
+ elif site_meta["name"] == "Lampedusa":
63
+ ws = LampedusaWS(weather_station_file, site_meta)
62
64
  else:
63
65
  msg = "Unsupported site"
64
66
  raise ValueError(msg) # noqa: TRY301
@@ -486,3 +488,57 @@ class JuelichWS(WS):
486
488
  data[keymap[key]].append(parsed)
487
489
 
488
490
  return self.format_data(data)
491
+
492
+
493
+ class LampedusaWS(WS):
494
+ """Read Lampedusa weather station data in ICOS format."""
495
+
496
+ def __init__(self, filenames: list[str], site_meta: dict):
497
+ super().__init__(site_meta)
498
+ self.filename = filenames[0]
499
+ self._data = self._read_data()
500
+
501
+ def _read_data(self) -> dict:
502
+ with open(self.filename, newline="") as f:
503
+ fields = [
504
+ "time",
505
+ "str1",
506
+ "str2",
507
+ "T",
508
+ "RH",
509
+ "Td",
510
+ "P",
511
+ "WSi",
512
+ "WDi",
513
+ "WS10m",
514
+ "WD10m",
515
+ "rain1m",
516
+ "rain2h",
517
+ "empty",
518
+ ]
519
+ reader = csv.DictReader(f, fieldnames=fields)
520
+ raw_data: dict = {key: [] for key in fields}
521
+ for row in reader:
522
+ for key, value in row.items():
523
+ parsed_value: float | datetime.datetime
524
+ if key == "time":
525
+ parsed_value = datetime.datetime.strptime(
526
+ value, "%y%m%d %H%M%S"
527
+ )
528
+ else:
529
+ try:
530
+ parsed_value = float(value)
531
+ except ValueError:
532
+ parsed_value = math.nan
533
+ raw_data[key].append(parsed_value)
534
+
535
+ data = {
536
+ "time": raw_data["time"],
537
+ "air_temperature": raw_data["T"],
538
+ "relative_humidity": raw_data["RH"],
539
+ "air_pressure": raw_data["P"],
540
+ "wind_speed": raw_data["WSi"],
541
+ "wind_direction": raw_data["WDi"],
542
+ "rainfall_rate": raw_data["rain1m"],
543
+ }
544
+ return self.format_data(data)
cloudnetpy/version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  MAJOR = 1
2
2
  MINOR = 69
3
- PATCH = 6
3
+ PATCH = 8
4
4
  __version__ = f"{MAJOR}.{MINOR}.{PATCH}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cloudnetpy
3
- Version: 1.69.6
3
+ Version: 1.69.8
4
4
  Summary: Python package for Cloudnet processing
5
5
  Author: Simo Tukiainen
6
6
  License: MIT License
@@ -36,13 +36,14 @@ Classifier: Operating System :: OS Independent
36
36
  Classifier: Programming Language :: Python :: 3.10
37
37
  Classifier: Programming Language :: Python :: 3.11
38
38
  Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
39
40
  Classifier: Topic :: Scientific/Engineering
40
41
  Requires-Python: >=3.10
41
42
  Description-Content-Type: text/markdown
42
43
  License-File: LICENSE
43
44
  Requires-Dist: cloudnetpy_qc>=1.15.0
44
45
  Requires-Dist: matplotlib
45
- Requires-Dist: mwrpy>=0.4.3
46
+ Requires-Dist: mwrpy>=1.2.0
46
47
  Requires-Dist: netCDF4
47
48
  Requires-Dist: requests
48
49
  Requires-Dist: rpgpy>=0.14.5
@@ -9,7 +9,7 @@ cloudnetpy/metadata.py,sha256=BDEpgwZ58PHznc1gi11gtNNV4kFiMAmlHnF4huTy7nw,5982
9
9
  cloudnetpy/output.py,sha256=lq4YSeMT_d-j4rlQkKm9KIZ8boupTBBBKV1eUawpmCI,15672
10
10
  cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  cloudnetpy/utils.py,sha256=U0iMIKPiKLrLVAfs_u9pPuoWYW1RJHcM8dbLF9a4yIA,29796
12
- cloudnetpy/version.py,sha256=bOMrMUm9vSvk1M_E6n6Vuivpe2UE2n6sQfRdPCJzuk0,72
12
+ cloudnetpy/version.py,sha256=oaJd6xYmjdmgsgXNLrMDy5RnVEklJFG2LJx1HtW5UnE,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
@@ -41,7 +41,7 @@ cloudnetpy/instruments/cl61d.py,sha256=g6DNBFju3wYhLFl32DKmC8pUup7y-EupXoUU0fuoG
41
41
  cloudnetpy/instruments/cloudnet_instrument.py,sha256=086GJ6Nfp7sK9ZK8UygJOn-aiVPreez674_gbrOZj4I,5183
42
42
  cloudnetpy/instruments/copernicus.py,sha256=99idcn6-iKOSvSslNjwFRng3gwlTLFjKPiT1tnVytpQ,6613
43
43
  cloudnetpy/instruments/galileo.py,sha256=BjWE15_S3tTCOmAM5k--oicI3wghKaO0hv9EUBxtbl8,4830
44
- cloudnetpy/instruments/hatpro.py,sha256=DzCWzTJxTc5BSOgoeyM8RjYkSXX6NDi3QXgKRp0uxlI,8759
44
+ cloudnetpy/instruments/hatpro.py,sha256=5jeONT2gBlAFr_M6mPablAiWloBYta_9nvXv6kt75LU,8969
45
45
  cloudnetpy/instruments/instruments.py,sha256=97hHMjp8fp2IKihr0XJYY3BrOlBArU7gYwYmt3OxqvU,4124
46
46
  cloudnetpy/instruments/lufft.py,sha256=nIoEKuuFGKq2dLqkX7zW-HpAifefG472tZhKfXE1yoA,4212
47
47
  cloudnetpy/instruments/mira.py,sha256=Wofp8HbiAwJce_IbOLjpEFV07H_Kh4170C9Wygiz-ew,11401
@@ -55,7 +55,7 @@ cloudnetpy/instruments/rpg.py,sha256=vfs_eGahPOxFjOIBczNywRwtdutOsJpSNeXZm99SIOo
55
55
  cloudnetpy/instruments/rpg_reader.py,sha256=ThztFuVrWxhmWVAfZTfQDeUiKK1XMTbtv08IBe8GK98,11364
56
56
  cloudnetpy/instruments/toa5.py,sha256=CfmmBMv5iMGaWHIGBK01Rw24cuXC1R1RMNTXkmsm340,1760
57
57
  cloudnetpy/instruments/vaisala.py,sha256=MA6hAlanFrxJlF4suDxLt5FyjcSSzJg-SWRnkLQpu3E,14688
58
- cloudnetpy/instruments/weather_station.py,sha256=jSu9sY2LYV1ssWcuLr6kiF8EEqGW29mywE9UUZccac0,18720
58
+ cloudnetpy/instruments/weather_station.py,sha256=3xClMqo4SV361flX7YM9psEKgF9gr8RHiAN0DKfJ0Kg,20623
59
59
  cloudnetpy/instruments/disdrometer/__init__.py,sha256=lyjwttWvFvuwYxEkusoAvgRcbBmglmOp5HJOpXUqLWo,93
60
60
  cloudnetpy/instruments/disdrometer/common.py,sha256=g52iK2aNp3Z88kovUmGVpC54NZomPa9D871gzO0AmQ4,9267
61
61
  cloudnetpy/instruments/disdrometer/parsivel.py,sha256=HJZrEysQkx9MiIVPDV25CYHpXi_SjgZlgO-otoaKK34,25640
@@ -116,9 +116,9 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
116
116
  cloudnetpy/products/mwr_tools.py,sha256=rd7UC67O4fsIE5SaHVZ4qWvUJTj41ZGwgQWPwZzOM14,5377
117
117
  cloudnetpy/products/product_tools.py,sha256=uu4l6reuGbPcW3TgttbaSrqIKbyYGhBVTdnC7opKvmg,11101
118
118
  docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
119
- cloudnetpy-1.69.6.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
120
- cloudnetpy-1.69.6.dist-info/METADATA,sha256=mXbB2TSu_snLy1mvDk5TyDyYCTJ7glAFI1F3hI6eGgU,5793
121
- cloudnetpy-1.69.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
122
- cloudnetpy-1.69.6.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
123
- cloudnetpy-1.69.6.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
124
- cloudnetpy-1.69.6.dist-info/RECORD,,
119
+ cloudnetpy-1.69.8.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
120
+ cloudnetpy-1.69.8.dist-info/METADATA,sha256=jNccVHKF97dDMCivFHqVVmoHQ0MQ2yU9ZnR6kz-Tfts,5844
121
+ cloudnetpy-1.69.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
122
+ cloudnetpy-1.69.8.dist-info/entry_points.txt,sha256=HhY7LwCFk4qFgDlXx_Fy983ZTd831WlhtdPIzV-Y3dY,51
123
+ cloudnetpy-1.69.8.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
124
+ cloudnetpy-1.69.8.dist-info/RECORD,,