Re: calculating lat/lon of minimum pressure

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Jun 28 2011 - 11:48:14 MDT

Hi Darren,
Assuming your latitude/longitude arrays are 3-dimensional (Time,
south_north, west_east for instance), then you could do something like
this: (array is named "pres", has 3 dimensions with the first one being
a coordinate variable named time, XLAT = 3D lat array, XLONG = 3D lon

; (untested!)
do gg = 0,dimsizes(pres&time)-1
    temp = pres(gg,:,:)
    temp1D = ndtooned(temp)
    i = ind(temp1D.eq.min(temp))
    indices = ind_resolve(i,dimsizes(temp))
    print(XLAT(gg,indices(0,0),indices(0,1))+ \
       " "+XLONG(gg,indices(0,0),indices(0,1)))
    print(temp(indices(0,0),indices(0,1))) ; check #1
    print(min(temp)) ; check #2
    delete([/temp,temp1D,i,indices/]) ; ncl v6.0.0 coding allows
    ......... ; multiple deletes
end do

Hopefully that all makes sense. The trick is to use ind and ind_resolve
to locate the indices that match the min of your array.

If that doesn't help let the group know.
Good luck,

On 06/28/2011 08:33 AM, Darren Slevin wrote:
> Hi,
> my name is Darren Slevin and I'm trying to find the latitude and
> longitude of a certain pressure. Im using WRF to model
> Hurricane Katrina. What I want to do is to be able to get the lat/lon
> location of the minimum pressure of the storm.
> I can get the min. pressure using slp = wrf_user_getvar(a,"slp",0) and
> then getting the minimum of that array. But Im
> having problems getting the latitude and longitude. I was wondering if
> someone could help me with this. Thanks in advance.
> regards,
> Darren
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

Adam Phillips                      
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Jun 28 11:48:22 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 30 2011 - 12:54:44 MDT