./
opendap_get.pro
This is the main interface routine for the OPeNDAP IDL bindings.
Author information
- Author
-
Patrick West
UCAR/HAO Dan Holloway
Based on IDL-DODS Written by Daniel J. Carr - Research Systems, Inc.
- Copyright
-
Copyright (c) 2006 OPeNDAP, Inc.
This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
topOPENDAP_GET
result = OPENDAP_GET(url [, opendap_data] [, CE=string] [, /DEFLATE] [, MODE=string] [, SEQ_BLOCKSIZE=long] [, /DEBUG])
Main interface routine for IDL-OPENDAP link.
opendap_get sets up the environment, and then calls opendap_get_das or opendap_get_data to establish a connection and return the appropriate OPeNDAP data.
The DAP data ("opendap_data" parameter) is returned as an IDL structure
variable. The IDL structure will have one tag for each DAP variable that is
returned, and the tag name is the same as the DAP name for that variable.
For simple DAP variables, the value of the corresponding IDL structure tag
will be an IDL scalar value. Other DAP variable types will be returned as
nested structures:
DAP data type Returned IDL structure
--------------------- ------------------------------------------------
ARRAY { ARRAY: data,
START_STRIDE_STOP: fltarr(3, N),
DIMENSION_NAMES: strarr(N) }
GRID { GRID: data,
dimension_name_0: dimension_data_0,
...
dimension_name_n: dimension_data_n }
NOTE: the grid dimension names are optional -
not all grids will have them.
STRUCTURE { var_name_0: var_data_0,
...
var_name_n: var_data_n }
SEQUENCE { record_name_0: record_data_0,
...
record_name_n: record_data_n }
NOTE: each record_data field corresponds to a
sequence "column".
Tag names in capital letters are literal. Other tag names are derived from
the DODS data.
Return value
Status (1=ok, 0=fail)
Parameters
- url in required type=string
URL location to connect to.
- opendap_data out optional type=structure
Returns the requested DODS data as an IDL structure.
Keywords
- CE in optional type=string
Data constraint expression.
- DEFLATE in optional type=boolean default=1
ACCEPT_DEFLATE flag (1=yes (default), 0=no).
- MODE in optional type=string
Flag for the type of data to retrieve (0 or 'DATA' for the data (default), 1 or 'DAS' for the DAS)
- SEQ_BLOCKSIZE in optional type=long default=4096
How many elements should be allocated at once for sequence data; default value is 4096
- DEBUG in optional type=boolean
set to print out debug information
Examples
Using OPENDAP_GET to retrieve all the data at an URL is quite simple:
IDL> url = 'http://test.opendap.org/opendap-3.4/nph-dods/data/nc/fnoc1.nc'
IDL> stat = opendap_get(url, data)
IDL> print, stat
1
IDL> help, data, /structures
** Structure <824e1a4>, 5 tags, length=23172, data length=23172, refs=1:
U STRUCT ->
Single variables or even slices of a variable can also be retrieved:
IDL> help, data, /structures
** Structure <1f29584>, 1 tags, length=11460, data length=11460, refs=1:
U STRUCT ->
or:
IDL> stat = opendap_get(url, data, ce='u[0][0:1:16][0:1:15]')
IDL> help, data, /structures
** Structure <1f29af4>, 1 tags, length=568, data length=568, refs=1:
U STRUCT ->
Attributes can be optained as well:
IDL> stat = opendap_get(url, data, mode='das')
IDL> help, data, /structures
** Structure <207b604>, 7 tags, length=212, data length=209, refs=1:
U STRUCT ->
File attributes
Modifcation date: | Sun Feb 17 21:21:17 2008 |
Lines: | 245 |
Docformat: | rst rst |