You can do this by using maxvalue() to compute the maximum value, and then find() to discover where it occurs. For example

How do I find where the maximum value of a field occurs

Step-by-step guide

You can do this by using maxvalue() to compute the maximum value, and then find() to discover where it occurs. For example:


  1. g = read("my_data.grib")
    m = maxvalue(g[1])      # maxvalue works on all fields given to it; we probably only want one
    print(m, find(g[1],m))  # prints a list of lat/lon pairs where the value occurs



Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.