On Tue, Apr 26, 2011 at 9:49 AM, Jackie Yip <span dir="ltr"><<a href="mailto:zheng.yip@mcgill.ca">zheng.yip@mcgill.ca</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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? </blockquote>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Or is that input.ctl the same ctl as I'd use to open that netcdf file inside grads using xdfopen? <div>
<br></div></blockquote><div><br></div><div>The input file is specified with the "-i" option; any grads readable file is acceptable.</div><div><br></div><div>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.</div>
<div><br></div><div> Arlindo</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div></div><font color="#888888"><div>Jackie</div>
</font><div><div></div><div class="h5"><br><div class="gmail_quote">On 25 April 2011 21:04, Arlindo da Silva <span dir="ltr"><<a href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On Fri, Apr 22, 2011 at 2:36 PM, Jackie Yip <span dir="ltr"><<a href="mailto:zheng.yip@mcgill.ca" target="_blank">zheng.yip@mcgill.ca</a>></span> wrote:<br></div></div><div class="gmail_quote">
<div><div></div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone, <div><br></div><div>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.). </div>
<div><br></div><div>Is this a problem related to the ydef in the descriptor file? </div><div><br></div></blockquote><div><br></div></div></div><div>A couple of things to watch for.</div><div><br></div><div>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.</div>
<div><br></div><div>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)</div><div><br></div><div>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:</div>
<div><br></div><div>% lats4d.sh -i input.ctl -o output -de newgrid.ctl -func 're(@,1)' -v</div><div><br></div><div>By default this will create a netcdf file (<a href="http://output.nc" target="_blank">output.nc</a>) on the new grid, use -format for specifying a different format; "lats4d.sh -h" gives a man page.</div>
<div><br></div><div> Good Luck,</div><div><br></div><div> Arlindo</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> Arlindo</div><div><br></div><div><br></div><div><br></div><div>
<br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div><font color="#888888"><div>Jackie</div>
</font><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a><br>
</font><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>