TwiceAsNice  2019-02-18
Public Member Functions | Static Protected Attributes | Private Member Functions | Friends | List of all members
Basda::VinoFitsCard Class Reference

A representation of a single line in a FITS header unit. More...

#include <FitsCard.h>

Inheritance diagram for Basda::VinoFitsCard:
Inheritance graph
Collaboration diagram for Basda::VinoFitsCard:
Collaboration graph

Public Member Functions

 VinoFitsCard ()
 define a void (empty) header card. More...
 
 VinoFitsCard (const VinoFitsCardVar &_var)
 
 VinoFitsCard (const std::string &_card)
 ctor given a full card line More...
 
 VinoFitsCard (const char *_card)
 ctor given a full card line More...
 
 VinoFitsCard (const std::string &_key, const char *_val, const std::string &_comment)
 ctor for a string type More...
 
 VinoFitsCard (const std::string &_key, const std::string &_val, const std::string &_comment)
 ctor for a string type More...
 
 VinoFitsCard (const std::string &_key, Nice::Int _val, const std::string &_comment)
 ctor for an integer type More...
 
 VinoFitsCard (const std::string &_key, const bool _val, const std::string &_comment)
 ctor for a bool/logical type More...
 
 VinoFitsCard (const std::string &_key, const double &_val, const std::string &_comment)
 ctor for a floating point type More...
 
 VinoFitsCard (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 ctor for a floating point type More...
 
void set (const std::string &_key, const char *_val, const std::string &_comment)
 overwrite values for a string type. More...
 
void set (const std::string &_key, const std::string &_val, const std::string &_comment)
 overwrite values for a string type. More...
 
void set (const std::string &_key, bool _bval, const std::string &_comment)
 overwrite values for a boolean type. More...
 
void set (const std::string &_key, Nice::Int _val, const std::string &_comment)
 overwrite values for an integer type. More...
 
void set (const std::string &_key, const double &_val, const std::string &_comment)
 overwrite values for a floating point type More...
 
void set (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 overwrite values for a floating point type More...
 
void setValue (const char *_val)
 overwrite the value with a new string More...
 
void setValue (const std::string &_val)
 overwrite the value with a new string If this is a COMMENT card, this is a no-op. More...
 
void setValue (int _val)
 Set the card value to a specific integer. If this is a COMMENT card, this is a no-op. More...
 
void setValue (const bool _bval)
 
void setValue (const double &_val)
 Set the card value to a specific floating point value. If this is a COMMENT card, this is a no-op. More...
 
void setValue (const double &_val, size_t _precision)
 Set the card value to a specific floating point value. If this is a COMMENT card, this is a no-op. More...
 
void setComment (const std::string &_comment)
 overwrite the comment of the card by a new one. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card. More...
 
void setComment (const std::string &_unit, const Nice::Date &_date)
 add a unit and a date to the comment. The unit is preprended and the date is appended to the existing comment. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card. More...
 
void setComment (const std::string &_unit, const std::string &_date="(%Y-%m-%d:%H:%M:%S)")
 add a unit and a date to the comment. The unit is preprended and the current date is appended to the existing comment. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card. More...
 
Nice::Byte getType () const
 get the type More...
 
std::string getCard () const
 Convert to a key = value / comment line. More...
 
std::string getKey () const
 get the key More...
 
std::string getStringVal () const
 convert the value into a string. More...
 
bool getBoolVal () const
 parse the value deciding on <>0 or == 0 . More...
 
Nice::Int getIntVal () const
 parse the value with integer precision. More...
 
double getDoubleVal () const
 Convert the value into a floating point number. More...
 
Nice::Byte getDoublePrecisionVal () const
 
std::string getComment () const
 retrieve the comment part. More...
 
int write (fitsfile *)
 insert the card into a header-data unit. More...
 
VinoFitsCardoperator= (const VinoFitsCard &oth)
 Assignment operator. More...
 
 VinoFitsCard ()
 
 VinoFitsCard (const VinoFitsCardVar &_var)
 
 VinoFitsCard (const std::string &_card)
 
 VinoFitsCard (const char *_card)
 
 VinoFitsCard (const std::string &_key, const char *_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const std::string &_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, Nice::Int _val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const bool _val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const double &_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 
void set (const std::string &_key, const char *_val, const std::string &_comment)
 
void set (const std::string &_key, const std::string &_val, const std::string &_comment)
 
void set (const std::string &_key, bool _bval, const std::string &_comment)
 
void set (const std::string &_key, Nice::Int _val, const std::string &_comment)
 
void set (const std::string &_key, const double &_val, const std::string &_comment)
 
void set (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 
void setValue (const char *_val)
 
void setValue (const std::string &_val)
 
void setValue (int _val)
 
void setValue (const bool _bval)
 
void setValue (const double &_val)
 
void setValue (const double &_val, size_t _precision)
 
void setComment (const std::string &_comment)
 
void setComment (const std::string &_unit, const Nice::Date &_date)
 
void setComment (const std::string &_unit, const std::string &_date="(%Y-%m-%d:%H:%M:%S)")
 
Nice::Byte getType () const
 
std::string getCard () const
 
std::string getKey () const
 
std::string getStringVal () const
 
bool getBoolVal () const
 
Nice::Int getIntVal () const
 
double getDoubleVal () const
 
Nice::Byte getDoublePrecisionVal () const
 
std::string getComment () const
 
int write (fitsfile *)
 
VinoFitsCardoperator= (const VinoFitsCard &oth)
 
 VinoFitsCard ()
 
 VinoFitsCard (const VinoFitsCardVar &_var)
 
 VinoFitsCard (const std::string &_card)
 
 VinoFitsCard (const char *_card)
 
 VinoFitsCard (const std::string &_key, const char *_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const std::string &_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, Nice::Int _val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const bool _val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const double &_val, const std::string &_comment)
 
 VinoFitsCard (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 
void set (const std::string &_key, const char *_val, const std::string &_comment)
 
void set (const std::string &_key, const std::string &_val, const std::string &_comment)
 
void set (const std::string &_key, bool _bval, const std::string &_comment)
 
void set (const std::string &_key, Nice::Int _val, const std::string &_comment)
 
void set (const std::string &_key, const double &_val, const std::string &_comment)
 
void set (const std::string &_key, const double &_val, size_t _precision, const std::string &_comment)
 
void setValue (const char *_val)
 
void setValue (const std::string &_val)
 
void setValue (int _val)
 
void setValue (const bool _bval)
 
void setValue (const double &_val)
 
void setValue (const double &_val, size_t _precision)
 
void setComment (const std::string &_comment)
 
void setComment (const std::string &_unit, const Nice::Date &_date)
 
void setComment (const std::string &_unit, const std::string &_date="(%Y-%m-%d:%H:%M:%S)")
 
Nice::Byte getType () const
 
std::string getCard () const
 
std::string getKey () const
 
std::string getStringVal () const
 
bool getBoolVal () const
 
Nice::Int getIntVal () const
 
double getDoubleVal () const
 
Nice::Byte getDoublePrecisionVal () const
 
std::string getComment () const
 
int write (fitsfile *)
 
VinoFitsCardoperator= (const VinoFitsCard &oth)
 
- Public Member Functions inherited from Basda::VinoFitsCardVar
bool operator== (const VinoFitsCardVar &__rhs) const
 
bool operator< (const VinoFitsCardVar &__rhs) const
 
bool operator!= (const VinoFitsCardVar &__rhs) const
 
bool operator<= (const VinoFitsCardVar &__rhs) const
 
bool operator> (const VinoFitsCardVar &__rhs) const
 
bool operator>= (const VinoFitsCardVar &__rhs) const
 
bool operator== (const VinoFitsCardVar &__rhs) const
 
bool operator< (const VinoFitsCardVar &__rhs) const
 
bool operator!= (const VinoFitsCardVar &__rhs) const
 
bool operator<= (const VinoFitsCardVar &__rhs) const
 
bool operator> (const VinoFitsCardVar &__rhs) const
 
bool operator>= (const VinoFitsCardVar &__rhs) const
 

Static Protected Attributes

static std::map< std::string, size_t > s_typeStringToFitsNum
 

Private Member Functions

int templateAnal (char *card, char keyname[], char keyval[], char cmt[], char dtyp[])
 Analyse the contents and types in a template header line. More...
 
void initTpl (const char *card)
 ctor given a full card line More...
 
int templateAnal (char *card, char keyname[], char keyval[], char cmt[], char dtyp[])
 
void initTpl (const char *card)
 
int templateAnal (char *card, char keyname[], char keyval[], char cmt[], char dtyp[])
 
void initTpl (const char *card)
 

Friends

std::istream & operator>> (std::istream &, VinoFitsCardVar &)
 
std::ostream & operator<< (std::ostream &, const VinoFitsCardVar &)
 
std::istream & operator>> (std::istream &, VinoFitsCardVar &)
 
std::ostream & operator<< (std::ostream &, const VinoFitsCardVar &)
 
std::istream & operator>> (std::istream &, VinoFitsCardVar &)
 
std::ostream & operator<< (std::ostream &, const VinoFitsCardVar &)
 

Additional Inherited Members

- Public Attributes inherited from Basda::VinoFitsCardVar
::std::string mkey
 
::std::string mcomment
 
::Ice::Byte mtype
 
::Ice::Byte mtypeC
 
::Nice::SeqByte mdata
 

Detailed Description

A representation of a single line in a FITS header unit.

This basically contains a keyword, its value (and type) and a trailing human -readable comment.

Constructor & Destructor Documentation

◆ VinoFitsCard() [1/30]

Basda::VinoFitsCard::VinoFitsCard ( )

define a void (empty) header card.


◆ VinoFitsCard() [2/30]

Basda::VinoFitsCard::VinoFitsCard ( const VinoFitsCardVar _var)
inline

◆ VinoFitsCard() [3/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _card)

ctor given a full card line


Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-13
Author
R. J. Mathar

Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-13
Author
R. J. Mathar

◆ VinoFitsCard() [4/30]

Basda::VinoFitsCard::VinoFitsCard ( const char *  _card)

ctor given a full card line


Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-15
Author
R. J. Mathar

Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-15
Author
R. J. Mathar

◆ VinoFitsCard() [5/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const char *  _sval,
const std::string &  _comment 
)

ctor for a string type


Parameters
_keyKey value left from the equal sign. If empty this becomes a COMMENT card.
_svalvalue right from the equal sign
_commentcomment after the slash

◆ VinoFitsCard() [6/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const std::string &  _sval,
const std::string &  _comment 
)

ctor for a string type


Parameters
_keyKey value left from the equal sign. If empty this becomes a COMMENT card.
_svalvalue right from the equal sign
_commentcomment after the slash

◆ VinoFitsCard() [7/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
Nice::Int  _ival,
const std::string &  _comment 
)

ctor for an integer type


Parameters
_keyKeyword. If empty this becomes a COMMENT card.
_ivalinteger value of the key
_commentcomment after the slash

◆ VinoFitsCard() [8/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const bool  _bval,
const std::string &  _comment 
)

ctor for a bool/logical type


Parameters
_keyKeyword. If empty this becomes a COMMENT card.
_bvaltruth value of the key
_commentcomment after the slash

◆ VinoFitsCard() [9/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _dval,
const std::string &  _comment 
)

ctor for a floating point type


Parameters
_keykeyword. If empty this becomes a COMMENT card.
_dvalvalue of the keyword
_commentcomment after the slash

◆ VinoFitsCard() [10/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _dval,
size_t  _precision,
const std::string &  _comment 
)

ctor for a floating point type


Parameters
_keykeyword of the card. If empty this becomes a COMMENT card.
_dvalvalue of the keyword
_precisionnumber of digits in the value
Todo:
what number of digits in what representation?
Parameters
_commentcomment after the slash

Parameters
_keykeyword of the card. If empty this becomes a COMMENT card.
_dvalvalue of the keyword
_precisionnumber of digits in the value
Todo:
what number of digits in what representation?
Parameters
_commentcomment after the slash

◆ VinoFitsCard() [11/30]

Basda::VinoFitsCard::VinoFitsCard ( )

◆ VinoFitsCard() [12/30]

Basda::VinoFitsCard::VinoFitsCard ( const VinoFitsCardVar _var)
inline

◆ VinoFitsCard() [13/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _card)

◆ VinoFitsCard() [14/30]

Basda::VinoFitsCard::VinoFitsCard ( const char *  _card)

◆ VinoFitsCard() [15/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const char *  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [16/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const std::string &  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [17/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
Nice::Int  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [18/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const bool  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [19/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [20/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _val,
size_t  _precision,
const std::string &  _comment 
)

◆ VinoFitsCard() [21/30]

Basda::VinoFitsCard::VinoFitsCard ( )

◆ VinoFitsCard() [22/30]

Basda::VinoFitsCard::VinoFitsCard ( const VinoFitsCardVar _var)
inline

◆ VinoFitsCard() [23/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _card)

◆ VinoFitsCard() [24/30]

Basda::VinoFitsCard::VinoFitsCard ( const char *  _card)

◆ VinoFitsCard() [25/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const char *  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [26/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const std::string &  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [27/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
Nice::Int  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [28/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const bool  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [29/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _val,
const std::string &  _comment 
)

◆ VinoFitsCard() [30/30]

Basda::VinoFitsCard::VinoFitsCard ( const std::string &  _key,
const double &  _val,
size_t  _precision,
const std::string &  _comment 
)

Member Function Documentation

◆ getBoolVal() [1/3]

bool Basda::VinoFitsCard::getBoolVal ( ) const

parse the value deciding on <>0 or == 0 .


Returns
The value narrowed down to boolean value. If this is a COMMENT card, this returns false.
Since
2017-02-13

◆ getBoolVal() [2/3]

bool Basda::VinoFitsCard::getBoolVal ( ) const

◆ getBoolVal() [3/3]

bool Basda::VinoFitsCard::getBoolVal ( ) const

◆ getCard() [1/3]

std::string Basda::VinoFitsCard::getCard ( ) const

Convert to a key = value / comment line.


Returns
Representation of the card as a string. If this is a COMMENT card, prefix the comment with COMMENT.
Since
2017-02-13 added case for TLOGICAL

◆ getCard() [2/3]

std::string Basda::VinoFitsCard::getCard ( ) const

◆ getCard() [3/3]

std::string Basda::VinoFitsCard::getCard ( ) const

◆ getComment() [1/3]

std::string Basda::VinoFitsCard::getComment ( ) const

◆ getComment() [2/3]

std::string Basda::VinoFitsCard::getComment ( ) const

retrieve the comment part.


Returns
The piece of the card right from the slash. If this is a COMMENT card, this is the comment.

◆ getComment() [3/3]

std::string Basda::VinoFitsCard::getComment ( ) const

◆ getDoublePrecisionVal() [1/3]

Nice::Byte Basda::VinoFitsCard::getDoublePrecisionVal ( ) const

◆ getDoublePrecisionVal() [2/3]

Nice::Byte Basda::VinoFitsCard::getDoublePrecisionVal ( ) const

Returns

◆ getDoublePrecisionVal() [3/3]

Nice::Byte Basda::VinoFitsCard::getDoublePrecisionVal ( ) const

◆ getDoubleVal() [1/3]

double Basda::VinoFitsCard::getDoubleVal ( ) const

◆ getDoubleVal() [2/3]

double Basda::VinoFitsCard::getDoubleVal ( ) const

Convert the value into a floating point number.


Returns
The value represented as a floating point number If this is a COMMENT card, this returns zero.
Since
2017-02-13 added TLOGICAL

◆ getDoubleVal() [3/3]

double Basda::VinoFitsCard::getDoubleVal ( ) const

◆ getIntVal() [1/3]

Nice::Int Basda::VinoFitsCard::getIntVal ( ) const

◆ getIntVal() [2/3]

Nice::Int Basda::VinoFitsCard::getIntVal ( ) const

parse the value with integer precision.


Returns
The value narrowed down to an integer. If this is a COMMENT card, this is zero.
Since
2017-02-13 added TLOGICAL

◆ getIntVal() [3/3]

Nice::Int Basda::VinoFitsCard::getIntVal ( ) const

◆ getKey() [1/3]

std::string Basda::VinoFitsCard::getKey ( ) const

◆ getKey() [2/3]

std::string Basda::VinoFitsCard::getKey ( ) const

get the key


Returns
The key in the card. The string left from the equal sign. If this is a COMMENT card, the return value will be an empty string.

◆ getKey() [3/3]

std::string Basda::VinoFitsCard::getKey ( ) const

◆ getStringVal() [1/3]

std::string Basda::VinoFitsCard::getStringVal ( ) const

convert the value into a string.


Returns
The stringified representation of the number or string. If this is a COMMENT card, this is the comment.
Since
2017-02-13 added TLOGICAL

◆ getStringVal() [2/3]

std::string Basda::VinoFitsCard::getStringVal ( ) const

◆ getStringVal() [3/3]

std::string Basda::VinoFitsCard::getStringVal ( ) const

◆ getType() [1/3]

Nice::Byte Basda::VinoFitsCard::getType ( ) const

◆ getType() [2/3]

Nice::Byte Basda::VinoFitsCard::getType ( ) const

get the type


Returns
The type (TDOUBLE, TLOGICAL, TINT, TSTRING, TEMPTY) If this is a COMMENT card, the return value will be TSTRING.

◆ getType() [3/3]

Nice::Byte Basda::VinoFitsCard::getType ( ) const

◆ initTpl() [1/3]

void Basda::VinoFitsCard::initTpl ( const char *  card)
private

◆ initTpl() [2/3]

void Basda::VinoFitsCard::initTpl ( const char *  _card)
private

ctor given a full card line


Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-13
Author
R. J. Mathar

Parameters
_cardThe line with the fully qualified format key = val / comment or COMMENT.
Todo:

Support the complex valued cards with val = (..,...) in parentheses .

Support cards that start with HISTORY

Since
2017-02-13
Author
R. J. Mathar

◆ initTpl() [3/3]

void Basda::VinoFitsCard::initTpl ( const char *  card)
private

◆ operator=() [1/3]

VinoFitsCard& Basda::VinoFitsCard::operator= ( const VinoFitsCard oth)

◆ operator=() [2/3]

Basda::VinoFitsCard & Basda::VinoFitsCard::operator= ( const VinoFitsCard oth)

Assignment operator.


Parameters
othThe other card to be copied.
Returns
A copy of the other card.
Since
2017-02-15

◆ operator=() [3/3]

VinoFitsCard& Basda::VinoFitsCard::operator= ( const VinoFitsCard oth)

◆ set() [1/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const char *  _sval,
const std::string &  _comment 
)

overwrite values for a string type.


Parameters
_keyKeyword. If empty this becomes a COMMENT card.
_sval
_comment

◆ set() [2/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const char *  _val,
const std::string &  _comment 
)

◆ set() [3/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const char *  _val,
const std::string &  _comment 
)

◆ set() [4/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const std::string &  _sval,
const std::string &  _comment 
)

overwrite values for a string type.


Parameters
_keyKeyword.If empty this becomes a COMMENT card.
_sval
_comment

◆ set() [5/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const std::string &  _val,
const std::string &  _comment 
)

◆ set() [6/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const std::string &  _val,
const std::string &  _comment 
)

◆ set() [7/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
bool  _bval,
const std::string &  _comment 
)

◆ set() [8/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
bool  _bval,
const std::string &  _comment 
)

overwrite values for a boolean type.


Parameters
_keyKeyword. If empty this becomes a COMMENT card
_bvalboolean value
_commentcomment after the slash with units and others.
Since
2017-02-13

◆ set() [9/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
bool  _bval,
const std::string &  _comment 
)

◆ set() [10/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
Nice::Int  _val,
const std::string &  _comment 
)

◆ set() [11/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
Nice::Int  _val,
const std::string &  _comment 
)

overwrite values for an integer type.


Parameters
_keyKeyword. If empty this becomes a COMMENT card
_ival
_comment

◆ set() [12/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
Nice::Int  _val,
const std::string &  _comment 
)

◆ set() [13/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _val,
const std::string &  _comment 
)

◆ set() [14/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _val,
const std::string &  _comment 
)

◆ set() [15/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _dval,
const std::string &  _comment 
)

overwrite values for a floating point type


Parameters
_key.Keyword. If empty this becomes a COMMENT card.
_dval
_comment

◆ set() [16/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _val,
size_t  _precision,
const std::string &  _comment 
)

◆ set() [17/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _val,
size_t  _precision,
const std::string &  _comment 
)

◆ set() [18/18]

void Basda::VinoFitsCard::set ( const std::string &  _key,
const double &  _dval,
size_t  _precision,
const std::string &  _comment 
)

overwrite values for a floating point type


Parameters
_keyKeyword. If empty this becomes a COMMENT card.
_dval
_comment

◆ setComment() [1/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _comment)

◆ setComment() [2/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _comment)

◆ setComment() [3/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _comment)

overwrite the comment of the card by a new one. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card.


Parameters
_commentThe new comment.

◆ setComment() [4/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const Nice::Date _date 
)

◆ setComment() [5/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const Nice::Date _date 
)

◆ setComment() [6/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const Nice::Date _date 
)

add a unit and a date to the comment. The unit is preprended and the date is appended to the existing comment. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card.


Parameters
_unitThe IAU unit string without the two brackets.
_dateA time specification. The time will be added in UTC ISO format.

◆ setComment() [7/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const std::string &  _date = "(%Y-%m-%d:%H:%M:%S)" 
)

◆ setComment() [8/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const std::string &  _fmt = "(%Y-%m-%d:%H:%M:%S)" 
)

add a unit and a date to the comment. The unit is preprended and the current date is appended to the existing comment. The comment to be changed is the entire card (if this is a COMMENT card) or the comment piece of the card.


Parameters
_unitThe IAU unit string without the two brackets.
_fmtA time/date string

◆ setComment() [9/9]

void Basda::VinoFitsCard::setComment ( const std::string &  _unit,
const std::string &  _date = "(%Y-%m-%d:%H:%M:%S)" 
)

◆ setValue() [1/18]

void Basda::VinoFitsCard::setValue ( const char *  _val)

◆ setValue() [2/18]

void Basda::VinoFitsCard::setValue ( const char *  _val)

◆ setValue() [3/18]

void Basda::VinoFitsCard::setValue ( const char *  _sval)

overwrite the value with a new string


Parameters
_svalthe new string If this is a COMMENT card, this is a no-op.

◆ setValue() [4/18]

void Basda::VinoFitsCard::setValue ( const std::string &  _sval)

overwrite the value with a new string If this is a COMMENT card, this is a no-op.


Parameters
_svalThe new string

◆ setValue() [5/18]

void Basda::VinoFitsCard::setValue ( const std::string &  _val)

◆ setValue() [6/18]

void Basda::VinoFitsCard::setValue ( const std::string &  _val)

◆ setValue() [7/18]

void Basda::VinoFitsCard::setValue ( int  _val)

◆ setValue() [8/18]

void Basda::VinoFitsCard::setValue ( int  _val)

Set the card value to a specific integer. If this is a COMMENT card, this is a no-op.


Parameters
_ivalThe new value of the card

◆ setValue() [9/18]

void Basda::VinoFitsCard::setValue ( int  _val)

◆ setValue() [10/18]

void Basda::VinoFitsCard::setValue ( const bool  _bval)

◆ setValue() [11/18]

void Basda::VinoFitsCard::setValue ( const bool  _bval)

Parameters
_bvalThe boolean value to be stored. The value is stored as a zero (or nonzero) byte in mdata[0] If this is a COMMENT card, this is a no-op.
Since
2017-02-13

◆ setValue() [12/18]

void Basda::VinoFitsCard::setValue ( const bool  _bval)

◆ setValue() [13/18]

void Basda::VinoFitsCard::setValue ( const double &  _val)

◆ setValue() [14/18]

void Basda::VinoFitsCard::setValue ( const double &  _val)

◆ setValue() [15/18]

void Basda::VinoFitsCard::setValue ( const double &  _dval)

Set the card value to a specific floating point value. If this is a COMMENT card, this is a no-op.


Parameters
_dvalThe new value of the card

◆ setValue() [16/18]

void Basda::VinoFitsCard::setValue ( const double &  _val,
size_t  _precision 
)

◆ setValue() [17/18]

void Basda::VinoFitsCard::setValue ( const double &  _dval,
size_t  _precision 
)

Set the card value to a specific floating point value. If this is a COMMENT card, this is a no-op.


Parameters
_dvalThe new value of the card
_precision

◆ setValue() [18/18]

void Basda::VinoFitsCard::setValue ( const double &  _val,
size_t  _precision 
)

◆ templateAnal() [1/3]

int Basda::VinoFitsCard::templateAnal ( char *  card,
char  keyname[],
char  keyval[],
char  cmt[],
char  dtyp[] 
)
private

◆ templateAnal() [2/3]

int Basda::VinoFitsCard::templateAnal ( char *  card,
char  keyname[],
char  keyval[],
char  cmt[],
char  dtyp[] 
)
private

◆ templateAnal() [3/3]

int Basda::VinoFitsCard::templateAnal ( char *  card,
char  keyname[],
char  keyval[],
char  cmt[],
char  dtyp[] 
)
private

Analyse the contents and types in a template header line.


Parameters
[in]cardThe card to be analysed, typically up to 80 characters.
[out]keynameKeyword name in the card.
[out]keyvalKeyword value in the card.
[out]cmtComment after the slash in the card.
[out]dtypRough type (string, integer, float, boolean or complex)
Returns
The cfitsio error code. 0 if there was no error.
Since
2017-02-13
Author
R. J. Mathar

◆ write() [1/3]

int Basda::VinoFitsCard::write ( fitsfile *  )

◆ write() [2/3]

int Basda::VinoFitsCard::write ( fitsfile *  _fitsptr)

insert the card into a header-data unit.


Parameters
_fitsptrThe cfitsio represeentation fo the current FITS header.
Returns
The status (error value) of cfitsio.
Since
2017-02-13 also write boolean/logical

◆ write() [3/3]

int Basda::VinoFitsCard::write ( fitsfile *  )

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  ,
const VinoFitsCardVar  
)
friend

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  ,
const VinoFitsCardVar  
)
friend

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  ,
const VinoFitsCardVar  
)
friend

◆ operator>> [1/3]

std::istream& operator>> ( std::istream &  ,
VinoFitsCardVar  
)
friend

◆ operator>> [2/3]

std::istream& operator>> ( std::istream &  ,
VinoFitsCardVar  
)
friend

◆ operator>> [3/3]

std::istream& operator>> ( std::istream &  ,
VinoFitsCardVar  
)
friend

Member Data Documentation

◆ s_typeStringToFitsNum

static std::map< std::string, size_t > Basda::VinoFitsCard::s_typeStringToFitsNum
staticprotected
Initial value:
= boost::assign::map_list_of("Empty", TEMPTY)
("Bool", TLOGICAL)
("String", TSTRING)
("Double", TDOUBLE)
("Int", TINT)

The documentation for this class was generated from the following files: