Use CollectSeries instead of Collect, that way you can assign an appropriate Z level, when you Stack. Pass the output of CollectSeries to Append, to go beyond the limitation of inputs to CollectSeries.
| Steve Cousins <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 08/26/2004 06:12 PM
|
To: opendx <[email protected]> cc: Subject: [opendx-users] How to create a 3D array from a 2D array? |
I've got an "array" that is 120 x 180. I'd like to create a 3D array
that is 120x180x22 where each of the 22 levels is identical.
Some background: I'm bringing the data in from a NetCDF file and I have
the network doing what I want, except that I've faked the Depth variable
by manually creating a 3D version in the NetCDF file instead of the
regular 2D version. The Depth variable just holds the bottom depth in
meters at each XY grid point. The reason I have needed to have a 3D
version of this is because it is used in a Compute module that works
with two other variables that are 3D variables and all of the inputs to
the Compute module need to be the same size.
I've tried to use Collect but it has a maximum of 21 inputs. If it
could take 22 inputs then I think it would work. I tried using 3
collects like (sorry for the crude ASCII art):
_|_|_|_ ... _|_ _|_|_|_ ... _|_
| Collect | | Collect |
------------- -------------
| |
----------------------
|
____ |_____
| Collect |
-------------
|
____ |_____
| Stack |
-------------
Each of the top two Collects have 11 inputs. This however creates two
arrays, each with 11 levels. In place of the bottom Collect, I tried to
use Append but this doesn't work either.
Anyone have any ideas about how to do this? The end result that I want
is to have an object that looks the same as when I Import->Select the
faked 3D version.
Thanks for your help.
Steve
--
______________________________________________________________________
Steve Cousins, Ocean Modeling Group Email: [EMAIL PROTECTED]
Marine Sciences, 208 Libby Hall http://rocky.umeoce.maine.edu
Univ. of Maine, Orono, ME 04469 Phone: (207) 581-4302
