import intake
import hvplot.pandas
import hvplot.xarray
import cook_inlet_catalogs as cic
import holoviews as hv

CTD Transect (OTF KBNERR): Repeated from Anchor Point

CTD Transect Across Anchor Point, for GEM Project 030670.

This project used a vessel of opportunity to collect physical oceanographic and fisheries data at six stations along a transect across lower Cook Inlet from Anchor Point (AP) to the Red River delta each day during July. Logistical support for the field sampling was provided in part by the Alaska Department of Fish and Game which has chartered a drift gillnet vessel annually to fish along this transect providing inseason projections of the size of sockeye salmon runs entering Cook Inlet. This project funded collection of physical oceanographic data on board the chartered vessel to help identify intrusions of the Alaska Coastal Current (ACC) into Cook Inlet and test six hypotheses regarding effects of changing oceanographic conditions on migratory behavior and catchability of sockeye salmon entering Cook Inlet. In 2003-2007, a conductivity-temperature-depth profiler was deployed at each station. In 2003-2005, current velocities were estimated along the transect using a towed acoustic Doppler current profiler, and salmon relative abundance and vertical distribution was estimated using towed fisheries acoustic equipment.

Willette, T.M., W.S. Pegau, and R.D. DeCino. 2010. Monitoring dynamics of the Alaska coastal current and development of applications for management of Cook Inlet salmon - a pilot study. Exxon Valdez Oil Spill Gulf Ecosystem Monitoring and Research Project Final Report (GEM Project 030670), Alaska Department of Fish and Game, Commercial Fisheries Division, Soldotna, Alaska.

Report: https://evostc.state.ak.us/media/2176/2004-040670-final.pdf Project description: https://evostc.state.ak.us/restoration-projects/project-search/monitoring-dynamics-of-the-alaska-coastal-current-and-development-of-applications-for-management-of-cook-inlet-salmon-040670/

cat = intake.open_catalog(cic.utils.cat_path("ctd_transects_otf_kbnerr"))

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
['2003-07-01',
 '2003-07-02',
 '2003-07-04',
 '2003-07-05',
 '2003-07-06',
 '2003-07-07',
 '2003-07-08',
 '2003-07-09',
 '2003-07-10',
 '2003-07-11',
 '2003-07-12',
 '2003-07-13',
 '2003-07-14',
 '2003-07-15',
 '2003-07-16',
 '2003-07-17',
 '2003-07-18',
 '2003-07-19',
 '2003-07-21',
 '2003-07-22',
 '2003-07-23',
 '2003-07-24',
 '2003-07-25',
 '2003-07-26',
 '2003-07-28',
 '2003-07-29',
 '2003-07-30',
 '2004-07-01',
 '2004-07-02',
 '2004-07-03',
 '2004-07-04',
 '2004-07-05',
 '2004-07-06',
 '2004-07-07',
 '2004-07-08',
 '2004-07-09',
 '2004-07-10',
 '2004-07-11',
 '2004-07-12',
 '2004-07-13',
 '2004-07-14',
 '2004-07-15',
 '2004-07-16',
 '2004-07-17',
 '2004-07-18',
 '2004-07-19',
 '2004-07-20',
 '2004-07-21',
 '2004-07-22',
 '2004-07-23',
 '2004-07-24',
 '2004-07-25',
 '2004-07-27',
 '2004-07-28',
 '2004-07-29',
 '2004-07-30',
 '2005-07-01',
 '2005-07-02',
 '2005-07-03',
 '2005-07-04',
 '2005-07-05',
 '2005-07-06',
 '2005-07-07',
 '2005-07-08',
 '2005-07-09',
 '2005-07-10',
 '2005-07-11',
 '2005-07-12',
 '2005-07-13',
 '2005-07-14',
 '2005-07-15',
 '2005-07-16',
 '2005-07-17',
 '2005-07-18',
 '2005-07-19',
 '2005-07-20',
 '2005-07-21',
 '2005-07-22',
 '2005-07-23',
 '2005-07-24',
 '2005-07-25',
 '2005-07-26',
 '2005-07-27',
 '2005-07-28',
 '2005-07-29',
 '2005-07-30',
 '2006-07-01',
 '2006-07-02',
 '2006-07-03',
 '2006-07-04',
 '2006-07-05',
 '2006-07-06',
 '2006-07-07',
 '2006-07-09',
 '2006-07-10',
 '2006-07-11',
 '2006-07-12',
 '2006-07-13',
 '2006-07-15',
 '2006-07-16',
 '2006-07-17',
 '2006-07-18',
 '2006-07-19',
 '2006-07-21',
 '2006-07-23',
 '2006-07-25',
 '2006-07-26',
 '2006-07-27',
 '2006-07-28']

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
2003-07-04
datetime Cruise Station Type Lon (oE) Lat (oN) Bot. Depth [m] Temp [oC] C0S/m WetStar Trans [volts] Chl [volts] V2 Par O2 [v] Depth [m] Salinity [psu] O2 [mg/l] O2 [%sat] distance [km]
0 2003-07-04 12:00:00 4 4.0 c -152.151667 59.82500 45 9.73 3.42 3.22 0.323 4.020 3.45 443.000 3.46 1.0 31.3 9.14 98.3 0.000000
1 2003-07-04 12:00:00 4 4.0 c -152.151667 59.82500 45 9.73 3.42 3.54 0.341 4.020 3.47 110.000 3.47 2.0 31.3 9.16 98.5 0.000000
2 2003-07-04 12:00:00 4 4.0 c -152.151667 59.82500 45 9.73 3.42 3.58 0.344 4.040 3.47 374.000 3.47 3.0 31.3 9.17 98.6 0.000000
3 2003-07-04 12:00:00 4 4.0 c -152.151667 59.82500 45 9.73 3.42 3.15 0.319 4.050 3.47 131.000 3.47 4.0 31.3 9.16 98.5 0.000000
4 2003-07-04 12:00:00 4 4.0 c -152.151667 59.82500 45 9.73 3.42 3.16 0.320 4.050 3.47 101.000 3.46 5.0 31.3 9.15 98.4 0.000000
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
378 2003-07-04 17:02:00 4 8.0 c -152.438333 59.87333 59 10.00 3.34 4.15 0.377 0.435 3.42 0.061 3.42 44.0 30.2 9.07 97.5 16.956284
379 2003-07-04 17:02:00 4 8.0 c -152.438333 59.87333 59 10.00 3.34 4.17 0.378 0.450 3.42 0.061 3.43 45.0 30.2 9.08 97.6 16.956284
380 2003-07-04 17:02:00 4 8.0 c -152.438333 59.87333 59 10.00 3.34 4.24 0.382 0.433 3.43 0.061 3.43 46.0 30.2 9.08 97.6 16.956284
381 2003-07-04 17:02:00 4 8.0 c -152.438333 59.87333 59 10.00 3.34 4.30 0.386 0.363 3.42 0.062 3.42 47.0 30.2 9.07 97.5 16.956284
382 2003-07-04 17:02:00 4 8.0 c -152.438333 59.87333 59 10.00 3.34 11.30 0.790 0.216 3.41 0.062 3.41 48.0 30.2 9.04 97.1 16.956284

383 rows × 20 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']