[ncl-talk] Opendap retrieve only a subset of data
Rick Brownrigg
brownrig at ucar.edu
Mon Jul 11 10:33:29 MDT 2016
Hi Ugo,
Apologies for the delay in reply. I don't know the issue for certain, but
I think the query syntax should something more like this:
"
http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs20160701/gfs_0p25_00z?lon[9],lat[40],tmp2m[0:80][40][9]
This seemed to work for me -- I got the time-series at the point 40N, 9E.
What I could not do was use wild-card notation for specifying I wanted all
times, e.g., tmp2m[:][40][9]. The syntax seems to accept only explicit
single-values, or a start:stop pair, or a start:stop:stride tuplet. That
means I had to look at the metadata of the source file first to know how
many time values were present -- a nuisance at best and a potential source
of error at worst.
I hope that helps...
Rick
On Sat, Jul 2, 2016 at 3:50 AM, Ugo Merlini <umerlini at enet.it> wrote:
> Hi
>
> Sorry I forgot to say I have the opendap version installed also forgot to
> say that this string only retrieve the variables list after the question
> mark for example this line retrive lon, lat and tmp2m variables
>
>
> http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs20160701/gfs_0p25_00z?lon
> [9],lat[40],tmp2m
> but it grab all tmp2m all over the world when I'm interestest to tmp2m at
> logitude 9 and latitude 40
>
> I have many variables to download at the same position so a subregion
> limitation will save time
>
> Ugo
>
>
> Il 01/07/2016 23:37, Rick Brownrigg ha scritto:
>
> Hi,
>
> Are you getting the "Either file doesn't exist, or NCL does not have
> OPeNDAP capabilities on this system" message, or some other error -- I'm
> getting a SEGV out of the isfilepresent() function call. Ncl is
> optionally built with OpenDAP, and it may be that your version was built
> without it?
>
> Rick
>
>
> On Fri, Jul 1, 2016 at 1:03 PM, Ugo Merlini <umerlini at enet.it> wrote:
>
>> I'm trying to to retrieve form ncep opendap server asubset of data
>> limiting the usage of the internet band speed up all the script. In
>> Grads and in NCO is possibile (but this last give me many reading error)
>> is there a way to it in NCL?
>>
>> Regards
>> Ugo
>>
>> here my script
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/calendar_decode2.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl"
>>
>> begin
>> data_sistema =systemfunc("date -d '-1 day' +'%Y%m%d'")
>>
>> http1 = "http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs"
>> http2 = systemfunc("date -d '-1 day' +'%Y%m%d'")
>> http3 = "gfs_0p25"
>>
>>
>> filename = http1 + http2 + "/" + http3 + "_00z"
>> data_run_temp = data_sistema + " 0000"
>> data_run = systemfunc( "date -u -d '"+ data_run_temp +"' '+%s'" )
>> run = "gfs_0p25_00"
>> print(filename)
>>
>>
>>
>> exists = isfilepresent(filename)
>> if(.not.exists) then
>> print("OPeNDAP isfilepresent test unsuccessful.")
>> print("Either file doesn't exist, or NCL does not have OPeNDAP
>> capabilities on this system")
>> else
>> print("OPeNDAP isfilepresent test successful.")
>> gfs = addfile(filename,"r")
>> vars = getfilevarnames(gfs)
>> end if
>>
>> end
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160711/99251e43/attachment.html
More information about the ncl-talk
mailing list