22 #ifndef ASTSHIM_FITSCHAN_H 23 #define ASTSHIM_FITSCHAN_H 77 FoundValue(
bool found,
T const &value) : found(found), value(value) {}
231 astDelFits(getRawPtr());
245 astEmptyFits(getRawPtr());
550 bool getIwc()
const {
return getB(
"Iwc"); }
596 astPurgeWCS(getRawPtr());
617 astPutCards(getRawPtr(), cards.
c_str());
645 astPutFits(getRawPtr(), card.
c_str(), overwrite);
662 astReadFits(getRawPtr());
675 astRetainFits(getRawPtr());
697 bool overwrite =
false) {
699 astSetFitsCF(getRawPtr(), name.
c_str(),
reinterpret_cast<double(&)[2]
>(value), comment.c_str(),
726 astSetFitsCM(getRawPtr(), comment.
c_str(), overwrite);
757 bool overwrite =
false) {
758 astSetFitsCN(getRawPtr(), name.
c_str(), value.
c_str(), comment.c_str(), overwrite);
787 bool overwrite =
false) {
788 astSetFitsF(getRawPtr(), name.
c_str(), value, comment.c_str(), overwrite);
817 bool overwrite =
false) {
818 astSetFitsI(getRawPtr(), name.
c_str(), value, comment.c_str(), overwrite);
847 bool overwrite =
false) {
848 astSetFitsL(getRawPtr(), name.
c_str(), value, comment.c_str(), overwrite);
885 bool overwrite =
false) {
886 astSetFitsS(getRawPtr(), name.
c_str(), value.
c_str(), comment.c_str(), overwrite);
916 astSetFitsU(getRawPtr(), name.
c_str(), comment.c_str(), overwrite);
923 void setCarLin(
bool cdMatrix) { setB(
"CarLin", cdMatrix); }
934 void setClean(
bool clean) { setB(
"Clean", clean); }
967 void setIwc(
bool iwcs) { setB(
"Iwc", iwcs); }
972 void setSipOK(
bool sipOK) { setB(
"SipOK", sipOK); }
1001 astShowFits(getRawPtr());
1026 astWriteFits(getRawPtr());
1039 auto *rawKeyMap =
reinterpret_cast<AstObject *
>(astGetTables(getRawPtr()));
1044 return Object::fromAstObject<KeyMap>(rawKeyMap,
true);
1051 explicit FitsChan(AstFitsChan *rawFitsChan) :
Channel(reinterpret_cast<AstChannel *>(rawFitsChan)) {
1052 if (!astIsAFitsChan(getRawPtr())) {
1054 os <<
"this is a " <<
getClassName() <<
", which is not a FitsChan";
void setFitsTol(double tol)
Set FitsTol: Tolerance used for writing a FrameSet using a foreign encoding.
void setIwc(bool iwcs)
Set Iwc: add a Frame describing Intermediate World Coords?
bool found
Was the value found?
std::string getFitsAxisOrder() const
Get FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::writ...
void emptyFits()
Delete all cards and associated information from a FitsChan.
FoundValue(bool found, T const &value)
Construct a FoundValue.
void setCarLin(bool cdMatrix)
Set CarLin: ignore spherical rotations on CAR projections?
void setDefB1950(bool defB1950)
Set DefB1950: use FK4 B1950 as default equatorial coordinates?
void purgeWcs()
Delete all cards in a FitsChan that relate to any of the recognised WCS encodings.
double getFitsTol() const
Get FitsTol: Tolerance used for writing a FrameSet using a foreign encoding.
AST wrapper classes and functions.
CardType getCardType() const
Get CardType: data type of the current FITS card.
void setSipReplace(bool replace)
Set SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative...
void setFitsCF(std::string const &name, std::complex< double > value, std::string const &comment="", bool overwrite=false)
Create a new card of type std::complex<double>, possibly overwriting the current card.
void setPolyTan(int polytan)
Set PolyTan: use PVi_m keywords to define distorted TAN projection?
Channel provides input/output of AST objects.
std::string getCardComm() const
Get CardComm: the comment of the current card.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
void setFitsU(std::string const &name, std::string const &comment="", bool overwrite=false)
Create a new card with an undefined value, possibly overwriting the current card. ...
std::string getCardName() const
Get CardName: the keyword name of the current card.
int getNCard() const
Get NCard: the number of cards.
bool getCDMatrix() const
Get CDMatrix: use CDi_j keywords to represent pixel scaling, rotation, etc?
A specialized form of Channel which reads and writes FITS header cards.
void retainFits()
Keep the current card when an Object is read that uses the card.
void setFitsI(std::string const &name, int value, std::string const &comment="", bool overwrite=false)
Create a new card of type int, possibly overwriting the current card.
void writeFits()
Write out all cards currently in the channel and clear the channel.
void setCard(int ind)
Set Card: the index of the current card, where 1 is the first card.
void setFitsDigits(int digits)
Set FitsDigits: digits of precision for floating-point FITS values.
keyword is present and has a value
card is a comment-style card with no "=" (COMMENT, HISTORY, ...)
CardType
Enums describing the FITS card type.
void setTabOK(int tabOK)
Set TabOK: should the FITS "-TAB" algorithm be recognised?
bool getCarLin() const
Get CarLin: ignore spherical rotations on CAR projections?
int getNKey() const
Get Nkey: the number of unique keywords.
keyword is present, but has no value
bool getClean() const
Get Clean: remove cards used whilst reading even if an error occurs?
bool getDefB1950() const
Get DefB1950: use FK4 B1950 as default equatorial coordinates?
void putFits(std::string const &card, bool overwrite)
Store a FITS header card in a FitsChan.
void setFitsF(std::string const &name, double value, std::string const &comment="", bool overwrite=false)
Create a new card of type double, possibly overwriting the current card.
void setFitsAxisOrder(std::string const &order)
Set FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::writ...
void delFits()
Delete the current FITS card.
T value
The found value; ignore if found is false.
bool getSipReplace() const
Get SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative...
void setWarnings(std::string const &warnings)
Set Warnings attribute, which controls the issuing of warnings about selected conditions when an Obje...
void setClean(bool clean)
Set Clean: remove cards used whilst reading even if an error occurs?
void setFitsS(std::string const &name, std::string value, std::string const &comment="", bool overwrite=false)
Create a new card of type string, possibly overwriting the current card.
std::string getClassName(AstObject const *rawObj)
Get the AST class name, changing CmpMap to SeriesMap or ParallelMap as appropriate.
void putCards(std::string const &cards)
Replace all FITS header cards.
void setFitsCM(std::string const &comment, bool overwrite=false)
Create a new comment card, possibly overwriting the current card.
std::string getAllWarnings() const
Get AllWarnings: a space separated list of all the conditions names recognized by the Warnings attrib...
std::string getEncoding() const
Get Encoding: the encoding system to use when AST Objects are stored as FITS header cards in a FitsCh...
int getCard() const
Get Card: the index of the current card, where 1 is the first card.
std::string getWarnings() const
Get Warnings attribute, which controls the issuing of warnings about selected conditions when an Obje...
FitsKeyState
Enums describing the presence or absence of a FITS keyword.
void readFits()
Read cards from the source and store them in the FitsChan.
int getTabOK() const
Get TabOK: should the FITS "-TAB" algorithm be recognised?
void setEncoding(std::string const &encoding)
Set Encoding: the encoding system to use when AST Objects are stored as FITS header cards in a FitsCh...
void showFits() const
Write all the cards in the channel to standard output.
void setSipOK(bool sipOK)
Set SipOK: use Spitzer Space Telescope keywords to define distortion?
void setCDMatrix(bool cdMatrix)
Get CDMatrix: Use CDi_j keywords to represent pixel scaling, rotation, etc?
void setFitsL(std::string const &name, bool value, std::string const &comment="", bool overwrite=false)
Create a new card of type bool, possibly overwriting the current card.
void setFitsCN(std::string const &name, std::string value, std::string const &comment="", bool overwrite=false)
Create a new "CONTINUE" card, possibly overwriting the current card.
FoundValue()
Default constructor: found false, value is default-constructed.
A value and associated validity flag.
void clearCard()
Rewind the card index to the beginning.
card does not exist (card number invalid)
A stream for ast::Channel.
bool getIwc() const
Get Iwc: add a Frame describing Intermediate World Coords?
std::shared_ptr< KeyMap > getTables() const
bool getSipOK() const
Get SipOK: use Spitzer Space Telescope keywords to define distortion?
int getPolyTan() const
Get PolyTan: use PVi_m keywords to define distorted TAN projection?
int getFitsDigits() const
Get FitsDigits: digits of precision for floating-point FITS values.
FitsChan(AstFitsChan *rawFitsChan)
Construct a FitsChan from a raw AstFitsChan.