cloudnetpy 1.61.2__py3-none-any.whl → 1.61.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.
- cloudnetpy/instruments/disdrometer/thies.py +16 -10
- cloudnetpy/version.py +1 -1
- {cloudnetpy-1.61.2.dist-info → cloudnetpy-1.61.4.dist-info}/METADATA +1 -1
- {cloudnetpy-1.61.2.dist-info → cloudnetpy-1.61.4.dist-info}/RECORD +7 -7
- {cloudnetpy-1.61.2.dist-info → cloudnetpy-1.61.4.dist-info}/LICENSE +0 -0
- {cloudnetpy-1.61.2.dist-info → cloudnetpy-1.61.4.dist-info}/WHEEL +0 -0
- {cloudnetpy-1.61.2.dist-info → cloudnetpy-1.61.4.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import datetime
|
2
|
+
from collections import defaultdict
|
2
3
|
from os import PathLike
|
3
4
|
from typing import Any
|
4
5
|
|
@@ -125,7 +126,7 @@ class Thies(Disdrometer):
|
|
125
126
|
self.n_velocity = 20
|
126
127
|
self.n_diameter = 22
|
127
128
|
self.site_meta = site_meta
|
128
|
-
self.raw_data: dict[str, Any] =
|
129
|
+
self.raw_data: dict[str, Any] = defaultdict(list)
|
129
130
|
self._read_data(filename)
|
130
131
|
self._screen_time(expected_date)
|
131
132
|
self.data = {}
|
@@ -156,7 +157,7 @@ class Thies(Disdrometer):
|
|
156
157
|
with open(filename) as file:
|
157
158
|
for line in file:
|
158
159
|
self._read_line(line)
|
159
|
-
if
|
160
|
+
if len(self.raw_data["time"]) == 0:
|
160
161
|
raise ValidTimeStampError
|
161
162
|
for key, value in self.raw_data.items():
|
162
163
|
array = np.array(value)
|
@@ -193,9 +194,13 @@ class Thies(Disdrometer):
|
|
193
194
|
|
194
195
|
def _read_line(self, line: str, timestamp: datetime.datetime | None = None):
|
195
196
|
raw_values = line.split(";")
|
196
|
-
|
197
|
+
# Support custom truncated format used in Leipzig LIM.
|
198
|
+
expected_columns = self.site_meta.get("truncate_columns", 521)
|
199
|
+
if len(raw_values) != expected_columns:
|
197
200
|
return
|
198
201
|
for i, key in TELEGRAM4:
|
202
|
+
if i >= expected_columns - 1:
|
203
|
+
break
|
199
204
|
value: Any
|
200
205
|
if key == "_date":
|
201
206
|
value = _parse_date(raw_values[i])
|
@@ -225,14 +230,13 @@ class Thies(Disdrometer):
|
|
225
230
|
value = raw_values[i]
|
226
231
|
else:
|
227
232
|
value = int(raw_values[i])
|
228
|
-
if key not in self.raw_data:
|
229
|
-
self.raw_data[key] = []
|
230
233
|
self.raw_data[key].append(value)
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
+
if expected_columns > 79:
|
235
|
+
self.raw_data["spectrum"].append(
|
236
|
+
np.array(list(map(int, raw_values[79:-2])), dtype="i2").reshape(
|
237
|
+
self.n_diameter, self.n_velocity
|
238
|
+
)
|
234
239
|
)
|
235
|
-
)
|
236
240
|
if timestamp is not None:
|
237
241
|
self.raw_data["time"].append(timestamp)
|
238
242
|
else:
|
@@ -267,7 +271,9 @@ class Thies(Disdrometer):
|
|
267
271
|
|
268
272
|
def _parse_date(date: str) -> datetime.date:
|
269
273
|
day, month, year = map(int, date.split("."))
|
270
|
-
|
274
|
+
if year < 100:
|
275
|
+
year += 2000
|
276
|
+
return datetime.date(year, month, day)
|
271
277
|
|
272
278
|
|
273
279
|
def _parse_time(time: str) -> datetime.time:
|
cloudnetpy/version.py
CHANGED
@@ -8,7 +8,7 @@ cloudnetpy/metadata.py,sha256=v_VDo2vbdTxB0zIsfP69IcrwSKiRlLpsGdq6JPI4CoA,5306
|
|
8
8
|
cloudnetpy/output.py,sha256=WoVTNuxni0DUr163vZ-_mDr1brXhY15XSlGMrq9Aoqw,14700
|
9
9
|
cloudnetpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
cloudnetpy/utils.py,sha256=0TlHm71YtSrKXBsRKctitnhQrvZPE-ulEVeAQW-oK58,27398
|
11
|
-
cloudnetpy/version.py,sha256=
|
11
|
+
cloudnetpy/version.py,sha256=e_eLbPeFYVSCx8YcbtXxBImBp3rQVNwG5SXDoE8Pkps,72
|
12
12
|
cloudnetpy/categorize/__init__.py,sha256=gP5q3Vis1y9u9OWgA_idlbjfWXYN_S0IBSWdwBhL_uU,69
|
13
13
|
cloudnetpy/categorize/atmos.py,sha256=fWW8ye_8HZASRAiYwURFKWzcGOYIA2RKeVxCq0lVOuM,12389
|
14
14
|
cloudnetpy/categorize/atmos_utils.py,sha256=wndpwJxc2-QnNTkV8tc8I11Vs_WkNz9sVMX1fuGgUC4,3777
|
@@ -51,7 +51,7 @@ cloudnetpy/instruments/weather_station.py,sha256=gTY3Y5UATqJo9Gld4hm7WdsKBwcF8Wg
|
|
51
51
|
cloudnetpy/instruments/disdrometer/__init__.py,sha256=lyjwttWvFvuwYxEkusoAvgRcbBmglmOp5HJOpXUqLWo,93
|
52
52
|
cloudnetpy/instruments/disdrometer/common.py,sha256=g52iK2aNp3Z88kovUmGVpC54NZomPa9D871gzO0AmQ4,9267
|
53
53
|
cloudnetpy/instruments/disdrometer/parsivel.py,sha256=WiL-vCjw9Gmb5irvW3AXddsyprp8MGOfqcVAlfy0zpc,25521
|
54
|
-
cloudnetpy/instruments/disdrometer/thies.py,sha256=
|
54
|
+
cloudnetpy/instruments/disdrometer/thies.py,sha256=lNR5ahOKIsO_gcpmbYZwh2UP2aawpQ5J9RrrnPKFFIE,10046
|
55
55
|
cloudnetpy/model_evaluation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
56
56
|
cloudnetpy/model_evaluation/file_handler.py,sha256=oUGIblcEWLLv16YKUch-M5KA-dGRAcuHa-9anP3xtX4,6447
|
57
57
|
cloudnetpy/model_evaluation/metadata.py,sha256=7ZL87iDbaQJIMu8wfnMvb01cGVPkl8RtvEm_tt9uIHE,8413
|
@@ -108,8 +108,8 @@ cloudnetpy/products/mie_lu_tables.nc,sha256=It4fYpqJXlqOgL8jeZ-PxGzP08PMrELIDVe5
|
|
108
108
|
cloudnetpy/products/mwr_tools.py,sha256=PRm5aCULccUehU-Byk55wYhhEHseMjoAjGBu5TSyHao,4621
|
109
109
|
cloudnetpy/products/product_tools.py,sha256=rhx_Ru9FLlQqCNM-awoiHx18-Aq1eBwL9LiUaQoJs6k,10412
|
110
110
|
docs/source/conf.py,sha256=IKiFWw6xhUd8NrCg0q7l596Ck1d61XWeVjIFHVSG9Og,1490
|
111
|
-
cloudnetpy-1.61.
|
112
|
-
cloudnetpy-1.61.
|
113
|
-
cloudnetpy-1.61.
|
114
|
-
cloudnetpy-1.61.
|
115
|
-
cloudnetpy-1.61.
|
111
|
+
cloudnetpy-1.61.4.dist-info/LICENSE,sha256=wcZF72bdaoG9XugpyE95Juo7lBQOwLuTKBOhhtANZMM,1094
|
112
|
+
cloudnetpy-1.61.4.dist-info/METADATA,sha256=gM3zR9qeG2l3S744iQ035IAb7bxzONhHnegT14nGHfM,5784
|
113
|
+
cloudnetpy-1.61.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
114
|
+
cloudnetpy-1.61.4.dist-info/top_level.txt,sha256=ibSPWRr6ojS1i11rtBFz2_gkIe68mggj7aeswYfaOo0,16
|
115
|
+
cloudnetpy-1.61.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|