[gradsusr] Max Value Coordinates

Charles Seman Charles.Seman at noaa.gov
Mon Oct 25 12:43:51 EDT 2010


Andrew and Jeff and GrADS Users,

Kun-Hsuan Chou provided the reference code for this technique (which can 
be found in the attached file hurricane_tracking.txt, taken from an 
email exchange posted to the GrADS Listserv by Kun-Hsuan Chou and Arturo 
Caracas Uribe in Oct, 2004).

Chuck

Jeffrey Duda wrote:
> 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 
> <mailto: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 <mailto: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 <http://www.meteor.iastate.edu/%7Ejdduda>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>   

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hurricane_tracking.txt
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20101025/b5abbf46/attachment-0003.txt 


More information about the gradsusr mailing list