I think RB is correct.
I think (1) NLDAS files are in GRIB format
(2) one file per time
I have little experience with OPeNDAP but something like
setfileoption("grb","SingleElementDimensions","Initial_time") ;
force time dimension
diri = "..." ; input directory
fili = systemfunc("cd "+diri+" ; ls NLDAS*grb")
fin = addfiles(diri+fili, "r")
latS = 39.5
latN = 41.5
lonL = -83.5
lonR = -81.5
d = fin->apcpsfc(:, {latS:latN}, {lonL:lonR})
printVarSummary(d)
; you could save this to a netCDF
On 3/12/13 10:39 AM, Rick Brownrigg wrote:
> Hi Noel,
>
> I'm not expert at this, but I think you'd subset something like:
>
> d = fin->apcpsfc(:, {39.5:41.5}, {-83.5:-81.5})
>
> I did this using a small subset of the time dimension, and the spatial subsetting seemed to be right.
>
> However, using ":" for time above is not quite right. I don't understand the time coordinate in this file -- the values all seem to be zeros. If I understand "time"s metadata, I think you'd have to calculate indices N and M for your start/stop times and specify it as:
>
> d = fin->apcpsfc(N:M, {39.5:41.5}, {-83.5:-81.5})
>
> I hope that helps…
> Rick
>
> On Mar 12, 2013, at 10:11 AM, Noel Aloysius <noel.aloysius@gmail.com> wrote:
>
>> Hello NCL-talk,
>>
>> I want to extract a subset (lat 39.5 to 41.5 and lon -83.5 to -81.5) of hourly precipitation for the period 1979-2012 from the NLDAS-2 OPeNDAP archives.
>>
>> I am not sure how to define the subset.
>>
>>
>> f1 = "http://hydro1.sci.gsfc.nasa.gov:80/dods/NLDAS_FORA0125_H.002"
>> exists = isfilepresent(f1)
>> print("File: <" + f1 + ">, existence: " + exists) ; returns the following
>>
>> (0) File: <http://hydro1.sci.gsfc.nasa.gov:80/dods/NLDAS_FORA0125_H.002>, existence: True
>>
>> fin = addfile(f1, "r")
>>
>> At this point, I am not sure how to define the subset of the variable apcpsfc (precipitation hourly total (kg/m^2)
>>
>> Thanks in advance for the help.
>>
>> I am using NCL 6.1.2 DAP-enabled version.
>>
>> Thanks,
>> Noel
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 12 11:55:01 2013
This archive was generated by hypermail 2.1.8 : Wed Mar 13 2013 - 14:19:38 MDT