Selecting the relevant observations

What you will learn

You will learn how to select a subset of observations from the Data Challenge data for your analysis.

We recommended to analyse the data region by region since the analysis of the Data Challenge data in a single shot will be very very time consuming.

Let’s assume that you want to analyse the central region of our Galaxy using the data obtained during the Galactic Plane Survey.

As first step you should create a folder that will contain your analysis results and any intermediate data products. In this example we name the folder my_first_analysis, and create and step into it using

$ mkdir my_first_analysis
$ cd my_first_analysis

For the following, make sure that you have set the CTADATA and CALDB environment variables as desribed here.

The first step of the analysis consists in selecting the observations from the observation definition file obs_gps_baseline.xml that have pointing directions close to the Galactic Centre. You do this with the csobsselect script by typing:

$ csobsselect
Input event list or observation definition XML file [obs.xml] $CTADATA/obs/obs_gps_baseline.xml
Pointing selection region shape (CIRCLE|BOX) [CIRCLE]
Coordinate system (CEL - celestial, GAL - galactic) (CEL|GAL) [CEL] GAL
Galactic longitude of selection centre (deg) (0-360) [184.56] 0.0
Galactic latitude of selection centre (deg) (-90-90) [-5.79] 0.0
Radius of selection circle (deg) (0-180) [5.0] 3.0
Start time (UTC string, JD, MJD or MET in seconds) [NONE]
Output observation definition XML file [outobs.xml] obs.xml

You selected CIRCLE as the shape of the pointing selection region, specified the Galactic Centre as the centre of the selection region, and selected all observations with pointing directions within 3 degrees from the Galactic Centre from the obs_gps_baseline.xml file. The selected observations are written into the file obs.xml that will be created in the my_first_analysis folder.

You may use the csobsinfo script to display a summary of the selected observations into the console:

$ csobsinfo debug=yes
Input event list, counts cube, or observation definition XML file [obs.xml]
Output DS9 region file [ds9.reg]

Note

The debug=yes attribute instructs csobsinfo to direct the log file output also to the console. Duplication of log file output into the console using the debug=yes attribute works for any tool or script.

The output of csobsinfo is shown below. csobsselect selected 57 observations from the Galactic Plane Survey data containing a total of 6 045 130 events.

2018-01-26T10:30:20: +=========+
2018-01-26T10:30:20: | Summary |
2018-01-26T10:30:20: +=========+
2018-01-26T10:30:20: === Observations ===
2018-01-26T10:30:20:  Unbinned observations .....: 57
2018-01-26T10:30:20:  Binned observations .......: 0
2018-01-26T10:30:20: === Events ===
2018-01-26T10:30:20:  Number of events ..........: 6045130
2018-01-26T10:30:20:  Number of bins ............: 0
2018-01-26T10:30:20: === Pointings ===
2018-01-26T10:30:20:  Mean offset angle .........: Unknown
2018-01-26T10:30:20:  Mean zenith angle .........: 0.00 deg
2018-01-26T10:30:20:  Mean azimuth angle ........: 0.00 deg
2018-01-26T10:30:20: === Energy range ===
2018-01-26T10:30:20:  Minimum energy ............: 30 GeV
2018-01-26T10:30:20:  Maximum energy ............: 160 TeV
2018-01-26T10:30:20: === Time range ===
2018-01-26T10:30:20:  MJD (days) ................: 59235.500 - 59276.921
2018-01-26T10:30:20:  UTC .......................: 2021-01-21T11:58:51 - 2021-03-03T22:04:51
2018-01-26T10:30:20:  MET (seconds) .............: 664502400.000 - 668081160.000
2018-01-26T10:30:20:  Total ontime ..............: 102600.00 s = 1710.00 min = 28.50 h
2018-01-26T10:30:20:  Total livetime ............: 100548.00 s = 1675.80 min = 27.93 h

The resulting observation definition file will look as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<observation_list title="observation list">
  <observation name="GPS" id="110380" instrument="CTA">
    <parameter name="EventList" file="/Users/jurgen/analysis/cta/dc/1dc/1dc/tutorial/1dc/data/baseline/gps/gps_baseline_110380.fits" />
    <parameter name="Calibration" database="1dc" response="South_z20_50h" />
  </observation>
  <observation name="GPS" id="110381" instrument="CTA">
    <parameter name="EventList" file="/Users/jurgen/analysis/cta/dc/1dc/1dc/tutorial/1dc/data/baseline/gps/gps_baseline_110381.fits" />
    <parameter name="Calibration" database="1dc" response="South_z20_50h" />
  </observation>
  ...
  <observation name="GPS" id="111177" instrument="CTA">
    <parameter name="EventList" file="/Users/jurgen/analysis/cta/dc/1dc/1dc/tutorial/1dc/data/baseline/gps/gps_baseline_111177.fits" />
    <parameter name="Calibration" database="1dc" response="South_z20_50h" />
  </observation>
</observation_list>

Each <observation> element corresponds to one observation that is identified by a name attribute and a unique identifier attribute. An <observation> element contains two parameters: the EventList parameter that specifies the name of the corresponding event file, and the Calibration parameter that specifies the instrument response function that applies to the event file.