GammaLib



ctools is a software package developed for the scientificanalysis of Cherenkov Telescope Array (CTA) data, as well as data fromexisting Imaging Air Cherenkov Telescopes (such as H.E.S.S., MAGIC or VERITAS).

Cherenkov Telescope Array (CTA) is an instrument used for studying very high energy gamma-ray astrophysics. This project enhances the CTools / GammaLib analysis tools and is built on top of them. Download Citation GammaLib - A new framework for the analysis of Astronomical Gamma-Ray Data With the advent of a new generation of telescopes (INTEGRAL, Fermi, H.E.S.S., MAGIC, VERITAS. An initial discussion about the project can be found in GammaLib-ctoolsAddTradAnaMethods.pdf. This was followed by a code structure proposal presented in GammaLib-ctoolsAddTradAnaMethods2.pdf. The first objective of the meeting is to fix the code structure and interfaces, before filling in the required functionalities. About Tracker Navigator Open-Source Reports Services Contacts. Tested libraries.

ctools comprises a set of ftools-like binary executables andPython scripts with a command-line interface allowing for interactive step-wisedata analysis. ctools includes also Python modules to control all tools andscripts from within Python. Creation of shell or Python scripts and pipelinesis supported as well.

Compile GammaLib. Generic Computer Vision Library Topics. Computer-vision computer-graphics human-pose-estimation video-based-rendering Resources.

ctools are based on GammaLib,a versatile toolbox for the scientific analysis of astronomical gamma-ray data.Besides CTA, GammaLib supports the analysis of H.E.S.S., MAGIC, VERITAS,Fermi/LAT, COMPTEL and INTEGRAL/SPI data. GammaLib supports in particular thecombination of data from different instruments in a true joint multi-wavelengthanalysis that consistently handles the response of each instrument. An interfaceto virtual observatory ressources does also exist.

ctools are developed by a team of enthousiastic gamma-rayastronomers with support from engineers. We regularily organisecoding sprintswhere key developers but also newcomers meet to discuss the developments and next steps, and advance with the coding of the software.

ctools is free software distributed under theGNU GPL license version 3

Introduction¶

This page describes how times should be stored.This is a solved problem, we follow the FITS standard.However, the FITS standard is very complex (see also FITS time paper),and allows for different ways to store times in FITS, some of whichare hard to understand and implement.

To keep things simple, we here agree on a way to store times thatis fully compliant, but a subset of the ways allowed by the FITS standard(see Formats below).

This has the advantage of simplicity and uniformity for writers and readers(see Tools below).

One major point allowing for this simplicity is that we only need single 64-bit float precision for timein high-level (DL3 and up) gamma-ray astronomy, as explained in the Precision section below.

GammaLibLibya

At the time of writing this general page on time, the following definitions reference it:

  • EVENTS has the TIME column and several times given via header keywords
  • GTI has the START and STOP columns
  • POINTING has the TIME column
  • Observation index table has the TSTART and TSTOP columns

Other useful resources concerning time:

Formats¶

In tables, times should be given as 64-bit float values. For all the tables and columns mentionedin the introduction, the times are given as seconds since a reference time point.

The reference time point is specified by the following FITS header keywords:

  • MJDREFI type: int, unit: days
    • Integer part of instrument specific MJD time reference
  • MJDREFF type: float, unit: days
    • Float part of instrument specific MJD time reference
  • TIMEUNIT type: string
    • Time unit (e.g. ‘s’)
  • TIMESYS type: string
    • Time system, also referred as time scale (e.g. ‘UT1’, ‘UTC’, ‘TT’, ‘TAI’, see Table 30 of the FITS standard)
  • TIMEREF type: string
    • Time reference frame, used for example for barycentric corrections(options: ‘TOPOCENTER’, ‘GEOCENTER’, ‘BARYCENTER’, ‘HELIOCENTER’, and more see Table 31 of the FITS standard)

See the FITS standard and the FITS time paper for further information.

For light curves (not specified yet), the use of TIMESYS='d' in days is also common.

Some existing files don’t give TIMEUNIT and / or TIMEREF. In those cases, science toolsshould assume defaults of TIMEUNIT='s' and TIMEREF='LOCAL'. No defaults exist forMJDREFI, MJDREFF and TIMESYS, if those are missing science tools should raise an error and exit.New files should always be written with all five header keys.

In addition to that main way of specifying times as a floating point number wrt. a reference time point,the following header keys with date and time values as strings can be added.This is for convenience and humans reading the information. Usually science tools will not accessthis redundant and optional information. The time system used should be the one given by TIMESYS.All values for the keywords mentioned here shall be ISO8601 date and time strings,yyyy-mm-ddTHH:MM:SS.fff.The precision is not fixed, so seconds or fractional seconds could be left out.

  • DATE-OBS type: string
    • Observation date and time, typically the start of observations if not defined otherwise in the comment
  • DATE-BEG type: string
    • Observation start date and time
  • DATE-AVG type: string
    • Average observation date and time
  • DATE-END type: string
    • Observation end date and time

Tools¶

The SOFA Time Scale and Calendar Tools document provides a detaileddescription of times in the high-precision IAU SOFA library, which is thegold standard for times in astronomy.The SOFA time routines are available via the Astropy time Python package,which makes it easy to convert between different time scales(utc, tt and mjd in this example).

as well as different time formats (iso, isot and fits in this example)

Gamma Librae Type Of Star

If you don’t want to install SOFA or Astropy (or to double-check),you can use the xTime time conversion utility provided by HEASARC as a web tool.

  • Gammapy uses Astropy time, with custom utility functions for FITS I/Oto write in the formats recommended here.
  • Gammalib has custom code to hande times that is described in Times in Gammalib.

Precision¶

Depending on the use case and required precision, times are stored as stringsor as one or several integer or floating point numbers. Tools usually useone 64-bit or two 64-bit floating point numbers for time calculations.

Gammalib Documentation

For high-level gamma-ray astronomy, the situation can be summarised like this(see sub-section computation below for details):

  • Do use single 64-bit floats for times.The resulting precision will be about 0.1 micro-seconds or better,which is sufficient for any high-level analysis (including milli-second pulsars).
  • Do not use 32-bit floats for times.If you do, times will be incorrect at the 1 to 100 second level.
  • More than 64-bit floats or a combination of two floating point numbers is not necessary

Use Gammalib

For data acquisition and low-level analysis (event triggering, traces, …),IACTs require nanosecond precision or better. There, the simple advice to use64-bit floats representing seconds wrt. a single reference time doesn’t work!One either needs to have several reference times (e.g. per-observation) ortwo integer or float values. This is not covered by this spec.

Gamma Librae

The time precision obtained with a single 32-bit or 64-bit float can be computedwith this function: