Using F-TDS and the server-side analysis
F-TDS allows data files which can be read and geo-referenced by Ferret to be served as OPeNDAP data sets. F-TDS allows allows the dynamic creation of new variables via requests for server-side analysis.
F-TDS is an OPeNDAP server built on top of the THREDDS Data Server. F-TDS expands the capabilities of TDS by allowing users to ask for data to processed (to deliver the data on a new grid, to perform averaging or other analysis supported by Ferret) on the server before delivering the results of the calculation via OPeNDAP. This mechanism also allows data from multiple sources to be used as input a calculation on the server.
Using F-TDS
An OPeNDAP request can be made by sending a URL to the FDS. An example URL is as follows:
http://ferret.pmel.noaa.gov:8080/thredds/dodsC/data/coads_climo.jnl.asc?SST[0:2:2][0:2:8][0:2:17]
^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | |
| | | | | | | |
Protocol | | | | | | |
Machine Name--- | | | | | |
Port number----------------------- | | | | |
Server--------------------------------- | | | |
Directory--------------------------------------------- | | |
Filename--------------------------------------------------------- | |
URL Suffix-------------------------------------------------------------- |
Contraint-----------------------------------------------------------------------
If you are issuing an OPeNDAP request from a non-OPeNDAP client, such as a web browser, you can specify the type of request by appending a suffix to the URL. Different suffixes demand different services from the server:
- Data Attribute
- This service returns the entire data
attribute structure for the given dataset. This is a text file
describing the attributes of each data quantity in that dataset.
This service is activated when the
server receives a URL ending with
.das - Data Descriptor
- This service returns the entire data descriptor
structure for the given dataset. This is a text file describing the
structure of the variables in the dataset.
This service is activated when the server receives a URL ending with
.dds - OPeNDAP Data
- This service returns the actual data requested by
a given URL. This is not a text file, but is encoded as a
Multipurpose Internet Mail Extensions (MIME) document. This service
is activated when the server receives a URL ending with
.dods - ASCII Data
- This service returns an ASCII representation of
the requested data. This can make the data available to a wide
variety of browser programs. This service is activated when the
server receives a URL ending with
.ascor.ascii - Information
- This service returns information about
the server and dataset, in human-readable HTML form. The returned
document may include information about both the data server itself
(e.g. server functions implemented), and the dataset referenced in
the URL. The server administrator determines what information is
returned in response to such a request. This service is activated
when the server receives a URL ending with
.info - Version
- This service returns version information about
the server. This service is activated when the server receives a URL
ending with
.ver
For further details about OPeNDAP request, please check out this link: http://www.unidata.ucar.edu/packages/dods/user/guide-html/
Data Analysis
F-TDS also has analysis capability that allows users to process local or remote datasets before retrieving the resultant dataset. The analysis operation can be a sequence of commands supported by Ferret. And the analysis result can be used as a dataset in another analysis operation. So the power of FDS is only limited by the power of Ferret.The syntax of a F-TDS analysis expression is:
http://machine:port/thredds/dodsC/dataset_expr_{dataset2,dataset3,...}{expression1;expression2;...}.URLsuffix?constraint
The part of URL in red is a F-TDS analysis expression. A F-TDS analysis expression starts with "_expr_" followed by 1 or 2 clauses which are separated by curly brackets:
- The first clause is to describe the datasets that will be used by this F-TDS analysis expression. Datasets in the first curly bracket are comma-separated. They can be local or remote datasets, analysis results from F-TDS, GDS or other OPeNDAP servers.
- The second clause consists of a sequence of operations separated by semi-commas. An operation can either be a Ferret command, a variable or a variable definition. If an operation is a variable or a variable definition (not a Ferret command), the variable will be in the output dataset. If an operation is a Ferret command, the command will be executed by F-TDS.
The result of a F-TDS analysis expression can be viewed as an output dataset file. All the OPeNDAP services described in using OPeNDAP section can be requested upon this output "dataset file".
An simple example of a F-TDS analysis expression is as follows:
http://porter.pmel.noaa.gov:8920/thredds/dodsC/las/NOAA_NCEP_EMC_CMB_Ocean_Analysis_ml/data__iridl.ldeo.columbia.edu_SOURCES_.NOAA_.NCEP_.EMC_.CMB_.Pacific_.monthly_dods.jnl_expr_{}{let A=temp*2}.asc?A
In this analysis expression, F-TDS creates a new variable "A" which is equal to 2 times TEMP. We can show the result using a browser by asking for the data for the A variable in ASCII using the .asc extension.
Another example of F-TDS analysis expression regrids and compares two datasets that are not in the same grid:
http://porter.pmel.noaa.gov:8920/thredds/dodsC/las/NOAA_NCEP_EMC_CMB_Ocean_Analysis_ml/data__iridl.ldeo.columbia.edu_SOURCES_.NOAA_.NCEP_.EMC_.CMB_.Pacific_.monthly_dods.jnl_expr_{http://porter.pmel.noaa.gov:8920/thredds/dodsC/las/coads_climatology_cdf/data_coads_climatology.jnl}{let sst_2_regrid=sst[d=2,gxy=temp[d=1]]-temp[d=1]}
In this analysis expression, F-TDS defines a new variable that is the difference between SST from COADS (a 2x2 degree grid) interpolated to the same grid as TEMP variable from the NCEP Pacific Ocean Analysis (a 1x1 degree grid) and the TEMP variable itself.