title: Python - Spatial variance of a parameter in a netCDF file
body: <p>I have a netCDF file <code>monthly_qc_data.nc</code>, representing the monthly value of a parameter call <code>Lai_500m</code> in a bounding box of 0.5º.</p>
  
  <p>Considering that the center of the bounding box/netCDF file is the reference point. I would like to calculate the difference of the parameter <code>Lai_500m</code> against the value of this parameter on the center of the bounding box.</p>
  
  <p>For that I am using the following:</p>
  
  <pre><code>##SPATIAL VARIANCE
  os.chdir(inbasedir)
  data = xr.open_dataset('monthly_qc_data.nc')
  ref_data = data.where((data['lat'] ==  10) &amp; (data['lon'] == 10)) #considering the poin lat:10 and lon:10 as the center of the bounding box
  dif_data = data.where((data['Lai_500m'] - ref_data))
  </code></pre>
  
  <p>Unfortunately this returns the following error:</p>
  
  <pre><code>ufunc 'bitwise_and' not supported for the input types, and the inputs could not be 
  safely coerced to any supported types according to the casting rule ''safe''
  </code></pre>
  
  <p>I also tried using python netCDF4:</p>
  
  <pre><code>from netCDF4 import Dataset 
  os.chdir(inbasedir)
  dataset = Dataset("monthly_qc_data.nc")
  dif_data = dataset.variables['Lai_500m'][:,:,:] - dataset.variables['Lai_500m'][:,10,10] 
  </code></pre>
  
  <p>who also returned the (obvious) error:</p>
  
  <pre><code>ValueError: operands could not be broadcast together with shapes (12,120,120) (12,) 
  </code></pre>
  
  <p>Does anyone knows how to overcome that?</p>