LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
A specialized form of Channel which reads and writes FITS header cards. More...
#include <FitsChan.h>
Public Types | |
using | ObjectPtr = std::unique_ptr<AstObject, Deleter> |
unique pointer holding an AST raw pointer | |
Public Member Functions | |
FitsChan (Stream &stream, std::string const &options="") | |
Construct a channel that uses a provided Stream. | |
virtual | ~FitsChan () |
FitsChan (FitsChan const &)=delete | |
FitsChan (FitsChan &&)=default | |
FitsChan & | operator= (FitsChan const &)=delete |
FitsChan & | operator= (FitsChan &&)=default |
void | delFits () |
Delete the current FITS card. | |
void | emptyFits () |
Delete all cards and associated information from a FitsChan. | |
FoundValue< std::string > | findFits (std::string const &name, bool inc) |
Search for a card in a FitsChan by keyword. | |
FoundValue< std::complex< double > > | getFitsCF (std::string const &name="", std::complex< double > defval={0, 0}) const |
Get the value of a complex double card. | |
FoundValue< std::string > | getFitsCN (std::string const &name="", std::string defval="") const |
Get the value of a CONTINUE card. | |
FoundValue< double > | getFitsF (std::string const &name="", double defval=0) const |
Get the value of a double card. | |
FoundValue< int > | getFitsI (std::string const &name="", int defval=0) const |
Get the value of a int card. | |
FoundValue< bool > | getFitsL (std::string const &name="", bool defval=false) const |
Get the value of a bool card. | |
FoundValue< std::string > | getFitsS (std::string const &name="", std::string defval="") const |
Get the value of a string card. | |
std::vector< std::string > | getAllCardNames () |
Get the name of all cards, in order, starting from the first card. | |
std::string | getAllWarnings () const |
Get AllWarnings: a space separated list of all the conditions names recognized by the Warnings attribute. | |
int | getCard () const |
Get Card: the index of the current card, where 1 is the first card. | |
std::string | getCardComm () const |
Get CardComm: the comment of the current card. | |
std::string | getCardName () const |
Get CardName: the keyword name of the current card. | |
CardType | getCardType () const |
Get CardType: data type of the current FITS card. | |
bool | getCarLin () const |
Get CarLin: ignore spherical rotations on CAR projections? | |
bool | getCDMatrix () const |
Get CDMatrix: use CDi_j keywords to represent pixel scaling, rotation, etc? | |
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? | |
std::string | getEncoding () const |
Get Encoding: the encoding system to use when AST Objects are stored as FITS header cards in a FitsChan. | |
std::string | getFitsAxisOrder () const |
Get FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::write. | |
int | getFitsDigits () const |
Get FitsDigits: digits of precision for floating-point FITS values. | |
double | getFitsTol () const |
Get FitsTol: Tolerance used for writing a FrameSet using a foreign encoding. | |
bool | getIwc () const |
Get Iwc: add a Frame describing Intermediate World Coords? | |
int | getNCard () const |
Get NCard: the number of cards. | |
int | getNKey () const |
Get Nkey: the number of unique keywords. | |
bool | getSipOK () const |
Get SipOK: use Spitzer Space Telescope keywords to define distortion? | |
bool | getSipReplace () const |
Get SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative inverse)? | |
int | getTabOK () const |
Get TabOK: should the FITS "-TAB" algorithm be recognised? | |
int | getPolyTan () const |
Get PolyTan: use PVi_m keywords to define distorted TAN projection? | |
std::string | getWarnings () const |
Get Warnings attribute, which controls the issuing of warnings about selected conditions when an Object or keyword is read from or written to a FitsChan. | |
void | purgeWcs () |
Delete all cards in a FitsChan that relate to any of the recognised WCS encodings. | |
void | putCards (std::string const &cards) |
Replace all FITS header cards. | |
void | putFits (std::string const &card, bool overwrite) |
Store a FITS header card in a FitsChan. | |
void | readFits () |
Read cards from the source and store them in the FitsChan. | |
void | retainFits () |
Keep the current card when an Object is read that uses the card. | |
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 | setFitsCM (std::string const &comment, bool overwrite=false) |
Create a new comment card, 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. | |
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 | 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 | 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 | 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. | |
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. | |
void | setCarLin (bool cdMatrix) |
Set CarLin: ignore spherical rotations on CAR projections? | |
void | setCDMatrix (bool cdMatrix) |
Get CDMatrix: Use CDi_j keywords to represent pixel scaling, rotation, etc? | |
void | setClean (bool clean) |
Set Clean: remove cards used whilst reading even if an error occurs? | |
void | setDefB1950 (bool defB1950) |
Set DefB1950: use FK4 B1950 as default equatorial coordinates? | |
void | setEncoding (std::string const &encoding) |
Set Encoding: the encoding system to use when AST Objects are stored as FITS header cards in a FitsChan. | |
void | setFitsAxisOrder (std::string const &order) |
Set FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::write. | |
void | setFitsDigits (int digits) |
Set FitsDigits: digits of precision for floating-point FITS values. | |
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? | |
void | setSipOK (bool sipOK) |
Set SipOK: use Spitzer Space Telescope keywords to define distortion? | |
void | setSipReplace (bool replace) |
Set SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative inverse)? | |
void | setTabOK (int tabOK) |
Set TabOK: should the FITS "-TAB" algorithm be recognised? | |
void | setPolyTan (int polytan) |
Set PolyTan: use PVi_m keywords to define distorted TAN projection? | |
void | setWarnings (std::string const &warnings) |
Set Warnings attribute, which controls the issuing of warnings about selected conditions when an Object or keyword is read from or written to a FitsChan. | |
void | showFits () const |
Write all the cards in the channel to standard output. | |
FitsKeyState | testFits (std::string const &name="") const |
Determine if a card is present, and if so, whether it has a value. | |
void | writeFits () |
Write out all cards currently in the channel and clear the channel. | |
void | clearCard () |
Rewind the card index to the beginning. | |
void | setCard (int ind) |
Set Card: the index of the current card, where 1 is the first card. | |
std::shared_ptr< KeyMap > | getTables () const |
FitsChan (AstFitsChan *rawFitsChan) | |
Construct a FitsChan from a raw AstFitsChan. | |
std::shared_ptr< Channel > | copy () const |
Return a deep copy of this object. | |
bool | getComment () const |
Get Comment: include textual comments in output? | |
int | getFull () const |
Get Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. | |
int | getIndent () const |
Get Indent: indentation increment between objects. | |
int | getReportLevel () const |
Get ReportLevel: report level. | |
bool | getSkip () const |
Get Skip: skip irrelevant data on input? | |
bool | getStrict () const |
Get Strict: generate errors instead of warnings? | |
std::shared_ptr< Object > | read () |
Read an object from a channel. | |
void | setComment (bool skip) |
Set Comment: include textual comments in output? | |
void | setFull (int full) |
Set Full: level of output detail; one of -1: minimum, 0: normal, 1: verbose. | |
void | setIndent (int indent) |
Set Indent: indentation increment between objects. | |
void | setReportLevel (int level) |
Set ReportLevel: report level; an integer in the range [0, 3] where 0 is the most verbose. | |
void | setSkip (bool skip) |
Set Skip: skip irrelevant data on input? | |
void | setStrict (bool strict) |
Set Strict: generate errors instead of warnings? | |
KeyMap | warnings () const |
Return a KeyMap holding the text of any warnings issued as a result of the previous invocation of read or write. | |
int | write (Object const &object) |
Write an object to a channel. | |
bool | operator== (Object const &rhs) const |
Return True if this and rhs are the equal. | |
bool | operator!= (Object const &rhs) const |
Return True if this and rhs are not equal. | |
void | clear (std::string const &attrib) |
Clear the values of a specified set of attributes for an Object. | |
bool | hasAttribute (std::string const &attrib) const |
Does this object have an attribute with the specified name? | |
std::string | getClassName () const |
Get Class: the name of the class (e.g. | |
std::string | getID () const |
Get ID: object identification string that is not copied. | |
std::string | getIdent () const |
Get Ident: object identification string that is copied. | |
int | getNObject () const |
Get NObject: number of AST objects in existence of the same type as the underlying AST class. | |
int | getObjSize () const |
Get ObjSize: the in-memory size of the AST object in bytes. | |
int | getRefCount () const |
Get RefCount: number of active pointers to the underlying AST object. | |
bool | getUseDefs () const |
Get UseDefs: allow use of default values for Object attributes? | |
void | lock (bool wait) |
Lock this object for exclusive use by the calling thread. | |
bool | same (Object const &other) const |
Does this contain the same AST object as another? | |
void | setID (std::string const &id) |
Set ID: object identification string that is not copied. | |
void | setIdent (std::string const &ident) |
Set Ident: object identification string that is copied. | |
void | setUseDefs (bool usedefs) |
Set UseDefs: allow use of default values for Object attributes? | |
void | show (std::ostream &os, bool showComments=true) const |
Print a textual description the object to an ostream. | |
std::string | show (bool showComments=true) const |
Return a textual description the object as a string. | |
bool | test (std::string const &attrib) const |
Has this attribute been explicitly set (and not subsequently cleared)? | |
void | unlock (bool report=false) |
Unlock this object previously locked using lock, so that other threads can use this object. | |
AstObject const * | getRawPtr () const |
Get the raw AST pointer. | |
AstObject * | getRawPtr () |
Get the raw AST pointer. | |
Static Public Member Functions | |
static std::shared_ptr< Object > | fromString (std::string const &str) |
Construct an Object from a string, using astFromString. | |
template<typename Class > | |
static std::shared_ptr< Class > | fromAstObject (AstObject *rawObj, bool copy) |
Given a bare AST object pointer return a shared pointer to an ast::Object of the correct type. | |
Protected Member Functions | |
virtual std::shared_ptr< Object > | copyPolymorphic () const override |
Return a deep copy of this object. | |
template<typename T , typename AstT > | |
std::shared_ptr< T > | copyImpl () const |
Implementation of deep copy. | |
bool | getB (std::string const &attrib) const |
Get the value of an attribute as a bool. | |
std::string const | getC (std::string const &attrib) const |
Get the value of an attribute as a string. | |
double | getD (std::string const &attrib) const |
Get the value of an attribute as a double. | |
float | getF (std::string const &attrib) const |
Get the value of an attribute as a float. | |
int | getI (std::string const &attrib) const |
Get the value of an attribute as an int. | |
long int | getL (std::string const &attrib) const |
Get the value of an attribute as a long int. | |
void | set (std::string const &setting) |
Assign a set of attribute values, over-riding any previous values. | |
void | setB (std::string const &attrib, bool value) |
Set the value of an attribute as a bool. | |
void | setC (std::string const &attrib, std::string const &value) |
Set the value of an attribute as a string. | |
void | setD (std::string const &attrib, double value) |
Set the value of an attribute as a double. | |
void | setF (std::string const &attrib, float value) |
Set the value of an attribute as a float. | |
void | setI (std::string const &attrib, int value) |
Set the value of an attribute as an int. | |
void | setL (std::string const &attrib, long int value) |
Set the value of an attribute as a long int. | |
Static Protected Member Functions | |
template<typename ShimT , typename AstT > | |
static std::shared_ptr< ShimT > | makeShim (AstObject *p) |
Functor to make an astshim instance from a raw AST pointer of the corresponding type. | |
A specialized form of Channel which reads and writes FITS header cards.
Writing an Object to a FitsChan will, if the Object is suitable, generate a description of that Object composed of FITS header cards, and reading from a FitsChan will create a new Object from its FITS header card description.
While a FitsChan is active, it represents a buffer which may contain zero or more 80-character "header cards" conforming to FITS conventions. Any sequence of FITS-conforming header cards may be stored, apart from the "END" card whose existence is merely implied. The cards may be accessed in any order by using the FitsChan's Card attribute, which identifies a "current" card, to which subsequent operations apply. Searches based on keyword may be performed (using findFits), new cards may be inserted (putFits, putCards, setFitsS and similar) and existing ones may be deleted with delFits, extracted with getFitsS and similar, or changed with setFitsS and similar.
Tables are not yet supported, so the following AST functions are not wrapped as methods:
FitsChan has the following attributes, in addition to those provided by Channel and Object
setFits
function (e.g. setFitsS) to overwrite the old value.As for any Channel, when you create a FitsChan, you specify a Stream which sources and sinks data by reading and writing FITS header cards. If you provide a source, it is used to fill the FitsChan with header cards when it is accessed for the first time. If you do not provide a source, the FitsChan remains empty until you explicitly enter data into it (e.g. using putFits
, putCards
, write or by using the SourceFile attribute to specifying a text file from which headers should be read). When the FitsChan is deleted, any remaining header cards in the FitsChan will be written to the sink.
Coordinate system information may be described using FITS header cards using several different conventions, termed "encodings". When an AST Object is written to (or read from) a FitsChan, the value of the FitsChan's Encoding attribute determines how the Object is converted to (or from) a description involving FITS header cards. In general, different encodings will result in different sets of header cards to describe the same Object. Examples of encodings include the DSS encoding (based on conventions used by the STScI Digitised Sky Survey data), the FITS-WCS encoding (based on a proposed FITS standard) and the NATIVE encoding (a near loss-less way of storing AST Objects in FITS headers).
The available encodings differ in the range of Objects they can represent, in the number of Object descriptions that can coexist in the same FitsChan, and in their accessibility to other (external) astronomy applications (see the Encoding attribute for details). Encodings are not necessarily mutually exclusive and it may sometimes be possible to describe the same Object in several ways within a particular set of FITS header cards by using several different encodings.
The detailed behaviour of read and write, when used with a FitsChan, depends on the encoding in use. In general, however, all successful use of read is destructive, so that FITS header cards are consumed in the process of reading an Object, and are removed from the FitsChan (this deletion can be prevented for specific cards by calling the retainFits function). An unsuccessful call of read (for instance, caused by the FitsChan not containing the necessary FITS headers cards needed to create an Object) results in the contents of the FitsChan being left unchanged.
If the encoding in use allows only a single Object description to be stored in a FitsChan (e.g. the DSS
, FITS-WCS
and FITS-IRAF
encodings), then write operations using write will over-write any existing Object description using that encoding. Otherwise (e.g. the NATIVE
encoding), multiple Object descriptions are written sequentially and may later be read back in the same sequence.
Definition at line 202 of file FitsChan.h.
|
inherited |
|
explicit |
Construct a channel that uses a provided Stream.
[in] | stream | Stream for channel I/O:
|
[in] | options | Comma-separated list of attribute assignments. |
Definition at line 44 of file FitsChan.cc.
|
virtual |
Definition at line 51 of file FitsChan.cc.
|
delete |
|
default |
|
inlineexplicit |
Construct a FitsChan from a raw AstFitsChan.
Definition at line 1051 of file FitsChan.h.
|
inlineinherited |
Clear the values of a specified set of attributes for an Object.
Clearing an attribute cancels any value that has previously been explicitly set for it, so that the standard default attribute value will subsequently be used instead. This also causes the astTest function to return the value zero for the attribute, indicating that no value has been set.
|
inline |
Rewind the card index to the beginning.
Definition at line 1031 of file FitsChan.h.
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineoverrideprotectedvirtualinherited |
Return a deep copy of this object.
This is called by copy.
Each subclass must override this method. The standard implementation is:
for example Frame implements this as:
Implements ast::Object.
Definition at line 159 of file Channel.h.
|
inline |
Delete the current FITS card.
The current card may be selected using the Card attribute (if its index is known) or by using findFits
(if only the FITS keyword is known). After deletion, the following card becomes the current card.
Definition at line 230 of file FitsChan.h.
|
inline |
Delete all cards and associated information from a FitsChan.
Definition at line 244 of file FitsChan.h.
FoundValue< std::string > ast::FitsChan::findFits | ( | std::string const & | name, |
bool | inc ) |
Search for a card in a FitsChan by keyword.
The search commences at the current card (identified by the Card
attribute) and ends when a card is found whose FITS keyword matches the template supplied, or when the last card in the FitsChan has been searched.
getFitsX
methods such as getFitsS, whose search wraps around. In order to search all keys using findFits you must first call clearCard.If the search is successful (i.e. a card is found which matches the template), the contents of the card are returned and the Card attribute is adjusted to identify the card found (if inc
false) or the one following it (if inc
is true).
If the search is not successful, the Card attribute is set to the "end-of-file".
[in] | name | The keyword to be found. In the simplest case, this should simply be the keyword name (the search is case insensitive and trailing spaces are ignored). However, this template may also contain "field specifiers" which are capable of matching a range of characters (see the "Keyword Templates" section for details). In this case, the first card with a keyword which matches the template will be found. To find the next FITS card regardless of its keyword, you should use the template "%f". |
[in] | inc | If false (and the search is successful), the FitsChan's Card attribute will be set to the index of the card that was found. If true , however, the Card attribute will be incremented to identify the card which follows the one found. |
The templates used to match FITS keywords are normally composed of literal characters, which must match the keyword exactly (apart from case). However, a template may also contain "field specifiers" which can match a range of possible characters. This allows you to search for keywords that contain (for example) numbers, where the digits comprising the number are not known in advance.
A field specifier starts with a "%" character. This is followed by an optional single digit (0 to 9) specifying a field width. Finally, there is a single character which specifies the
type of character to be matched, as follows:
If the field width is omitted, the field specifier matches one or more characters. If the field width is zero, it matches zero or more characters. Otherwise, it matches exactly the number of characters specified. In addition to this:
For example:
auto foundvalue = fitschan.findFits("%f", true)
Return the current FITS card and advance the @ref FitsChan_Card "Card" attribute to the card that follows (the "%f" template matches any keyword).
auto foundvalue = fitschan.findFits("BITPIX", false) @iverbatim Return the next FITS card with the "BITPIX" keyword and leave the @ref FitsChan_Card "Card" attribute pointing to it. You might wish to then call
setFitsI(...)to modify its value. @endiverbatim\ilinebr
auto foundvalue = fitscan.findFits("COMMENT", true) @iverbatim Return the next COMMENT card and advance the @ref FitsChan_Card "Card" attribute to the card that follows. @endiverbatim\ilinebr
auto foundvalue = fitschan.findFits("CRVAL%1d", true)`
Return the next keyword of the form "CRVALi" (for example, any of the keywords "CRVAL1", "CRVAL2" or "CRVAL3" would be matched). Advance the @ref FitsChan_Card "Card" attribute to the card that follows.
Definition at line 124 of file FitsChan.cc.
|
staticinherited |
Given a bare AST object pointer return a shared pointer to an ast::Object of the correct type.
The returned object takes ownership of the pointer. This is almost always what you want, for instance astDecompose returns shallow copies of the internal pointers.
Class | The class of the returned shared pointer. (The actual class will be the correct class of rawPtr.) |
[in] | rawObj | A bare AST object pointer |
[in] | copy | If True then make a deep copy of the pointer (and free the original) |
Definition at line 138 of file Object.cc.
|
inlinestaticinherited |
std::vector< std::string > ast::FitsChan::getAllCardNames | ( | ) |
Get the name of all cards, in order, starting from the first card.
Not "const" because the code changes the index of the current card while operating (but restores the original index when done).
Definition at line 106 of file FitsChan.cc.
|
inline |
Get AllWarnings: a space separated list of all the conditions names recognized by the Warnings attribute.
Definition at line 481 of file FitsChan.h.
|
inlineprotectedinherited |
Get the value of an attribute as a bool.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Get the value of an attribute as a string.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Get Card: the index of the current card, where 1 is the first card.
Definition at line 486 of file FitsChan.h.
|
inline |
|
inline |
|
inline |
|
inline |
Get CarLin: ignore spherical rotations on CAR projections?
Definition at line 506 of file FitsChan.h.
|
inline |
Get CDMatrix: use CDi_j keywords to represent pixel scaling, rotation, etc?
Definition at line 512 of file FitsChan.h.
|
inlineinherited |
Get Class: the name of the class (e.g.
Note: if AST returns "CmpMap" then the name will be changed to "SeriesMap" or "ParallelMap", as appropriate.
Definition at line 139 of file Object.h.
|
inline |
Get Clean: remove cards used whilst reading even if an error occurs?
Definition at line 517 of file FitsChan.h.
|
inlineinherited |
|
inlineprotectedinherited |
Get the value of an attribute as a double.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Get DefB1950: use FK4 B1950 as default equatorial coordinates?
Definition at line 522 of file FitsChan.h.
|
inline |
|
inlineprotectedinherited |
Get the value of an attribute as a float.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Get FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::write.
Definition at line 534 of file FitsChan.h.
FoundValue< std::complex< double > > ast::FitsChan::getFitsCF | ( | std::string const & | name = "", |
std::complex< double > | defval = {0, 0} ) const |
Get the value of a complex double card.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | Value to return if keyword not found |
Definition at line 59 of file FitsChan.cc.
FoundValue< std::string > ast::FitsChan::getFitsCN | ( | std::string const & | name = "", |
std::string | defval = "" ) const |
Get the value of a CONTINUE card.
CONTINUE cards are treated like string values, but are encoded without an equals sign.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | value to return if keyword not found |
Definition at line 69 of file FitsChan.cc.
|
inline |
Get FitsDigits: digits of precision for floating-point FITS values.
Definition at line 540 of file FitsChan.h.
FoundValue< double > ast::FitsChan::getFitsF | ( | std::string const & | name = "", |
double | defval = 0 ) const |
Get the value of a double card.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | value to return if keyword not found |
Definition at line 77 of file FitsChan.cc.
FoundValue< int > ast::FitsChan::getFitsI | ( | std::string const & | name = "", |
int | defval = 0 ) const |
Get the value of a int card.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | value to return if keyword not found |
Definition at line 84 of file FitsChan.cc.
FoundValue< bool > ast::FitsChan::getFitsL | ( | std::string const & | name = "", |
bool | defval = false ) const |
Get the value of a bool card.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | Value to return if keyword not found |
Definition at line 91 of file FitsChan.cc.
FoundValue< std::string > ast::FitsChan::getFitsS | ( | std::string const & | name = "", |
std::string | defval = "" ) const |
Get the value of a string card.
[in] | name | Name of keyword, or empty for the current card |
[in] | defval | Value to return if keyword not found |
Definition at line 98 of file FitsChan.cc.
|
inline |
Get FitsTol: Tolerance used for writing a FrameSet using a foreign encoding.
Definition at line 545 of file FitsChan.h.
|
inlineinherited |
|
protectedinherited |
Get the value of an attribute as an int.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Get Iwc: add a Frame describing Intermediate World Coords?
Definition at line 550 of file FitsChan.h.
|
inlineprotectedinherited |
Get the value of an attribute as a long int.
If possible, the attribute value is converted to the type you request.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inline |
Get PolyTan: use PVi_m
keywords to define distorted TAN projection?
Definition at line 582 of file FitsChan.h.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Get SipOK: use Spitzer Space Telescope keywords to define distortion?
Definition at line 565 of file FitsChan.h.
|
inline |
Get SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative inverse)?
Definition at line 571 of file FitsChan.h.
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 1038 of file FitsChan.h.
|
inline |
Get TabOK: should the FITS "-TAB" algorithm be recognised?
Definition at line 576 of file FitsChan.h.
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
Lock this object for exclusive use by the calling thread.
The thread-safe public interface to AST is designed so that an error is reported if any thread attempts to use an Object that it has not previously locked for its own exclusive use using this function. When an Object is created, it is initially locked by the thread that creates it, so newly created objects do not need to be explicitly locked. However, if an Object pointer is passed to another thread, the original thread must first unlock it (using astUnlock) and the new thread must then lock it (using astLock) before the new thread can use the Object.
[in] | wait | If the Object is curently locked by another thread then this function will either report an error or block. If a non-zero value is supplied for "wait", the calling thread waits until the object is available for it to use. Otherwise, an error is reported and the function returns immediately without locking the Object. |
|
inlinestaticprotectedinherited |
Functor to make an astshim instance from a raw AST pointer of the corresponding type.
ShimT | Output astshim class |
AstT | Output AST class |
|
inlineinherited |
|
inherited |
Return True if this and rhs
are the equal.
For two objects be equal, they both must have the same attributes and all contained objects must be equal.
Definition at line 85 of file Object.cc.
|
inline |
|
inline |
Replace all FITS header cards.
The cards are supplied concatenated together into a single character string. Any existing cards in the FitsChan are removed before the new cards are added. The FitsChan is "re-wound" on exit. This means that a subsequent invocation of read can be made immediately without the need to re-wind the FitsChan first.
[in] | cards | A string containing the FITS cards to be stored. Each individual card should occupy 80 characters in this string, and there should be no delimiters, new lines, etc, between adjacent cards. The final card may be less than 80 characters long. This is the format produced by the fits_hdr2str function in the CFITSIO library. |
Definition at line 616 of file FitsChan.h.
|
inline |
Store a FITS header card in a FitsChan.
The card is either inserted before the current card or over-writes the current card, depending on overwrite
.
[in] | card | A character string containing the FITS cards to be stored. Each individual card should occupy 80 characters in this string, and there should be no delimiters, new lines, etc, between adjacent cards. The final card may be less than 80 characters long. This is the format produced by the fits_hdr2str function in the CFITSIO library. |
[in] | overwrite | if false , the new card is inserted in before the current card. If true the new card replaces the current card. In either case, the Card attribute is then incremented by one so that it subsequently identifies the card following the one stored. |
Definition at line 644 of file FitsChan.h.
|
inherited |
Read an object from a channel.
Definition at line 52 of file Channel.cc.
|
inline |
Read cards from the source and store them in the FitsChan.
This normally happens once-only, when the FitsChan is accessed for the first time. This function provides a means of forcing a re-read of the external source, and may be useful if (say) new cards have been deposited into the external source. Any new cards read from the source are appended to the end of the current contents of the FitsChan.
Definition at line 661 of file FitsChan.h.
|
inline |
Keep the current card when an Object is read that uses the card.
Cards that have not been flagged in this way are removed when a read operation completes succesfully, but only if the card was used in the process of creating the returned Object. Any cards that are irrelevant to the creation of the Object are retained whether or not they are flagged.
Definition at line 674 of file FitsChan.h.
|
inlineinherited |
|
inlineprotectedinherited |
Assign a set of attribute values, over-riding any previous values.
The attributes and their new values are specified via a character string, which should contain a comma-separated list of the form: "attribute_1 = value_1, attribute_2 = value_2, ... " where "attribute_n" specifies an attribute name, and the value to the right of each " =" sign should be a suitable textual representation of the value to be assigned. This value will be interpreted according to the attribute's data type.
std::runtime_error | if the attribute is read-only |
|
inlineprotectedinherited |
Set the value of an attribute as a bool.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineprotectedinherited |
Set the value of an attribute as a string.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Set Card: the index of the current card, where 1 is the first card.
Definition at line 1036 of file FitsChan.h.
|
inline |
Set CarLin: ignore spherical rotations on CAR projections?
Definition at line 923 of file FitsChan.h.
|
inline |
Get CDMatrix: Use CDi_j keywords to represent pixel scaling, rotation, etc?
Definition at line 929 of file FitsChan.h.
|
inline |
Set Clean: remove cards used whilst reading even if an error occurs?
Definition at line 934 of file FitsChan.h.
|
inlineinherited |
|
inlineprotectedinherited |
Set the value of an attribute as a double.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Set DefB1950: use FK4 B1950 as default equatorial coordinates?
Definition at line 939 of file FitsChan.h.
|
inline |
Set Encoding: the encoding system to use when AST Objects are stored as FITS header cards in a FitsChan.
Definition at line 945 of file FitsChan.h.
|
inlineprotectedinherited |
Set the value of an attribute as a float.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Set FitsAxisOrder: the order for the WCS axes in any new FITS-WCS headers created using Channel::write.
Definition at line 951 of file FitsChan.h.
|
inline |
Create a new card of type std::complex<double>, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 696 of file FitsChan.h.
|
inline |
Create a new comment card, possibly overwriting the current card.
The card will have a name of " " (eight spaces) and no equals sign. There is presently no way to generate a card with name HISTORY or COMMENT, but FITS treats those essentially the same as cards with blank names.
[in] | comment | Comment to associated with the keyword. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 725 of file FitsChan.h.
|
inline |
Create a new "CONTINUE" card, possibly overwriting the current card.
"CONTINUE" cards are treated like string values, but are encoded without an equals sign.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 756 of file FitsChan.h.
|
inline |
Set FitsDigits: digits of precision for floating-point FITS values.
Definition at line 957 of file FitsChan.h.
|
inline |
Create a new card of type double, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 786 of file FitsChan.h.
|
inline |
Create a new card of type int, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 816 of file FitsChan.h.
|
inline |
Create a new card of type bool, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 846 of file FitsChan.h.
|
inline |
Create a new card of type string, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | value | the value of the card. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
Definition at line 884 of file FitsChan.h.
|
inline |
Set FitsTol: Tolerance used for writing a FrameSet using a foreign encoding.
Definition at line 962 of file FitsChan.h.
|
inline |
Create a new card with an undefined value, possibly overwriting the current card.
[in] | name | Name of keyword for the new card. This may be a complete FITS header card, in which case the keyword to use is extracted from it. |
[in] | comment | Comment to associated with the keyword. If blank, then any comment included in the string supplied for the name parameter is used instead. If name contains no comment, then any existing comment in the card being over-written is retained. Otherwise, no comment is stored with the card. |
[in] | overwrite | if true the new card formed from the supplied keyword name, value and comment over-writes the current card, and the current card is incremented to refer to the next card (see the Card attribute). If false , the new card is inserted before the current card and the current card is left unchanged. In either case, if the current card on entry points to the "end-of-file", the new card is appended to the end of the list. |
findFits
, and then use the appropriate setFits
function to over-write the old value.Definition at line 915 of file FitsChan.h.
|
inlineinherited |
|
inlineprotectedinherited |
Set the value of an attribute as an int.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Set Iwc: add a Frame describing Intermediate World Coords?
Definition at line 967 of file FitsChan.h.
|
inlineprotectedinherited |
Set the value of an attribute as a long int.
If possible, the type you provide is converted to the actual type of the attribute.
std::runtime_error | if the attribute does not exist or the value cannot be converted |
|
inline |
Set PolyTan: use PVi_m
keywords to define distorted TAN projection?
Definition at line 989 of file FitsChan.h.
|
inlineinherited |
Set ReportLevel: report level; an integer in the range [0, 3] where 0 is the most verbose.
std::invalid_argument | if level is not in range [0, 3] |
Definition at line 125 of file Channel.h.
|
inline |
Set SipOK: use Spitzer Space Telescope keywords to define distortion?
Definition at line 972 of file FitsChan.h.
|
inline |
Set SipReplace: ignore inverse SIP coefficients (replacing them with fit coefficients or an iterative inverse)?
Definition at line 978 of file FitsChan.h.
|
inlineinherited |
|
inlineinherited |
|
inline |
Set TabOK: should the FITS "-TAB" algorithm be recognised?
Definition at line 983 of file FitsChan.h.
|
inlineinherited |
|
inline |
|
inherited |
Return a textual description the object as a string.
[in] | showComments | Show comments? |
|
inherited |
Print a textual description the object to an ostream.
[in,out] | os | The stream to which to write the string representation. |
[in] | showComments | Show comments? |
Definition at line 158 of file Object.cc.
|
inline |
Write all the cards in the channel to standard output.
Definition at line 1000 of file FitsChan.h.
|
inlineinherited |
Has this attribute been explicitly set (and not subsequently cleared)?
false
.std::runtime_error | if an error results. |
FitsKeyState ast::FitsChan::testFits | ( | std::string const & | name = "" | ) | const |
Determine if a card is present, and if so, whether it has a value.
[in] | name | Name of keyword, or empty for the current card |
Definition at line 132 of file FitsChan.cc.
|
inlineinherited |
Unlock this object previously locked using lock, so that other threads can use this object.
See lock for further details.
[in] | report | If true, an error will be reported if the supplied Object, or any Object contained within the supplied Object, is not currently locked by the running thread. If false, such Objects will be left unchanged, and no error will be reported. |
|
inherited |
Return a KeyMap holding the text of any warnings issued as a result of the previous invocation of read or write.
If no warnings were issued, an empty KeyMap will be returned. Such warnings are non-fatal and will not prevent the read or write operation succeeding. However, the converted object may not be identical to the original object in all respects. Differences which would usually be deemed as insignificant in most usual cases will generate a warning, whereas more significant differences will generate an error.
The " Strict" attribute allows this warning facility to be switched off, so that a fatal error is always reported for any conversion error.
Definition at line 67 of file Channel.cc.
|
inherited |
Write an object to a channel.
Definition at line 61 of file Channel.cc.
|
inline |
Write out all cards currently in the channel and clear the channel.
Definition at line 1025 of file FitsChan.h.