Potential Data Source -- NEMO from SalishSeaCast
NEMO & SalishSeaCast Data
As we have spoken about in some of our recent meetings, I've been working on integrating data from the SalishSeaCast with the Northern Strait of Georgia (NSOG) range test data we have. In particular, I have been using the hindcast data from the NEMO v19-05 model. This data is stored in the datasets labelled as "Green, Salish Sea,..." on ERDDAP server's griddap page.
Adding support for this dataset to kadlu could prove to lead to the easy addition of other ERDDAP servers, since many (from my data scouring over the last couple months) appear to have the same quirks.
Determining Bounds
The one trick I encountered is that these environmental data are indexed by gridX & gridY coordinates, rather than longitude / latitude. This was a problem, since the bounds we have been using to access data in kadlu, etc all use lon/lat. So, to figure out what the grid boundaries should be, I first needed to download the geolocation & bathymetry dataset. This dataset provides the mapping from (gridX, gridY) to (longitude, latitude). Using this, I was able to find the gridX & gridY ranges (and even maximum depth) that I could use to query the ERDDAP data servers.
Downloading Data
Once you know the bounds you want to use, accessing the data is relatively easy. The simplest way is to programmatically construct the data URL for each variable and download the data directly from the server.
Once it's downloaded, you can load it into an xarray (assuming you are downloading NetCDF files), add in lon/lat coordinates by inner-merging with the bathymetry data, and then save that to disk. I've been saving to NetCDF files, b/c that fits with the rest of the range-driver pipeline, but it could obviously be saved to a database instead.
Jupyter Notebook
Also, I've attached the Jupyter Notebook I have been using to download the data. It's pretty bare bones and doesn't do a good job of handling the errors that can come from the ERDDAP servers (e.g. specifying depth bounds when variable doesn't have it, or 502 errors), but it should give an idea of what the download process looks like.