We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Gammapy version v0.20
Bug description When using the fixed_offset option and the "aeff-max" option the SafeMaskMaker fails with:
fixed_offset
"aeff-max"
SafeMaskMaker
ValueError: observation argument is mandatory with 1 deg
Expected behavior It should handle the case correctly.
To Reproduce
from gammapy.data import DataStore from gammapy.makers import SafeMaskMaker, MapDatasetMaker from gammapy.maps import WcsGeom, MapAxis from gammapy.datasets import MapDataset data_store = DataStore.from_dir("$GAMMAPY_DATA/hess-dl3-dr1") selection = dict( type="sky_circle", frame="icrs", lon="83.633 deg", lat="22.014 deg", radius="5 deg", ) selected_obs_table = data_store.obs_table.select_observations(selection) observations = data_store.get_observations(selected_obs_table["OBS_ID"]) energy_axis = MapAxis.from_energy_bounds(1.0, 10.0, 4, unit="TeV") geom = WcsGeom.create( skydir=(85.633, 22.014), binsz=0.02, width=(10, 10), frame="icrs", proj="CAR", axes=[energy_axis], ) # Reduced IRFs are defined in true energy (i.e. not measured energy). energy_axis_true = MapAxis.from_energy_bounds( 0.5, 20, 10, unit="TeV", name="energy_true" ) stacked = MapDataset.create( geom=geom, energy_axis_true=energy_axis_true, name="crab-stacked" ) offset_max = 2.5 * u.deg maker = MapDatasetMaker() maker_safe_mask = SafeMaskMaker( methods=["offset-max", "aeff-max"], fixed_offset="1 deg" ) for obs in observations: empty = stacked.copy(name=f"obs-{obs.obs_id}") # A MapDataset is filled in this cutout geometry dataset = maker.run(empty, obs) # The data quality cut is applied dataset = maker_safe_mask.run(dataset, obs)
Triggered by #3978.
The text was updated successfully, but these errors were encountered:
The issue here is that the observation argument is not passed correctly to the other methods:
observation
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Gammapy version
v0.20
Bug description
When using the
fixed_offset
option and the"aeff-max"
option theSafeMaskMaker
fails with:Expected behavior
It should handle the case correctly.
To Reproduce
Triggered by #3978.
The text was updated successfully, but these errors were encountered: