Closed lpilz closed 2 years ago
@jthielen Do you have any idea what's happening here?
This is a really silly typo bug: it should be coord_data.variable
not coord_data
in
Messy stuff with alignment can happen when you have a DataArray when you're expecting a Variable. PR incoming soon!
Messy stuff with alignment can happen when you have a DataArray when you're expecting a Variable.
That's good to know! Thanks :)
What happened?
It started innocently enough, with me trying to test manually whether destaggering
DataArrays
really works. However, it didn't and the error message readsValueError: conflicting sizes for dimension 'x': length 200 on the data but length 199 on coordinate 'x'
.I tracked the bug down to the interpolation between
left_or_bottom_cells
andright_or_top_cells
in_destag_variable
. As weird as it sounds,xarray
seems to not be able to properly add the two arrays.While the code reads: https://github.com/xarray-contrib/xwrf/blob/37adcb0a9f60bea83e2df1f48beeb43ecdb5781b/xwrf/destagger.py#L61-L63
The sizes of the three variables (generated using
print
statements) are:This seems to be connected with
WRFDatasetAccessor.postprocess()
somehow, as the bug only occurs if one has called this method beforeMinimal Complete Verifiable Example
Relevant log output
Environment
Anything else we need to know?
No response