Package: bmi-wavewatch3
WAVEWATCH III data in PythonAboutThebmi_wavewatch3Python package provides both a command line interface and a programming interface
for downloading and working withWAVEWATCH IIIdata.bmi_wavewatch3provides access to the following raster data sources,30 year wave hindcastPhase 130 year wave hindcastPhase 2Production hindcastSinglegridProduction hindcastMultigridAll data sources provide both global and regional grids.Installationbmi_wavewatch3can be installed by runningpip installbmi-wavewatch3. It requires Python >= 3.8 to run.If you simply can’t wait for the latest release, you can installbmi_wavewatch3directly from GitHub,$pipinstallgit+https://github.com/csdms/bmi-wavewatch3bmi_wavewatch3is also available throughconda,conda installbmi-wavewatch3-cconda-forge.UsageTo get started, you can downloadWAVEWATCH IIIdata by date with theww3command
(useww3 –helpto print a brief message),$ww3fetch"2010-05-22"You can also do this through Python,>>>frombmi_wavewatch3importWaveWatch3>>>WaveWatch3.fetch("2010-05-22")Thebmi_wavewatch3package provides theWaveWatch3class for downloading data and
presenting it as anxarrayDataset.>>>frombmi_wavewatch3importWaveWatch3>>>ww3=WaveWatch3("2010-05-22")>>>ww3.data<xarray.Dataset>...Use theincmethod to advance in time month-by-month,>>>ww3.date'2010-05-22'>>>ww3.inc()'2010-06-22'>>>ww3.data.time<xarray.DataArray'time'()>array('2010-06-01T00:00:00.000000000',dtype='datetime64[ns]')...This will download new datasets as necessary and load the new data into thedataattribute.NoteIf the new data are not cached on you computer, you will notice a delay while the new
data are download. If thelazyflag is set, the download will only occur once you
try to access the data (i.e.ww3.data), otherwise the data are downloaded
as soon as the date is set.ExamplePlot data from the command lineRunning the following from the command line will plot the variablesignificant wave heightfrom the WAVEWATCH IIIat_4mgrid. Note that the time of day (in this case, 15:00) is
separated from the date with aT(i.e. times can be given asYYYY-MM-DDTHH)$ww3plot--grid=at_4m--data-var=swh"2010-09-15T15"Plot data from PythonThis example is similar to the previous but uses thebmi_wavewatch3Python interface.>>>frombmi_wavewatch3importWaveWatch3>>>ww3=WaveWatch3("2009-11-08")The data can be accessed as anxarrayDatasetthrough thedataattribute.>>>ww3.data<xarray.Dataset>Dimensions:(step:241,latitude:311,longitude:720)Coordinates:timedatetime64[ns]2009-11-01*step(step)timedelta64[ns]0days00:00:00...30days00:00:00surfacefloat641.0*latitude(latitude)float6477.577.076.576.0...-76.5-77.0-77.5*longitude(longitude)float640.00.51.01.5...358.0358.5359.0359.5valid_time(step)datetime64[ns]dask.array<chunksize=(241,),meta=np.ndarray>Datavariables:dirpw(step,latitude,longitude)float32dask.array<chunksize=(241,311,720),meta=np.ndarray>perpw(step,latitude,longitude)float32dask.array<chunksize=(241,311,720),meta=np.ndarray>swh(step,latitude,longitude)float32dask.array<chunksize=(241,311,720),meta=np.ndarray>u(step,latitude,longitude)float32dask.array<chunksize=(241,311,720),meta=np.ndarray>v(step,latitude,longitude)float32dask.array<chunksize=(241,311,720),meta=np.ndarray>Attributes:GRIB_edition:2GRIB_centre:kwbcGRIB_centreDescription:USNationalWeatherService-NCEPGRIB_subCentre:0Conventions:CF-1.7institution:USNationalWeatherService-NCEPhistory:2022-06-08T16:08GRIBtoCDM+CFviacfgrib-0.9.1...Thestepattribute points to the current time slice into the data (i.e number of three hour increments
since the start of the month),>>>ww3.step56>>>ww3.data.swh[ww3.step,:,:].plot()CreditsDevelopment LeadEric Hutton (@mcflugen)ContributorsNone yet. Why not be the first?Release Notes0.2.0 (2022-06-17)New FeaturesAdded a new subcommand,plot, to theww3command-line program.ww3 plotwith download (if the data files are not already cached) and
create a plot of the requested data. (#13)Bug FixesFixed a bug in the reporting of an error caused by an invalide datatime
string. (#13)0.1.1 (2022-06-10)Other Changes and AdditionsSet up GitHub Action to create a source distribution and push it toTestPyPI. This action is only run if the version tag is a prerelease version
(i.e. the version string ends with[ab][0-9]+). (#10)Set up GitHub Action to create a source distribution and push it toPyPI. This action is only run if the version tag is a release version
(i.e. the version string doesn’t end with[ab][0-9]+). (#11)0.1.1b1 (2022-06-09)New FeaturesAddedww3command line interface to download WaveWatch III data by date,
region and quantity (significant wave height, wind speed, etc.). (#1)AddedWaveWatch3class, which is the main access point for users of this package.
This class downloads WaveWatch III data files (if not already cached) and provides a
view of the data as an xarray Dataset. Users can then advance through the data
month-by-month, downloading additional data as necessary. (#3)Added theww3 cleansubcommand that removes cached data files. (#4)AddedBMIWaveWatch3class to provide a Basic Model Interface for thewavewatch3package. (#5)Added additional WaveWatch III data sources from which users can fraw data
from. (#6)Addedfetchmethod to WaveWatch3 to mimic the command line programww3 fetch. (#7)Added additional data sources from which to retreive data from. Available
data sources now include: Phase 1, Phase 2, Multigrid, Multigrid-extended,
and Multigrid-thredds. (#7)Addedww3 infocommand to print information (e.g. available grids, quantities,
etc.) about data sources. (#7)Added astepproperty toWaveWatch3to track the current time slice
of the data cube. This property is also settable so that a user can use it to
advance throught the data (additional data are downloaded in the background as
needed). (#8)Dates can now be specified as iso-formatted date/time strings. For example,
“1944-06-06T06:30”. (#8)Rename package tobmi_wavewatch3. This follows the convention used by other
CSDMS data components. (#9)Documentation EnhancementsAdded package description, installation, usage, and an example to the
documentation. (#8)Other Changes and AdditionsSet up continuous integration using GitHub actions. This includes tests to
ensure that the code is styled according toblack, is free of lint, and
passes all unit tests. (#2)Added more unit tests, particularly for data sources. (#7)Added a GitHub action to build the sphinx-based documentation as part of the
continuous integration. (#8)Better error reporting for the command line interface for HTTP errors when
retreiving data as well as input validation. (#8)Set up GitHub Action to create a source distribution and push it toTestPyPI. This action is only run if the version tag is a prerelease version
(i.e. the version string ends with[ab][0-9]+). (#10)