-
Notifications
You must be signed in to change notification settings - Fork 62
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
Implement StokesSpectralCube #249
Conversation
parameters can be accessed with attribute notation. | ||
A class to store a spectral cube with multiple Stokes parameters. | ||
|
||
The individual Stokes cubes will share masks. |
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.
share a common mask
?
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.
Fixed
Looks good; all my comments are minor. I didn't check the travis failure. IO question: what do we do if the user gives a FITS file with 4 dimensions, but one is a degenerate Stokes dimension? I recommend we return a |
Right - ideally the user should really access the readers through SpectralCube.read and StokesSpectralCube.read and then it's obvious what the user wants returned. |
Good point - yes, let's just have that interface implemented, then. |
@astrofrog thanks for the fixes. It looks like there are still bugs. Want to ping me when this is ready for review again? |
@keflavich - yes, I'm working on updating the travis config in #258 |
…all yet, and doesn't deal with derived cubes either
…_dir__ with Python 2
This still requires some more work for input/output for Stokes cubes, so not ready for review yet. |
I don't have time to investigate making a writer for stokes spectral cubes (which requires adding a stokes axis to the WCS), so I'm tidying this up and I think it would be great if we could merge it and address the writing (#266) later. |
@keflavich - can you review this? |
mask[component] = LazyMask(np.isfinite, data=data[component], wcs=wcs_slice) | ||
comp_data, comp_wcs = cube_utils._orient(data[component], wcs) | ||
comp_mask = LazyMask(np.isfinite, data=comp_data, wcs=comp_wcs) | ||
stokes_data[component] = SpectralCube(comp_data, wcs=comp_wcs, mask=comp_mask, meta=meta, header=header) |
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.
Wrap this at 80 chars? (and related PEP8 if there are other things, but I assume you have done those right everywhere without checking)
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.
Fixed
Review complete! The only comment that requires a chance is the |
👍 Merge when it passes |
Implement StokesSpectralCube
@keflavich - this is the combination of your work and my tests and work since.
Still a fair bit to do, including implementing the I/O, but maybe you can already check if this seems ok so far?