Skip to content
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

Merged
merged 16 commits into from
Jan 10, 2016
Merged

Conversation

astrofrog
Copy link
Member

@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?

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

share a common mask ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@keflavich
Copy link
Contributor

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 SpectralCube by default, not a StokesSpectralCube.

@astrofrog
Copy link
Member Author

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.

@keflavich
Copy link
Contributor

Good point - yes, let's just have that interface implemented, then.

@keflavich
Copy link
Contributor

@astrofrog thanks for the fixes. It looks like there are still bugs. Want to ping me when this is ready for review again?

@astrofrog
Copy link
Member Author

@keflavich - yes, I'm working on updating the travis config in #258

@astrofrog
Copy link
Member Author

This still requires some more work for input/output for Stokes cubes, so not ready for review yet.

@astrofrog
Copy link
Member Author

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.

@astrofrog
Copy link
Member Author

@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)
Copy link
Contributor

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@keflavich
Copy link
Contributor

Review complete! The only comment that requires a chance is the is_broadcastable one. The rest are questions.

@keflavich
Copy link
Contributor

👍 Merge when it passes

astrofrog added a commit that referenced this pull request Jan 10, 2016
Implement StokesSpectralCube
@astrofrog astrofrog merged commit 22bc9f5 into radio-astro-tools:master Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants