Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gps data decoding 60min tables #288

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/pypromice/process/L0toL1.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ def toL1(L0, vars_df, T_0=273.15, tilt_threshold=-100):
if ds['gps_lat'].dtype.kind == 'O': # Decode and reformat GPS information
if 'NH' in ds['gps_lat'].dropna(dim='time').values[1]:
ds = decodeGPS(ds, ['gps_lat','gps_lon','gps_time'])
elif 'L' in ds['gps_lat'].dropna(dim='time').values[1]:
logger.info('Found L in GPS string')
ds = decodeGPS(ds, ['gps_lat','gps_lon','gps_time'])
for l in ['gps_lat', 'gps_lon']:
ds[l] = ds[l]/100000
else:
try:
ds = decodeGPS(ds, ['gps_lat','gps_lon','gps_time']) # TODO this is a work around specifically for L0 RAW processing for THU_U. Find a way to make this slicker

except:
print('Invalid GPS type {ds["gps_lat"].dtype} for decoding')

Expand Down Expand Up @@ -180,7 +186,7 @@ def addTimeShift(ds, vars_df):
if ds.attrs['logger_type'] == 'CR1000X':
# v3, data is hourly all year long
# shift everything except instantaneous
df_a = df_a.shift(periods=-1, freq="H")
df_a = df_a.shift(periods=-1, freq="h")
df_out = pd.concat([df_a, df_i], axis=1) # different columns, same datetime indices
df_out = df_out.sort_index()
elif ds.attrs['logger_type'] == 'CR1000':
Expand Down
Loading