Changeset 2321 for trunk/src/Scantable.cpp
- Timestamp:
- 10/04/11 14:15:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ) {
Note: See TracChangeset
for help on using the changeset viewer.