make_test_bg_cube_model

gammapy.datasets.make_test_bg_cube_model(detx_range=<Angle [-10., 10.] deg>, ndetx_bins=24, dety_range=<Angle [-10., 10.] deg>, ndety_bins=24, energy_band=<Quantity [1.e-02, 1.e+02] TeV>, nenergy_bins=14, altitude=<Angle 70. deg>, sigma=<Angle 5. deg>, spectral_index=2.7, apply_mask=False, do_not_force_mev_units=False)[source]

Make a test bg cube model.

The background counts cube is created following a 2D symmetric gaussian model for the spatial coordinates (X, Y) and a power-law in energy. The gaussian width varies in energy from sigma/2 to sigma. The power-law slope in log-log representation is given by the spectral_index parameter. The norm depends linearly on the livetime and on the altitude angle of the observation. It is possible to mask 1/4th of the image (for x > x_center and y > y_center). Useful for testing coordinate rotations.

Per default units of 1 / (MeV sr s) for the bg rate are enforced, unless do_not_force_mev_units is set. This is in agreement to the convention applied in make_bg_cube_model.

This method is useful for instance to produce true (simulated) background cube models to compare to the reconstructed ones produced with make_bg_cube_model. For details on how to do this, please refer to Datasets for testing.

Parameters:

detx_range : Angle, optional

X coordinate range (min, max).

ndetx_bins : int, optional

Number of (linear) bins in X coordinate.

dety_range : Angle, optional

Y coordinate range (min, max).

ndety_bins : int, optional

Number of (linear) bins in Y coordinate.

energy_band : Quantity, optional

Energy range (min, max).

nenergy_bins : int, optional

Number of (logarithmic) bins in energy.

altitude : Angle, optional

observation altitude angle for the model.

sigma : Angle, optional

Width of the gaussian model used for the spatial coordinates.

spectral_index : float, optional

Index for the power-law model used for the energy coordinate.

apply_mask : bool, optional

If set, 1/4th of the image is masked (for x > x_center and y > y_center).

do_not_force_mev_units : bool, optional

Set to True to use the same energy units as the energy binning for the bg rate.

Returns:

bg_cube_model : FOVCubeBackgroundModel

Bacground cube model.