[Thread Prev][Thread Next][Index]
Re: How to define grided variable from point data
On Mon, 15 Nov 2004, Yogesh K. Tiwari wrote:
> I have the point data like :
> title I J K L
> CO2_sat -- -- -- 1:1860206
> lat -- -- -- 1:1860206
> lon -- -- -- 1:1860206
> year -- -- -- 1:1860206
> mo -- -- -- 1:1860206
> day -- -- -- 1:1860206
> hour -- -- -- 1:1860206
> minut -- -- -- 1:1860206
> here L is number of index.
> ++++ I want to compute the average column burdon of
> CO2_sat as a function of latitude, long, time.
Hi Yogesh,
While there would be ways based on the various "scat2grid"
functions, a simple minded approach in which a series of masks are
used to isolate regions within the region, may be appropriate.
Separate zonal, meridional, and time averages are easy to
illustrate, as in the demo below, but 2-d or 3-d masks would be
possible with nested "repeat" loops.
For example the zonal averages at 85S, 75S, ... 85N in a
globe-spanning dataset could be found using:
let lat0=-90 ; let dlat=10
sp touch zoneav.d ! prepare file to accept values
repeat/k=1:18 (go zoneav) ! put results into the file using append
def axis/y=85S:85N:10/units=latitude ylat ! recover results
def grid/y=ylat glat
file/form=free/g=glat/var=mylat,myav,npts zoneav.d
plot myav
where you have previously created the following script.
!********************* zoneav.jnl ***************************
let lat1=(`k`-1)*dlat + lat0
let lat2=lat1+dlat
let co2mask=if(lat ge lat1 and lat lt lat2)then co2_sat
list/nohead/app/form=(f5.1,e12.4,f8.0)/file=zoneav.d \
lat1+dlat/2,co2mask[l=@ave],co2mask[l=@ngd]
!************************************************************
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement