-
Notifications
You must be signed in to change notification settings - Fork 4
Spherical harmonics transform #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
mberz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should review the concept again. Specifying all properties again does not use the power of the SH class at all from a users perspective.
Passing the SH class instead of creating it within the function would make things much easier in my opinion.
|
spharpy/sht.py
Outdated
| if not signal.time.shape[axis] == coordinates.csize: | ||
| if coordinates.csize not in signal.time.shape: | ||
| raise ValueError("Signal shape does not match " | ||
| "number of coordinates.") | ||
| else: | ||
| axis = signal.time.shape.index(coordinates.csize) | ||
| warnings.warn("Compute spherical harmonics transform along " | ||
| f"axis = {axis}.", UserWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only raise an error here and not change the user input. But I like the idea of detecting the axis. How about having axis='auto' as a default and use
axis = np.where(np.array(signal.cshape) == Y_inv.shape[1])[0]
to detect the axis. Compared to signal.time.shape.index(coordinates.csize) it has the advantage of detecting the case of multiple matching axes. If len(axis) == 1 we proceed. If len(axis) == 0 we raise an error and if len(axis) > 1 we raise a different errror.
Which issue(s) are closed by this pull request?
Closes #133
Changes proposed in this pull request:
transforms?