Loading [MathJax]/extensions/tex2jax.js
GammaLib
2.0.0
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
x
Functions
a
c
d
e
f
g
h
i
l
m
n
p
r
s
t
w
x
Variables
d
e
f
g
i
l
m
o
p
r
s
t
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
d
e
f
h
i
l
m
n
p
r
s
u
v
Enumerations
Enumerator
Related Symbols
a
c
e
g
i
l
m
n
o
p
s
t
Files
File List
File Members
All
_
a
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
Functions
_
a
c
e
i
l
m
n
o
p
s
t
Variables
c
d
g
j
m
n
o
r
s
t
u
Typedefs
Enumerations
Enumerator
Macros
_
c
d
f
g
h
n
u
▼
GammaLib
Todo List
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
include
GammaLib.hpp
►
GApplication.hpp
►
GApplicationPar.hpp
►
GApplicationPars.hpp
►
GArf.hpp
►
GBase.hpp
►
GBilinear.hpp
►
GCaldb.hpp
►
GContainer.hpp
►
GCsv.hpp
►
GDaemon.hpp
►
GDerivative.hpp
►
GEbounds.hpp
►
GEnergies.hpp
►
GEnergy.hpp
►
GEphemerides.hpp
►
GEvent.hpp
►
GEventAtom.hpp
►
GEventBin.hpp
►
GEventCube.hpp
►
GEventList.hpp
►
GEvents.hpp
►
GException.hpp
►
GFft.hpp
►
GFftWavetable.hpp
►
GFilename.hpp
►
GFits.hpp
►
GFitsAsciiTable.hpp
►
GFitsBinTable.hpp
►
GFitsHDU.hpp
►
GFitsHeader.hpp
►
GFitsHeaderCard.hpp
►
GFitsImage.hpp
►
GFitsImageByte.hpp
►
GFitsImageDouble.hpp
►
GFitsImageFloat.hpp
►
GFitsImageLong.hpp
►
GFitsImageLongLong.hpp
►
GFitsImageSByte.hpp
►
GFitsImageShort.hpp
►
GFitsImageULong.hpp
►
GFitsImageUShort.hpp
►
GFitsTable.hpp
►
GFitsTableBitCol.hpp
►
GFitsTableBoolCol.hpp
►
GFitsTableByteCol.hpp
►
GFitsTableCDoubleCol.hpp
►
GFitsTableCFloatCol.hpp
►
GFitsTableCol.hpp
►
GFitsTableDoubleCol.hpp
►
GFitsTableFloatCol.hpp
►
GFitsTableLongCol.hpp
►
GFitsTableLongLongCol.hpp
►
GFitsTableShortCol.hpp
►
GFitsTableStringCol.hpp
►
GFitsTableULongCol.hpp
►
GFitsTableUShortCol.hpp
►
GFunction.hpp
►
GFunctions.hpp
►
GGti.hpp
►
GHealpix.hpp
►
GHorizDir.hpp
►
GInstDir.hpp
►
GIntegral.hpp
►
GIntegrals.hpp
►
GLog.hpp
►
GMath.hpp
►
GMatrix.hpp
►
GMatrixBase.hpp
►
GMatrixSparse.hpp
►
GMatrixSymmetric.hpp
►
GModel.hpp
►
GModelAssociation.hpp
►
GModelAssociations.hpp
►
GModelData.hpp
►
GModelPar.hpp
►
GModelRegistry.hpp
►
GModels.hpp
►
GModelSky.hpp
►
GModelSpatial.hpp
►
GModelSpatialComposite.hpp
►
GModelSpatialDiffuse.hpp
►
GModelSpatialDiffuseConst.hpp
►
GModelSpatialDiffuseCube.hpp
►
GModelSpatialDiffuseMap.hpp
►
GModelSpatialElliptical.hpp
►
GModelSpatialEllipticalDisk.hpp
►
GModelSpatialEllipticalGauss.hpp
►
GModelSpatialEllipticalGeneralGauss.hpp
►
GModelSpatialPointSource.hpp
►
GModelSpatialRadial.hpp
►
GModelSpatialRadialDisk.hpp
►
GModelSpatialRadialGauss.hpp
►
GModelSpatialRadialGeneralGauss.hpp
►
GModelSpatialRadialProfile.hpp
►
GModelSpatialRadialProfileDMBurkert.hpp
►
GModelSpatialRadialProfileDMEinasto.hpp
►
GModelSpatialRadialProfileDMZhao.hpp
►
GModelSpatialRadialProfileGauss.hpp
►
GModelSpatialRadialRing.hpp
►
GModelSpatialRadialShell.hpp
►
GModelSpatialRegistry.hpp
►
GModelSpectral.hpp
►
GModelSpectralBins.hpp
►
GModelSpectralBrokenPlaw.hpp
►
GModelSpectralComposite.hpp
►
GModelSpectralConst.hpp
►
GModelSpectralExpInvPlaw.hpp
►
GModelSpectralExponential.hpp
►
GModelSpectralExpPlaw.hpp
►
GModelSpectralFunc.hpp
►
GModelSpectralGauss.hpp
►
GModelSpectralLogParabola.hpp
►
GModelSpectralMultiplicative.hpp
►
GModelSpectralNodes.hpp
►
GModelSpectralPlaw.hpp
►
GModelSpectralPlawEnergyFlux.hpp
►
GModelSpectralPlawPhotonFlux.hpp
►
GModelSpectralRegistry.hpp
►
GModelSpectralSmoothBrokenPlaw.hpp
►
GModelSpectralSuperExpPlaw.hpp
►
GModelSpectralTable.hpp
►
GModelSpectralTablePar.hpp
►
GModelSpectralTablePars.hpp
►
GModelTemporal.hpp
►
GModelTemporalConst.hpp
►
GModelTemporalLightCurve.hpp
►
GModelTemporalPhaseCurve.hpp
►
GModelTemporalRegistry.hpp
►
GNdarray.hpp
►
GNodeArray.hpp
►
GObservation.hpp
►
GObservationRegistry.hpp
►
GObservations.hpp
►
GOptimizer.hpp
►
GOptimizerFunction.hpp
►
GOptimizerLM.hpp
►
GOptimizerPar.hpp
►
GOptimizerPars.hpp
►
GPha.hpp
►
GPhases.hpp
►
GPhoton.hpp
►
GPhotons.hpp
►
GPulsar.hpp
►
GPulsarEphemeris.hpp
►
GRan.hpp
►
GRegistry.hpp
►
GResponse.hpp
►
GResponseCache.hpp
►
GResponseVectorCache.hpp
►
GRmf.hpp
►
GRoi.hpp
►
GSkyDir.hpp
►
GSkyDirs.hpp
►
GSkyMap.hpp
►
GSkyPixel.hpp
►
GSkyProjection.hpp
►
GSkyRegion.hpp
►
GSkyRegionCircle.hpp
►
GSkyRegionMap.hpp
►
GSkyRegionRectangle.hpp
►
GSkyRegions.hpp
►
GSource.hpp
►
GTestCase.hpp
►
GTestSuite.hpp
►
GTestSuites.hpp
►
GTime.hpp
►
GTimeReference.hpp
►
GTimes.hpp
►
GTools.hpp
►
GTypemaps.hpp
►
GUrl.hpp
►
GUrlFile.hpp
►
GUrlString.hpp
►
GVector.hpp
►
GVOClient.hpp
►
GVOHub.hpp
►
GVOTable.hpp
►
GWcs.hpp
►
GWcsAIT.hpp
►
GWcsARC.hpp
►
GWcsAZP.hpp
►
GWcsCAR.hpp
►
GWcsGLS.hpp
►
GWcsMER.hpp
►
GWcsMOL.hpp
►
GWcsRegistry.hpp
►
GWcsSFL.hpp
►
GWcsSIN.hpp
►
GWcsSTG.hpp
►
GWcsTAN.hpp
►
GXml.hpp
►
GXmlAttribute.hpp
►
GXmlComment.hpp
►
GXmlDocument.hpp
►
GXmlElement.hpp
►
GXmlNode.hpp
►
GXmlPI.hpp
►
GXmlText.hpp
►
inst
►
src
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
GFitsHeader.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
* GFitsHeader.hpp - FITS header cards container class *
3
* ----------------------------------------------------------------------- *
4
* copyright (C) 2008-2017 by Juergen Knoedlseder *
5
* ----------------------------------------------------------------------- *
6
* *
7
* This program is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
19
* *
20
***************************************************************************/
21
/**
22
* @file GFitsHeader.hpp
23
* @brief FITS header cards container class definition
24
* @author Juergen Knoedlseder
25
*/
26
27
#ifndef GFITSHEADER_HPP
28
#define GFITSHEADER_HPP
29
30
/* __ Includes ___________________________________________________________ */
31
#include <map>
32
#include <string>
33
#include <vector>
34
#include "
GContainer.hpp
"
35
#include "
GFitsHeaderCard.hpp
"
36
37
38
/***********************************************************************/
/**
39
* @class GFitsHeader
40
*
41
* @brief Interface for FITS header class
42
*
43
* The FITS header class is a container class for header cards.
44
*
45
* All cards of a FITS file extension will be held in memory, so no link to
46
* a FITS file is required. Cards are read from a file using the load()
47
* method, and cards are saved into a file using the save() method.
48
***************************************************************************/
49
class
GFitsHeader
:
public
GContainer
{
50
51
public
:
52
// Constructors and destructors
53
GFitsHeader
(
void
);
54
GFitsHeader
(
const
GFitsHeader
& header);
55
virtual
~GFitsHeader
(
void
);
56
57
// Operators
58
GFitsHeader
&
operator=
(
const
GFitsHeader
& header);
59
GFitsHeaderCard
&
operator[]
(
const
int
& cardno);
60
const
GFitsHeaderCard
&
operator[]
(
const
int
& cardno)
const
;
61
GFitsHeaderCard
&
operator[]
(
const
std::string& keyname);
62
const
GFitsHeaderCard
&
operator[]
(
const
std::string& keyname)
const
;
63
64
// Methods
65
void
clear
(
void
);
66
GFitsHeader
*
clone
(
void
)
const
;
67
std::string
classname
(
void
)
const
;
68
GFitsHeaderCard
&
at
(
const
int
& cardno);
69
const
GFitsHeaderCard
&
at
(
const
int
& cardno)
const
;
70
GFitsHeaderCard
&
at
(
const
std::string& keyname);
71
const
GFitsHeaderCard
&
at
(
const
std::string& keyname)
const
;
72
std::string
string
(
const
int
& cardno)
const
;
73
std::string
string
(
const
std::string& keyname)
const
;
74
double
real
(
const
int
& cardno)
const
;
75
double
real
(
const
std::string& keyname)
const
;
76
int
integer
(
const
int
& cardno)
const
;
77
int
integer
(
const
std::string& keyname)
const
;
78
int
size
(
void
)
const
;
79
bool
is_empty
(
void
)
const
;
80
GFitsHeaderCard
&
append
(
const
GFitsHeaderCard
& card);
81
GFitsHeaderCard
&
insert
(
const
int
& cardno,
const
GFitsHeaderCard
& card);
82
GFitsHeaderCard
&
insert
(
const
std::string& keyname,
const
GFitsHeaderCard
& card);
83
void
remove
(
const
int
& cardno);
84
void
remove
(
const
std::string& keyname);
85
void
reserve
(
const
int
& num);
86
void
extend
(
const
GFitsHeader
& header);
87
bool
contains
(
const
int
& cardno)
const
;
88
bool
contains
(
const
std::string& keyname)
const
;
89
void
load
(
void
* vptr);
90
void
save
(
void
* vptr)
const
;
91
std::string
print
(
const
GChatter
& chatter =
NORMAL
)
const
;
92
93
private
:
94
// Private methods
95
void
init_members
(
void
);
96
void
copy_members
(
const
GFitsHeader
& header);
97
void
free_members
(
void
);
98
int
get_index
(
const
std::string& keyname)
const
;
99
void
update_keyname_map
(
void
);
100
101
// Private data area
102
std::vector<GFitsHeaderCard>
m_cards
;
//!< Header cards
103
std::map<std::string, GFitsHeaderCard*>
m_keyname_map
;
//!< Header pointers
104
};
49
class
GFitsHeader
:
public
GContainer
{
…
};
105
106
107
/***********************************************************************/
/**
108
* @brief Return class name
109
*
110
* @return String containing the class name ("GFitsHeader").
111
***************************************************************************/
112
inline
113
std::string
GFitsHeader::classname
(
void
)
const
114
{
115
return
(
"GFitsHeader"
);
116
}
113
std::string
GFitsHeader::classname
(
void
)
const
{
…
}
117
118
119
/***********************************************************************/
/**
120
* @brief Return header card
121
*
122
* @param[in] cardno Number of card in header [0,...,size()-1]
123
* @return Header card.
124
***************************************************************************/
125
inline
126
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
int
& cardno)
127
{
128
return
(
m_cards
[cardno]);
129
}
126
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
int
& cardno) {
…
}
130
131
132
/***********************************************************************/
/**
133
* @brief Return pointer to model (const version)
134
*
135
* @param[in] cardno Number of card in header [0,...,size()-1]
136
* @return Header card.
137
***************************************************************************/
138
inline
139
const
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
int
& cardno)
const
140
{
141
return
(
m_cards
[cardno]);
142
}
139
const
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
int
& cardno)
const
{
…
}
143
144
145
/***********************************************************************/
/**
146
* @brief Return header card
147
*
148
* @param[in] keyname Name of header card
149
* @return Header card.
150
***************************************************************************/
151
inline
152
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
std::string& keyname)
153
{
154
return
(
at
(keyname));
155
}
152
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
std::string& keyname) {
…
}
156
157
158
/***********************************************************************/
/**
159
* @brief Return header card (const version)
160
*
161
* @param[in] keyname Name of header card
162
* @return Header card.
163
***************************************************************************/
164
inline
165
const
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
std::string& keyname)
const
166
{
167
return
(
at
(keyname));
168
}
165
const
GFitsHeaderCard
&
GFitsHeader::operator[]
(
const
std::string& keyname)
const
{
…
}
169
170
171
/***********************************************************************/
/**
172
* @brief Return number of cards in header
173
*
174
* @return Number of cards in header.
175
*
176
* Returns the number of cards in the extension header.
177
***************************************************************************/
178
inline
179
int
GFitsHeader::size
(
void
)
const
180
{
181
return
(
int
)
m_cards
.size();
182
}
179
int
GFitsHeader::size
(
void
)
const
{
…
}
183
184
185
/***********************************************************************/
/**
186
* @brief Signals if there are no cards in the FITS header
187
*
188
* @return True if there are no cards in the FITS header, false otherwise
189
*
190
* Signals if there are no cards in the FITS header.
191
***************************************************************************/
192
inline
193
bool
GFitsHeader::is_empty
(
void
)
const
194
{
195
return
(
m_cards
.empty());
196
}
193
bool
GFitsHeader::is_empty
(
void
)
const
{
…
}
197
198
199
/***********************************************************************/
/**
200
* @brief Reserves space for cards in FITS header
201
*
202
* @param[in] num Number of cards
203
*
204
* Reserves space for @p num cards in the FITS header.
205
***************************************************************************/
206
inline
207
void
GFitsHeader::reserve
(
const
int
& num)
208
{
209
m_cards
.reserve(num);
210
return
;
211
}
207
void
GFitsHeader::reserve
(
const
int
& num) {
…
}
212
213
214
/***********************************************************************/
/**
215
* @brief Check if card is present in header
216
*
217
* @param[in] cardno Number of card in header.
218
* @return True of card exists, false otherwise.
219
*
220
* Signals whether a card with specified card number exists in header.
221
***************************************************************************/
222
inline
223
bool
GFitsHeader::contains
(
const
int
& cardno)
const
224
{
225
return
(cardno >= 0 && cardno <
size
());
226
}
223
bool
GFitsHeader::contains
(
const
int
& cardno)
const
{
…
}
227
228
229
/***********************************************************************/
/**
230
* @brief Check if card is present in header
231
*
232
* @param[in] keyname Name of header card.
233
* @return True of card exists, false otherwise.
234
*
235
* Signals whether a card with specified @p keyname exists in header.
236
***************************************************************************/
237
inline
238
bool
GFitsHeader::contains
(
const
std::string& keyname)
const
239
{
240
return
(
get_index
(keyname) != -1);
241
}
238
bool
GFitsHeader::contains
(
const
std::string& keyname)
const
{
…
}
242
243
#endif
/* GFITSHEADER_HPP */
GContainer.hpp
Definition of interface for container classes.
GFitsHeaderCard.hpp
FITS header card class definition.
GChatter
GChatter
Definition
GTypemaps.hpp:33
NORMAL
@ NORMAL
Definition
GTypemaps.hpp:36
GContainer
Interface class for container classes.
Definition
GContainer.hpp:52
GFitsHeaderCard
Implements FITS header card interface.
Definition
GFitsHeaderCard.hpp:44
GFitsHeader
Interface for FITS header class.
Definition
GFitsHeader.hpp:49
GFitsHeader::free_members
void free_members(void)
Delete class members.
Definition
GFitsHeader.cpp:781
GFitsHeader::m_cards
std::vector< GFitsHeaderCard > m_cards
Header cards.
Definition
GFitsHeader.hpp:102
GFitsHeader::clone
GFitsHeader * clone(void) const
Clone header.
Definition
GFitsHeader.cpp:171
GFitsHeader::contains
bool contains(const int &cardno) const
Check if card is present in header.
Definition
GFitsHeader.hpp:223
GFitsHeader::~GFitsHeader
virtual ~GFitsHeader(void)
Destructor.
Definition
GFitsHeader.cpp:101
GFitsHeader::reserve
void reserve(const int &num)
Reserves space for cards in FITS header.
Definition
GFitsHeader.hpp:207
GFitsHeader::string
std::string string(const int &cardno) const
Return header card value as string value.
Definition
GFitsHeader.cpp:282
GFitsHeader::get_index
int get_index(const std::string &keyname) const
Get index of header card.
Definition
GFitsHeader.cpp:797
GFitsHeader::GFitsHeader
GFitsHeader(void)
Constructor.
Definition
GFitsHeader.cpp:70
GFitsHeader::at
GFitsHeaderCard & at(const int &cardno)
Return header card.
Definition
GFitsHeader.cpp:186
GFitsHeader::init_members
void init_members(void)
Initialise class members.
Definition
GFitsHeader.cpp:749
GFitsHeader::save
void save(void *vptr) const
Save header to FITS file.
Definition
GFitsHeader.cpp:689
GFitsHeader::classname
std::string classname(void) const
Return class name.
Definition
GFitsHeader.hpp:113
GFitsHeader::remove
void remove(const int &cardno)
Remove card from header.
Definition
GFitsHeader.cpp:541
GFitsHeader::copy_members
void copy_members(const GFitsHeader &header)
Copy class members.
Definition
GFitsHeader.cpp:765
GFitsHeader::append
GFitsHeaderCard & append(const GFitsHeaderCard &card)
Append or update header card.
Definition
GFitsHeader.cpp:427
GFitsHeader::operator=
GFitsHeader & operator=(const GFitsHeader &header)
Assignment operator.
Definition
GFitsHeader.cpp:123
GFitsHeader::operator[]
GFitsHeaderCard & operator[](const int &cardno)
Return header card.
Definition
GFitsHeader.hpp:126
GFitsHeader::print
std::string print(const GChatter &chatter=NORMAL) const
Print FITS header information.
Definition
GFitsHeader.cpp:715
GFitsHeader::extend
void extend(const GFitsHeader &header)
Append header.
Definition
GFitsHeader.cpp:600
GFitsHeader::clear
void clear(void)
Clear header.
Definition
GFitsHeader.cpp:153
GFitsHeader::integer
int integer(const int &cardno) const
Return header card value as integer value.
Definition
GFitsHeader.cpp:378
GFitsHeader::m_keyname_map
std::map< std::string, GFitsHeaderCard * > m_keyname_map
Header pointers.
Definition
GFitsHeader.hpp:103
GFitsHeader::insert
GFitsHeaderCard & insert(const int &cardno, const GFitsHeaderCard &card)
Insert card into header.
Definition
GFitsHeader.cpp:465
GFitsHeader::update_keyname_map
void update_keyname_map(void)
Update the header card pointers.
Definition
GFitsHeader.cpp:828
GFitsHeader::real
double real(const int &cardno) const
Return header card value as double precision value.
Definition
GFitsHeader.cpp:330
GFitsHeader::load
void load(void *vptr)
Load header from FITS file.
Definition
GFitsHeader.cpp:639
GFitsHeader::size
int size(void) const
Return number of cards in header.
Definition
GFitsHeader.hpp:179
GFitsHeader::is_empty
bool is_empty(void) const
Signals if there are no cards in the FITS header.
Definition
GFitsHeader.hpp:193
include
GFitsHeader.hpp
Generated on Tue Jan 14 2025 15:02:54 for GammaLib by
1.11.0