[ncl-talk] Help with copying array into a larger array
Mary Haley
haley at ucar.edu
Fri Jun 8 12:08:12 MDT 2018
Hi Laura,
For reasons I don't understand right now, it doesn't like that one variable
has a "lat" dimension, while the other one is "lat2".
If you rename the data "lat2" dimension to "lat" before you do the copy, I
think it should work (I tried it on a small test program).
data!1 = "lat"
-Mary
On Fri, Jun 8, 2018 at 10:43 AM, Laura Fowler <laura at ucar.edu> wrote:
> Good morning:
>
> I would like to copy TRMM data into a global array:
>
> printVarSummary of my TRMM data shows:
>
> 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]
> Number Of Attributes: 5
> _FillValue : -9999.9
> units : mm
> long_name : Daily accumulated precipitation (combined microwave-IR)
> estimate with gauge calibration over land
> coordinates : lat lon
> average_op_ncl : dim_avg_n over dimension(s): ncl_join
>
>
> I would like to put the TRMM data (limited between the latitudes
> -49.875 to 49.875 into an array between the latitudes -89.875 to
> 89.875. printVarSummary of my output TRMM data shows:
>
> Variable: data
> Type: float
> Total Size: 4147200 bytes
> 1036800 values
> Number of Dimensions: 2
> Dimensions and sizes: [lon | 1440] x [lat2 | 720]
> Coordinates:
> lon: [-179.875..179.875]
> lat2: [-89.875..89.875]
> Number Of Attributes: 1
> _FillValue : 9.96921e+36
>
>
> I tried the following. To put precip into data, I tried:
> data(:,{-49.875:49.875}) = precip(:,{-49.875:49.875})
> or
> data(:,{lat2|-49.875:49.875}) = precip(:,{lat|-49.875:49.875})
>
> but it is not working. The last error I get is:
>
> fatal:syntax error: line 59 in file
> global_mean.precipitation_minus_TRMM-3B42.ncl before or near lat2
> data(:,{lat2
>
>
> After looking at the documentation, I am not sure what I am doing wrong.
>
> 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/20180608/4740529b/attachment.html>
More information about the ncl-talk
mailing list