-
Notifications
You must be signed in to change notification settings - Fork 49
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
Support an "ideal" RMF where MATRIX is a scalar (pyfits backend, fix #862) #863
Conversation
A test case is needed, which is why this is still a WIP. EDITED TO ADD I've now added the test, do have removed the WIP |
Gah. Another PR that needs rebasing. |
This is to support issue sherpa#862 where a MATRIX column is a scalar, not an array. This is aready supported by Crates, so the Astropy backend needs updating.
This test requires readnig a file in. Rather than adding another test file to the dataset this just creates the file local (in a temporary file) that gets deleted after the test runs. It makes it easier to create a "minimal" test case.
In rebasing this I found that two of the "extra" commits from this PR were no-longer needed (as another PR had converted test_io.py to pytest from SherpaTestCase) so I have dropped them. Which makes this more focussed: a commit to add the change, and one to add the test. |
Codecov Report
@@ Coverage Diff @@
## master #863 +/- ##
==========================================
- Coverage 62.98% 62.97% -0.02%
==========================================
Files 70 70
Lines 24315 24321 +6
Branches 3509 3510 +1
==========================================
Hits 15315 15315
- Misses 7862 7867 +5
- Partials 1138 1139 +1
Continue to review full report at Codecov.
|
Summary
The AstroPy (pyfits) backend could not handle the case of an ideal RMF when the MATRIX column was specified as a scalar and not a 1-element array.
Details
This is to support issue #862 where a MATRIX column is a scalar, not an array. This is aready supported by Crates, so the Astropy backend needs updating. The change is small (if you can't access the first element of an array then treat it as a scalar), and is an extension to the changes in PRs #358 and #412 which dealt with Swift and ROSAT responses.
A test is added, but rather than adding a file to the Sherpa data corpus, we instead just create the file when needed. It also means that we can easily test the values read in as the data can be made to be easily tested (i.e. a small number of bins).