diff --git a/cscripts/csroot2caldb.par b/cscripts/csroot2caldb.par index 53ff9e9..9dff400 100644 --- a/cscripts/csroot2caldb.par +++ b/cscripts/csroot2caldb.par @@ -24,6 +24,8 @@ version, s, a, prod3,,, "Instrument Response Function version" analysis, s, a, DESY,,, "Instrument Response Function analysis" zenith, r, a, 20.0,0.0,90.0, "Zenith Angle (deg)" azimuth, r, a, 0.0,0.0,360.0, "Azimuth Angle (deg)" +emin, r, h, UNDEF,,, "Minimum energy threshold (TeV)" +emax, r, h, UNDEF,,, "Maximum energy threshold (TeV)" psftype, s, h, Gauss,Gauss|King,, "Point spread function type" split, b, h, no,,, "Split IRF components into different files" norm1d, b, h, no,,, "Normalize on 1D histograms" diff --git a/cscripts/csroot2caldb.py b/cscripts/csroot2caldb.py index 542e86d..1a36e74 100755 --- a/cscripts/csroot2caldb.py +++ b/cscripts/csroot2caldb.py @@ -588,6 +588,14 @@ class csroot2caldb(ctools.cscript): self._set_cif_keywords(ds['HDU_EA'], irf['EA_NAME'], irf['EA_BOUNDS'], irf['EA_DESC'], irf) + # Optionally write energy thresholds + if self['emin'].is_valid(): + emin = self['emin'].real() + ds['HDU_EA'].card('LO_THRES', emin, '[TeV] Low energy threshold') + if self['emax'].is_valid(): + emin = self['emax'].real() + ds['HDU_EA'].card('HI_THRES', emin, '[TeV] High energy threshold') + # Create "EFFAREA" data column self._make_2D(etrue, ds['HDU_EA'], 'EFFAREA', 'm2')