wave_height_period
Figure Module¶Render figure object produced by the nowcast.figures.wwatch3.wave_height_period
module.
Provides data for visual testing to confirm that refactoring has not adversely changed figure for web page.
Set-up and function call replicates as nearly as possible what is done in the nowcast.workers.make_plots
worker.
Notebooks like this should be developed in a Nowcast Figures Development Environment so that all of the necessary dependency packages are installed.
import io
from pathlib import Path
import yaml
from nowcast.figures.wwatch3 import wave_height_period
%matplotlib inline
The bits of config/nowcast.yaml
that are required:
config = '''
figures:
dataset URLs:
wwatch3 fields:
# https://salishsea.eos.ubc.ca/erddap/griddap/ubcSSf2DWaveFields30mV17-02.nc?hs,fp
https://salishsea.eos.ubc.ca/erddap/griddap/ubcSSf2DWaveFields30mV17-02
'''
config = yaml.safe_load(io.StringIO(config))
The bits that the make_figures
worker must provide:
wwatch3_dataset_url = config['figures']['dataset URLs']['wwatch3 fields']
# %%timeit -n1 -r1
from importlib import reload
reload(wave_height_period)
buoys = [
'Halibut Bank',
'Sentry Shoal',
]
for buoy in buoys:
fig = wave_height_period.make_figure(buoy, wwatch3_dataset_url)