--- author: Max Grover date: 2021-3-19 tags: dashboard, jupyter --- # HiRes-CESM Interactive Dashboard Example In this example, our goal is to create an interactive dashboard, using images already output on a remote server. We are specifically interested in looking at plots created using the [HighRes-CESM-Analysis](https://github.com/marbl-ecosys/HiRes-CESM-analysis) repository. Images created by this package can be visualized through an interactive dashboard using [Panelify](https://github.com/andersy005/panelify) ```python import pandas as pd import panel as pn import panelify pn.extension() ``` --- ## Accessing the Data (Plots) The plots from this example are stored on the [CGD webext machine](https://webext.cgd.ucar.edu/), specifically from [this specific case](https://webext.cgd.ucar.edu/g.e22b05.G1850ECOIAF_JRA.TL319_g17.cocco.001/), which we use as the path. ```python paths = ( "https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA_HR.TL319_t13.004/", "https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA_HR.TL319_t13.003/", ) ``` ### Read in the CSV File Containing Metadata We use pandas to remotely read in the data, dropping the Unnamed column, and merging the absolute path to the directory and the relative filepaths ```python df_list = [] for path in paths: df = pd.read_csv(f"{path}png_catalog.csv").drop(columns="Unnamed: 0") # Convert the relative filepaths to absolute filepaths df["absolute_filepath"] = path + df.filepath.astype(str) df_list.append(df) # Merge the dataframes df = pd.concat(df_list) ``` ```python df ```
plot_type | varname | casename | apply_log10 | time_period | isel_dict | filepath | date | absolute_filepath | |
---|---|---|---|---|---|---|---|---|---|
0 | histogram | CaCO3_FLUX_100m | g.e22.G1850ECO_JRA_HR.TL319_t13.004 | False | 0001-01-01_0001-12-31 | {} | histogram/CaCO3_FLUX_100m.0001-01-01_0001-12-3... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
1 | histogram | CaCO3_FLUX_100m | g.e22.G1850ECO_JRA_HR.TL319_t13.004 | True | 0001-01-01_0001-12-31 | {} | histogram/CaCO3_FLUX_100m.0001-01-01_0001-12-3... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
2 | histogram | CaCO3_FLUX_100m | g.e22.G1850ECO_JRA_HR.TL319_t13.004 | False | 0002-01-01_0002-12-31 | {} | histogram/CaCO3_FLUX_100m.0002-01-01_0002-12-3... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
3 | histogram | CaCO3_FLUX_100m | g.e22.G1850ECO_JRA_HR.TL319_t13.004 | True | 0002-01-01_0002-12-31 | {} | histogram/CaCO3_FLUX_100m.0002-01-01_0002-12-3... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
4 | histogram | CaCO3_FLUX_100m | g.e22.G1850ECO_JRA_HR.TL319_t13.004 | False | 0003-01-01_0003-12-31 | {} | histogram/CaCO3_FLUX_100m.0003-01-01_0003-12-3... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
719 | trend_map | SiO3 | g.e22.G1850ECO_JRA_HR.TL319_t13.003 | NaN | 0002-01-01_0004-12-31 | {'z_t': 0} | trend_map/SiO3.0002-01-01_0004-12-31.z_t--3510... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
720 | trend_map | SiO3 | g.e22.G1850ECO_JRA_HR.TL319_t13.003 | NaN | 0003-01-01_0004-12-31 | {'basins': 0} | trend_map/SiO3.0003-01-01_0004-12-31.basins--A... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
721 | trend_map | SiO3 | g.e22.G1850ECO_JRA_HR.TL319_t13.003 | NaN | 0003-01-01_0004-12-31 | {'basins': 0} | trend_map/SiO3.0003-01-01_0004-12-31.basins--G... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
722 | trend_map | SiO3 | g.e22.G1850ECO_JRA_HR.TL319_t13.003 | NaN | 0003-01-01_0004-12-31 | {'basins': 0} | trend_map/SiO3.0003-01-01_0004-12-31.basins--I... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
723 | trend_map | SiO3 | g.e22.G1850ECO_JRA_HR.TL319_t13.003 | NaN | 0003-01-01_0004-12-31 | {'basins': 0} | trend_map/SiO3.0003-01-01_0004-12-31.basins--P... | NaN | https://webext.cgd.ucar.edu/g.e22.G1850ECO_JRA... |
1969 rows × 9 columns