MHKiT-Python
MHKiT-Python copied to clipboard
Fix: Handle unnamed index/dimension in `wave.resource.surface_elevation`
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".