Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

TEST_OPENDAP

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