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

Properly handle Swift RMF when using Astropy backend (fix #357) #358

Merged
merged 10 commits into from
Jul 7, 2017

Commits on Jul 6, 2017

  1. Add tests of reading in Swift PHA, ARF, and RMF files.

    The RMF reading is known to be broken with the AstroPy backend
    (issue sherpa#357).
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    53b33ae View commit details
    Browse the repository at this point in the history
  2. Improve the tests for invalid file input

    Adds tests for invalid reads of ARF and RMF, and ensures that the
    expected error class is thrown when using crates of pyfits backends.
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    7512467 View commit details
    Browse the repository at this point in the history
  3. Fix reading of non-variable-length-array FITS matrix

    This just tests that the data can be read in as expected. It does
    not check it can be used in Sherpa. These responses have an energy
    grid starting at 0 keV which causes Sherpa problems (but that is
    technically outside the bug that is fixed in this PR).
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    cfad850 View commit details
    Browse the repository at this point in the history
  4. Add a test ensuring Swift data can be used in the UI layer

    The Swift data and responses are read in, and the statistic
    calculated (for all data and a subset of data) for a chi-square
    and Poisson-based variant. The results are compared to values
    caluclated using XSPEC 12.9.1b.
    
    The ARF and RMF have to be modified before being used, to replace
    the energy-bin edge equal to 0. Asserts are used to check that the
    data really contains the problem value, in case the I/O layer is
    ever changed to "fudge" problem data like this (XSPEC does it when
    the RMF is read in, with the message
    
        ***Warning: Detected response matrix energy bin value = 0 (or neg).
             XSPEC will instead use small finite value (response file will not be altered).
    
    The 0-value bin causes a division-by-zero warning (if it is not fixed).
    This warning is checked for, but at present there doesn't seem to be
    an obvious way to tell the pytext fixture in sherpa/conftest.py,
    namely capture_all_warnings, that this warning should only be ignored
    for this test. I have tried (in other PRs) to use the recwarn fixture
    to remove the warning from the system, but it did not seem reliable
    (e.g. would work if a single test file was run, but not when all tests
    were run).
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    4538e8a View commit details
    Browse the repository at this point in the history
  5. Change a comment; no functional change.

    The only reason for this change is to try and get Travis-CI to run the tests.
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    2d10b85 View commit details
    Browse the repository at this point in the history
  6. Switch from using XSPEC power law to Sherpa for a test

    Surprisingly enough this switch changed the stat value (from NaN
    to a finite value). This value is only used as a regression test,
    to ensure that we note when the behavior changes, rather than a
    validation that the code is doing the right thing (which is later
    on in this particular test).
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    dc99785 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b9efe73 View commit details
    Browse the repository at this point in the history
  8. Skip true_divide warning messages.

    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    8f165d7 View commit details
    Browse the repository at this point in the history
  9. Fix failure in test with Crates backend.

    This replaces '==' by '='. It also adds some explicit checks for
    the backend not being available, which should not happen but let's be
    carefull out there.
    DougBurke authored and olaurino committed Jul 6, 2017
    Configuration menu
    Copy the full SHA
    6c8b45e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b596baf View commit details
    Browse the repository at this point in the history