|
Ken,
I saw
you email a week ago and only now have had a chance to respond to
your
need
to min/max averages over variable filter areas. Several
thoughts:
- Have a look at the various DEM filters, algorithms
from Jo Wood, that John Dehls kindly
coded and provided as user based C filters
specifically for DEM work (thanks John!).
These do some interesting work for DEM
enhancements.
- As it look like you have already found, C based
filter (kernel) functions will be the best
approach to your specific requirement.
- Have a look at <ER Mapper
path>\usercode\kernel\c for some examples,
and the "Writing compiling usercode on PCs" section of the
"Customizing" manual
- When you define the kernel interface to your C
function, you specify the default filter
size. However, you can override this by clicking
on the filter icon in the algorithm window,
and changing the size of the filter at a later time
(assuming your C function can handle
different kernel sizes, of course). Various examples
show how your code gets passed
the array of numbers, including the size. "Average.c"
is a good simple example.
- In your case, you probably want to create an circular
average (perhaps guassian) matrix to
multiply the filter input values
against.
- If you have some init work (like the point above)
that only needs to be done once,
you can add a "<filter>_init(int rows, int
cols)" function. Lets say your function is
called "avgminmax()", then your init function would be
called "avgminmax_init()".
Ditto for a "<filter>_finish()" function if you need
it.
- The manual gives some examples of things like digging
out cell size if you need that
for some reason.
- You might also want to look at the "Weighted local
mean adjustment kernel" which
comes close to doing what you want (source is in
wlocalmadj.c). Created by Dr. Liu
(his work is always worth exploring).
Don't
let all the above scare you off - it is actually
really easy
to
link user code filters and formulae extensions to ER Mapper,
and
the example files should give you most of what you need. If not, there
are
a
number of power-user ER Mapper people who are on the list who would be happy
to
help
(as I and other ERM people will of course as well).
Kind
regards,
Stuart
|
- circular smoothing and relative difference Ken Hickey
- URL data loading Stuart Nixon
- URL data loading Alejandro Hinojosa
- RE: URL data loading Andrew Greenhill
- RE: URL data loading Mike Dunne
- RE: URL data loading Alejandro Hinojosa
- RE: URL data loading Mike Dunne
