Skip to content

Commit 788993f

Browse files
committed
Fix convertOG1 time issue
1 parent 6152497 commit 788993f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

seagliderOG1/convertOG1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def convert_to_OG1(
6868
ds_og1 = xr.concat(processed_datasets, dim="N_MEASUREMENTS")
6969
ds_og1 = ds_og1.sortby("TIME")
7070
# Change format of time into datetime64[ns] to avoid problems with attributes and writing to netcdf
71-
ds_og1["TIME"] = (ds_og1["TIME"].astype("float64") * 1e9).astype("datetime64[ns]")
71+
# ds_og1["TIME"] = (ds_og1["TIME"].astype("float64") * 1e9).astype("datetime64[ns]")
7272

7373
# Apply attributes
7474
ordered_attributes = update_dataset_attributes(
@@ -285,6 +285,7 @@ def process_dataset(ds1_base: xr.Dataset, firstrun: bool = False) -> tuple[
285285
ds_new = tools.add_sensor_to_dataset(ds_new, ds_sensor, ds_sgcal, firstrun)
286286

287287
# To avoid problems, reset the dtype of TIME_GPS
288+
# ds_new['TIME_GPS'] = ds_new['TIME_GPS'].astype('datetime64[ns]')
288289
ds_new["TIME_GPS"] = (ds_new["TIME_GPS"].astype("float64") * 1e9).astype(
289290
"datetime64[ns]"
290291
)

0 commit comments

Comments
 (0)