An 'aggregation servlet developed specifically for the EDSC web client
This returns a Zip file containing a number of resources read/produced by the Hyrax
BES. It can handle a list of resources (typically files) and simply return them,
unaltered or translated into netCDF files. In the later case, a constraint expression
can be applied to each resource before the transformation takes place, limiting the
variables and/or parts of variables in the resulting netCDF file. Note that for the
netCDF format response to work, the BES must be able to read the format of the
original resource (e.g., HDF4).
To methods of interaction are supported: GET and POST. HEAD requests are also supported,
although not particularly meaningful.
How to call this service:
&operation=version: Get the version of this servlet. Includes BES version info too.
&operation=file: Given a list of files, return them in a zip archive. Each file is named
using &file=
. Both GET and POST are supported. In the case of
POST, the &file= entries may be separated by a newline. The
'file' param must be supplied.
&operation=netcdf3: Like 'file' above, but all data are returned in netCDF3 files. In addition,
each file has an associated constraint expression, specified using &var=,
, ..., . This is required. If only one 'var' param is given, that constraint
is applied to every file. If more than one 'var' param is supplied, the number must
match the number of files and they are associated 1-to-1. The /netcdf3 option also
accepts an optional &bbox parameter. The format for these is
&bbox=,,,. These values are
used as a bounding box for the variables listed in the &var parameter. NB: &var
must not be empty if &bbox is used, otherwise, if &var it is empty,
the entire file contents will be returned.
&operation=netcdf4: Like 'netcdf3', but the individual response files use netCDF4
&operation=ascii: Like 'netcdf4', but using the DAP ASCII format - this is not the
tabular data option.
&operation=csv: Convert the arrays listed in 'var' into a table, and optionally restrict
the values to those defined by the bounding box(es) given using the bbox parameter.
All of the values are returned in a single table.
Example use:
Suppose 'hdf4_files.txt' contains:
&operation=netcdf3
&ce=Sensor_Azimuth,Sensor_Zenith
&file=/data/hdf4/MOD04_L2.A2015021.0020.051.NRT.hdf
&file=/data/hdf4/MOD04_L2.A2015021.0025.051.NRT.hdf
&file=/data/hdf4/MOD04_L2.A2015021.0030.051.NRT.hdf
curl -X POST -d @hdf4_files.txt http://localhost:8080/opendap/aggregation -o data.zip
Will call the servlet, using the data in 'hdf4_files.txt' as the contents of the
HTTP request document body (i.e., using POST) and save the response to 'data.zip'.
Running unizp -t on the response reveals a zip archive with three files:
Archive: data2.zip
testing: MOD04_L2.A2015021.0020.051.NRT.hdf.nc OK
testing: MOD04_L2.A2015021.0025.051.NRT.hdf.nc OK
testing: MOD04_L2.A2015021.0030.051.NRT.hdf.nc OK
No errors detected in compressed data of data2.zip.
TODO Write a /help response?
TODO (Hard) Make parallel requests to the BES.