open-gamma-ray-astro / gamma-astro-data-formats

Data formats for gamma-ray astronomy
https://gamma-astro-data-formats.readthedocs.io
Creative Commons Attribution 4.0 International
30 stars 27 forks source link

Time Format #104

Closed kbruegge closed 6 years ago

kbruegge commented 6 years ago

I'm confused about the time format in the event lists. Description here and here don't seem to state to what reference the seconds in the Time column should be saved. Is it supposed to be relative to TIME-OBS?

TarekHC commented 6 years ago

I believe we are using the FITS standard (we cite the correct reference).

Whatever time unit you use, will be with respect to the MJDREFI and MJDREFF you define.

As far as I understand, you can use any time system / reference as long as you consistently use the correct keywords TIMESYS and TIMEREF.

I guess the simplest would be local UTC times with respect to, for example, the MJD of first light?

cdeil commented 6 years ago

I think http://gamma-astro-data-formats.readthedocs.io/en/latest/general/time.html is pretty extensive. Like @TarekHC said, the relevant header keys are in the list after "The reference time point is specified" and the FITS standard and time paper that we reference has more information.

Every mission / telescope picks the reference time point they like. Usually a bit before the start of the mission, so that METs are positive numbers. But not too far in the past (such as e.g. 1900 or 1970) because then the precision gets lower due to floating point precision. Here's what Fermi-LAT has chosen: https://fermi.gsfc.nasa.gov/ssc/data/analysis/documentation/Cicerone/Cicerone_Data/Time_in_ScienceTools.html

Very recently, Astropy improved it's support for Time FITS serialisation: http://docs.astropy.org/en/stable/io/unified.html#time I haven't had time to try it yet.

@mackaiver - Close issue? Or is it not clear? If you see any possibility to improve the description in the spec, please send a pull request.

kbruegge commented 6 years ago

We can close it. I chose an arbitrary offset. I was using the new astropy features and was confused that things look quite different. That's why I asked.

cdeil commented 6 years ago

In case an extra example helps ... this is what we put in HESS in the FITS headers:

The \hess observatory location (usually not needed for science analysis) is:

\begin{verbatim}
    GEOLAT  =    -23.2717777777778 / latitude of observatory (deg)
    GEOLON  =     16.5002222222222 / longitude of observatory (deg)
    ALTITUDE=                1835. / altitude of observatory (km)
\end{verbatim}

The \hess reference time is defined following the FITS time standard, with the
following values:

\begin{verbatim}
    MJDREFI =                51910 / int part of reference MJD for times
    MJDREFF = 0.000742870370370241 / fractional part of MJDREF
    TIMEUNIT= 's       '           / time unit is seconds since MET start
    TIMESYS = 'TT      '           / Time system (TT=terrestrial time)
    TIMEREF = 'local   '           / local time reference
\end{verbatim}