import intake
import hvplot.pandas
import hvplot.xarray
import cook_inlet_catalogs as cic
import holoviews as hv
CTD transects (2002)¶
Miscellaneous CTD transects in Cook Inlet from 2002
cat = intake.open_catalog(cic.utils.cat_path("ctd_transects_misc_2002"))
Plot all datasets in catalog¶
dd, ddlabels = cic.utils.combine_datasets_for_map(cat)
dd.hvplot(**cat.metadata["map"]) * ddlabels.hvplot(**cat.metadata["maplabels"])
List available datasets in the catalog¶
dataset_ids = list(cat)
dataset_ids
['Bear_Jul-02',
'Cohen',
'Glacier',
'Peterson_Jul-02',
'PtAdam_jul-02',
'pogibshi_Jul-02']
Select one dataset to investigate¶
try:
dataset_id = dataset_ids[2]
except:
dataset_id = dataset_ids[0]
print(dataset_id)
dd = cat[dataset_id].read()
dd
Glacier
| datetime | Station | Lat (N) | Long (E) | Depth | Temperature | Salinity | Fluorometer (V) | Par | distance [km] | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2002-07-26 18:46:00 | Glacier 1 | 59.6519 | -151.1958 | 1 | 10.5420 | 21.2755 | 5.5815 | 58.912 | 0.000000 |
| 1 | 2002-07-26 18:46:00 | Glacier 1 | 59.6519 | -151.1958 | 2 | 10.7102 | 24.9959 | 5.3172 | 19.677 | 0.000000 |
| 2 | 2002-07-26 18:54:00 | Glacier 2 | 59.6589 | -151.2073 | 1 | 11.8259 | 19.4604 | 6.6117 | 84.639 | 1.014165 |
| 3 | 2002-07-26 18:54:00 | Glacier 2 | 59.6589 | -151.2073 | 2 | 11.7213 | 21.8182 | 6.8899 | 49.328 | 1.014165 |
| 4 | 2002-07-26 18:54:00 | Glacier 2 | 59.6589 | -151.2073 | 3 | 11.5455 | 23.6893 | 7.5801 | 30.039 | 1.014165 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 148 | 2002-07-26 19:18:00 | Glacier 6 | 59.6884 | -151.2485 | 1 | 10.6941 | 16.3522 | 6.5965 | 198.400 | 5.053674 |
| 149 | 2002-07-26 19:18:00 | Glacier 6 | 59.6884 | -151.2485 | 2 | 10.5821 | 19.3512 | 5.7647 | 105.940 | 5.053674 |
| 150 | 2002-07-26 19:18:00 | Glacier 6 | 59.6884 | -151.2485 | 3 | 10.3231 | 22.1773 | 5.1020 | 60.810 | 5.053674 |
| 151 | 2002-07-26 19:22:00 | Glacier 7 | 59.6954 | -151.2578 | 1 | 10.7662 | 17.6879 | 5.0959 | 187.240 | 5.993081 |
| 152 | 2002-07-26 19:22:00 | Glacier 7 | 59.6954 | -151.2578 | 2 | 10.4240 | 18.8099 | 4.6585 | 46.582 | 5.993081 |
153 rows × 10 columns
Plot one dataset¶
keys = list(cat[dataset_id].metadata["plots"].keys())
print(keys)
plots = []
for key in keys:
plot_kwargs = cat[dataset_id].metadata["plots"][key]
if "clim" in plot_kwargs and isinstance(plot_kwargs["clim"], list):
plot_kwargs["clim"] = tuple(plot_kwargs["clim"])
if "dynamic" in plot_kwargs:
plot_kwargs["dynamic"] = False
plots.append(cat[dataset_id].ToHvPlot(**plot_kwargs).read())
hv.Layout(plots).cols(1)
['salt', 'temp']