title: How to invert a masked numpy array?
body: <p>I've created a mask over a vector shapefile and have then created another one which zooms in to the relevant area. The problem I have with this new mask is that the masked area is the bit that I want, so I need to invert it somehow. (<em>Note that I imported numpy as np</em>)</p>
  
  <p><strong>This is the code I used for the 2nd mask:</strong></p>
  
  <pre><code>catchment_mask = gmask[minrow:minrow+nrow, mincol:mincol+ncol]
  catchment_mask = np.where(catchment_mask == 1, 1., np.nan)
  </code></pre>
  
  <p>I've tried using this code to invert it but it has applied a mask to the entire area:</p>
  
  <pre><code>inverse_catchment_mask = (np.logical_not(catchment_mask))
  </code></pre>
  
  <p>I'd be really grateful for any suggestions!</p>