TEST_OPENDAP(url)
Returns the status flag from attempt to open an OPeNDAP URL or local NetCDF file.
url: OPeNDAP URL to test (STRING)
A status flag of 0 means successful access.
Arguments: |
URL |
String, the URL to try |
Result Axes: |
X |
ABSTRACT |
Y |
NORMAL |
|
Z |
NORMAL |
|
T |
NORMAL |
Examples: First a valid URL. The code for Success is 0.
yes? LIST test_opendap ("http://test.opendap.org/opendap/data/nc/test.nc") VARIABLE : TEST_OPENDAP ("http://test.opendap.org/opendap/data/nc/test.nc") X : 1 0.0000
Here is a test of an invalid URL
yes? LIST test_opendap ("http://not_a_valid_server/test.nc") VARIABLE : TEST_OPENDAP ("http://not_a_valid_server/test.nc") X : 1 1001.
The function may also be run on local files, returning 0 for success and a non-zero flag for failure to open the dataset as a netCDF file, however if the file is not in the current working directory then the specification must include the path on the local file system. (Ferret's "USE" command searches the directories that are included in the FER_DATA environment variable; the TEST_OPENDAP function does not.) It does not operate on file types other than netCDF files.
yes? LIST test_opendap ("myfile.nc") VARIABLE : TEST_OPENDAP ("myfile.nc") X : 1 0.0000 yes? LIST test_opendap("this_file_doesnt_exist.nc") VARIABLE : TEST_OPENDAP("this_file_doesnt_exist.nc") X : 1 2.000