- Timestamp:
- 10/04/11 14:15:54 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/CMakeLists.txt
r2289 r2321 57 57 ${SRCDIR}/MSWriter.cpp 58 58 ${SRCDIR}/AsapLogSink.cpp 59 ${SRCDIR}/STUpgrade.cpp 59 60 ${SRCDIR}/Templates.cpp ) 60 61 -
trunk/src/STMolecules.h
r1819 r2321 44 44 ***/ 45 45 46 casa::uInt addEntry( casa::Vector<casa::Double> restfreq, const casa::Vector<casa::String>& name=casa::Vector<casa::String>(0), 46 casa::uInt addEntry( casa::Vector<casa::Double> restfreq, 47 const casa::Vector<casa::String>& name=casa::Vector<casa::String>(0), 47 48 const casa::Vector<casa::String>& formattedname=casa::Vector<casa::String>(0)); 48 49 … … 51 52 casa::String& formattedname, casa::uInt id) const; 52 53 ***/ 53 void getEntry( casa::Vector<casa::Double>& restfreq, casa::Vector<casa::String>& name, 54 casa::Vector<casa::String>& formattedname, casa::uInt id) const; 54 void getEntry( casa::Vector<casa::Double>& restfreq, 55 casa::Vector<casa::String>& name, 56 casa::Vector<casa::String>& formattedname, 57 casa::uInt id) const; 55 58 56 59 std::vector<double> getRestFrequencies() const; -
trunk/src/Scantable.cpp
r2290 r2321 68 68 #include "STPolLinear.h" 69 69 #include "STPolStokes.h" 70 #include "STUpgrade.h" 70 71 #include "Scantable.h" 71 72 … … 116 117 uInt version = tab.keywordSet().asuInt("VERSION"); 117 118 if (version != version_) { 118 if ( version == 2 && version_ == 3 ) { 119 // run asap2to3 command 119 STUpgrade upgrader(version_); 120 120 LogIO os( LogOrigin( "Scantable" ) ) ; 121 string command="asap2to3" ;122 string exec=command+" in="+name ;123 string outname=name ;124 if ( name.at(name.length()-1) == '/' )125 outname = outname.substr( 0, name.length()-1 ) ;126 outname += ".asap3" ;127 121 os << LogIO::WARN 128 << name << " is incompatible data format (Scantable v2)." << endl 129 << "Running " << command << " to create " << outname << ", " << endl 130 << "which is identical to " << name << " but compatible " << endl 131 << "data format with current software version (Scantable v3)." 122 << name << " data format version " << version 123 << " is deprecated" << endl 124 << "Running upgrade."<< endl 132 125 << LogIO::POST ; 133 int ret = system( string("which "+command+" > /dev/null 2>&1").c_str() ) ; 134 if ( ret != 0 ) 135 throw(AipsError(command+" is not installed")) ; 126 std::string outname = upgrader.upgrade(name); 136 127 os << LogIO::WARN 137 128 << "Data will be loaded from " << outname << " instead of " 138 129 << name << LogIO::POST ; 139 int tmp = system( exec.c_str() ) ;140 (void) tmp;141 130 tab = Table(outname, Table::Update ) ; 142 //os << "tab.tableName()=" << tab.tableName() << LogIO::POST ;143 }144 else {145 throw(AipsError("Unsupported version of ASAP file."));146 }147 131 } 148 132 if ( type_ == Table::Memory ) { -
trunk/src/Scantable.h
r2290 r2321 86 86 87 87 /** 88 * Create a Scantable object f orm an existing table on disk88 * Create a Scantable object from an existing table on disk 89 89 * @param[in] name the name of the existing Scantable 90 90 */ 91 explicit Scantable(const std::string& name, casa::Table::TableType ttype = casa::Table::Memory); 91 explicit Scantable(const std::string& name, 92 casa::Table::TableType ttype = casa::Table::Memory); 92 93 93 94 /// @fixme this is only sensible for MemoryTables.... … … 638 639 std::vector<uint> getNumbers(const casa::ScalarColumn<casa::uInt>& col) const; 639 640 640 static const casa::uInt version_ = 3;641 static const casa::uInt version_ = 4; 641 642 642 643 STSelector selector_;
Note:
See TracChangeset
for help on using the changeset viewer.