Changeset 10927 for trunk/FACT++/src/Fits.cc
- Timestamp:
- 06/08/11 14:40:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Fits.cc
r10898 r10927 148 148 { 149 149 string factTableName = "FACT-" + tableName; 150 fTable = fFile->addTable(factTableName, 0, allNames, allDataTypes, allUnits); 151 fTable->makeThisCurrent(); 150 //first, let's check if the table already exist in the file 151 vector<string> tryToLoadName; 152 tryToLoadName.push_back(factTableName); 153 fFile->read(tryToLoadName); 154 const multimap< string, CCfits::ExtHDU * >& extMap = fFile->extension(); 155 if (extMap.find(factTableName) == extMap.end()) 156 { 157 for (multimap<string, CCfits::ExtHDU*>::const_iterator it=extMap.begin(); it!= extMap.end(); it++) 158 fMess->Debug(it->first); 159 fTable = fFile->addTable(factTableName, 0, allNames, allDataTypes, allUnits); 160 } 161 else 162 { 163 fTable = dynamic_cast<CCfits::Table*>(extMap.find(factTableName)->second); 164 } 165 if (!fTable) 166 { 167 fMess->Error("The table " + factTableName + " could not be created nor loaded. skipping it"); 168 return; 169 } 170 fTable->makeThisCurrent(); 152 171 fCopyBuffer = new unsigned char[fTotalNumBytes]; 153 172 fNumRows = fTable->rows(); … … 178 197 updating = true; 179 198 } 199 180 200 } 181 201 catch(CCfits::FitsException e) … … 301 321 WriteSingleHeaderKey("TSTOP", fEndMjD, "Time of the last receied data"); 302 322 if (fFile != NULL && fOwner) 303 delete fFile; 323 { 324 // fFile->flush(); 325 delete fFile; 326 } 304 327 fFile = NULL; 305 328 if (fCopyBuffer != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.