comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » aggregate pixel values within shapes or another raster
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
aggregate pixel values within shapes or another raster [message #69391] Thu, 14 January 2010 01:54 Go to next message
ivitseva is currently offline  ivitseva
Messages: 15
Registered: December 2009
Junior Member
Dear All,
I have a time series of images (yearly data) on 1km spatial resolution
and I have a systematic grid in an ArcGIS shapefile format or a ArcGIS
grid format or envi BIL format, whatever suits best that has a 25km
spatial resolution. I need to calculate the mean and standard
deviation of all pixels within 1 grid zone, for all years and write
them out in a new image. Thus, in case of 26 input years on 1km
spatial resolution I need to have 26 output images on 25km spatial
resolution, where in each 25km cell the mean and/or the standard
deviation of the 1km cells within the respective grid is written.
Besdies opening and reading the files (at least that I have no
problems with) any clue please how to start it? Thank you very much in
advance, Eva.
Re: aggregate pixel values within shapes or another raster [message #69512 is a reply to message #69391] Mon, 18 January 2010 00:06 Go to previous message
wita is currently offline  wita
Messages: 43
Registered: January 2005
Member
Dear Itiseva,

Have a look at: ftp://sc:image1@ftp.alterra.nl/pub/adewit/cgi_zonal_stats.pr o

It is basically as simple as:

result = cgi_zonal_stats(zones, data)

Results is a structure which contains the zone_id, mean, count, stdev
and median of the values in 'data' (each layer in your time-series)
for each unique zone in 'zones' (your 25km grid). A requirement is
that 'zones' and 'data' are on the same grid, so resample your 25km
grid to your 1km data grid.

The function leverages the power of HISTOGRAM module by looping over
the reverse indices returned by HISTOGRAM and is therefore maybe
faster then David's solution. Moreover, my routine can aggregate data
over arbitrary shaped zoned and not just within kernel.

My guess is that this is exactly what you need.

Hope this helps

Allard
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: eMake Money Rs. 1000 per day
Next Topic: How can we pass Greek symbols and formula to IPLOT?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:35:58 PDT 2025

Total time taken to generate the page: 0.00653 seconds