title: Multidimensional xarray where dorps coordinates?
body: <p>I have a multidimensional variable which I would like to mask it using a multidimensional mask. However, using <code>xarray.where</code> drops the coordinates of the variable. Here is an example using very small files (link to download var file <a href="https://drive.google.com/file/d/1Cx6cMwSgshzrLKX2HfQFD1F8021AhDph/view?usp=sharing" rel="nofollow noreferrer">here</a> and mask file <a href="https://drive.google.com/file/d/16d-2y-LEssub9hsCd9Fgt8Wtciagk1Rz/view?usp=sharing" rel="nofollow noreferrer">here</a>):</p>
  <pre><code>import xarray as xr
  mask = xr.open_dataarray(&quot;mask.nc&quot;)
  var = xr.open_dataarray(&quot;var.nc&quot;)
  
  masked_var = var.where(mask,drop=False)
  
  &gt;&gt;&gt; print(mask.shape)
  (3, 3, 101, 101)
  &gt;&gt;&gt; print(var.shape)
  (3, 3, 101, 101)
  &gt;&gt;&gt; print(masked_var.shape)
  (1, 3, 101, 101)  # Note expected dimension is (3, 3, 101, 101)
  </code></pre>
  <p>As you can see <code>where</code> dropped coordinates.
  My expected behavior is:</p>
  <pre><code>var.isel(lat=0,lon=0).where(mask.isel(lat=0,lon=0))
  var.isel(lat=1,lon=1).where(mask.isel(lat=1,lon=1))
  .
  .
  .
  #for all lat and lon, resulting in masked_var with (3, 3, 101, 101) shape.
  </code></pre>