Changeset 14025 for trunk/FACT++/src


Ignore:
Timestamp:
06/01/12 16:25:45 (12 years ago)
Author:
tbretz
Message:
Started to prepare to move WriteFits as WriteFitsImp to DrsCalibration class
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.cc

    r14024 r14025  
    211211}
    212212
    213 void DataCalib::WriteFits(const string &filename)
    214 {
    215     ofits file(filename.c_str());
    216 
     213void DataCalib::WriteFitsImp(const string &filename, const vector<float> &vec) const
     214{
    217215    const uint16_t roi = fData.fRoi;
    218216    const uint16_t ntm = fData.fNumTm;
     217
     218    const size_t n = 1440*1024*4 + 1440*roi*2 + ntm*roi*2 + 3;
     219
     220    if (vec.size()!=n+1)
     221        throw runtime_error("Size of vector does not match region-of-interest");
     222
     223    ofits file(filename.c_str());
    219224
    220225    file.AddColumnInt("RunNumberBaseline");
     
    252257
    253258    file.WriteTableHeader("DrsCalibration");
    254 
    255     const int n = (1440*1024*4 + 1440*roi*2 + ntm*roi*2 + 3)*sizeof(float);
    256     file.WriteRow(fStats.data()+1, n);
     259    file.WriteRow(vec.data()+1, n*sizeof(float));
    257260}
    258261
     
    305308        try
    306309        {
    307             WriteFits(filename);
     310            WriteFitsImp(filename, fStats);
    308311
    309312            ostringstream str;
  • trunk/FACT++/src/DataCalib.h

    r14024 r14025  
    2424//    uint16_t fDAC[8];
    2525
    26     void WriteFits(const std::string &filename);
     26    void WriteFitsImp(const std::string &filename, const std::vector<float> &vec) const;
    2727
    2828    int GetDrsStep() const { return fData.fStep; }
Note: See TracChangeset for help on using the changeset viewer.