pypromice 1.4.1__tar.gz → 1.4.2__tar.gz
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.
Potentially problematic release.
This version of pypromice might be problematic. Click here for more details.
- {pypromice-1.4.1/src/pypromice.egg-info → pypromice-1.4.2}/PKG-INFO +1 -1
- {pypromice-1.4.1 → pypromice-1.4.2}/setup.py +1 -1
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/resample.py +33 -4
- {pypromice-1.4.1 → pypromice-1.4.2/src/pypromice.egg-info}/PKG-INFO +1 -1
- {pypromice-1.4.1 → pypromice-1.4.2}/LICENSE.txt +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/MANIFEST.in +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/README.md +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/setup.cfg +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/get/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/get/get.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/get/get_promice_data.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/bufr_to_csv.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/bufr_utilities.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/create_bufr_files.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/get_bufr.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/make_metadata_csv.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/positions_seed.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/postprocess/real_time_utilities.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/L0toL1.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/L1toL2.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/L2toL3.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/aws.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/get_l2.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/get_l2tol3.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/join_l2.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/join_l3.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/load.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/utilities.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/value_clipping.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/process/write.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/github_data_issues.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/percentiles/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/percentiles/compute_thresholds.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/percentiles/outlier_detector.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/percentiles/thresholds.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/qc/persistence.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/resources/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/resources/file_attributes.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/resources/variable_aliases_GC-Net.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/resources/variables.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/station_configuration.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/get_l0tx.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/get_msg.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/get_watsontx.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/payload_formats.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/payload_types.csv +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/tx/tx.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/utilities/__init__.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice/utilities/git.py +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice.egg-info/SOURCES.txt +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice.egg-info/dependency_links.txt +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice.egg-info/entry_points.txt +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice.egg-info/requires.txt +0 -0
- {pypromice-1.4.1 → pypromice-1.4.2}/src/pypromice.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="pypromice",
|
|
8
|
-
version="1.4.
|
|
8
|
+
version="1.4.2",
|
|
9
9
|
author="GEUS Glaciology and Climate",
|
|
10
10
|
description="PROMICE/GC-Net data processing toolbox",
|
|
11
11
|
long_description=long_description,
|
|
@@ -32,15 +32,44 @@ def resample_dataset(ds_h, t):
|
|
|
32
32
|
ds_d : xarray.Dataset
|
|
33
33
|
L3 AWS dataset resampled to the frequency defined by t
|
|
34
34
|
'''
|
|
35
|
-
|
|
35
|
+
# Convert dataset to DataFrame
|
|
36
|
+
df_d = ds_h.to_dataframe()
|
|
36
37
|
|
|
38
|
+
# Identify non-numeric columns
|
|
39
|
+
non_numeric_cols = df_d.select_dtypes(exclude=['number']).columns
|
|
40
|
+
|
|
41
|
+
# Log a warning and drop non-numeric columns
|
|
42
|
+
if len(non_numeric_cols) > 0:
|
|
43
|
+
for col in non_numeric_cols:
|
|
44
|
+
unique_values = df_d[col].unique()
|
|
45
|
+
logger.warning(f"Dropping column '{col}' because it is of type '{df_d[col].dtype}' and contains unique values: {unique_values}")
|
|
46
|
+
|
|
47
|
+
df_d = df_d.drop(columns=non_numeric_cols)
|
|
48
|
+
# Resample the DataFrame
|
|
49
|
+
df_d = df_d.resample(t).mean()
|
|
50
|
+
|
|
37
51
|
# taking the 10 min data and using it as instantaneous values:
|
|
38
|
-
|
|
52
|
+
is_10_minutes_timestamp = (ds_h.time.diff(dim='time') / np.timedelta64(1, 's') == 600)
|
|
53
|
+
if (t == '60min') and is_10_minutes_timestamp.any():
|
|
39
54
|
cols_to_update = ['p_i', 't_i', 'rh_i', 'rh_i_cor', 'wspd_i', 'wdir_i','wspd_x_i','wspd_y_i']
|
|
55
|
+
timestamp_10min = ds_h.time.where(is_10_minutes_timestamp, drop=True).to_index()
|
|
56
|
+
timestamp_round_hour = df_d.index
|
|
57
|
+
timestamp_to_update = timestamp_round_hour.intersection(timestamp_10min)
|
|
58
|
+
|
|
40
59
|
for col in cols_to_update:
|
|
41
|
-
|
|
60
|
+
if col not in df_d.columns:
|
|
61
|
+
df_d[col] = np.nan
|
|
62
|
+
else:
|
|
63
|
+
# if there are already instantaneous values in the dataset
|
|
64
|
+
# we want to keep them as they are
|
|
65
|
+
# removing timestamps where there is already t_i filled from a TX file
|
|
66
|
+
missing_instantaneous = ds_h.reindex(time=timestamp_to_update)[col].isnull()
|
|
67
|
+
timestamp_to_update = timestamp_to_update[missing_instantaneous]
|
|
68
|
+
df_d.loc[timestamp_to_update, col] = ds_h.reindex(
|
|
69
|
+
time= timestamp_to_update
|
|
70
|
+
)[col.replace('_i','_u')].values
|
|
42
71
|
if col == 'p_i':
|
|
43
|
-
df_d[col] = df_d[col].values-1000
|
|
72
|
+
df_d.loc[timestamp_to_update, col] = df_d.loc[timestamp_to_update, col].values-1000
|
|
44
73
|
|
|
45
74
|
|
|
46
75
|
# recalculating wind direction from averaged directional wind speeds
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|