[gradsusr] xdef and ydef problem

Arlindo da Silva dasilva at alum.mit.edu
Tue Apr 26 12:09:49 EDT 2011


On Tue, Apr 26, 2011 at 9:49 AM, Jackie Yip <zheng.yip at mcgill.ca> wrote:

> Thank you, Arlindo. The problem is solved... there was a mistake in the
> argument of re(). But if I was to use the lats4d option you suggested, why
> is the input file a ctl instead of the netcdf file of my data?

Or is that input.ctl the same ctl as I'd use to open that netcdf file inside
> grads using xdfopen?
>
>
The input file is specified with the "-i" option; any grads readable file is
acceptable.

When doing regridding with lats4d you need to specify a dimension
environment file given at the target resolution ("-de" option). Again, it
does not have to be a ctl, any grads readable file would do it.

   Arlindo




> Jackie
>
> On 25 April 2011 21:04, Arlindo da Silva <dasilva at alum.mit.edu> wrote:
>
>> 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
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> 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/20110426/03532326/attachment-0003.html 


More information about the gradsusr mailing list