Fix test for gammapy/scripts/cta_utils.py
@@ -126,21 +126,22 @@ class CTAObservationSimulation(object):
on_counts += bkg_counts # evts in ON region
- counts_kwargs = dict(energy_lo=reco_energy.lo,
- energy_hi=reco_energy.hi,
- livetime=livetime,
- creator='gammapy')
- on_vector = PHACountsSpectrum(data=on_counts,
+ meta = dict(EXPOSURE=livetime.to('s').value)
+
+ on_vector = PHACountsSpectrum(
+ data=on_counts,
backscal=1,
- **counts_kwargs)
+ energy_lo=reco_energy.lo,
+ energy_hi=reco_energy.hi,
+ meta=meta,
+ )
off_vector = PHACountsSpectrum(energy_lo=reco_energy.lo,
energy_hi=reco_energy.hi,
data=off_counts,
- livetime=livetime,
backscal=1. / alpha,
is_bkg=True,
- creator='gammapy')
+ )
obs = SpectrumObservation(on_vector=on_vector,
off_vector=off_vector,
