[gradsusr] xdfopen via opendap (developed from re Re: sdfopen with opendap file)

Jennifer Adams jma at cola.iges.org
Tue Jun 21 08:43:24 EDT 2011


On Jun 20, 2011, at 3:57 PM, James T. Potemra wrote:

> Takaya:
>
> I don't think that the template option works with data via OPeNDAP,  
> only on
> local files.
That is incorrect. Templating works on OPeNDAP URLs the same way it  
works on local file names, you need to add 'options template' to the  
descriptor file.

As for the descriptor file, this is what works for me:

dset http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/ 
%y4/%y4%m2.s04m1pfv50-bsst-16b.hdf
dtype netcdf
options yrev template
title Please Put An Accurate Title in Every Descriptor File
undef 0
unpack scale_factor add_off
xdef 8192 linear -180 0.043945
ydef 4096 linear -90 0.043945
zdef 1 linear 0 1
tdef 12 linear 00z01JAN1985 1mo
vars 1
bsst 0 y,x temperature
endvars

The xdfopen interface wouldn't find the unpacking attribute names  
because they are non-standard ("add_off"), so a full descriptor is  
necessary. You can expand the tdef statement to include all the years  
in the data set, I just used 12 to make sure the templating was working.

--Jennifer



> The data provider needs to aggregate the data on the server
> side
> of things. Otherwise, you will have to write your script to loop  
> through
> all the
> files.
>
> You are also welcome to get the Pathfinder SST from our site,
> http://apdrc.soest.hawaii.edu.
> The exact URL is:
>
> http://apdrc.soest.hawaii.edu:80/dods/public_data/satellite_product/AVHRR/avhrr_mon
>
> for the monthly values (and these are aggregated).
>
> Jim
>
> Namba Takaya wrote:
>> Dear Sir
>>
>> I tried to read the HDF file of pathfinder monthly sst via opendap
>>
>> Fortunately I could read the sst data by xdfopen and data descriptor
>> file(bsst.ctl) as bellow,
>> Then I tried to develop using % of DSET in the data descriptor file.
>> Then I have a problem explained below and could you tell me how to
>> solve the problem?
>>
>> Best Regards, Takaya Namba
>>
>> bsst.ctl (data descriptor file)
>>
>> DSET
>> http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/1985/198501.s04m1pfv50-bsst-16b.hdf
>> options yrev
>> ***DSET
>> http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/ 
>> %y4/%y4%m2.s04m1pfv50-bsst-16b.hdf
>> TITLE This is a sample
>> UNDEF 99999.0
>> YDEF lat 4096 LINEAR -90 0.043945
>> XDEF lon 8192 LINEAR -180 0.043945
>> ***TDEF time 1 linear 00:00z1! 5JAN1985 1mo
>> VARS 1:
>> bsst=>bsst 1 99 surface temperature
>> ENDVARS
>>
>>
>> However, I would like to use
>> DSET
>> http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/ 
>> %y4/%y4%m2.s04m1pfv50-bsst-16b.hdf
>> instead of
>> DSET
>> http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/1985/198501.s04m1pfv50-bsst-16b.hdf 
>> .
>> Because I would like to do all the thirty years from jan 1988 to  
>> 2009.
>>
>> I added the line in the bsst.ctl
>> TDEF time 1 linear 00:00z15JAN1985 1mo
>> and then
>> grads -cl batch-opendap.gs.
>>
>> However, the error comes like below,
>>
>> Error: nc_open failed to open file
>> http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/ 
>> %y4/%y4%m2.s04m1pfv50-bsst-16b.hdf
>> NetCDF: DAP server error
>> gadsdf: Couldn't i! ngest SDF metadata.
>> SDF Descriptor file bsst.ctl was not suc cessfully opened & parsed.
>>
>> I understand that I could not replace /%y4/%y4%m2 with /1985/198501  
>> by
>> the data descriptor file.
>> Could you tell me how can I replace by the proper descriptor file  
>> as I
>> expected?
>>
>> (batch-opendap.gs grads script file)
>> 'set gxout shaded'
>> 'xdfopen bsst.ctl'
>> 'q file'
>> say result
>> 'set lat 10 50'
>> 'set lon 120 170'
>> 'set T 1'
>> 'set Z 1'
>> 'd bsst'
>> 'cbar'
>> 'quit'
>>
>>
>> dncdump -h
>> "http://data.nodc.noaa.gov/opendap/pathfinder/Version5.0/Monthly/1985/198501.s04m1pfv50-bsst-16b.hdf 
>> "
>>
>> is as below,
>>
>> netcdf 198501.s04m1pfv50-bsst-16b { // format variant: 64bit
>> dimensions:
>> lat = 4096 ;
>> &n! bsp; lon = 8192 ;
>> variables:
>> short bsst(lat, lon) ;
>> bsst:dsp_PixelType = 1b ;
>> bsst:dsp_PixelSize = 2b ;
>> bsst:dsp_Flag = 0s ;
>> bsst:dsp_nBits = 16s ;
>> bsst:dsp_LineSize = 0 ;
>> bsst:dsp_cal_name = "Temperature" ;
>> bsst:units = "Temp" ;
>> bsst:dsp_cal_eqnNumber = 2s ;
>> bsst:dsp_cal_CoeffsLeng! th = 8s ;
>> &n bsp; bsst:dsp_cal_coeffs = 0.075f, -3.f ;
>> bsst:scale_factor = 0.075f ;
>> bsst:add_off = -3.f ;
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110621/e56d7a02/attachment-0003.html 


More information about the gradsusr mailing list