40 #define G_COPY_DTYPE "GFitsHeaderCard::copy_dtype(GFitsHeaderCard&)"
41 #define G_FREE_DTYPE "GFitsHeaderCard::free_dtype()"
42 #define G_SET_DTYPE "GFitsHeaderCard::set_dtype(std::string&)"
43 #define G_READ_NUM "GFitsHeaderCard::read(void*, int&)"
44 #define G_READ_STR "GFitsHeaderCard::read(void*, std::string&)"
45 #define G_WRITE "GFitsHeaderCard::write(void*)"
89 const std::string& value,
90 const std::string& unit,
91 const std::string& comment)
116 const std::string& value,
117 const std::string& comment)
124 this->
value(
"'"+value+
"'");
143 const std::string& comment)
169 const std::string& comment)
195 const std::string& comment)
221 const std::string& comment)
228 this->
value(std::string(value));
374 std::string value_dtype =
645 result = (
m_value ==
"T") ? 1.0 : 0.0;
680 result = (
m_value ==
"T") ? 1 : 0;
713 if (
m_unit.length() > 0) {
728 result.append(
" <null>");
731 result.append(
" <bit>");
734 result.append(
" <byte>");
737 result.append(
" <signed byte>");
740 result.append(
" <bool>");
743 result.append(
" <string>");
746 result.append(
" <unsigned short>");
749 result.append(
" <short>");
752 result.append(
" <unsigned int>");
755 result.append(
" <int>");
758 result.append(
" <unsigned long>");
761 result.append(
" <long>");
764 result.append(
" <long long>");
767 result.append(
" <float>");
770 result.append(
" <double>");
773 result.append(
" <complex>");
776 result.append(
" <double complex>");
877 const std::string& value,
878 const std::string& unit,
879 const std::string& comment) {
941 std::string msg =
"Invalid data type code "+
995 std::string msg =
"Invalid data type code "+
1027 int last =
m_value.length() - 1;
1064 if ((value_dbl >= 0 && value_dbl == value_ull) ||
1065 (value_dbl < 0 && value_dbl == value_ll)) {
1068 if (value_dbl >= 0) {
1069 if (value_ull > ULONG_MAX) {
1073 else if (value_ull > USHRT_MAX) {
1085 if (value_ll > LONG_MAX || value_ll < LONG_MIN) {
1089 else if (value_ll > SHRT_MAX || value_ll < SHRT_MIN) {
1102 if (value_dbl > FLT_MAX || value_dbl < FLT_MIN) {
1137 status =
__ffgkyn(
FPTR(vptr), keynum, keyname, value, comment, &status);
1181 if (status == 202) {
1182 std::string msg =
"Header card with keyword \""+keyname+
"\" not"
1183 " found in FITS header (status=202).";
1186 else if (status != 0) {
1187 std::string msg =
"Unable to read keyword \""+keyname+
"\" from"
1283 std::string msg =
"The code should never arrive at this point!\n"
1284 "The keyname \""+
m_keyname+
"\" is neither"
1285 " \"COMMENT\" nor \"HISTRORY\" but it has a"
1286 " NULL data type value and a data type of"
1288 "Maybe an invalid FITS header card has been"
1289 " encountered in reading a file?";
void warning(const std::string &origin, const std::string &message)
Emits warning.
#define __ffukyl(A, B, C, D, E)
FITS file class interface definition.
#define __ffgkey(A, B, C, D, E)
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
#define __ffuky(A, B, C, D, E, F)
std::string right(const std::string &s, const int &n, const char &c= ' ')
Right justify string to achieve a length of n characters.
#define __ffukye(A, B, C, D, E, F)
#define __ffukys(A, B, C, D, E)
CFITSIO interface header.
std::string left(const std::string &s, const int &n, const char &c= ' ')
Left justify string to achieve a length of n characters.
#define __ffphis(A, B, C)
#define __ffukyd(A, B, C, D, E, F)
unsigned long long toulonglong(const std::string &arg)
Convert string into unsigned long long value.
#define __ffukyu(A, B, C, D)
#define __ffpcom(A, B, C)
long long tolonglong(const std::string &arg)
Convert string into long long value.
#define __ffprec(A, B, C)
Exception handler interface definition.
#define __ffgkyn(A, B, C, D, E, F)
int toint(const std::string &arg)
Convert string into integer value.
int fits_move_to_hdu(const std::string &caller, void *vptr, const int &hdunum=0)
Move to FITS extension.
double todouble(const std::string &arg)
Convert string into double precision value.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.