Changeset 26847
- Timestamp:
- Feb 10, 2010, 3:02:06 PM (16 years ago)
- Location:
- branches/eam_branches/20091201
- Files:
-
- 6 edited
-
ippconfig/recipes/filerules-split.mdc (modified) (1 diff)
-
ppViz/src/ppVizPattern (modified) (1 prop)
-
ppViz/src/ppVizPattern/ppVizPatternCamera.c (modified) (1 diff)
-
ppViz/src/ppVizPattern/ppVizPatternLoop.c (modified) (4 diffs)
-
psModules/src/detrend/pmPattern.c (modified) (4 diffs)
-
psModules/src/detrend/pmPatternIO.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/ippconfig/recipes/filerules-split.mdc
r26841 r26847 285 285 PPVIZPSF.OUTPUT OUTPUT {OUTPUT}.{CHIP.NAME}.fits IMAGE NONE CHIP TRUE NONE 286 286 PPVIZPATTERN.OUTPUT OUTPUT {OUTPUT}.{CHIP.NAME}.fits IMAGE NONE CHIP TRUE NONE 287 PPVIZPATTERN.CHIP OUTPUT {OUTPUT}.{CHIP.NAME}.ch.fits IMAGE NONE CHIP TRUE NONE 287 288 288 289 # {FPA.OBS} -
branches/eam_branches/20091201/ppViz/src/ppVizPattern
- Property svn:ignore
-
old new 1 ppVizPSF2 1 Makefile.in 3 ppVizPSFVersionDefinitions.h4 2 .deps 5 3 Makefile 4 ppVizPattern 5 ppVizPatternVersionDefinitions.h
-
- Property svn:ignore
-
branches/eam_branches/20091201/ppViz/src/ppVizPattern/ppVizPatternCamera.c
r26837 r26847 42 42 pmFPAfile *output = pmFPAfileDefineOutput(data->config, input->fpa, "PPVIZPATTERN.OUTPUT"); 43 43 if (!output) { 44 psError(psErrorCodeLast(), false, "Unable to define output.");44 psError(psErrorCodeLast(), false, "Unable to define file PPVIZPATTERN.OUTPUT"); 45 45 return false; 46 46 } 47 47 output->save = true; 48 49 pmFPAfile *outChip = pmFPAfileDefineChipMosaic(data->config, input->fpa, "PPVIZPATTERN.CHIP"); 50 if (!outChip) { 51 psError(psErrorCodeLast(), false, "Unable to define file PPVIZPATTERN.CHIP"); 52 return false; 53 } 54 outChip->save = true; 55 48 56 49 57 #if 0 -
branches/eam_branches/20091201/ppViz/src/ppVizPattern/ppVizPatternLoop.c
r26842 r26847 15 15 { 16 16 pmConfig *config = data->config; // Configuration data 17 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPVIZPATTERN.INPUT", 0); // File with PSF 17 pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPVIZPATTERN.INPUT", 0); // Input file 18 pmFPAfile *output = pmFPAfileSelectSingle(config->files, "PPVIZPATTERN.CHIP", 0); // Output file 18 19 19 20 pmFPAview *view = pmFPAviewAlloc(0); // Pointer into FPA hierarchy … … 48 49 return false; 49 50 } 50 if (!readout->data_exists) { 51 // Need to generate an image even if there's nothing in this readout, so chip-mosaicked image 52 // is filled in. 53 if (!readout->data_exists && !cell->data_exists && !chip->data_exists) { 51 54 continue; 52 55 } … … 100 103 return false; 101 104 } 105 106 // Blow away bias sections to prevent warnings 107 psMetadataItem *biassec = psMetadataLookup(cell->concepts, "CELL.BIASSEC"); // Bias section 108 psFree(biassec->data.list); 109 biassec->data.list = psListAlloc(NULL); 102 110 } 103 111 // Cell … … 107 115 } 108 116 } 117 118 pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPVIZPATTERN.CHIP"); 119 if (!outChip->hdu && !outChip->parent->hdu) { 120 const char *name = psMetadataLookupStr(NULL, chip->parent->concepts, "FPA.OBS"); // Name of FPA 121 pmFPAAddSourceFromView(outChip->parent, name, view, output->format); 122 } 123 if (!pmChipMosaic(outChip, chip, true, MASK_BAD)) { 124 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chip."); 125 return false; 126 } 127 109 128 // Chip 110 129 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) { -
branches/eam_branches/20091201/psModules/src/detrend/pmPattern.c
r26845 r26847 87 87 88 88 psImage *corr = psImageAlloc(order + 1, numRows, PS_TYPE_F64); // Corrections applied 89 psImageInit(corr, NAN); 89 90 90 91 for (int y = 0; y < numRows; y++) { … … 113 114 } 114 115 116 poly->coeff[0] -= background; 115 117 memcpy(corr->data.F64[y], poly->coeff, (order + 1) * PSELEMTYPE_SIZEOF(PS_TYPE_F64)); 116 corr->data.F64[y][0] -= background;117 118 118 psVector *solution = psPolynomial1DEvalVector(poly, indices); // Solution vector 119 119 if (!solution) { … … 125 125 126 126 for (int x = 0; x < numCols; x++) { 127 image->data.F32[y][x] += (background - solution->data.F32[x]);127 image->data.F32[y][x] -= solution->data.F32[x]; 128 128 } 129 129 psFree(solution); … … 174 174 175 175 for (int y = 0; y < numRows; y++) { 176 memcpy(poly->coeff, corr->data.F64[y], order* PSELEMTYPE_SIZEOF(PS_TYPE_F64));176 memcpy(poly->coeff, corr->data.F64[y], (order + 1) * PSELEMTYPE_SIZEOF(PS_TYPE_F64)); 177 177 psVector *solution = psPolynomial1DEvalVector(poly, indices); // Solution vector 178 178 if (!solution) { -
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.
