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

Underway CTD (GWA): Towed, temperature only

Temperature only: Environmental Drivers: Continuous Plankton Recorders, Gulf Watch Alaska.

This project is a component of the integrated Long-term Monitoring of Marine Conditions and Injured Resources and Services submitted by McCammon et. al. Many important species, including herring, forage outside of Prince William Sound for at least some of their life history (salmon, birds and marine mammals for example) so an understanding of the productivity of these shelf and offshore areas is important to understanding and predicting fluctuations in resource abundance. The Continuous Plankton Recorder (CPR) has sampled a continuous transect extending from the inner part of Cook Inlet, onto the open continental shelf and across the shelf break into the open Gulf of Alaska monthly through spring and summer since 2004. There are also data from 2000-2003 from a previous transect. The current transect intersects with the outer part of the Seward Line and provides complementary large scale data to compare with the more local, finer scale plankton sampling on the shelf and in PWS. Resulting data will enable us to identify where the incidences of high or low plankton are, which components of the community are influenced, and whether the whole region is responding in a similar way to meteorological variability. Evidence from CPR sampling over the past decade suggests that the regions are not synchronous in their response to ocean climate forcing. The data can also be used to try to explain how the interannual variation in ocean food sources creates interannual variability in PWS zooplankton, and when changes in ocean zooplankton are to be seen inside PWS. The CPR survey is a cost-effective, ship-of-opportunity based sampling program supported in the past by the EVOS TC that includes local involvement and has a proven track record.

Nominal 7m depth, 2011-2016.

Project overview: https://gulf-of-alaska.portal.aoos.org/#metadata/87f56b09-2c7d-4373-944e-94de748b6d4b/project

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

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
['2011-06-20',
 '2011-07-23',
 '2011-08-22',
 '2012-04-09',
 '2012-05-13',
 '2012-06-11',
 '2012-09-16',
 '2012-10-16',
 '2013-04-14',
 '2013-05-13',
 '2013-06-15',
 '2013-07-15',
 '2013-08-17',
 '2014-04-27',
 '2014-05-27',
 '2014-06-29',
 '2014-07-29',
 '2014-08-31',
 '2015-08-23',
 '2015-09-01',
 '2016-04-17',
 '2016-05-16',
 '2016-06-19',
 '2016-07-19',
 '2016-08-29',
 '2016-10-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
2011-08-22
date_time Latitude (deg N) Longitude (-ve west) temperature depth [m] distance [km]
0 2011-08-22 15:20:00 58.811167 -150.500000 11.3 7.0 0.000000
1 2011-08-22 15:25:00 58.822271 -150.543750 11.4 7.0 2.814286
2 2011-08-22 15:30:00 58.833375 -150.587500 11.8 7.0 5.627848
3 2011-08-22 15:35:00 58.844479 -150.631250 11.7 7.0 8.440684
4 2011-08-22 15:40:00 58.855583 -150.675000 11.3 7.0 11.252796
5 2011-08-22 15:45:00 58.866687 -150.718750 11.4 7.0 14.064182
6 2011-08-22 15:50:00 58.877792 -150.762500 11.7 7.0 16.874844
7 2011-08-22 15:55:00 58.888896 -150.806250 11.5 7.0 19.684780
8 2011-08-22 16:00:00 58.900000 -150.850000 11.2 7.0 22.493992
9 2011-08-22 16:05:00 58.911083 -150.900000 11.4 7.0 25.628966
10 2011-08-22 16:10:00 58.922167 -150.950000 11.5 7.0 28.763094
11 2011-08-22 16:15:00 58.933250 -151.000000 11.2 7.0 31.896374
12 2011-08-22 16:20:00 58.944333 -151.050000 11.4 7.0 35.028806
13 2011-08-22 16:25:00 58.955417 -151.100000 11.4 7.0 38.160392
14 2011-08-22 16:30:00 58.966500 -151.150000 11.7 7.0 41.291130
15 2011-08-22 16:35:00 58.977583 -151.200000 11.5 7.0 44.421020
16 2011-08-22 16:40:00 58.988667 -151.250000 11.3 7.0 47.550063
17 2011-08-22 16:45:00 58.999750 -151.300000 11.3 7.0 50.678258
18 2011-08-22 16:50:00 59.010833 -151.350000 11.2 7.0 53.805606
19 2011-08-22 16:55:00 59.021917 -151.400000 11.3 7.0 56.932106
20 2011-08-22 17:00:00 59.033000 -151.450000 11.2 7.0 60.057758
21 2011-08-22 17:05:00 59.033000 -151.506974 11.2 7.0 63.329204
22 2011-08-22 17:10:00 59.033000 -151.563947 11.7 7.0 66.600651
23 2011-08-22 17:15:00 59.033000 -151.620921 12.0 7.0 69.872097
24 2011-08-22 17:20:00 59.033000 -151.677895 11.3 7.0 73.143538
25 2011-08-22 17:25:00 59.033000 -151.734868 11.3 7.0 76.414985
26 2011-08-22 17:30:00 59.033000 -151.791842 11.7 7.0 79.686431
27 2011-08-22 17:35:00 59.033000 -151.848816 12.0 7.0 82.957878
28 2011-08-22 17:40:00 59.041976 -151.895195 12.3 7.0 85.802172
29 2011-08-22 17:45:00 59.064415 -151.925683 12.3 7.0 88.853264
30 2011-08-22 17:50:00 59.086854 -151.956171 12.3 7.0 91.903710
31 2011-08-22 17:55:00 59.109293 -151.986659 12.2 7.0 94.953509
32 2011-08-22 18:00:00 59.131732 -152.017146 12.1 7.0 98.002661
33 2011-08-22 18:05:00 59.154171 -152.047634 11.7 7.0 101.051166

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)
['temp']