Add test-cases for loading point-like irfs with data store
@@ -275,3 +275,32 @@ def test_datastore_from_dir_no_obs_index(caplog, tmpdir):
data_store_copy = DataStore.from_dir(test_dir)
assert len(data_store_copy.obs_ids) == 1
assert data_store_copy.obs_table == None
+
+
+@requires_data()
+def test_data_store_required_irf_pointlike_fixed_rad_max():
+ """Check behavior of the "point-like" option for datastore"""
+ store = DataStore.from_dir('$GAMMAPY_DATA/joint-crab/dl3/magic')
+ obs = store.get_observations([5029748], required_irf='point-like')
+ assert len(obs) == 1
+ assert u.allclose(obs[0].rad_max.quantity, np.sqrt(0.02) * u.deg)
+
+ obs = store.get_observations([5029748], required_irf=['aeff', 'edisp', 'rad_max'])
+ assert len(obs) == 1
+ assert u.allclose(obs[0].rad_max.quantity, np.sqrt(0.02) * u.deg)
+
+
+@requires_data()
+def test_data_store_required_irf_pointlike_variable_rad_max():
+ """Check behavior of the "point-like" option for datastore"""
+ store = DataStore.from_dir('$GAMMAPY_DATA/magic/rad_max/data/')
+ obs = store.get_observations(
+ [5029747, 5029748],
+ required_irf=['aeff', 'edisp', 'rad_max']
+ )
+ assert len(obs) == 2
+ assert obs[0].rad_max is not None
+
+ obs = store.get_observations([5029747, 5029748], required_irf='point-like')
+ assert len(obs) == 2
+ assert obs[0].rad_max.quantity is not None
