[ncl-talk] correlation_query
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Tue Jun 20 03:39:22 MDT 2017
Hi Kunal,
if your one variable is
var1(lat, lon, X1, time)
and the other is
var2(lat, lat_bands, lon, lon_bands, Y1, time, time_bands)
you can use the 'standard subscripts' to get rid of the bands in this
second variable with
new_var2 = var2(:, 0, ;, 0, :, :, 0) ;-- new_var2(lat,lon,Y1,time)
Please, read the NCL User Guide to learn more about the NCL basics.
Bye,
Karin
Am 19.06.17 um 09:17 schrieb Kunal Bali:
> Dear NCL users
>
>
> I am trying to get the spatial
>
> atal:Number of subscripts do not match number of dimensions of
> variable,(3) Subscripts used, (5) Subscripts expected
>
> I have two files with
> Ist file have lat, lon, X1, time dimensions
> 2nd file have lat, lat_bands, lon, lon_bands, Y1, time, time_bands
> dimensions
>
> So how to remove the time_bands, lon_bands, and lat_bands so that all
> the dimensions of 2nd file will be matched with 1st file.
>
>
>
> I used the script
>
> in1 = addfile("/home/kunal/x1.nc <http://x1.nc>","r")
> in2 = addfile("/home/kunal/y2.nc <http://y2.nc>","r")
> filename = "/home/kunal/IND_adm/india_state.shp"
>
> tmp2 = int1->X1
> tmp1 = in2->Y2
> ;************************************************
> ; reorder to get time as right most dimension
> ;***********************************************
> ts1 = tmp1(lat|:,lon|:,time|:)
> ts2 = tmp2(lat|:,lon|:,time|:)
> ;************************************************
> ; calculate cross correlations
> ;************************************************
> maxlag = 0 ; set lag
> ; note, the max lag should not be more than N/4
>
> ccr = esccr(ts2,ts1,maxlag) ; calc cross correlations
>
> ; copy meta data and coordinate variables using contributed functions
> copy_VarAtts(ts1, ccr)
> copy_VarCoords_1(ts2,ccr)
> printVarSummary(ccr)
>
> plot = gsn_csm_contour_map_ce(wks,ccr(:,:,lag),res)
>
>
> please provide some information on that.
> Thank You
>
> Regards
> Kunal
>
>
>
>
> _______________________________________________
> 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/20170620/1c856ab4/attachment.html
More information about the ncl-talk
mailing list