Skip to content

Commit

Permalink
further debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptisteVandecrux committed May 22, 2024
1 parent 47c5981 commit 97eaedb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
packages=setuptools.find_packages(where="src"),
python_requires=">=3.8",
package_data={
"pypromice.process": ["metadata.csv", "variables.csv"],
"pypromice.process": ["metadata.csv", "variables.csv", "variable_aliases_GC-Net.csv"],
"pypromice.tx": ["payload_formats.csv", "payload_types.csv"],
"pypromice.qc.percentiles": ["thresholds.csv"],
"pypromice.postprocess": ["station_configurations.toml", "positions_seed.csv"],
Expand Down
19 changes: 16 additions & 3 deletions src/pypromice/process/join_l4.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
import os, unittest
import os, unittest, pkg_resources
import pandas as pd
import numpy as np
import xarray as xr
Expand Down Expand Up @@ -218,7 +218,14 @@ def join_l4():
if is_gcnet:
ds2 = gcnet_postprocessing(ds2)
ds2 = ds2[[v for v in ds1.data_vars if v in ds2.data_vars]]

for v in ds1.data_vars:
if v not in ds2.data_vars:
ds2[v] = ds2.t_u*np.nan
print('dropping')
for v in ds2.data_vars:
if v not in ds1.data_vars:
print(v)
ds2 = ds2.drop(v)
ds1 = xr.concat((ds2.sel(
time=slice(ds2.time.isel(time=0),
ds1.time.isel(time=0))
Expand All @@ -231,7 +238,13 @@ def join_l4():
else:
print(f'Invalid file {args.file1}')
exit()

all_values = []
for l in old_name.values():
for ll in l:
all_values.append(ll)
if n1 in all_values:
print(n1, 'is used as auxilary at another site')
exit()
# Get hourly, daily and monthly datasets
print('Resampling L3 data to hourly, daily and monthly resolutions...')
l3_h = resampleL3(ds1, '60min')
Expand Down
6 changes: 3 additions & 3 deletions src/pypromice/process/variable_aliases_GC-Net.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ t_i_11,
tilt_x,
tilt_y,
rot,
gps_lat,
gps_lon,
gps_alt,
gps_lat,latitude
gps_lon,longitude
gps_alt,elevation
gps_time,
gps_geounit,
gps_hdop,
Expand Down

0 comments on commit 97eaedb

Please sign in to comment.