[gradsusr] Regrid or constrain grid dimensions after opening grib file?

Jeff Duda jeffduda319 at gmail.com
Fri Feb 12 14:39:07 EST 2021


If you have a PDEF line in your control file or the XDEF and YDEF lines
have different numbers for dimension sizes than what is in the PDEF entry
then GrADS will perform interpolation before plotting values, which is
probably the cause of your slowdown. Your only hope is to not make GrADS
perform the interpolation. I'm not sure if that is readily done. I would
recommend performing interpolation outside of GrADS in general.

Jeff Duda

On Fri, Feb 12, 2021 at 11:02 AM Brian Gaze <brianw.gaze at googlemail.com>
wrote:

> Jeff,
>
> Thanks. Perhaps I didn't explain well. That is what I do at the moment,
> but if a script generates X number of charts for a region it seems to
> complete much more quickly if the grib file has been regridded for that
> region rather than constrained using set lat and set lon. Perhaps the
> overhead is in opening the bigger file?
>
> Brian
>
>
>
> On Fri, 12 Feb 2021 at 17:05, <gradsusr-request at gradsusr.org> wrote:
>
>> Send gradsusr mailing list submissions to
>>         gradsusr at gradsusr.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         http://gradsusr.org/mailman/listinfo/gradsusr
>> or, via email, send a message with subject or body 'help' to
>>         gradsusr-request at gradsusr.org
>>
>> You can reach the person managing the list at
>>         gradsusr-owner at gradsusr.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of gradsusr digest..."
>>
>>
>> Today's Topics:
>>
>>    1. Regrid or constrain grid dimensions after opening grib    file?
>>       (Brian Gaze)
>>    2. Re: Regrid or constrain grid dimensions after opening     grib
>>       file? (Jeff Duda)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 12 Feb 2021 16:39:13 +0000
>> From: Brian Gaze <brianw.gaze at googlemail.com>
>> To: gradsusr at gradsusr.org
>> Subject: [gradsusr] Regrid or constrain grid dimensions after opening
>>         grib    file?
>> Message-ID:
>>         <CA+pnuaOwvxJa4MwLg6Y02tNooCK0S7gsadx8FExnFe=
>> FkfOprA at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi,
>>
>> I know it is relatively straightforward to define a new grid using wgrib2
>> but I wondered whether it is possible to do something similar in GRaDS? So
>> just storing the new grid temporarily in memory whilst the script is
>> working on the file data, for example to generate charts for a smaller
>> region than the original grid covers.
>>
>> Essentially I'm trying to optimize without going through the overhead of
>> writing out a new file using wgrib2.
>>
>> Thanks
>>
>> Brian
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://gradsusr.org/pipermail/gradsusr/attachments/20210212/8b81df8c/attachment-0001.html
>> >
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Fri, 12 Feb 2021 09:49:20 -0700
>> From: Jeff Duda <jeffduda319 at gmail.com>
>> To: GrADS Users Forum <gradsusr at gradsusr.org>
>> Subject: Re: [gradsusr] Regrid or constrain grid dimensions after
>>         opening grib file?
>> Message-ID:
>>         <
>> CAAig09AFSEWXmiGvuSmBhBq-PmAJWRTpMfMAfxBAg8awL3QOdg at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Yes. Restrict the dimension environment.
>>
>> 'set lat [bounds]'
>> 'set lon [bounds]'
>> 'set t [bounds]'
>> 'set z [bounds]'
>>
>> 'define field'
>>
>> (perform operations on field)
>>
>> On Fri, Feb 12, 2021 at 9:47 AM Brian Gaze <brianw.gaze at googlemail.com>
>> wrote:
>>
>> > Hi,
>> >
>> > I know it is relatively straightforward to define a new grid using
>> wgrib2
>> > but I wondered whether it is possible to do something similar in GRaDS?
>> So
>> > just storing the new grid temporarily in memory whilst the script is
>> > working on the file data, for example to generate charts for a smaller
>> > region than the original grid covers.
>> >
>> > Essentially I'm trying to optimize without going through the overhead of
>> > writing out a new file using wgrib2.
>> >
>> > Thanks
>> >
>> > Brian
>> >
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>>
>>
>> --
>> Jeff Duda, Research Scientist
>> University of Colorado Boulder
>> Cooperative Institute for Research in Environmental Sciences
>> NOAA/OAR/ESRL/Global Systems Laboratory
>> Boulder, CO
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <
>> http://gradsusr.org/pipermail/gradsusr/attachments/20210212/94459998/attachment-0001.html
>> >
>>
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>> ------------------------------
>>
>> End of gradsusr Digest, Vol 132, Issue 2
>> ****************************************
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>


-- 
Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Laboratory
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20210212/457e0a52/attachment-0001.html>


More information about the gradsusr mailing list