[gradsusr] Max Value Coordinates

Jeffrey Duda jdduda at iastate.edu
Fri Oct 22 22:27:25 EDT 2010


Andrew,
I had posted a request on this forum about this exact question in August.  I
believe it was Charles Seaman who provided the answer.  The meat of the code
is

'd maxloc(max('ans',x='x1',x='x2'),y='y1',y='y2')'
 yline = sublin(result,2)
 ymax = subwrd(yline,4)
'd maxloc(max('ans',y='y1',y='y2'),x='x1',x='x2')'
 xline = sublin(result,2)
 xmax = subwrd(xline,4)


where "ans" refers to the field for which you want to find the max/min, and
x1, x2 refer to x-grid values or longitude points and y1, y2 refer to y-grid
values or latitude points.  xmax, ymax are the coordinates of the maximum
value.  To find the minimum, just replace maxloc and max with minloc and
min.

Jeff Duda

On Fri, Oct 22, 2010 at 7:43 PM, Andrew Revering <andy at f5data.com> wrote:

>  I'd like to have the coordinates of our 'max value'… I know about
> maxloc(), and tried various examples I found in forums, documentation and
> email conversations, but I can't seem to get it to perform as I expect.
>
>
>
> When it supposedly works, I just see some white lines on the bottom and
> right of my image (not where the max value is)… is there a way to actually
> get lat/lon coordinates of the max value?
>
>
>
> I should note that in my situation there will be the teeniest dot of
> plotted value, the rest of the grid is blank. I don't know if that matters
> in these functions.
>
>
>
> Andrew Revering
>
> Convective Development, Inc.
>
> http://www.convectivedevelopment.com/
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Iowa State University
Meteorology Graduate Student
3134 Agronomy Hall
www.meteor.iastate.edu/~jdduda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101022/a5ac9ac1/attachment-0003.html 


More information about the gradsusr mailing list