reshaping of multidimensional arrays

From: Tim Brücher <tim.bruecher_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 16 2012 - 06:58:29 MST

Dear all,

I am on writing a function which needs the possibility to re-shape some unknown n-dim arrays.

So, let's say the input array x has n-dimensions, and two of them are called lon and lat.

x_in(xdim(0), xdim(1) ...., lon, lat .... , xdim(n)

Afterwards I would like to end up with an n-dim converted array like x_out(lat|:,lon|:, xdim(..)$|:, xdim(..)$|:, ......).

Unfortunately, I have not seen the possibility (if any) to shape the array by giving an vector of my ordered dimensions. It looks like, that I have to know in advance, how many dimensions I do have to put this hardcoded in my ncl script. Is this true?

Thanks in advance,

Tim

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 16 06:58:33 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST