[ncl-talk] Difference plot in NCL

Tabish Ansari tabishumaransari at gmail.com
Fri Aug 29 13:44:15 MDT 2014


Hi Partha

You can use a simple logic (I am not writing in the exact syntax):

Lets say these are two arrays a[][] and b[][] and the resultant difference
array is c[][]. Of course all 3 arrays have same dimensions.

Just put a nested loop like:

do i=0, n-1
 do j=0, m-1
  if (a[i][j] or b[i][j] > 0.2)
    c[i][j] = a[i][j]-b[i][j]
  else
    c[i][j] = 0
 end do
end do

This will calculate the difference only if at least one of the arrays has
value > 0.2 otherwise it will store a zero value (or you may even store a
missing value)

Hope it helps!

Tabish U Ansari
MS Research Scholar
Environmental & Water Resources Engineering Division
Department of Civil Engineering
IIT Madras


On 30 August 2014 00:48, Partha Bhattacharjee <pbhatta2 at jhu.edu> wrote:

>  ​Dear NCL,
>
>
>   I want to plot a difference between two model outputs (see the attached
> figure). In both plots, >0.2 (in the colorbar) are subject of interest.
>  Simple difference plot shows difference in <0.2 background also. How do I
> specifically plot difference keeping background <0.2 at constant in NCL?
>
>
>   Thanks,
>
>  Partha
>
> _______________________________________________
> ncl-talk mailing list
> 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/20140830/4d4250bb/attachment.html 


More information about the ncl-talk mailing list