Spaces:
Sleeping
Sleeping
Tina Odaka commited on
Commit ·
eb78a2d
1
Parent(s): eba100b
cleaning
Browse files
app.py
CHANGED
|
@@ -139,14 +139,11 @@ def load_netCDF(file_path):
|
|
| 139 |
.set_xindex("PROFZ")
|
| 140 |
.set_xindex("TIME")
|
| 141 |
)
|
|
|
|
|
|
|
|
|
|
| 142 |
return ds
|
| 143 |
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
class SADCP_Viewer(param.Parameterized):
|
| 151 |
#file_csv = "https://data-eurogoship.ifremer.fr/data/table.csv"
|
| 152 |
#file = fs.open(file_csv)
|
|
@@ -255,16 +252,6 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 255 |
data_dir = "https://data-eurogoship.ifremer.fr/copy_seadatanet/"
|
| 256 |
file_path = os.path.join(data_dir, selected_file)
|
| 257 |
self.ds=load_netCDF(file_path)
|
| 258 |
-
#file_path = fs.open(file_path)
|
| 259 |
-
#self.ds = (
|
| 260 |
-
#xr.open_dataset(
|
| 261 |
-
#file_path, decode_cf=True, decode_times=False, engine="scipy"
|
| 262 |
-
#)
|
| 263 |
-
# .squeeze()
|
| 264 |
-
# .set_coords(["LONGITUDE", "LATITUDE", "TIME", "PROFZ"])
|
| 265 |
-
#@.set_xindex("PROFZ")
|
| 266 |
-
# .set_xindex("TIME")
|
| 267 |
-
# )
|
| 268 |
|
| 269 |
self.ds = self.ds.where(
|
| 270 |
(self.ds.VCUR_SEADATANET_QC == 49)
|
|
@@ -280,32 +267,13 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 280 |
drop=False)
|
| 281 |
self.ds = self.ds[
|
| 282 |
[
|
| 283 |
-
"USHIP",
|
| 284 |
-
"
|
| 285 |
-
"ROLL",
|
| 286 |
-
"
|
| 287 |
-
"TR_TEMP",
|
| 288 |
-
"HEADING",
|
| 289 |
-
"U_BOTTOM",
|
| 290 |
-
"V_BOTTOM",
|
| 291 |
-
"UCUR",
|
| 292 |
-
"VCUR",
|
| 293 |
-
"WCUR",
|
| 294 |
-
"ECUR",
|
| 295 |
-
"PGOOD",
|
| 296 |
-
"ECI",
|
| 297 |
-
"BATHY",
|
| 298 |
-
"UTIDE",
|
| 299 |
-
"VTIDE",
|
| 300 |
-
"BOTTOM_DEPTH",
|
| 301 |
-
"TIME",
|
| 302 |
]
|
| 303 |
]
|
| 304 |
|
| 305 |
-
date = fix_time(self.ds)
|
| 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),
|
| 311 |
int(self.ds["LONGITUDE"].max().round() + 1),
|
|
@@ -314,15 +282,10 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 314 |
int(self.ds["LATITUDE"].min().round() - 1),
|
| 315 |
int(self.ds["LATITUDE"].max().round() + 1),
|
| 316 |
)
|
|
|
|
| 317 |
self.depth1 = abs(self.ds.coords["PROFZ"])
|
| 318 |
deph_range = (int(self.depth1.min()), int(self.depth1.max()))
|
| 319 |
|
| 320 |
-
# Ku_std_dataarray = xr.DataArray(Ku_std,dims='dim1')
|
| 321 |
-
|
| 322 |
-
# date=dataset.assign(TIME=date)
|
| 323 |
-
|
| 324 |
-
# dataset['TIME']=dataset['TIME'].assign_coords(dim=dataset.dims['MAXT'])
|
| 325 |
-
|
| 326 |
self.longitude_slider.start = lon_range[0]
|
| 327 |
self.longitude_slider.end = lon_range[1]
|
| 328 |
self.longitude_slider.value = lon_range
|
|
|
|
| 139 |
.set_xindex("PROFZ")
|
| 140 |
.set_xindex("TIME")
|
| 141 |
)
|
| 142 |
+
date = fix_time(ds)
|
| 143 |
+
date = xr.DataArray(date, dims="MAXT")
|
| 144 |
+
ds = ds.assign(TIME=date)
|
| 145 |
return ds
|
| 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
class SADCP_Viewer(param.Parameterized):
|
| 148 |
#file_csv = "https://data-eurogoship.ifremer.fr/data/table.csv"
|
| 149 |
#file = fs.open(file_csv)
|
|
|
|
| 252 |
data_dir = "https://data-eurogoship.ifremer.fr/copy_seadatanet/"
|
| 253 |
file_path = os.path.join(data_dir, selected_file)
|
| 254 |
self.ds=load_netCDF(file_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
|
| 256 |
self.ds = self.ds.where(
|
| 257 |
(self.ds.VCUR_SEADATANET_QC == 49)
|
|
|
|
| 267 |
drop=False)
|
| 268 |
self.ds = self.ds[
|
| 269 |
[
|
| 270 |
+
"TIME", "BATHY", "USHIP", "VSHIP", "BOTTOM_DEPTH",
|
| 271 |
+
"UCUR", "VCUR",
|
| 272 |
+
# "ROLL", "PITCH", "TR_TEMP", "HEADING", "U_BOTTOM", "V_BOTTOM",
|
| 273 |
+
# "WCUR", "ECUR", "PGOOD", "ECI", "UTIDE", "VTIDE",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
]
|
| 275 |
]
|
| 276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
lon_range = (
|
| 278 |
int(self.ds["LONGITUDE"].min().round() - 1),
|
| 279 |
int(self.ds["LONGITUDE"].max().round() + 1),
|
|
|
|
| 282 |
int(self.ds["LATITUDE"].min().round() - 1),
|
| 283 |
int(self.ds["LATITUDE"].max().round() + 1),
|
| 284 |
)
|
| 285 |
+
|
| 286 |
self.depth1 = abs(self.ds.coords["PROFZ"])
|
| 287 |
deph_range = (int(self.depth1.min()), int(self.depth1.max()))
|
| 288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
self.longitude_slider.start = lon_range[0]
|
| 290 |
self.longitude_slider.end = lon_range[1]
|
| 291 |
self.longitude_slider.value = lon_range
|