Spaces:
Runtime error
Runtime error
take hvplot function outside
Browse files
app.py
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
|
|
| 1 |
import fsspec
|
|
|
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
import numpy as np
|
| 4 |
import pandas as pd
|
| 5 |
import panel as pn
|
| 6 |
import xarray as xr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
import param
|
| 8 |
|
| 9 |
pn.extension("tabulator")
|
|
@@ -83,6 +95,15 @@ def quiver_depth_filterd(ax,ds_filtered, depth1, depth_range_slider, scale_facto
|
|
| 83 |
headwidth=3,
|
| 84 |
transform=ccrs.PlateCarree(),
|
| 85 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
class SADCP_Viewer(param.Parameterized):
|
| 88 |
df = load_csv()
|
|
@@ -298,14 +319,7 @@ class SADCP_Viewer(param.Parameterized):
|
|
| 298 |
|
| 299 |
# @param.depends( 'file_dropdown.value', 'longitude_slider.value', 'latitude_slider.value', watch=True)
|
| 300 |
def hvplot_plots(self):
|
| 301 |
-
|
| 302 |
-
return [
|
| 303 |
-
self.ds_filtered["BATHY"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 304 |
-
self.ds_filtered["USHIP"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 305 |
-
self.ds_filtered["VSHIP"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 306 |
-
self.ds_filtered["BOTTOM_DEPTH"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 307 |
-
|
| 308 |
-
]
|
| 309 |
|
| 310 |
def get_file_list(self):
|
| 311 |
return self.file_names
|
|
|
|
| 1 |
+
#import cftime
|
| 2 |
import fsspec
|
| 3 |
+
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
import numpy as np
|
| 6 |
import pandas as pd
|
| 7 |
import panel as pn
|
| 8 |
import xarray as xr
|
| 9 |
+
#from ipywidgets import (
|
| 10 |
+
# Checkbox,
|
| 11 |
+
## FloatRangeSlider,
|
| 12 |
+
# FloatSlider,
|
| 13 |
+
# IntRangeSlider,
|
| 14 |
+
# IntSlider,
|
| 15 |
+
## interactive,
|
| 16 |
+
#)
|
| 17 |
+
|
| 18 |
+
|
| 19 |
import param
|
| 20 |
|
| 21 |
pn.extension("tabulator")
|
|
|
|
| 95 |
headwidth=3,
|
| 96 |
transform=ccrs.PlateCarree(),
|
| 97 |
)
|
| 98 |
+
def bathy_uship_vship_bottom_depth(ds):
|
| 99 |
+
import hvplot.xarray
|
| 100 |
+
return [
|
| 101 |
+
ds["BATHY"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 102 |
+
ds["USHIP"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 103 |
+
ds["VSHIP"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 104 |
+
ds["BOTTOM_DEPTH"].max(dim="PROFZ").hvplot(x="TIME", width=400, height=200),
|
| 105 |
+
]
|
| 106 |
+
bathy_uship_vship_bottom_depth
|
| 107 |
|
| 108 |
class SADCP_Viewer(param.Parameterized):
|
| 109 |
df = load_csv()
|
|
|
|
| 319 |
|
| 320 |
# @param.depends( 'file_dropdown.value', 'longitude_slider.value', 'latitude_slider.value', watch=True)
|
| 321 |
def hvplot_plots(self):
|
| 322 |
+
return bathy_uship_vship_bottom_depth(self.ds_filtered)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
|
| 324 |
def get_file_list(self):
|
| 325 |
return self.file_names
|