mrschweizer / PyThat

This is a community package which helps reading .h5 files created by ThatecOS and converting them to xarray objects and netcdf files. This software is not maintained by and has no affiliations to THATec Innovation GmbH.
MIT License
4 stars 1 forks source link

Naming for xarray dims not well defined #1

Closed mrschweizer closed 2 years ago

mrschweizer commented 2 years ago

If two are loaded from the same Measurement Tree, it is possible that the same dimensions have different names (eg Frequency and Frequency+). This Bug will occur when one array depends on multiple rows with the same Name, and one only depends on one of those.

mrschweizer commented 2 years ago

Problem: xarray Broadcasting doesnt work Properly since the names of the dimensions are not equal on a global scale: eg. ('Field', 'Frequency', 'Frequency+') vs ('Field', 'Frequency') where Frequency+ and Frequency refer to the same coordinates.

A workaround is manually renaming the dims (e.g. 'Frequency' -> 'Frequency+'.

This could be accomodated in future releases by checking for duplicates in the self.definition of the measurement tree, instead of checking for while building the dependencies of the xarray.DataArray.

mrschweizer commented 2 years ago

This has been addressed in 0.0.27 and 0.0.28.