Re: Attach two 1D array to make one 2D array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 09 Jun 2009 16:43:44 -0600

Untested .......

function combine (x[*], y[*])
begin
    nx = dimsizes(x)
    ny = dimsizes(y)
    if (nx.eq.my) then
         xy = new ( (/nx,2/), typeof(x)) ; (row,col)
         xy(:,0) = (/ x /)
         xy(:,1) = (/ y /)
         return (xy)
    end if

    print("combine error")
    exit
end
  

these arrays are
Cecille M. Villanueva Birriel wrote:
> Hello,
>
> I have two 1D arrays (pressure and temperature) and I want to
> attach both columns to make a 2D array. I know of the function
> array_append_record but this only attaches the column below the other
> one maintaining the ID array. Is there a way I can do this?
>
> Cecille
> **
> **
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jun 09 2009 - 16:43:44 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 11 2009 - 14:54:53 MDT