As the title says, supposing I have a
ds with coords:
[time lat lon], how can I obtain for each timestep in
time the pair of
['lat','lon'] in which the maximum(or minimum) value for a given variable is located.
max_lons = ds.max(dim="lat").idxmax(dim="lon") max_lats = ds.max(dim="lon").idxmax(dim="lat")
The results will be datasets, with each variable giving the lon or lat coresponding to the maximum in each time step for that variable.