[gradsusr] Enc: regriding problem

Arlindo da Silva dasilva at alum.mit.edu
Wed Nov 9 10:04:39 EST 2011


On Tue, Nov 8, 2011 at 12:13 PM, Jennifer Adams <jma at cola.iges.org> wrote:

>
> On Nov 7, 2011, at 2:46 PM, Arlindo da Silva wrote:
>
> On Mon, Nov 7, 2011 at 10:11 AM, Arlindo Meque <mequitomz at yahoo.com.br>wrote:
>
>>   Dear  all,
>>
>>
>> 1. I have a forecast file (1.875X1.25)  with 192 points in x-direction
>> and 145 points in y-direction. I am trying to regrid the file to match the
>> observation (2.5X2.5) with 144 points in x-direction and 72 points on
>> y-direction
>>
>>
>> 2. I am able to create the  regridded file, the problem is  that the
>> dimensions of the regridded file do not much those of the observation file,
>> so I am not able to make the diffidence between the forecast and the
>> observation.
>>
>> 3. Please find attached the forecast and observed file along with the
>> regriding script.
>>
>>
> This more of a question for Jeniffer as I am not sure how sdfwrite figures
> out the coordinate variables of the output file (does it use the
> coordinates of the default file?).
>
> The sdfwrite copies the coordinate information from the default file at
> the time the 'define' command was invoked.
> I have no idea what the re() function does when it returns the new grid.
> If you used lterp instead, you would have the right coordinate info because
> it's attached to the destination grid expression.
>
>
Function re() works the same way as sdfwrite: the new coordinate
information (the one the data has been interpolated to) is also returned.
The main difference is that re() allows you to specify the coordinates of
the destination gridded field without the need to have an open file that
matches that destination grid. (I should include a gsUDF to implement an
interface similar to lterp, I like its convenience.)

Since lats4d derives the coordinates of the destination file from the
default file this can lead to trouble if one is not careful. In such cases,
the user must provide a "dimension environment" file (option is "-de
filename") with a valid file with the destination coordinates. The data
file does not actually have to exist, it is sufficient to created a
templated ctl, no need to have any actual data file created. (However, if
you do have a file on that destination grid, just specify it with the -de
option).

For convenience I have build a number of options in lats4d to perform
regridding to a number of popular grids (like from MERRA, ERA and NCEP
reanalyses, GPCP, etc). These options create the "dimension environment"
ctl on the fly for you. You can see what is available with

% lats4d.sh -h

from the OS command line or with

ga-> lats4d -h

from the grads command line. This "manual page" also has a section on
REGRIDDING that gives more information on how to do regridding with lats4d.

   Arlindo



-- 
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111109/40c9155c/attachment-0003.html 


More information about the gradsusr mailing list