Photon and spacecraft data are all that a user needs for the analysis. For the definition of LAT data products see the information in the Cicerone.
The LAT data can be extracted from the Fermi Science Support Center web site, as described in section Extract LAT data. Preparing these data for analysis depends on the type of analysis you wish to perform (e.g. point source, extended source, GRB spectral analysis, timing analysis, etc). The different cuts to the data are described in detail in the Cicerone.
Data preparation consists of two steps.
Here we give an example of how to prepare the data for the analysis of a point source. For your particular source analysis you have to prepare your data performing similar steps, but with the cuts suggested in Cicerone for your case.
You can download this tutorial as a Jupyter notebook and run it interactively. Please see the instructions for using the notebooks with the Fermitools.
In this section, we look at making basic data cuts using gtselect. By default, gtselect prompts for cuts on:
However, by using hidden parameters defined on the command line (or using the 'Show Advanced Parameters' check box in GUI mode), you can also make cuts on:
For this example we use data that was extracted using the procedure described in the Extract LAT Data tutorial. The original selection used the following information:
The LAT operated in survey mode for that period of time. We provide the user with the photon and spacecraft data files extracted in the same method as described in the Extract LAT data tutorial:
If more than one file was generated by the LAT Data Server, we will need to provide an input file list, in order to use all the event data files in the same analysis. This text file can be generated by typing:
ls *_PH* > events.txt
This input file can be used in place of a single input events (or FT1) file by placing an @ symbol before the text filename. The output from gtselect will be a single file containing all events from the combined file list that satisfy the other specified cuts.
For a simple point source analysis, it is recommended that you only include events with a high probability of being photons. This cut is performed by selecting "source" class events with the the gtselect tool by including the hidden parameter evclass on the command line. For LAT Pass 8 data, "source" events are specified as event class 128 (the default value).
Additionally, in Pass 8 you can supply the hidden parameter evtype (event type) which is a sub-selection on evclass. For a simple analysis, we wish to include all front+back converting events within all PSF and Energy subclasses. This is specified as evtype 3 (the default value).
The recommended values for both evclass and evtype may change as LAT data processing develops.
Now run gtselect to select the data you wish to analyze. For this example, we consider the source class photons within a 20 degree acceptance cone of the blazar 3C 279. We apply the gtselect tool to the data file as follows:
prompt> gtselect evclass=128 evtype=3
Input FT1 file[] @events.txt
Output FT1 file[] 3C279_region_filtered.fits
RA for new search center (degrees) (0:360) [0] 193.98
Dec for new search center (degrees) (-90:90) [0] -5.82
radius of new search region (degrees) (0:180) [180] 20
start time (MET in s) (0:) [0] INDEF
end time (MET in s) (0:) [0] INDEF
lower energy limit (MeV) (0:) [30] 100
upper energy limit (MeV) (0:) [300000] 500000
maximum zenith angle value (degrees) (0:180) [180] 90
Done.
prompt>
The filtered data is provided here.
If you don't want to make a selection on a given parameter, just enter a zero (0) as the value.
In this step we also selected the maximum zenith angle value as suggested in the Cicerone. Photons coming from the Earth limb are a strong source of background. You can minimize this effect with a zenith angle cut. The value of 90 degrees is suggested for reconstructing events above 100 MeV and provides a sufficient buffer between your region of interest (ROI) and the Earth's limb. In the next step, gtmktime will remove any time period that our ROI overlaps this buffer region. While increasing the buffer (reducing zmax) may decrease the background rate from albedo gammas, it will also reduce the amount of time your ROI is completely free of the buffer zone and thus reduce the livetime on the source of interest.
Notes:
BE AWARE: gtselect writes descriptions of the data selections to a series of `Data Sub-Space' (DSS) keywords in the EVENTS extension header. These keywords are used by the exposure-related tools and by gtlike for calculating various quantities, such as the predicted number of detected events given by the source model. These keywords MUST be same for all of the filtered event files considered in a given analysis. gtlike will check to ensure that all of the DSS keywords are the same in all of the event data files. For a discussion of the DSS keywords see the Data Sub-Space Keywords page.
There are multiple ways to view information about your data file. For example:
fhelp fkeypar
prompt> gtvcut suppress_gtis=no
Input FITS file[] 3C279_region_filtered.fits
Extension name[EVENTS]
DSTYP1: BIT_MASK(EVENT_CLASS,128,P8R3)
DSUNI1: DIMENSIONLESS
DSVAL1: 1:1
DSTYP2: POS(RA,DEC)
DSUNI2: deg
DSVAL2: CIRCLE(193.98,-5.82,20)
DSTYP3: TIME
DSUNI3: s
DSVAL3: TABLE
DSREF3: :GTI
GTIs:
239557417.494 239558069.093
239559567.98 239563954.084
239565647.986 239569844.085
...
255384024.931 255388191.087
255390039.929 255394247.086
255396028.929 255398400
DSTYP4: BIT_MASK(EVENT_TYPE,3,P8R3)
DSUNI4: DIMENSIONLESS
DSVAL4: 1:1
DSTYP4: ENERGY
DSUNI4: MeV
DSVAL4: 100:500000
DSTYP5: ZENITH_ANGLE
DSUNI5: deg
DSVAL5: 0:90
prompt>
You may have noticed that all of these files have a GTI extension in them. Before we look at making selections with the gtmktime tool, we should probably clarify what at Good Time Interval (GTI) is:
How are these interpreted for Fermi?
Notes:
gtmktime is used to update the GTI extension and make cuts based on spacecraft parameters contained in the spacecraft (pointing and livetime history) file. It reads the spacecraft file and, based on the filter expression and specified cuts, creates a set of GTIs. These are then combined (logical and) with the existing GTIs in the Event data file, and all events outside this new set of GTIs are removed from the file. New GTIs are then written to the GTI extension of the new file.
Cuts can be made on any field in the spacecraft file by adding terms to the filter expression using C-style relational syntax:
!->not, &&-> and, -> or, ==, !=, >, <, >=, <=ABS(), COS(), SIN(), etc., also work
NOTE: Every time you specify an additional cut on time, ROI, zenith angle, event class, or event type using gtselect, you must run gtmktime to reevaluate the GTI selection.
Several of the cuts made above with gtselect will directly affect the exposure. Running gtmktime will select the correct GTIs to handle these cuts.
It is also especially important to apply a zenith cut for small ROIs (< 20 degrees), as this brings your source of interest close to the Earth's limb.There are two different methods for handling the complex cut on zenith angle. One method involves excluding time intervals where the buffer zone defined by the zenith cut intersects the ROI from the list of GTIs. In order to do that, run gtmktime and answer "yes" at the prompt:
Apply ROI-based zenith angle cut [ ] yes
Filter expression [ ] ( ANGSEP(RA_ZENITH,DEC_ZENITH,RA_SCZ,DEC_SCZ) < limb_angle_minus_FOV ) || ( ANGSEP(RA_ZENITH,DEC_ZENITH,RA_of_center_ROI,DEC_of_center_ROI) + radius_ROI < zenith_cut )
Apply ROI-based zenith angle cut [ ] no
Here, RA_of_center_ROI, DEC_of_center_ROI and radius_ROI correspond to the ROI selection made with gtselect, zenith_cut is defined as 90 degrees (as above), and limb_angle_minus_FOV is (zenith angle of horizon - FOV radius) where the zenith angle of the horizon is 113 degrees.
You can, instead, apply the zenith cut to the livetime calculation while running gtltcube. This is the method that is currently recommended by the LAT team (see the Livetimes and Exposure section of the Cicerone), and is the method we will use most commonly in these analysis threads. To do this, answer "no" at the gtmktime prompt:
Apply ROI-based zenith angle cut [ ] no
And instead, remember to use the hidden "zmax" parameter later when calculating the livetime cube:
prompt> gtltcube zmax=90
gtmktime also provides the ability to exclude periods when some event has negatively affected the quality of the LAT data. To do this, we select good time intervals (GTIs) by using a logical filter for any of the quantities in the spacecraft file. Some possible quantities for filtering data are:
NOTE: A history of the rocking profiles that have been used by the LAT can be found in the observations section.
Here is an example of running gtmktime on the 3C 279 filtered events file. It is useful to rename the spacecraft file to something easier. Here, we have renamed L14043015051399489F7F38_SC00.fits to spacecraft.fits.
prompt> gtmktime
Spacecraft data file[] spacecraft.fits
Filter expression[] (DATA_QUAL>0)&&(LAT_CONFIG==1)
Apply ROI-based zenith angle cut[] no
Event data file[] 3C279_region_filtered.fits
Output event file name[] 3C279_region_filtered_gti.fits
The data with all the cuts described above is provided in this link.
After the data preparation it is advisable to take a look at your data before beginning the detailed analysis. The Explore LAT data tutorial has suggestions on method of getting a quick preview of your data.
Last updated by: N. Mirabal 10/04/2018