Re: Inverting file array order

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 30 Jul 2007 09:11:35 -0600 (MDT)

Rosa,

You can use the "::-1" syntax to reverse the order of any dimension.
Say your array T is dimensioned lev x lat x lon, and you want to
reverse the "lev" (leftmost) dimension:

    T_rev = T(::-1,:,:)

--Mary

On Mon, 30 Jul 2007, Rosa Maria Nascimento dos Santos wrote:

> Hi,
>
> Does anybody knows how can I invert an array order in a .nc file? Let's
> say I have 1 or more variables that are varying in the vertical
> according to the pressure level such as:
>
> VAR LEVEL
> (0) T 50
> (1) T 950
> (10) T 1000
>
> ... and I want to invert the order of this variable and level in the file,
> such as:
>
> VAR LEVEL
> (0) T 1000
> (1) T 950
> (10) T 50
>
> How can I do that? I Thought first doing a loop to make this, but it
> didn't work well: it changed the level but not the var related to it!
>
> Thanks,
>
> Rosa
>
>
>
>
>
> --
> Rosa Maria Nascimento dos Santos
> Doutora em Meteorologia
> LBA/INPA
> Tel: +55 92 36433623
> e-mail: rosasto_at_inpa.gov.br
> rosa_sto_at_yahoo.com
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 30 2007 - 09:11:35 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 01 2007 - 08:50:33 MDT