Spaces:
Sleeping
Sleeping
Tina Odaka commited on
Commit ·
4e40526
1
Parent(s): 1fcff8c
clean fix_time
Browse files
app.py
CHANGED
|
@@ -76,10 +76,10 @@ def greg_0h(jourjul):
|
|
| 76 |
return gtime
|
| 77 |
|
| 78 |
|
| 79 |
-
def fix_time(
|
| 80 |
from datetime import datetime, timedelta
|
| 81 |
|
| 82 |
-
time =
|
| 83 |
time2 = time.dropna(dim="MAXT")
|
| 84 |
time2 = time2.reindex_like(time, method="nearest")
|
| 85 |
jourjul = [greg_0h(jourjul) for jourjul in time2.values]
|
|
@@ -87,11 +87,9 @@ def fix_time(dataset):
|
|
| 87 |
datetime(jourjul[0], jourjul[1], jourjul[2], jourjul[3], jourjul[4], jourjul[5])
|
| 88 |
for jourjul in jourjul
|
| 89 |
]
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
return date
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
from datetime import datetime, timedelta
|
| 95 |
|
| 96 |
import cartopy.crs as ccrs
|
| 97 |
import cartopy.feature as cfeature
|
|
@@ -302,9 +300,7 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 302 |
]
|
| 303 |
]
|
| 304 |
|
| 305 |
-
|
| 306 |
-
date = xr.DataArray(date, dims="MAXT")
|
| 307 |
-
self.ds = self.ds.assign(TIME=date)
|
| 308 |
|
| 309 |
lon_range = (
|
| 310 |
int(self.ds["LONGITUDE"].min().round() - 1),
|
|
|
|
| 76 |
return gtime
|
| 77 |
|
| 78 |
|
| 79 |
+
def fix_time(ds):
|
| 80 |
from datetime import datetime, timedelta
|
| 81 |
|
| 82 |
+
time = ds["TIME"]
|
| 83 |
time2 = time.dropna(dim="MAXT")
|
| 84 |
time2 = time2.reindex_like(time, method="nearest")
|
| 85 |
jourjul = [greg_0h(jourjul) for jourjul in time2.values]
|
|
|
|
| 87 |
datetime(jourjul[0], jourjul[1], jourjul[2], jourjul[3], jourjul[4], jourjul[5])
|
| 88 |
for jourjul in jourjul
|
| 89 |
]
|
| 90 |
+
date = xr.DataArray(date, dims="MAXT")
|
| 91 |
+
return ds.assign(TIME=date)
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
import cartopy.crs as ccrs
|
| 95 |
import cartopy.feature as cfeature
|
|
|
|
| 300 |
]
|
| 301 |
]
|
| 302 |
|
| 303 |
+
self.ds = fix_time(self.ds)
|
|
|
|
|
|
|
| 304 |
|
| 305 |
lon_range = (
|
| 306 |
int(self.ds["LONGITUDE"].min().round() - 1),
|