Commit 96ece9d74212f1f30e4fe338fd3d55923b2b39f9
1 parent
6f6a50fc
cleaned up par file and add reference manual
Showing
3 changed files
with
214 additions
and
20 deletions
cscripts/csscs.par
| ... | ... | @@ -25,25 +25,24 @@ edispcube, f, a, NONE,,, "Input energy dispersion cube file" |
| 25 | 25 | bkgcube, f, a, NONE,,, "Input background cube file" |
| 26 | 26 | caldb, s, a, prod2,,, "Calibration database" |
| 27 | 27 | irf, s, a, South_0.5h,,, "Instrument response function" |
| 28 | -inexclusion, f, a, NONE,,, "Exclusion regions TODO: add meaningful default" | |
| 28 | +inexclusion, f, a, skymap.fits,,, "Exclusion regions file" | |
| 29 | 29 | edisp, b, h, no,,, "Apply energy dispersion?" |
| 30 | 30 | outfile, f, a, maps.fits,,, "Output maps" |
| 31 | 31 | |
| 32 | 32 | # |
| 33 | 33 | # Script parameters |
| 34 | 34 | #================== |
| 35 | +nxpix, i, a, 20,,, "Size of the X axis in pixels" | |
| 36 | +nypix, i, a, 20,,, "Size of the Y axis in pixels" | |
| 37 | +binsz, r, a, 0.1,,, "Pixel size (deg/pixel)" | |
| 35 | 38 | coordsys, s, a, CEL,CEL|GAL,, "Coordinate System" |
| 36 | 39 | proj, s, a, CAR,AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN,, "Projection method" |
| 37 | 40 | xref, r, a, 83.63,0,360, "First coordinate of image center in degrees (RA or galactic l)" |
| 38 | 41 | yref, r, a, 22.51,-90,90, "Second coordinate of image center in degrees (DEC or galactic b)" |
| 39 | -nxpix, i, a, 20,,, "Size of the X axis in pixels" | |
| 40 | -nypix, i, a, 20,,, "Size of the Y axis in pixels" | |
| 41 | -binsz, r, a, 0.1,,, "Pixel size (deg/pixel)" | |
| 42 | 42 | rad, r, a, 0.2,,, "Radius of the region for component separation (deg)" |
| 43 | -statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" | |
| 44 | -method, s, a, UNBINNED, UNBINNED|ONOFF,, "Analysis method" | |
| 45 | 43 | emin, r, a, 0.1,,, "Lower energy limit (TeV)" |
| 46 | 44 | emax, r, a, 100.0,,, "Upper energy limit (TeV)" |
| 45 | +method, s, a, UNBINNED, UNBINNED|ONOFF,, "Analysis method" | |
| 47 | 46 | enumbins, i, a, 20,,, "Number of energy bins" |
| 48 | 47 | bkgmethod, s, h, REFLECTED,REFLECTED,, "Method for background estimation" |
| 49 | 48 | srcshape, s, h, CIRCLE,CIRCLE,, "Shape of the source region" |
| ... | ... | @@ -54,11 +53,13 @@ maxoffset, r, h, 4.0,,, "Maximum offset of source from camera center to acce |
| 54 | 53 | etruemin, r, h, 0.01,,, "Minimum true energy (TeV)" |
| 55 | 54 | etruemax, r, h, 300.0,,, "Maximum true energy (TeV)" |
| 56 | 55 | etruebins, i, h, 30,,, "Number of bins per decade for true energy bins" |
| 57 | -calc_ts, b, h, yes,,, "Compute TS value in each bin" | |
| 58 | -calc_ulim, b, h, no,,, "Compute upper limit in each bin" | |
| 59 | -fix_srcs, b, h, yes,,, "Fix other skymodel normalisations" | |
| 56 | +statistic, s, h, DEFAULT,DEFAULT|CSTAT|WSTAT|CHI2,, "Optimization statistic" | |
| 57 | +calc_ts, b, h, yes,,, "Compute TS value for each map bin" | |
| 58 | +calc_ulim, b, h, no,,, "Compute upper limit for each map bin" | |
| 59 | +fix_srcs, b, h, yes,,, "Fix normalisations of other skymodels" | |
| 60 | 60 | fix_bkg, b, h, no,,, "Fix background normalisation" |
| 61 | 61 | |
| 62 | + | |
| 62 | 63 | # |
| 63 | 64 | # Standard parameters |
| 64 | 65 | #==================== | ... | ... |
doc/source/users/reference_manual/csscs.rst
| ... | ... | @@ -3,26 +3,217 @@ |
| 3 | 3 | csscs |
| 4 | 4 | ============================== |
| 5 | 5 | |
| 6 | -ToDo: Describe in a one liner what the script is doing. | |
| 6 | +Performs spectral component separation. | |
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | Synopsis |
| 10 | 10 | -------- |
| 11 | 11 | |
| 12 | -ToDo: Desribe in detail what the script is doing, what it takes on input and | |
| 13 | -what it produces on output. Please do not write more than 80 characters per | |
| 14 | -line since this file is also used to produce a help text for the terminal. | |
| 15 | - | |
| 12 | +This script performs a spectral component separation, that is, | |
| 13 | +produces a flux skymap of one or multiple sources by running a likelihood | |
| 14 | +analysis over multiple adjacent circular regions of interest (ROI) | |
| 15 | +based on prior knowledge of the sources' spectra. The centre of the | |
| 16 | +ROIs is displaced to coincide with the centre of each pixel in the | |
| 17 | +output flux map, while the radius is set through the user parameter ``rad``. | |
| 18 | + | |
| 19 | +The model fit per ROI is performed using :doc:`ctlike`, and only the | |
| 20 | +normalisations of the model components are treated as free parameters. | |
| 21 | +The script provides the possibility to fix sources other than the | |
| 22 | +source(s) of interest (hidden parameter ``fix_srcs``) or to fix the | |
| 23 | +normalisation of the background | |
| 24 | +model component(s) (hidden parameter ``fix_bkg``). | |
| 25 | + | |
| 26 | +The script computes the source flux and its uncertainty in each | |
| 27 | +ROI/map pixel, as well as the significance of the source detection | |
| 28 | +(for faster execution the significance computation can be | |
| 29 | +deactivated using the hidden parameter ``calc_ts``). Optionally, the | |
| 30 | +script also computes an upper flux limit that is particularly useful | |
| 31 | +in case that the source is not significantly detected within an | |
| 32 | +ROI (hidden parameter ``calc_ulim``). | |
| 33 | + | |
| 34 | +The script accepts in input event lists, binned data, or observation | |
| 35 | +definition XML files. Only data | |
| 36 | +within an energy interval spanned by ``emin`` and ``emax`` are | |
| 37 | +considered. For event lists two analysis methods are proposed: | |
| 38 | +unbinned or On/Off. | |
| 39 | + | |
| 40 | +For the On/Off method :doc:`csphagen` is | |
| 41 | +used to prepare On/Off observations for every ROI | |
| 42 | +analysed. In On/Off mode the user is required to provide an exclusion | |
| 43 | +map to avoid using regions of significant gamma-ray emission in the | |
| 44 | +evaluation of the background (exclusion maps can be generate using | |
| 45 | +:doc:`ctskymap`). Furthemore, On/Off analysis including | |
| 46 | +sources other than the source(s) of interest is not supported, | |
| 47 | +and if more than one source of interest is | |
| 48 | +present the response will be calculated based on the | |
| 49 | +hypothesis that emission from the sources of interest is uniform over | |
| 50 | +each ROI. | |
| 51 | + | |
| 52 | +:ref:`csscs` generates a FITS file with empty primary extension. | |
| 53 | +Additional extensions provide for every source of interest a skymap of | |
| 54 | +flux, flux error, and, if requested, detection signficance and flux | |
| 55 | +upper limits. | |
| 16 | 56 | |
| 17 | 57 | General parameters |
| 18 | 58 | ------------------ |
| 19 | 59 | |
| 20 | -ToDo: Add here your parameters. | |
| 60 | +``inobs [file]`` | |
| 61 | + Input event list, counts cube or observation definition XML file. | |
| 62 | + | |
| 63 | +``inmodel [file]`` | |
| 64 | + Input model XML file. | |
| 65 | + | |
| 66 | +``srcnames [string]`` | |
| 67 | + Semicolon-separated list of names of the sources in the source | |
| 68 | + model XML file which should be considered for the spectral | |
| 69 | + component separation. | |
| 70 | + | |
| 71 | +``expcube [file]`` | |
| 72 | + Input exposure cube file. | |
| 73 | + | |
| 74 | +``psfcube [file]`` | |
| 75 | + Input PSF cube file. | |
| 76 | + | |
| 77 | +``edispcube [file]`` | |
| 78 | + Input energy dispersion cube file. | |
| 79 | + | |
| 80 | +``bkgcube [file]`` | |
| 81 | + Input background cube file. | |
| 82 | + | |
| 83 | +``caldb [string]`` | |
| 84 | + Calibration database. | |
| 85 | + | |
| 86 | +``irf [string]`` | |
| 87 | + Instrument response function. | |
| 88 | + | |
| 89 | +``inexclusion [file]`` | |
| 90 | + Optional FITS file containing a WCS map in the first extension that defines | |
| 91 | + sky regions not to be used for background estimation (where map value != 0). | |
| 92 | + | |
| 93 | +``(edisp = no) [boolean]`` | |
| 94 | + Apply energy dispersion to response computation? | |
| 95 | + | |
| 96 | +``outfile [file]`` | |
| 97 | + Output file. | |
| 98 | + | |
| 99 | +``nxpix [integer]`` | |
| 100 | + Size of the Right Ascension / Galactic longitude axis (in pixels). | |
| 101 | + | |
| 102 | +``nypix [integer]`` | |
| 103 | + Size of the Declination / Galactic latitude axis (in pixels). | |
| 104 | + | |
| 105 | +``binsz [real]`` | |
| 106 | + Pixel size (in degrees/pixel). | |
| 107 | + | |
| 108 | +``coordsys <CEL|GAL> [string]`` | |
| 109 | + Coordinate system (CEL - celestial, GAL - galactic). | |
| 110 | + | |
| 111 | +``proj <AIT|AZP|CAR|GLS|MER|MOL|SFL|SIN|STG|TAN> [string]`` | |
| 112 | + Projection method. | |
| 113 | + | |
| 114 | +``xref [real]`` | |
| 115 | + Right Ascension / Galactic longitude of image centre (J2000, in degrees). | |
| 116 | + | |
| 117 | +``yref [real]`` | |
| 118 | + Declination / Galactic latitude of image centre (J2000, in | |
| 119 | + degrees). | |
| 120 | + | |
| 121 | + ``rad [real]`` | |
| 122 | + Radius of region of interest for component separation (deg). Sets | |
| 123 | + the correlation scale between neighbour pixels in the output maps. Must | |
| 124 | + be at least sqrt(2) times ``binsz`` for full coverage of input data. | |
| 125 | + | |
| 126 | + ``emin [real]`` | |
| 127 | + Minimum energy (in TeV). | |
| 128 | + | |
| 129 | +``emax [real]`` | |
| 130 | + Maximum energy (in TeV). | |
| 131 | + | |
| 132 | +``method <UNBINNED|ONOFF> [string]`` | |
| 133 | + For input event lists selects between ``UNBINNED`` analysis | |
| 134 | + (3D spatial/energy likelihood without binning) and ``ONOFF`` | |
| 135 | + analysis (1D likelihood with background from Off regions). | |
| 136 | + | |
| 137 | +``enumbins [integer]`` | |
| 138 | + Number of energy bins per light curve bin (for On/Off analysis only). | |
| 139 | + | |
| 140 | +``(bkgmethod = REFLECTED) [string]`` | |
| 141 | + Method for background estimation in On/Off analysis. | |
| 142 | + ``REFLECTED:`` background evaluated in regions with the same shape as | |
| 143 | + source region reflected w.r.t. pointing direction for each | |
| 144 | + observation. | |
| 145 | + | |
| 146 | +``(srcshape = CIRCLE) [string]`` | |
| 147 | + Shape of the source region for On/Off analysis. | |
| 148 | + ``CIRCLE``: circular region around given position. | |
| 149 | + | |
| 150 | +``(bkgregmin = 2) [integer]`` | |
| 151 | + Minimum number of background regions that are required for an observation in | |
| 152 | + On/Off analysis. If this number of background regions is not available the | |
| 153 | + observation is skipped. | |
| 154 | + | |
| 155 | + ``(bkgregskip = 1) [integer]`` | |
| 156 | + Number of background regions that should be skipped next to the On regions. | |
| 157 | + Typically, one region is skipped so that the Off regions are taken sufficiently | |
| 158 | + distant from the On region, but in some cases it may be useful to keep the | |
| 159 | + background regions next to the On region. | |
| 160 | + | |
| 161 | +``(use_model_bkg = yes) [boolean]`` | |
| 162 | + Specifies whether the background model should be used for the computation | |
| 163 | + of the ``alpha`` parameter and the predicted background rate in the Off | |
| 164 | + region that is stored in the ``BACKRESP`` column of the Off spectrum when | |
| 165 | + using the ``ONOFF`` method. | |
| 166 | + | |
| 167 | + If the parameter is set to ``no`` the background model is not used and the | |
| 168 | + background rate is assumed identical within the On and Off regions. This | |
| 169 | + is the classical IACT analysis method that is used when using reflected Off | |
| 170 | + regions. In that case the ``alpha`` parameter becomes independent of energy | |
| 171 | + and only reflects the ratio between the solid angles of the On and Off | |
| 172 | + regions. The ``BACKRESP`` column in the Off spectrum will be filled with | |
| 173 | + the solid angle of the On region. The data need to be fitted with the ``wstat`` | |
| 174 | + statistic, fitting with ``cstat`` will not work. | |
| 175 | + | |
| 176 | +``(maxoffset = 4.0) [real]`` | |
| 177 | + Maximum offset in degrees of source from camera center to accept the | |
| 178 | + observation for On/Off analysis. | |
| 179 | + | |
| 180 | +``(etruemin = 0.01) [real]`` | |
| 181 | + Minimum true energy to evaluate instrumental response in On/Off analysis (TeV). | |
| 182 | + | |
| 183 | +``(etruemax = 0.01) [real]`` | |
| 184 | + Maximum true energy to evaluate instrumental response in On/Off analysis (TeV). | |
| 185 | + | |
| 186 | +``(etruebins = 30) [integer]`` | |
| 187 | + Number of bins per decade for true energy bins to evaluate instrumental | |
| 188 | + response in On/Off analysis. | |
| 189 | + | |
| 190 | +``(statistic = DEFAULT) <DEFAULT|CSTAT|WSTAT|CHI2> [string]`` | |
| 191 | + Optimization statistic. ``DEFAULT`` uses the default statistic for all | |
| 192 | + observations, which is ``CSTAT`` or the statistic specified in the | |
| 193 | + observation definition XML file. ``CSTAT`` uses the C statistic for | |
| 194 | + all observations, ``WSTAT`` uses the W statistic for On/Off | |
| 195 | + observations, and ``CHI2`` uses the Chi squared statistic for | |
| 196 | + binned or stacked observations. | |
| 197 | + | |
| 198 | +``(calc_ts = yes) [boolean]`` | |
| 199 | + Compute TS value for each map bin? | |
| 200 | + | |
| 201 | +``(calc_ulim = yes) [boolean]`` | |
| 202 | + Compute upper limit for each map bin? | |
| 203 | + | |
| 204 | +``(fix_srcs = yes) [boolean]`` | |
| 205 | + Fix other sky model parameters? | |
| 206 | + | |
| 207 | +``(fix_bkg = no) [boolean]`` | |
| 208 | + Fix background model parameters? | |
| 21 | 209 | |
| 22 | 210 | |
| 23 | 211 | Standard parameters |
| 24 | 212 | ------------------- |
| 25 | 213 | |
| 214 | +``(nthreads = 0) [integer]`` | |
| 215 | + Number of parallel processes (0=use all available CPUs). | |
| 216 | + | |
| 26 | 217 | ``(chatter = 2) [integer]`` |
| 27 | 218 | Verbosity of the executable: |
| 28 | 219 | ``chatter = 0``: no information will be logged |
| ... | ... | @@ -51,4 +242,6 @@ Standard parameters |
| 51 | 242 | Related tools or scripts |
| 52 | 243 | ------------------------ |
| 53 | 244 | |
| 54 | -None | |
| 245 | +:doc:`ctlike` | |
| 246 | +:doc:`ctskymap` | |
| 247 | +:doc:`csphagen` | ... | ... |
doc/source/users/reference_manual/index.rst
| ... | ... | @@ -3,12 +3,12 @@ |
| 3 | 3 | Reference Manual |
| 4 | 4 | ================ |
| 5 | 5 | |
| 6 | - | |
| 7 | 6 | This manual provides reference information for all ctools and csripts. |
| 8 | 7 | General information on ctools usage can be found `here |
| 9 | 8 | <../user_manual/introduction.html>`_. The description of user parameters in the reference |
| 10 | 9 | manual is documented `here <usage.html>`__. |
| 11 | 10 | |
| 11 | + | |
| 12 | 12 | Below you find links to the command line reference for all available tools and scripts. |
| 13 | 13 | |
| 14 | 14 | ctools |
| ... | ... | @@ -37,6 +37,7 @@ ctools |
| 37 | 37 | cttsmap --- Generates Test Statistic map <cttsmap> |
| 38 | 38 | ctulimit --- Calculates upper limit <ctulimit> |
| 39 | 39 | |
| 40 | + | |
| 40 | 41 | cscripts |
| 41 | 42 | -------- |
| 42 | 43 | |
| ... | ... | @@ -69,16 +70,16 @@ cscripts |
| 69 | 70 | cstsmapsplit --- Creates commands to split the Test Statistic map computations <cstsmapsplit> |
| 70 | 71 | csviscube --- Computes visibility cube <csviscube> |
| 71 | 72 | |
| 73 | + | |
| 72 | 74 | Scripts to manage an IACT database |
| 73 | 75 | ---------------------------------- |
| 74 | 76 | |
| 75 | 77 | .. warning:: |
| 78 | + | |
| 76 | 79 | The ``csiactdata``, ``csiactobs``, ``csfindobs`` and ``csiactcopy`` scripts |
| 77 | 80 | rely on the ``json`` Python module which is only available in Python 2.6 |
| 78 | 81 | or higher. These scripts will not work on older Python versions. |
| 79 | 82 | |
| 80 | - | |
| 81 | - | |
| 82 | 83 | .. toctree:: |
| 83 | 84 | :maxdepth: 1 |
| 84 | 85 | |
| ... | ... | @@ -87,4 +88,3 @@ Scripts to manage an IACT database |
| 87 | 88 | csiactobs --- Generates observation definition file for IACT data from observation IDs <csiactobs> |
| 88 | 89 | csfindobs --- Generates a list of IACT observation IDs <csfindobs> |
| 89 | 90 | csiactcopy --- Copies IACT data from one location to another <csiactcopy> |
| 90 | - | ... | ... |