diff --git a/src/pypromice/process/L0toL1.py b/src/pypromice/process/L0toL1.py index 0d55c730..eb097434 100644 --- a/src/pypromice/process/L0toL1.py +++ b/src/pypromice/process/L0toL1.py @@ -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') @@ -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':