45 :
Channel(reinterpret_cast<AstChannel *>(
46 astFitsChan(detail::
source, detail::
sink,
"%s", options.c_str())),
63 double *rawval =
reinterpret_cast<double(&)[2]
>(
val);
64 bool found = astGetFitsCF(
getRawPtr(), cstrOrNull(name), rawval);
71 bool found = astGetFitsCN(
getRawPtr(), cstrOrNull(name), &rawval);
79 bool found = astGetFitsF(
getRawPtr(), cstrOrNull(name), &val);
86 bool found = astGetFitsI(
getRawPtr(), cstrOrNull(name), &val);
92 int val =
static_cast<int>(defval);
93 bool found = astGetFitsL(
getRawPtr(), cstrOrNull(name), &val);
100 bool found = astGetFitsS(
getRawPtr(), cstrOrNull(name), &rawval);
107 int const initialIndex =
getCard();
112 for (
auto i = 1; i <= numCards; ++i) {
127 bool success =
static_cast<bool>(astFindFits(
getRawPtr(), name.
c_str(), fitsbuf.
get(), inc));
134 int hasvalue = astTestFits(
getRawPtr(), cstrOrNull(name), &there);
void sink(const char *cstr)
Sink function that allows astChannel to sink to a Stream.
FoundValue< std::string > getFitsCN(std::string const &name="", std::string defval="") const
Get the value of a CONTINUE card.
AstObject const * getRawPtr() const
Get the raw AST pointer.
FoundValue< std::string > findFits(std::string const &name, bool inc)
Search for a card in a FitsChan by keyword.
AST wrapper classes and functions.
Channel provides input/output of AST objects.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
std::vector< std::string > getAllCardNames()
Get the name of all cards, in order, starting from the first card.
std::string getCardName() const
Get CardName: the keyword name of the current card.
int getNCard() const
Get NCard: the number of cards.
FoundValue< std::complex< double > > getFitsCF(std::string const &name="", std::complex< double > defval={0, 0}) const
Get the value of a complex double card.
FitsChan(Stream &stream, std::string const &options="")
Construct a channel that uses a provided Stream.
FoundValue< int > getFitsI(std::string const &name="", int defval=0) const
Get the value of a int card.
void setCard(int ind)
Set Card: the index of the current card, where 1 is the first card.
keyword is present and has a value
FitsKeyState testFits(std::string const &name="") const
Determine if a card is present, and if so, whether it has a value.
keyword is present, but has no value
FoundValue< std::string > getFitsS(std::string const &name="", std::string defval="") const
Get the value of a string card.
const char * source()
Source function that allows astChannel to source from a Stream.
FoundValue< double > getFitsF(std::string const &name="", double defval=0) const
Get the value of a double card.
int getCard() const
Get Card: the index of the current card, where 1 is the first card.
FitsKeyState
Enums describing the presence or absence of a FITS keyword.
A value and associated validity flag.
A stream for ast::Channel.
T emplace_back(T... args)
FoundValue< bool > getFitsL(std::string const &name="", bool defval=false) const
Get the value of a bool card.