ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
calutils.py
Go to the documentation of this file.
1 # ==========================================================================
2 # Utility functions for calibration handling
3 #
4 # Copyright (C) 2016 Juergen Knoedlseder
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #
19 # ==========================================================================
20 import gammalib
21 
22 
23 # ======================= #
24 # Create CIF binary table #
25 # ======================= #
27  """
28  Create Calibration Database Index File binary table
29  """
30  # Create binary table
31  table = gammalib.GFitsBinTable()
32 
33  # Append columns. Reference: CAL/GEN/92-008
34  table.append(gammalib.GFitsTableStringCol("TELESCOP", 0, 10))
35  table.append(gammalib.GFitsTableStringCol("INSTRUME", 0, 10))
36  table.append(gammalib.GFitsTableStringCol("DETNAM", 0, 20))
37  table.append(gammalib.GFitsTableStringCol("FILTER", 0, 10))
38  table.append(gammalib.GFitsTableStringCol("CAL_DEV", 0, 20))
39  table.append(gammalib.GFitsTableStringCol("CAL_DIR", 0, 70))
40  table.append(gammalib.GFitsTableStringCol("CAL_FILE", 0, 40))
41  table.append(gammalib.GFitsTableStringCol("CAL_CLAS", 0, 3))
42  table.append(gammalib.GFitsTableStringCol("CAL_DTYP", 0, 4))
43  table.append(gammalib.GFitsTableStringCol("CAL_CNAM", 0, 20))
44  table.append(gammalib.GFitsTableStringCol("CAL_CBD", 0, 70, 9))
45  table.append(gammalib.GFitsTableShortCol("CAL_XNO", 0))
46  table.append(gammalib.GFitsTableStringCol("CAL_VSD", 0, 10))
47  table.append(gammalib.GFitsTableStringCol("CAL_VST", 0, 8))
48  table.append(gammalib.GFitsTableDoubleCol("REF_TIME", 0))
49  table.append(gammalib.GFitsTableShortCol("CAL_QUAL", 0))
50  table.append(gammalib.GFitsTableStringCol("CAL_DATE", 0, 8))
51  table.append(gammalib.GFitsTableStringCol("CAL_DESC", 0, 70))
52 
53  # Set keywords. Reference: CAL/GEN/92-008
54  table.extname("CIF")
55  table.card("CIFVERSN", "1992a", "Version of CIF format")
56 
57  # Return table
58  return table
def create_cif_table
Definition: calutils.py:26