This has been kicking my butt for a bit....
I have the following information:
1. a 1-D array of longitudes
2. a 1-D array of latitudues
3. a 2-D array of some quantity (sized len(lat),len(long))
What I want to do is get a subset of the array based on a range of latitudes and longitudes
I've tried something like this
ii = find( (lon >= xlims[0]) & (lon <= xlims[1]) )
jj = find( (lat >= ylims[0]) & (lat <= ylims[1]) )
z=array[jj, ii]
ValueError: shape mismatch: objects cannot be broadcast to a single shape
I have tried this using a boolean approach
ii = ( (lon >= xlims[0]) & (lon <= xlims[1]) )
jj = ( (lat >= ylims[0]) & (lat <= ylims[1]) )
but get the same error.
There is probably something subtle here I am missing... any thoughts?