MHKiT-Python icon indicating copy to clipboard operation
MHKiT-Python copied to clipboard

Fix: Handle unnamed index/dimension in `wave.resource.surface_elevation`

Open simmsa opened this issue 10 months ago • 1 comments

Fix: If unnamed, set spectrum dim_0 name to "Frequency"

The surface_elevation function typically takes in a spectrum generated by an mhkit function that sets the index/dimension name to "Frequency". This fix handles an atypical case where the index/first dimension is unnamed, which causes downstream issues where we are expecting a dimension named "Frequency".

Per the xarray DataArray documentation an unnamed dimension starts at dim_0. If we find this case we change the dim_0 name to "Frequency".

simmsa avatar Apr 26 '24 14:04 simmsa