Re: calculating lat/lon of minimum pressure

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
array):

; (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(indices)
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:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
______________________________________________________________