|
ERDDAP
Easier access to realtime and historic NERACOOS buoy observations. |
Brought to you by NOAA IOOS NERACOOS |
ERDDAP was designed around the idea that most datasets are huge, so most users
just need or want a subset of the dataset that they are interested in
(e.g., a smaller geographic area, a smaller time range, or not all of the data variables).
But we
understand that some users actually do want an entire dataset, or at least the subset
which is found in a subset of the source data files. If that's you, then the "files"
system may be for you. One advantage of the "files" system is that you can see each
file's Last Modified time (Zulu time zone), so it is easy to see if a file has been
changed.
Similarly, when you request a subset of data from one of ERDDAP's Data Access Forms,
you can specify the file type (e.g., .nc, .csv, .json, .mat) that you want to receive in
response. Naturally, the source data files available via "files" are just available in
one file type. If you aren't happy with the source file's file type, you might prefer
using the dataset's Data Access Forms instead.
and install it. To get to a command line in Windows, click on "Start" and type
"cmd" into the search textfield.
("Win32 - Generic, Win32, binary (without SSL)" worked for me in Windows 7.)
Instructions for using curl are on the
curl man page
and in this
curl tutorial
.
But here is a quick tutorial related to using curl with ERDDAP:
curl -g "https://coastwatch.pfeg.noaa.gov/erddap/files/cwwcNDBCMet/NDBC_41004_met.nc" -o ndbc/41004.ncIn curl, as in many other programs, the query part of the erddapUrl must be percent encoded
:
all characters in parameter values (the parts after '=' signs) other than A-Za-z0-9_-!.~'()*
must be encoded as %HH, where HH is the 2 digit hexadecimal value of the character,
for example,
a space becomes %20. Characters above #127 must be converted to UTF-8 bytes, then each UTF-8
byte must be percent encoded (ask a programmer for help). There are
web sites that percent encode and decode for you
.
If you get the URL from your browser's address textfield, this may be already done.
them in the erddapURL as %5B, %5D, %7B, %7D, respectively.
Fortunately, these are almost never in "files" file names.
Then, in the erddapUrl, replace a zero-padded number (for example 01) with a
range of values (for example, [01-15] ), or replace a substring (for example 41004) with a list of values (for example, {41004,41009,41010} ).
The #1 within the output fileName causes the current value of the range or
list to be put into the output fileName. For example,
curl "https://coastwatch.pfeg.noaa.gov/erddap/files/cwwcNDBCMet/NDBC_{41004,41009,41010}_met.nc" -o ndbc/#1.nc
Similarly, for a few audio file types (notably .mp3, .ogg, and .wav), you will see an audio control which allows you listen to the audio file.
These preview features will only work for certain file types, in certain browsers, in certain operating systems. They rely on browser features, so they are largely out of our control.
Alternatively, if you click on the link for an image, audio, or video file, a viewer
or player will open in a separate window. (If your browser asks you what you want
to do with the file, tell it to handle the media file itself (not via other software),
and tell it to
remember this choice so that it will be used automatically in the future.)
.
This is used by some client software (for example, audio and video players in web browsers)
to request chunks of the file instead of the whole file.
Some software that is normally used to read data from a local data file can
also work with a remote file if the server supports Byte Range requests.
So, in general, such software can work with remote files served by ERDDAP's "files" system.
For example,
Ferret
and
ncview
can read data from local and remote .nc files.
However, Byte Range requests are slow and inefficient compared to local access.
So the more you work with a remote file, the more sense it makes to download
the file so you can access the local file quickly and efficiently.