[ncl-talk] Finding points where data is zero

Adam Phillips asphilli at ucar.edu
Thu Jul 11 09:50:33 MDT 2019


Hi Amarjiit,
You can loop over each index, evaluating the previous index value and the
current index value. As an example:

; This will have to be modified for your own data, and is just an example
that you can build off of.
; arr is one-dimensional and corresponds to the latitudes ordered from
south to north
; untested, verify that the following is doing what you believe it is doing

lat = arr&lat   ; create a new array that holds the latitudes (if needed)
do gg = 1,dimsizes(lat)-1
     if (arr(gg-1).lt.0.and.arr(gg).ge.0) then
       print("Identified latitude: "+lat(gg)+", preceding lat value at
"+lat(gg-1)+"="+arr(gg-1)+", current lat value at "+lat(gg)+"="+arr(gg))
       final_lat = lat(gg)
       continue    ; desired latitude index found, exiting do loop
     end if
end do

That should at least get your started. As I stated, you will likely have to
alter the above to fit your own situation.
If you have any further questions let the ncl-talk email list know.
Adam



On Wed, Jul 10, 2019 at 5:23 PM Amarjiit Vikkas Pandde via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Dear NCL users,
>
> I am trying to calculate first latitude where the graph (attached below)
> changes from positive to negative north of 50-South and latitude where it
> changes from negative to positive south of 50-South. the data i plotting is
> tauu averaged over time and longitude, so it has latitude as its coordinate
> variable.
>
> Thank you in advance,
> Amarjiit Pandde.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190711/8c5eb701/attachment.html>


More information about the ncl-talk mailing list