[ncl-talk] reordering an array

Alan Brammer abrammer at albany.edu
Fri Dec 8 11:17:05 MST 2017


Think it's just a typo, you currently "re"ordered it to lon x lat

precip_r = precip(lon|:,lat|:)
should be
precip_r = precip(lat|:,lon|:)


Alan


On Fri, Dec 8, 2017 at 1:04 PM, Laura Fowler <laura at ucar.edu> wrote:

> Hello:
>
> I would like to re-order TRMM 3B42 data from [lon | 1440] x [lat |
> 400] to [lat| 400] x [lon | 1440], but that does not seem to work?
> Before re-ordering, the original precipitation array is:
>
> Variable: precip
> Type: float
> Total Size: 2304000 bytes
>             576000 values
> Number of Dimensions: 2
> Dimensions and sizes: [lon | 1440] x [lat | 400]
> Coordinates:
>             lon: [-179.875..179.875]
>             lat: [-49.875..49.875]
>
>
> After applying:
>
> f = addfile("3B42_Daily.20151128.7.nc4","r")
> precip   = f->precipitation
> precip_r = precip(lon|:,lat|:)
>
> I get the following for precip_r:
>
> Variable: precip_r
> Type: float
> Total Size: 2304000 bytes
>             576000 values
> Number of Dimensions: 2
> Dimensions and sizes: [lon | 1440] x [lat | 400]
> Coordinates:
>             lon: [-179.875..179.875]
>             lat: [-49.875..49.875]
>
>
> so it seems that it did not work. I am wondering if it is because the
> dimensions of precip are lon and lat which are the same as the
> coordinates lat and lon.
>
> I am not sure what to do next? If somebody would like to help me out,
> the ncl script and data are in /glade2/scratch2/laura/3B42. I am using
> ncl 6.4.0.
>
>
> Many thanks,
> Laura
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-----------------------------------------------------------
> --------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171208/402f7962/attachment.html>


More information about the ncl-talk mailing list