[Thread Prev][Thread Next][Index]
Re: padding a data set
Hi Brent,
How about the @NRST regridding transformation? This puts
your data wherever it exists onto the new larger grid and missing
data everywhere else.
yes? define axis/y=90s:90n:2.5 newy
yes? let ztend = hgttend[d=1,gy=newy@nrst]
yes? save/file=test.nc/i=1/l=1 ztend
The @XACT transformation could be used in a similar way, if
you define the new axis to exactly match the existing smaller axis.
Ansley Manke
Brent A McDaniel wrote:
> Hi,
>
> A simple question but one that's stumping me. I have data on a lat/lev
> grid where lat goes from -2.5:90:2.5spacing (38 pts). For an existing
> code, I need to put this onto a -90:90:2.5spacing grid (73 points). The
> numbers that are stored in the -90:-5 section (the new section) don't
> matter, i just need the data to have the proper dimensions. I tried to
> define a new global axis and regrid to that.
>
> yes? define axis/y=90s:90n:2.5 newy
> yes? let ztend=hgttend[d=1,gy=newy@asn]*0 !pad the new section with zeroes
> yes? save/file=test.nc/jlimits=1:73/j=1:35 ztend !write the new section to
> a file
> !this part works fine
> yes? let ztend=hgttend[d=1,gy=newy@asn] !now define the real data
> yes? save/file=test.nc/append/i=1/l=1/jlimits=1:73/j=36:73 ztend
>
> This approach doesn't work though. I understand why it doesn't work but I
> don't know how to shift the axis so that the proper data is written for
> the block -2.5:90. I need to @asn the good data to the last 38 points on
> the new axis but how?
>
> Any help is appreciated!
>
> Cheers,
>
> Brent
>
> --
> Brent A. McDaniel
>
> Dept of Earth and Atmospheric Sciences
> Georgia Institute of Technology
> Atlanta, Ga. USA
--
Ansley Manke Pacific Marine Environmental Laboratory Seattle WA
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement