-
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
Added stokes_data public method #751
Conversation
It was previously not possible to cleanly access the underlying data of a `StokesSpectralCube`, which only had the `_stokes_data` method. This commit implements a simple `StokesSpectralCube.stokes_data` method for public access.
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.
@e-koch @astrofrog any reason not to do this?
For some reason, reshaping the array then running map_blocks leads to memory issues when dealing with Numpy memory mapped arrays, e.g. with FITS files. This new approach avoids reshaping the array at all.
Codecov Report
@@ Coverage Diff @@
## master #751 +/- ##
==========================================
+ Coverage 77.55% 77.57% +0.01%
==========================================
Files 24 24
Lines 5775 5783 +8
==========================================
+ Hits 4479 4486 +7
- Misses 1296 1297 +1
Continue to review full report at Codecov.
|
Avoid memory issues when computing statistics
…endian data and provides no performance improvements
Don't use bottleneck in statistics()
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.
I'm fine with this; will merge soon if there are no objections |
Remove if statement that stops tox from running tests
@Kitchi or @preshanth -- The tests are now fixed from #759. Can you rebase this branch? |
I just did @e-koch . Hope that is enough |
It was previously not possible to cleanly access the underlying data of a `StokesSpectralCube`, which only had the `_stokes_data` method. This commit implements a simple `StokesSpectralCube.stokes_data` method for public access.
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.
Windows test failure is unrelated and known from #759 |
It was previously not possible to cleanly access the underlying data of
a
StokesSpectralCube
, which only had the_stokes_data
method. Thiscommit implements a simple
StokesSpectralCube.stokes_data
method forpublic access.
This implements the first suggestion in #750