|
ERDDAP
Easier access to scientific data |
Brought to you by NOAA NMFS SWFSC ERD |
The URL specifies what you want: the dataset, a description of the graph or the subset of the data, and the file
type for the response.
griddap request URLs must be in the form
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/datasetID.fileType{?query}
For example,
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.htmlTable?sst[(2007-10-21T00:00:00)][0][(-75):100:(75)][(180):100:(360)]
Thus, the query is often a variable name (e.g., sst),
followed by a set of [] for each of the variable's dimensions
(for example, [time][altitude][latitude][longitude]),
with your desired (start):stride:(stop) values within each [].
Details:
| Data fileTypes | Description | Info | Example |
|---|---|---|---|
| .asc | View OPeNDAP-style comma-separated ASCII text. | info | example |
| .csv | Download a comma-separated ASCII text table (line 1: names; line 2: units; ISO 8601 times). | info | example |
| .csvp | Download a .csv file with line 1: name (units). Times are ISO 8601 strings. | info | example |
| .das | View the data's metadata via an OPeNDAP Dataset Attribute Structure (DAS). | info | example |
| .dds | View the data's structure via an OPeNDAP Dataset Descriptor Structure (DDS). | info | example |
| .dods | OPeNDAP clients use this to download the data in the DODS binary format. | info | example |
| .esriAscii | Download an ESRI ASCII file (for lat lon data only; lon must be all below or all above 180). | info | example |
| .graph | View a Make A Graph web page. | info | example |
| .help | View a web page with a description of griddap. | info | example |
| .html | View an OPeNDAP-style HTML Data Access Form. | info | example |
| .htmlTable | View a .html web page with the data in a table. Times are ISO 8601 strings. | info | example |
| .json | View a JSON table (missing value = 'null'; times are ISO 8601 strings). | info | example |
| .mat | Download a MATLAB binary file. | info | example |
| .nc | Download a NetCDF binary file with COARDS/CF/THREDDS metadata. | info | example |
| .ncHeader | View the header (the metadata) for the NetCDF file. | info | example |
| .odvTxt | Download time,latitude,longitude,otherVariables as an ODV Generic Spreadsheet File (.txt). | info | example |
| .tsv | Download a tab-separated ASCII text table (line 1: names; line 2: units; ISO 8601 times). | info | example |
| .tsvp | Download a .tsv file with line 1: name (units). Times are ISO 8601 strings. | info | example |
| .xhtml | View an XHTML (XML) file with the data in a table. Times are ISO 8601 strings. | info | example |
ArcGIS
is a family of Geographical Information Systems (GIS) products from ESRI:
ArcView, ArcEditor, and ArcInfo. To get data from ERDDAP into your ArcGIS program:
in ERDDAP, save some data in an .esriAscii file. The file's extension will be .asc.
Then, import the data file into your ArcGIS program:
Shapefiles - We do not distribute grid data as shapefiles because shapefiles are usually
an inappropriate file format for distributing grid data. If the grid data is stored in a
shapefile, it is either treated as sets of points (MultiPointM or MultiPoint objects,
where one loses the information that the points are arranged in a grid) or as a Polygons
(where one deals with contiguous areas with a specific range of values, for example,
16 degrees <= Temperature < 17 degrees, where one loses the actual data values and the
information that the points are arranged in a grid). Such shapefiles can and should be
derived from the original grid data, which we do distribute.
We believe that the ESRI .asc files available from ERDDAP are the appropriate form for
distributing grid data to the ArcGIS programs. In fact, this ESRI .asc format was designed
by ESRI for this exact purpose -- the transfer of grid data between computers.
JSONP
- Requests for .json files may now include an optional jsonp request
by adding &.jsonp=functionName to the end of the query.
Basically, this just tells ERDDAP to add functionName( to the beginning of the
response and ")" to the end of the response.
If originally there was no query, leave off the "&" in your query.
MATLAB
users can use griddap's .mat file type to download data from within MATLAB.
Here is a one line example:
load(urlwrite('http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.mat?sst[(2007-10-21)][0][(-75):50:(75)][(180):50:(360)]&.draw=surface&.vars=longitude|latitude|sst&.colorBar=Rainbow|C|Linear|0|32|', 'test.mat'));
The data will be in a MATLAB structure. The structure's name will be the datasetID
imagesc(erdBAssta5day.longitude, erdBAssta5day.latitude, squeeze(erdBAssta5day.sst), [0 32]) set(gca, 'YDir', 'normal')The numbers at the end of the first line specify the range for the color mapping.
Ocean Data View (ODV)
users can download data in the
ODV Generic Spreadsheet Format
.txt file by requesting griddap's .odvTxt fileType.
The dataset MUST include longitude, latitude, and time dimensions.
Any longitude vales are fine.
After saving the resulting file (with the extension .txt) in your computer:
Making an Image File with a Graph or Map of Gridded Data
If a griddap request URL specifies a subset of data which is suitable for making
a graph or a map, and the fileType is an image fileType, griddap will return an image
with a graph or map.
griddap request URLs can include optional graphics commands which let you
customize the graph or map.
As with other griddap request URLs, you can create these URLs by hand or have a
computer program do it. Or, you can use the Make A Graph web pages, which simplify
creating these URLs (see the "graph" links in the table of
griddap datasets).
The fileType options for downloading images of graphs and maps of grid data are:
| Image fileTypes | Description | Info | Example |
|---|---|---|---|
| .geotif | View a GeoTIFF .tif image file (for lat lon data only; lon must be all below or all above 180). | info | example |
| .kml | View a Google Earth .kml file (for lat, lon, [time] results only) | info | example |
| .smallPdf | View a small .pdf image file with a graph or map. | info | example |
| View a standard, medium-sized, .pdf image file with a graph or map. | info | example | |
| .largePdf | View a large .pdf image file with a graph or map. | info | example |
| .smallPng | View a small .png image file with a graph or map. | info | example |
| .png | View a standard, medium-sized .png image file with a graph or map. | info | example |
| .largePng | View a large .png image file with a graph or map. | info | example |
| .transparentPng | View a .png image file (a geographic map without axes, landmask, or legend). | info | example |
The .transparentPng option will make a geographic map without axes, landmask,
or legend, and with a transparent (not opaque white) background.
This option can't be used for other types of graphs, for example, line graghs.
The .transparentPng image doesn't have a standard size. Instead, it makes an
image where one data point becomes one pixel. So in most cases, you should use
a stride value (see below) for the latitude and longitude axes, or use the
&.size=width|height parameter
to restrict the image size, so that the image isn't *huge*.
Incompatibilities
Some results file types have restrictions. For example, Google Earth .kml is only
appropriate for results with longitude and latitude values. If a given request is
incompatible with the requested file type, griddap throws an error.
Using [start:stride:stop]
When requesting dimension (axis) variables or data variables, the query may
specify a subset of a given dimension by identifying the [start{{:stride}:stop}]
indices for that dimension.
Or, if you change the fileType in the URL from .png to .graph, you can see a Make A Graph
web page with that request loaded:
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.graph?sst[(2007-07-01):(2007-10-21)][0][(29)][(225)]&.draw=linesAndMarkers&.vars=time|sst|&.marker=1|3&.color=0xFF9900&.colorBar=|C|Linear|||
That makes it easy for humans to modify an image request to make a similar graph or map.
Or, if you change the fileType in the URL from .png to a data fileType (e.g., .htmlTable), you can download the data that was graphed:
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.htmlTable?sst[(2007-07-01):(2007-10-21)][0][(29)][(225)]&.draw=linesAndMarkers&.vars=time|sst|&.marker=1|3&.color=0xFF9900&.colorBar=|C|Linear|||
Or, if you change the fileType in the URL from .png to .graph, you can see a Make A Graph
web page with that request loaded:
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.graph?sst[(2007-10-21)][0][(-75):50:(75)][(180):50:(360)]&.draw=surface&.vars=longitude|latitude|sst&.colorBar=Rainbow|C|Linear|0|32|
Or, if you change the fileType in the URL from .png to a data fileType (e.g., .htmlTable),
you can download the data that was mapped:
http://edac-dap2.northerngulfinstitute.org/erddap/griddap/erdBAssta5day.htmlTable?sst[(2007-10-21)][0][(-75):50:(75)][(180):50:(360)]&.draw=surface&.vars=longitude|latitude|sst&.colorBar=Rainbow|C|Linear|0|32|