Skip to content

Test response-data axes mismatch #477

@israelmcmc

Description

@israelmcmc

The axes of the current test response test_full_detector_response.h5 do not match the corresponding axes of the data test_spectral_fit_data.h5 and background test_spectral_fit_background.h5.

I inspected the elements in this test:

dr = str(data_path / "test_full_detector_response.h5") # path to detector response
data = BinnedData(data_path / "test_spectral_fit.yaml")
background = BinnedData(data_path / "test_spectral_fit.yaml")
data.load_binned_data_from_hdf5(binned_data=data_path / "test_spectral_fit_data.h5")
background.load_binned_data_from_hdf5(binned_data=data_path / "test_spectral_fit_background.h5")

$ FullDetectorResponse.open(dr).axes['Em'].edges
<Quantity [  100.   ,   158.489,   251.189,   398.107,   630.957,
            1000.   ,  1584.89 ,  2511.89 ,  3981.07 ,  6309.57 ,
           10000.   ] keV>

$ background.binned_data.axes['Em'].edges
<Quantity [ 150.,  220.,  325.,  480.,  520.,  765., 1120., 1650., 2350.,
           3450., 5000.] keV>

$ data.binned_data.axes['Em'].edges
<Quantity [ 150.,  220.,  325.,  480.,  520.,  765., 1120., 1650., 2350.,
           3450., 5000.] keV>

I realized this while fixing the units tests in the interfaces branch, which does check that the axes match. In develop only the number of bins matter, which is why it went unnoticed.

I'll fix in interfaces (by hacking the edge values, so I can recover the same numbers), but I'm opening this here since it affect develop as well.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions