Commit 4a91999bc941b73d90759dc384b9acfc72901069

Authored by Jürgen Knödlseder
2 parents d57b9e25 de021e79

Merge branch 'bugfix-1.0.1' into integration

# Conflicts:
#	README
ChangeLog
1 -2016-01-05 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 1 +2016-01-13 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
2 2
3 * Version 1.1.0 released 3 * Version 1.1.0 released
4 ========================= 4 =========================
5 5
6 6
7 -2016-01-05 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu> 7 +2016-01-13 Juergen Knoedlseder <jurgen.knodlseder@irap.omp.eu>
8 8
9 * Bug fix version 1.0.1 released 9 * Bug fix version 1.0.1 released
10 ================================ 10 ================================
11 11
  12 + Add units to CTA event list columns (#1616)
12 Allow usage of numbers in FITS extension names (#1611) 13 Allow usage of numbers in FITS extension names (#1611)
13 Solve compatibility issues with Anaconda on Mac OS X (#1607) 14 Solve compatibility issues with Anaconda on Mac OS X (#1607)
14 15
@@ -2,7 +2,7 @@ New Features and Important Changes in GammaLib 1.1.0 @@ -2,7 +2,7 @@ New Features and Important Changes in GammaLib 1.1.0
2 2
3 Author(s) : Juergen Knoedlseder 3 Author(s) : Juergen Knoedlseder
4 4
5 -5 January 2016 5 +13 January 2016
6 6
7 7
8 1. Introduction 8 1. Introduction
1 GammaLib information 1 GammaLib information
2 ==================== 2 ====================
3 -Version: 1.1.0 (5 January 2016) 3 +Version: 1.1.0 (13 January 2016)
4 Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) 4 Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu)
5 5
6 6
inst/cta/src/GCTAEventList.cpp
1 /*************************************************************************** 1 /***************************************************************************
2 * GCTAEventList.cpp - CTA event atom container class * 2 * GCTAEventList.cpp - CTA event atom container class *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2015 by Juergen Knoedlseder * 4 + * copyright (C) 2010-2016 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- * 5 * ----------------------------------------------------------------------- *
6 * * 6 * *
7 * This program is free software: you can redistribute it and/or modify * 7 * This program is free software: you can redistribute it and/or modify *
@@ -797,6 +797,13 @@ void GCTAEventList::write_events(GFitsBinTable&amp; hdu) const @@ -797,6 +797,13 @@ void GCTAEventList::write_events(GFitsBinTable&amp; hdu) const
797 GFitsTableFloatCol col_dec = GFitsTableFloatCol("DEC", size()); 797 GFitsTableFloatCol col_dec = GFitsTableFloatCol("DEC", size());
798 GFitsTableFloatCol col_energy = GFitsTableFloatCol("ENERGY", size()); 798 GFitsTableFloatCol col_energy = GFitsTableFloatCol("ENERGY", size());
799 799
  800 + // Set units of columns
  801 + // (see http://fits.gsfc.nasa.gov/standard30/fits_standard30aa.pdf)
  802 + col_time.unit("s");
  803 + col_ra.unit("deg");
  804 + col_dec.unit("deg");
  805 + col_energy.unit("TeV");
  806 +
800 // Fill mandatory columns 807 // Fill mandatory columns
801 for (int i = 0; i < size(); ++i) { 808 for (int i = 0; i < size(); ++i) {
802 col_eid(i) = m_events[i].m_event_id; 809 col_eid(i) = m_events[i].m_event_id;
@@ -815,23 +822,42 @@ void GCTAEventList::write_events(GFitsBinTable&amp; hdu) const @@ -815,23 +822,42 @@ void GCTAEventList::write_events(GFitsBinTable&amp; hdu) const
815 822
816 // If available, add detector coordinates in degrees 823 // If available, add detector coordinates in degrees
817 if (m_has_detxy) { 824 if (m_has_detxy) {
  825 +
  826 + // Allocate columns
818 GFitsTableFloatCol col_detx = GFitsTableFloatCol("DETX", size()); 827 GFitsTableFloatCol col_detx = GFitsTableFloatCol("DETX", size());
819 GFitsTableFloatCol col_dety = GFitsTableFloatCol("DETY", size()); 828 GFitsTableFloatCol col_dety = GFitsTableFloatCol("DETY", size());
  829 +
  830 + // Set units of columns
  831 + // (see http://fits.gsfc.nasa.gov/standard30/fits_standard30aa.pdf)
  832 + col_detx.unit("deg");
  833 + col_dety.unit("deg");
  834 +
  835 + // Fill columns
820 for (int i = 0; i < size(); ++i) { 836 for (int i = 0; i < size(); ++i) {
821 col_detx(i) = m_events[i].dir().detx() * gammalib::rad2deg; 837 col_detx(i) = m_events[i].dir().detx() * gammalib::rad2deg;
822 col_dety(i) = m_events[i].dir().dety() * gammalib::rad2deg; 838 col_dety(i) = m_events[i].dir().dety() * gammalib::rad2deg;
823 } 839 }
  840 +
  841 + // Append columns to table
824 hdu.append(col_detx); 842 hdu.append(col_detx);
825 hdu.append(col_dety); 843 hdu.append(col_dety);
  844 +
826 } 845 }
827 846
828 // If available, add event phase 847 // If available, add event phase
829 if (m_has_phase) { 848 if (m_has_phase) {
  849 +
  850 + // Allocate columns
830 GFitsTableFloatCol col_phase = GFitsTableFloatCol("PHASE", size()); 851 GFitsTableFloatCol col_phase = GFitsTableFloatCol("PHASE", size());
  852 +
  853 + // Fill columns
831 for (int i = 0; i < size(); ++i) { 854 for (int i = 0; i < size(); ++i) {
832 col_phase(i) = m_events[i].m_phase; 855 col_phase(i) = m_events[i].m_phase;
833 } 856 }
  857 +
  858 + // Append columns to table
834 hdu.append(col_phase); 859 hdu.append(col_phase);
  860 +
835 } 861 }
836 862
837 // Append other columns to table 863 // Append other columns to table