I have multiple 2D arrays, three of which are LONG, LAT and HEIGHT. I would like to determine the closest index in these 2D arrays for a given (long,lat).
So, within my 2D HEIGHT array, what is the index of (-43.5,45)?
I have multiple 2D arrays, three of which are LONG, LAT and HEIGHT. I would like to determine the closest index in these 2D arrays for a given (long,lat).
So, within my 2D HEIGHT array, what is the index of (-43.5,45)?
A few foolish minutes later; I have worked out an answer I believe sufficient:
a = abs( LAT-chosen_lat ) + abs( LONG-chosen_lon )i,j = np_unravel_index(a.argmin(), a.shape)