Spaces:
Sleeping
Sleeping
cancel update
Browse files
app.py
CHANGED
|
@@ -139,11 +139,14 @@ def load_netCDF(file_path):
|
|
| 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,6 +255,16 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 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,13 +280,32 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 267 |
drop=False)
|
| 268 |
self.ds = self.ds[
|
| 269 |
[
|
| 270 |
-
"
|
| 271 |
-
"
|
| 272 |
-
|
| 273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
]
|
| 275 |
]
|
| 276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
lon_range = (
|
| 278 |
int(self.ds["LONGITUDE"].min().round() - 1),
|
| 279 |
int(self.ds["LONGITUDE"].max().round() + 1),
|
|
@@ -282,10 +314,15 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 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
|
|
|
|
| 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 |
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 |
drop=False)
|
| 281 |
self.ds = self.ds[
|
| 282 |
[
|
| 283 |
+
"USHIP",
|
| 284 |
+
"VSHIP",
|
| 285 |
+
"ROLL",
|
| 286 |
+
"PITCH",
|
| 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 |
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
|