diff --git a/cscripts/csphagen.py b/cscripts/csphagen.py index ac36f80..9a99874 100755 --- a/cscripts/csphagen.py +++ b/cscripts/csphagen.py @@ -287,6 +287,15 @@ class csphagen(ctools.csobservation): self._has_exclusion = True elif self['inexclusion'].is_valid(): inexclusion = self['inexclusion'].filename() + # If the user has not specified the extension to use + # and there is an extension called 'EXCLUSION' ... + if not inexclusion.has_extname()\ + and not inexclusion.has_extno()\ + and gammalib.GFits(inexclusion).contains('EXCLUSION'): + # ... choose it for the exclusion map + extname = inexclusion.url() + '[EXCLUSION]' + inexclusion = gammalib.GFilename(extname) + # Otherwise will pick the default (primary) HDU self._excl_reg = gammalib.GSkyRegionMap(inexclusion) self._has_exclusion = True else: diff --git a/doc/source/users/reference_manual/csphagen.rst b/doc/source/users/reference_manual/csphagen.rst index 61a5659..ce40906 100644 --- a/doc/source/users/reference_manual/csphagen.rst +++ b/doc/source/users/reference_manual/csphagen.rst @@ -25,9 +25,13 @@ respect to the pointing direction that are smaller than the value specified by the ``maxoffset`` parameter. If less than ``bkgregmin`` reflected regions can be found because the offset angle between source and pointing direction is too small, the observation will be skipped. Regions to be excluded for background -determination can be specified using a mask file that is specified using the -``inexclusion`` parameter. A mask file is a sky map where all pixel values that -differ from zero will be used as exclusion region. +determination can be specified using a FITS mask file that is specified using the +``inexclusion`` parameter. A mask is a sky map where all pixel values that +differ from zero will be used as exclusion region. If the FITS file +contains multiple extensions and the user does not specify which one +to use, the extention ``EXCLUSION`` will be used if available (e.g., +if you use a skymap generated by :ref:`ctskymap`). +Otherwise the primary extension will be used. Alternatively, if ``bkgmethod=CUSTOM`` is specified, the source and background regions will be specified using the ``srcregfile`` and ``bkgregfile`` parameters, @@ -240,4 +244,7 @@ Standard parameters Related tools or scripts ------------------------ -None +:doc:`ctskymap` +:doc:`csphasecrv` +:doc:`cslightcrv` +