-
Notifications
You must be signed in to change notification settings - Fork 65
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
Possible fixes to the stacking code #465
Conversation
…n different shapes being merged together
shift and after for the pos shift
(also, add vel_surface to the cube generator)
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.
👍
@@ -269,7 +276,10 @@ def stack_spectra(cube, velocity_surface, v0=None, | |||
|
|||
all_shifted_spectra.extend([out for out in shifted_spectra]) | |||
|
|||
stacked = stack_function(all_shifted_spectra, axis=0) | |||
shifted_spectra_array = np.array(all_shifted_spectra) | |||
assert shifted_spectra_array.ndim == 2 |
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.
Just for the record, this is to solve a different issue - I once encountered an empty or weirdly shaped all_shifted_spectra
, and I want to prevent that. Obviously assertions are not that useful in production code, but it should make future related errors easier to trace.
cc @e-koch - the padding might be off. Testing underway...