Changeset 17224


Ignore:
Timestamp:
10/16/13 19:18:20 (11 years ago)
Author:
tbretz
Message:
Added missing include; setup a reasonable scheme for calling AddColumn for potentally compressed data
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/ofits.h

    r17221 r17224  
    3030#endif
    3131
     32#include "FITS.h"
    3233#include "checksum.h"
    3334
     
    649650    }
    650651
    651     virtual bool AddColumn(uint32_t cnt, char typechar, const string& name, const string& unit, const BlockHeaderWriter& header, const string& comment="", bool addHeaderKeys=true)
    652     {
    653         return AddColumn(cnt, typechar, name, unit, comment, addHeaderKeys);
    654     }
    655     virtual bool AddColumn(const string& compressionScheme, uint32_t cnt, char typechar, const string& name, const string& unit,  const string& comment="", bool addHeaderKeys=true)
    656     {
    657         if (compressionScheme != "" &&
    658             compressionScheme != "RAW")
    659         {
    660 #ifdef __EXCEPTIONS
    661             throw runtime_error("Trying to add a compressed column to an uncompressed file");
    662 #else
    663             gLog << ___err___ << "ERROR - Trying to add a compressed column to an uncompressed file" << endl;
    664             return false;
    665 #endif
    666         }
     652    virtual bool AddColumn(const FITS::Compression&, uint32_t cnt, char typechar, const string& name, const string& unit,  const string& comment="", bool addHeaderKeys=true)
     653    {
    667654        return AddColumn(cnt, typechar, name, unit, comment, addHeaderKeys);
    668655    }
     
    702689    { return AddColumn(1, 'L', name, unit, comment); }
    703690
     691    bool AddColumnShort(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     692    { return AddColumn(comp, cnt, 'I', name, unit, comment); }
     693    bool AddColumnInt(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     694    { return AddColumn(comp, cnt, 'J', name, unit, comment); }
     695    bool AddColumnLong(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     696    { return AddColumn(comp, cnt, 'K', name, unit, comment); }
     697    bool AddColumnFloat(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     698    { return AddColumn(comp, cnt, 'E', name, unit, comment); }
     699    bool AddColumnDouble(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     700    { return AddColumn(comp, cnt, 'D', name, unit, comment); }
     701    bool AddColumnChar(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     702    { return AddColumn(comp, cnt, 'A', name, unit, comment); }
     703    bool AddColumnByte(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     704    { return AddColumn(comp, cnt, 'B', name, unit, comment); }
     705    bool AddColumnBool(const FITS::Compression &comp, uint32_t cnt, const string &name, const string &unit="", const string &comment="")
     706    { return AddColumn(comp, cnt, 'L', name, unit, comment); }
     707
     708    bool AddColumnShort(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     709    { return AddColumn(comp, 1, 'I', name, unit, comment); }
     710    bool AddColumnInt(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     711    { return AddColumn(comp, 1, 'J', name, unit, comment); }
     712    bool AddColumnLong(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     713    { return AddColumn(comp, 1, 'K', name, unit, comment); }
     714    bool AddColumnFloat(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     715    { return AddColumn(comp, 1, 'E', name, unit, comment); }
     716    bool AddColumnDouble(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     717    { return AddColumn(comp, 1, 'D', name, unit, comment); }
     718    bool AddColumnChar(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     719    { return AddColumn(comp, 1, 'A', name, unit, comment); }
     720    bool AddColumnByte(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     721    { return AddColumn(comp, 1, 'B', name, unit, comment); }
     722    bool AddColumnBool(const FITS::Compression &comp, const string &name, const string &unit="", const string &comment="")
     723    { return AddColumn(comp, 1, 'L', name, unit, comment); }
     724
    704725    /*
    705726    bool AddKey(string key, double d, const string &comment)
Note: See TracChangeset for help on using the changeset viewer.