dim_minind_n / dim_maxind_n

From: Jatin Kala <jatin.kala.jk_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 10 2014 - 23:03:59 MDT

Hi all,
i have an n-dimensional array, lets say x(a,b,c,d). I want to find the
min along the first dimension, so i do:
x_min0 = dim_avg_n(x,0)

x_min0 is size(b,c,d)

But i also want an array of same size (b,c,d) as x_min0, which has the
indices of the min values.

Most languages have a function for this, e.g., numpy.argmax(x,axis=0)
for python, and MAXLOC/MINLOC (e.g., MAXLOC(x,dim=1)) in Fortran.

There does not seem to be an NCL equivalent????
ind_resolve does not do this, as in the case of a 4D array, it returns a
1 by 4 array.

It's friday and i might be missing something obvious....

Any comments?
I also tried to use use WRAPIT by making a F90 subroutine which uses
MAXLOC, but it's doing my head in!

Cheers,
Jatin.






_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Jul 11 05:04:08 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:47 MDT