[gradsusr] xdef and ydef problem

Arlindo da Silva dasilva at alum.mit.edu
Mon Apr 25 21:04:37 EDT 2011


On Fri, Apr 22, 2011 at 2:36 PM, Jackie Yip <zheng.yip at mcgill.ca> wrote:

> Hi everyone,
>
> I'm using the re() function of GrADs 2.0.a9.oga.1 to regrid my data. As my
> data is in netcdf format and it has 365 day calendar. I created a descriptor
> file (.ctl) to xdfopen it. The regridding seem to work fine and I fwrited it
> out as a grads binary (.dat) file. To view this regridded data, I created
> another descriptor file. When I tried to view this regridded data on grads,
> it has a diagonal strip of missing data. This problem disappeared once I
> have increased my xdef value by 1. Although now the regridded data looks
> right, I've found that the data shifts down off the map grid with time (e.g.
> at timestep 2, the data is about 2 gridcells unaligned to the map grid.).
>
> Is this a problem related to the ydef in the descriptor file?
>
>
A couple of things to watch for.

1) make sure grads is not doing any longitudinal wrapping; to be sure do a
"q file" and "set x 1 $xsize" and $xsize is the size of the x-dimension.

2) if you fwrite your data (as a plain binary stream) make sure your ctl
does not specify the file as "sequential" (or vice versa)

Another possibility is to use lats4d.sh to regrid your file. Let
"newgrid.ctl" be a ctl for a file on the new grid resolution (use "options
template" so the data file does not have to exist). Then from the shell
command line issue something like this:

% lats4d.sh -i input.ctl -o output -de newgrid.ctl -func 're(@,1)' -v

By default this will create a netcdf file (output.nc) on the new grid, use
-format for specifying a different format; "lats4d.sh -h" gives a man page.

  Good Luck,

    Arlindo





    Arlindo









> Jackie
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


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


More information about the gradsusr mailing list