- Timestamp:
- Feb 10, 2010, 3:02:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/psModules/src/detrend/pmPatternIO.c
r26843 r26847 9 9 #include "pmFPAfile.h" 10 10 #include "pmFPAfileFitsIO.h" 11 #include "pmFPAHeader.h" 11 12 #include "pmConceptsRead.h" 13 #include "pmConceptsWrite.h" 12 14 13 15 #include "pmPattern.h" … … 24 26 psImage *rowCorr = psMetadataLookupPtr(&gotRow, ro->analysis, PM_PATTERN_ROW_CORRECTION); // Row correction 25 27 float cellCorr = psMetadataLookupF32(&gotCell, ro->analysis, PM_PATTERN_CELL_CORRECTION); // Cell corr. 26 if (!gotRow && !gotCell) {27 // Nothing to write28 return true;29 }30 28 31 29 pmCell *cell = ro->parent; // Cell of interest … … 73 71 PS_ASSERT_PTR_NON_NULL(cell->readouts, false); 74 72 PS_ASSERT_PTR_NON_NULL(view, false); 73 74 if (!pmConceptsWriteCell(cell, true, config)) { 75 psError(PS_ERR_IO, false, "Unable to write concepts for cell."); 76 return false; 77 } 75 78 76 79 pmFPAview *thisView = pmFPAviewAlloc(view->nRows); // Copy of input view … … 97 100 PS_ASSERT_PTR_NON_NULL(view, false); 98 101 102 if (!pmConceptsWriteChip(chip, true, true, config)) { 103 psError(PS_ERR_IO, false, "Unable to write concepts for chip.\n"); 104 return false; 105 } 106 99 107 pmFPAview *thisView = pmFPAviewAlloc(view->nRows); // Copy of input view 100 108 *thisView = *view; … … 120 128 PS_ASSERT_PTR_NON_NULL(fpa->chips, false); 121 129 130 if (!pmConceptsWriteFPA(fpa, true, config)) { 131 psError(PS_ERR_IO, false, "Unable to write concepts for FPA.\n"); 132 return false; 133 } 134 122 135 pmFPAview *thisView = pmFPAviewAlloc(view->nRows); // Copy of input view 123 136 *thisView = *view; … … 168 181 } 169 182 170 bool data = false; // Did we find any data?183 bool data = true; // Did we find any data? 171 184 172 185 psMetadataItem *cellCorr = psMetadataLookup(header, PM_PATTERN_CELL_CORRECTION); // Cell pattern correction … … 216 229 pmReadout *readout = cell->readouts->data[i]; 217 230 thisView->readout = i; 218 pmReadoutReadPattern(readout, file->fits); 219 if (!readout->data_exists) { 220 continue; 221 } 222 #if 0 223 // load in the concept information for this cell 224 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 225 psErrorClear(); 226 psWarning("Difficulty reading concepts for cell; attempting to proceed."); 227 } 228 #endif 229 cell->data_exists = true; 230 } 231 psFree(thisView); 231 if (!pmReadoutReadPattern(readout, file->fits)) { 232 psError(PS_ERR_IO, false, "Unable to read pattern correction."); 233 return false; 234 } 235 } 236 psFree(thisView); 237 238 if (!pmCellReadHeader(cell, file->fits, config)) { 239 psError(PS_ERR_IO, false, "Unable to read header for cell."); 240 return false; 241 } 242 // load in the concept information for this cell 243 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 244 psErrorClear(); 245 psWarning("Difficulty reading concepts for cell; attempting to proceed."); 246 } 232 247 233 248 return true; … … 256 271 psFree(thisView); 257 272 258 #if 0 273 if (!pmChipReadHeader(chip, file->fits, config)) { 274 psError(PS_ERR_IO, false, "Unable to read header for cell."); 275 return false; 276 } 259 277 if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER, true, true, NULL)) { 260 278 psError(PS_ERR_IO, false, "Failed to read concepts for chip.\n"); 261 279 return false; 262 280 } 263 #endif264 281 265 282 return true; … … 284 301 psFree(thisView); 285 302 286 #if 0 303 if (!pmFPAReadHeader(fpa, file->fits, config)) { 304 psError(PS_ERR_IO, false, "Unable to read header for cell."); 305 return false; 306 } 287 307 if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER, true, NULL)) { 288 308 psError(PS_ERR_IO, false, "Failed to read concepts for fpa.\n"); 289 309 return false; 290 310 } 291 #endif292 311 293 312 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
