; IDL-OPENDAP interface. ; Copyright (c) 2006 OPeNDAP, Inc. ; Author: Patrick West UCAR/HAO ; Dan Holloway ; ; Based on IDL-DODS Written by Daniel J. Carr - Research Systems, 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. ; Function to establish a connection and get the DAS for a ; OPeNDAP dataset ; ; url - (Input ) ; URL location to connect to. ; ce - (Input ) ; Data constraint expression. ; opendap_data - (Output) ; Returns the requested OPeNDAP data as an IDL structure. ; deflate - (Optional input flag) ; ACCEPT_DEFLATE flag (1=yes (default), 0=no). ; mode - (Optional input flag) ; MODE flag (2=das (default), 5=fulldas). ; returns - ; Status (1=ok, 0=fail). FUNCTION OPENDAP_GET_DAS, url, opendap_data, CE=ce, $ DEFLATE=deflate, MODE=mode, debug ;{ root_node = 0ul conn = OPENDAP_CONNECT( [BYTE(STRTRIM(url[0], 2)), 0B], $ [BYTE(STRTRIM(ce[0], 2)),0B], $ root_node, $ ULONG(KEYWORD_SET(deflate)), $ ULONG(mode) ) IF( ( conn EQ 0ul ) OR ( root_node EQ 0ul ) ) THEN BEGIN ;{ PRINT, 'failed to retrieve opendap data' RETURN, 0ul ENDIF ;} status = 0ul ; Handle the root node status = OPENDAP_HANDLE_NODE( opendap_data, root_node, 0ul, debug ) RETURN, status ;} END