Darren:
1) Running means could be set up in GX using an algorithm such as the
following:
- create an array big enough to hold the biggest window you'll need (windows
should be odd numbers, so the center is really at the center)
- fill it with dummy values to indicate values NOT to be included in the
average.
- create variables to hold 1) the sum of the current values in the array and
2) the number of valid (non-dummy) values in the array.
- create a counter to walk through the array, so that you know where to put
each additional point.
- create a variable which gives the current window center. This of course
begins well outside the data, as the average works its way into the data.
- walk along the line one point at a time. For each point, subtract the
current value at the counter location from the sum, then put the new value
at the same position, and add it to the sum. Keep track of the number of
current values at the same time (you may replace a dummy with a valid item,
so the number of valid items would increase by 1).
- when the window center is inside the data, get the current average, using
the sum of values and number of values, and write it to an output VV.
- keep walking through until the window center passes the end of the data.
Of course at the end you won't be adding any new values, just taking values
off....
I think I may write such a function myself, and add it to VVU.GXH...
2) There is no single-step "canned" routine to do what you want, but it can
be done in a few short steps:
a) Create a polgon mask using the POLYDEF GX (Mapping|Masking|Create polygon
mask...).
b) Create a new "MASK" channel (type byte, for instance). Copy the X channel
into it, so it actually has values, then set it all to "1"
c) Run the POLYMASK GX (XUtility|Polygon mask...), and set values outside
the polygon to be dummies.
d) Select the all the data in the channel, then run the STAT GX
(Utility|Report|Mark statistics...) to count the number of valid items in
the MASK channel. Done.
This could all be done from a single GX by combining the above operations,
and selecting what you need from each GX.
Stephen Cheesman
Geosoft Inc.
-----Original Message-----
From: Darren Mortimer [mailto:[EMAIL PROTECTED]]
Sent: April 25, 2001 6:22 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [gxnet]: Running mean and node counting
Hi
I was wondering if anyone has any comments or hints for a couple
things I'm trying to do.
1) Calculate a 'running' mean, mode, and min of a channel over a given
interval - say 80 to 100 data points. Storing the results in a new channel
at the mid-point ie at the 40th point in the case of 80 points. This can be
done in a spreadsheet but I was hope to avoid have to export and
reimport the data.
2) Count the number of data points that would fall within given
sub-areas or windows. The sub-areas are usually squares if it
matters/helps. I could go through windowing the data, but has anybody
tried to automate this other than with a script and a series of mask files.
Thanks
Darren
_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html
List Archive http://www.mail-archive.com/gxnet@lists.geosoft.com
_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html
List Archive http://www.mail-archive.com/gxnet@lists.geosoft.com