coecms / xmhw

Xarray version of Marine Heatwaves code by Eric Olivier
https://xmhw.readthedocs.io/en/latest/
Apache License 2.0
23 stars 10 forks source link

don't call land_check if array has only 1 dimension #14

Closed paolap closed 4 years ago

paolap commented 4 years ago

At the moment I'ma summing that the dataset we passed as at least 3 dimensions: time, lat and Lon (how they're called doesn't matter). In the test I'm using some arrays with only time as a dimension need to check what happens in the following cases:

dimensions: 'time' dimensions: 'time', 'lat'

Majority of functions expect a 'cell' dimension so it would be better to add fake dimensions of size 1 rather than bypass land_check

paolap commented 4 years ago

This is fixed in branch detect commit https://github.com/coecms/xmhw/commit/115c0d706fca6564adfbf4055285327090f03b95

I've dded a 'point': 0. dimension to array and now it can create 'cell' stacked dimension, this means that it should also work with 2 dimensional arrays. test added in land_check