[gradsusr] question on reading remote data through opendap
Charles Seman - NOAA Federal
charles.seman at noaa.gov
Tue Sep 3 15:04:47 EDT 2013
Suhung,
I don't know if it would work for opendap files, but you could try a
technique, outlined below, which was developed from information in
3/30/2010 email replies from Jennifer Adams to the GrADS Users Forum to
answer my questions in this area; for searching the email archives, look
for an email subject "GrADS v2.0.a7.oga.3: modifying time axis units":
"The name of the dimension axis has to be one that exists in the file.
Since your variable has no Z or T dimension, use the name of the lon or
lat axis instead of "level" and "time". It doesn't matter what values
those axes contain, since you are overriding them completely with your
own metadata."
here's some code from a script I used in which "lon" is used to define
"zdef" and "tdef" records in the xdfopen data descriptor file used to
open the netCDF file:
---
function TRMM_3B42(args)
...
GrADS_yy = subwrd(args,3) ;* year for GrADS ddf
GrADS_month = subwrd(args,4) ;* month for GrADS ddf
GrADS_dd = subwrd(args,5) ;* day for GrADS ddf
GrADS_hh = subwrd(args,6) ;* hour for GrADS ddf
...
TRMM_ddf = 'TRMM_3B42.xdf'
GrADS_t0 = ''GrADS_hh'Z'GrADS_dd''GrADS_month''GrADS_yy''
say 'GrADS_t0 = 'GrADS_t0
'!rm -f 'TRMM_ddf
res = write (''TRMM_ddf'','dset 'TRMM_ifile'')
res = write (''TRMM_ddf'','zdef lon 1 levels 0')
res = write (''TRMM_ddf'','tdef lon 1 linear 'GrADS_t0' 1mn') ;* use
smallest "dt" available...
res = close (''TRMM_ddf'')
status = sublin(res,1)
if( status != 0 )
say
say '"'TRMM_ddf'" status number = 'status
say 'exiting script...'
say
exit
endif
'xdfopen 'TRMM_ddf
'q ctlinfo'
say
say result
...
---
Hope this helps,
Chuck
On 08/28/2013 02:56 PM, Shen, Suhung (GSFC-610.2)[GEORGE MASON
UNIVERSITY] wrote:
> Hi,
> I am able to read a single file in opendap with sdfopen. For example:
> Sdfopen http://disc2.nascom.nasa.gov/opendap/ncml/TRMM_L3/TRMM_3B42/1998/003/3B42.19980103.03.7.HDF.Z.ncml
>
> Then, I tried to read multiple data files with xdfopen to open the following control file, but it does not work.
>
> dset http://disc2.nascom.nasa.gov/opendap/ncml/TRMM_L3/TRMM_3B42/1998/003/3B42.%y4%m2%d2.03.7.HDF.Z.ncml
> OPTIONS template
> title "TRMM data"
> tdef time 8 linear 03Jan1998 1hr
>
> I got the error message:
> ga-> xdfopen trmm_opendap
> Scanning Descriptor File: trmm_opendap
> gadsdf: Time dimension time is not an SDF dimension.
> SDF Descriptor file trmm_opendap.ctl was not successfully opened & parsed.
>
> GrADS is looking for time dimension variable. However, the data files do not contain a time dimension variable.
>
> Any idea ??
>
> Thanks,
> -suhung
>
>
>
>
>
> ----------------------------------------------------------------
> Suhung Shen, Ph.D
> Goddard Earth Sciences Data and Information Services Center
> NASA/GSFC Code 610.2
> Greenbelt MD 20771
>
> Suhung.Shen at nasa.gov
> (301) 614-5088 (301) 614-5268 (fax)
> http://disc.gsfc.nasa.gov
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.
********************************************************************
Charles Seman Charles.Seman at noaa.gov
U.S. Department of Commerce / NOAA / OAR
Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547
201 Forrestal Road fax: (609) 987-5063
Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/
********************************************************************
"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."
More information about the gradsusr
mailing list