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

StokesSpectralCube access #750

Closed
keflavich opened this issue Oct 5, 2021 · 3 comments
Closed

StokesSpectralCube access #750

keflavich opened this issue Oct 5, 2021 · 3 comments

Comments

@keflavich
Copy link
Contributor

To access the components of a StokesSpectralCube, you presently need to access a private attribute, for example:

cube_I = cube._stokes_data['I']

That's not good! We should probably implement at least a public access like:

cube_I = cube.stokes_data['I']

and better still,

cube_I = cube['I']

@Kitchi, what do you think?

A PR would be welcome!

@Kitchi
Copy link
Collaborator

Kitchi commented Oct 5, 2021

I've got a PR ready with the first suggestion, but I like the second one a lot more. Both @preshanth and I can work on implementing that for the Stokes cubes.

@preshanth
Copy link
Collaborator

I agree that we should implement something along the second style of
cube_I = cube['I'].
This will allow for internal conversion functions between the different stokes say. You have a cube that contains ['I','Q','U','V'] then when a user asks for
cube_P=cube['P'] we can perform the stokes conversion internally.

Kitchi added a commit to Kitchi/spectral-cube that referenced this issue Nov 2, 2021
As per the second suggestion in radio-astro-tools#750 - the Stokes data can now be
accessed via cube['I'], cube['Q'] etc.

Assigning new keys is not yet supported and will throw
NotImplementedError if attempted.
preshanth pushed a commit to Kitchi/spectral-cube that referenced this issue Nov 3, 2021
As per the second suggestion in radio-astro-tools#750 - the Stokes data can now be
accessed via cube['I'], cube['Q'] etc.

Assigning new keys is not yet supported and will throw
NotImplementedError if attempted.
@keflavich
Copy link
Contributor Author

closed by #751

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

No branches or pull requests

3 participants