[ncl-talk] concatenating arrays in PynGL
Alessandra Giannini
alesall at iri.columbia.edu
Fri Jun 7 09:05:46 MDT 2019
hi, are you sure that you want to concatenate these two matrices?
According to the information you printed out, time intervals are 1979-2016 for one, and 2002-2018 for the other…
warm regards, alessandra
—
Alessandra Giannini
IRI for Climate and Society - The Earth Institute at Columbia University
P.O. Box 1000, Palisades NY 10964-8000
phone/fax: +1 845 680-4473/4864 - email: alesall at iri.columbia.edu
> On Jun 7, 2019, at 10:54 AM, Mahesh Kovilakam <mkmvarma at gmail.com> wrote:
>
> Hi,
> I am now transitioning to python and I recently installed PynGL and now converting one NCL script to python. I would like to concatenate two arrays and in NCL it was easy using "array_append_record". For python, I used "np.concatenate(array1,array2,axis=0)" but it gives me this error:
>
> File "MERGE_netcdf_test.py", line 86, in <module>
> merge_data = np.concatenate(ext_525_v11,ext_525_v2,axis=0)
> TypeError: 'NioVariable' object cannot be interpreted as an integer
>
> I am not sure what that means. Here are the two variables I am trying to concatenate:
>
> Variable: ext_525
> Type: float
> Total Size: 5253120 bytes
> 1313280 values
> Number of Dimensions: 4
> Dimensions and sizes: [year | 38] x [month | 12] x [lat | 32] x [alt | 90]
> Coordinates:
> year: [1979..2016]
> month: [1..12]
> lat: [-77.5..77.5]
> alt: [0.5..45]
> Number of Attributes: 2
> _FillValue : -999
> mwv : 0.525
>
> Variable: MERGED_EXT_525
> Type: float
> Total Size: 2350080 bytes
> 587520 values
> Number of Dimensions: 4
> Dimensions and sizes: [year | 17] x [month | 12] x [lat | 32] x [alt | 90]
> Coordinates:
> year: [2002..2018]
> month: [1..12]
> lat: [-77.5..77.5]
> alt: [0.5..45]
> Number of Attributes: 6
> mwv : 0.525
> description : zonally averaged cloud cleared extinction at 525 nm
> average_op_ncl : dim_avg_n over dimension(s): profiles
> long_name : merged extinction from OSIRIS, CALIPSO, and SAGEIII-ISS at 525 nm
> units : 1/km
> _FillValue : -999
>
>
> And my apologies of posting this question in NCL talk. I don't know if I could post this question to any other forum so posting it here.
>
> Thanks,
> Mahesh
> _______________________________________________
> 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/20190607/9f8f173a/attachment.html>
More information about the ncl-talk
mailing list