I/O routines

These C++ routines can be found in SPio.h and SPio.cxx and are not available from Python.

  •  template <class T> T SPreadKey(CCfits::PHDU& primary, const string Keyname,
                                    const T DefValue)
    

    Read a keyword value from the primary header.

  •  template <class T> T SPreadKey(CCfits::ExtHDU& ext, const string Keyname,
                                    const T DefValue)
    

    Read a keyword value from an extension header.

  •  template <class T> T SPreadKey(CCfits::ExtHDU& ext, const string Keyname,
                                    const Integer RowNumber, const T DefValue)
    

    Read a keyword value which may be in a column for type II files.

  •  template <class T> void SPreadCol(CCfits::ExtHDU& ext,
                                       const string ColName,
                                       std::valarray<T>& Data)
    

    Read a column into a valarray.

  •  template <class T> void SPreadCol(CCfits::ExtHDU& ext,
                                       const string ColName,
                                       std::vector<T>& Data)
    

    Read a column into a vector.

  •  void SPreadCol(CCfits::ExtHDU& ext, const string ColName,
                    StringVector& Data)
    

    Read a string column into a vector (special case necessary for a workaround in CCfits).

  •  template <class T> void SPreadCol(CCfits::ExtHDU& ext,
                                       const string ColName,
                                       const Integer RowNumber,
                                       std::valarray<T>& Data)
    

    Read a column from a Type II file into a valarray.

  •  template <class T> void SPreadCol(CCfits::ExtHDU& ext,
                                       const string ColName,
                                       const Integer RowNumber,
                                       std::vector<T>& Data)
    

    Read a column from a Type II file into a vector.

  •  template <class T> void SPreadVectorCol(CCfits::ExtHDU& ext,
                                             const string ColName,
                                   std::vector<std::valarray<T> >& Data)
    

    Read a vector column into a vector of valarrays.

  •  template <class T> void SPreadVectorCol(CCfits::ExtHDU& ext,
                                             const string ColName,
                                             std::vector<std::vector<T> >& Data)
    

    Read a vector column into a vector of vectors.

  •  template <class T> void SPreadVectorColRow(CCfits::ExtHDU& ext,
                                                const string ColName,
                                                const Integer RowNumber,
                                                std::valarray<T>& Data)
    

    Read a single row of a vector column into a valarray.

  •  template <class T> void SPreadVectorColRow(CCfits::ExtHDU& ext,
                                                const string ColName,
                                                const Integer RowNumber,
                                                std::vector<T>& Data)
    

    Read a single row of a vector column into a vector.

  •  template <class T> void SPwriteKey(CCfits::PHDU& primary,
                                        const string Keyname,
                                        const T KeyValue, const string Comment)
    

    Write a keyword to the primary header. This uses the CONTINUE convention if KeyValue is a string and longer than 68 characters.

  •  template <class T> void SPwriteKey(CCfits::Table& primary,
                                        const string Keyname,
                                        const string ColName,
                                        const std::valarray<T>& Data,
                                        const bool forceCol = false)
    

    Write a column from a valarray. If the data size is 1 or all values are the same then just write a keyword unless the forceCol bool is true.

  •  template <class T> void SPwriteCol(CCfits::Table& table,
                                        const string ColName,
                                        const std::vector<T>& Data,
                                        const bool forceCol = false)
    

    Write a column from a vector. If the data size is 1 or all values are the same then just write a keyword unless the forceCol bool is true.

  •  template <class T> void SPwriteVectorCol(CCfits::Table& table,
                                              const string ColName,
                                    const std::vector<std::valarray<T> >& Data,
                                              const bool forceCol = false)
    

    Write a column from a vector of valarrays. If the data size is 1 or all values are the same then just write a keyword unless the forceCol bool is true. If all values are the same within all valarrays then write a scalar column.

  •  template <class T> void SPwriteVectorCol(CCfits::Table& table,
                                              const string ColName,
                                    const std::vector<std::vector<T> >& Data,
                                              const bool forceCol = false)
    

    Write a column from a vector of vectors. If the data size is 1 or all values are the same then just write a keyword unless the forceCol bool is true. If all values are the same within all valarrays then write a scalar column.

  •  template <class T> bool SPneedCol(const T& Data, bool& isvector)
    

    Check whether a column is required and if it needs to be a vector column. Note that T is assumed to be a valarray or vector of a valarray of some type.

  •  template <class T> bool SPneedCol(const T& Data)
    

    Check whether a column is required. For this overloaded version T is assumed to be a valarray or vector of scalar of some type.

  •  template <class T> bool SPneedVecCol(const T& Data)
    

    Check whether a given column needs to be a vector. This assumes that the column is required and cannot be replaced by a keyword. T is assumed to be a valarray or a vector of a valarray of some type.

  •  StringVector SPreadAllPrimaryKeywords(const string& filename)
    

    Real all keywords from the primary extension into a vector of strings each of which is of format “KeyName = KeyValue”.

  •  StringVector SPreadAllKeywords(const string& filename,
                                    const string& hduName,
                                    const int& hduNumber)
    

    Real all keywords from an extension into a vector of strings each of which is of format “KeyName = KeyValue”.

  •  StringVector SPreadAllColumnNames(const string& filename,
                                    const string& hduName,
                                    const int& hduNumber)
    

    Real all the column names from an extension into a vector of strings.


HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 28-Aug-2024 16:49:34 EDT