TelRunNum.hxx
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 #ifndef TELRUNNUM_H
00008 #define TELRUNNUM_H
00009 
00010 #include <string>
00011 
00012 #include "DataMethod.hxx"
00013 #include "DataOps.h"
00014 #include "FitsFile.h"
00015 #include "Options.h"
00016 #include "StringOps.h"
00017 
00019 template<typename DataType>
00020 class TelRunNum : public DataMethod<DataType>
00021 {
00022 public:
00026   TelRunNum(const FitsFile& aFile)
00027   {
00028     DataMethod<DataType>::methodName = "TelRunNum";
00029     Options options;
00030     mFileName = aFile.getFileName();
00031     if (StringOps::ToLower(options.getArchive()) == "vsa" &&
00032         (mFileName.find(PreSuffixNames::CelestialSphere) != string::npos ||
00033          mFileName.find("v20") != string::npos)) {
00034       mRunNum = DataOps::getRunNoFromName(mFileName);
00035     } else {
00036       mRunNum = DataOps::getRunNoFromKey(aFile);
00037     }
00038   }
00039 
00041   virtual ~TelRunNum() { }
00042 
00044   void setSource(IntMap& tbls, IntMap& cols, StringMap units) { }
00045 
00047   void setTarget(IntMap& cols, StringMap units) { mCol = cols[0]; }
00048 
00050   void doit(TableData<DataType>& data, int rowBegin, int rowEnd)
00051   {
00052     for (int row = rowBegin; row < rowEnd; ++row)
00053     {
00054       data.assign(mCol, row, mRunNum);
00055     }
00056   }
00057 
00058   
00059   void doit2(TableData<DataType>& rawData, TableData<DataType>& data, int row1, int row2) { }
00060 
00061 private:
00062   int mCol;
00063   std::string mFileName;
00064   std::string mRunNum;
00065 };
00066 
00067 #endif
00068 
00069 
00070 
00071 
00072