Changeset 13904
- Timestamp:
- Jun 19, 2007, 4:53:35 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpLoop.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpLoop.c
r13705 r13904 50 50 } 51 51 52 // de-activate PSWARP.SKYCELL and PSWARP.OUTPUT 52 // Read the input astrometry 53 { 54 pmFPAfileActivate(config->files, false, "PSWARP.INPUT"); 55 pmFPAfileActivate(config->files, false, "PSWARP.MASK"); 56 pmFPAfileActivate(config->files, false, "PSWARP.WEIGHT"); 57 pmFPAfileActivate(config->files, true, "PSWARP.ASTROM"); 58 pmFPAfileActivate(config->files, false, "PSWARP.OUTPUT"); 59 pmFPAfileActivate(config->files, false, "PSWARP.OUTPUT.MASK"); 60 pmFPAfileActivate(config->files, false, "PSWARP.OUTPUT.WEIGHT"); 61 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 62 pmChip *chip; 63 pmFPAview *view = pmFPAviewAlloc(0); 64 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 65 psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 66 if (!chip->process || !chip->file_exists) { continue; } 67 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE); 68 pmCell *cell; 69 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 70 psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 71 if (!cell->process || !cell->file_exists) { continue; } 72 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 73 } 74 } 75 psFree(view); 76 77 pmFPAfileActivate(config->files, true, "PSWARP.INPUT"); 78 pmFPAfileActivate(config->files, true, "PSWARP.MASK"); 79 pmFPAfileActivate(config->files, true, "PSWARP.WEIGHT"); 80 pmFPAfileActivate(config->files, false, "PSWARP.ASTROM"); 81 pmFPAfileActivate(config->files, true, "PSWARP.OUTPUT"); 82 pmFPAfileActivate(config->files, true, "PSWARP.OUTPUT.MASK"); 83 pmFPAfileActivate(config->files, true, "PSWARP.OUTPUT.WEIGHT"); 84 } 85 53 86 pmFPAfileActivate(config->files, false, "PSWARP.SKYCELL"); 54 55 87 view = pmFPAviewAlloc(0); 56 88 … … 72 104 } 73 105 } 106 107 psList *cells = psListAlloc(NULL); // List of cells, for concepts averaging 74 108 75 109 // files associated with the science image … … 107 141 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE); 108 142 143 psListAdd(cells, PS_LIST_TAIL, cell); 144 109 145 // process each of the readouts 110 146 pmReadout *readout; … … 128 164 pmFPA *outFPA = outChip->parent; // Output FPA 129 165 130 if (!pmFPACopyConcepts(output->parent->parent->parent, input->fpa)) { 131 psError(PS_ERR_UNKNOWN, false, "Unable to copy concepts from input to output."); 166 if (!pmConceptsAverageCells(outCell, cells, NULL, NULL, false)) { 167 psError(PS_ERR_UNKNOWN, false, "Unable to average cell concepts."); 168 psFree(stats); 169 psFree(view); 170 return false; 171 } 172 173 if (!psMetadataCopy(outFPA->concepts, input->fpa->concepts)) { 174 psError(PS_ERR_UNKNOWN, false, "Unable to copy FPA concepts from input to output."); 132 175 psFree(stats); 133 176 psFree(view); … … 139 182 outChip->data_exists = true; 140 183 141 184 #if 0 185 float gain = 0.0, readnoise = 0.0, saturation = INFINITY, exposure = 0.0, darktime = 0.0; 186 double mjd = 0.0; 187 #endif 188 189 #if 0 142 190 // XXX Hack so that INSTRUME header keyword and the like are not updated properly 143 191 // If INSTRUME (etc) is updated, then the FITS file with the warped image will be often … … 158 206 item->data.V = NULL; 159 207 } 160 208 #endif 161 209 162 210 163 211 // Perform statistics on the output image 164 212 if (stats) { 165 ppStats(stats, output->parent->parent->parent, view, maskBad | maskPoor, config); 213 if (!ppStats(stats, output->parent->parent->parent, view, maskBad | maskPoor, config)) { 214 psWarning("Unable to perform statistics on warped image."); 215 } 166 216 } 167 217 … … 190 240 if (stats) { 191 241 const char *statsMDC = psMetadataConfigFormat(stats); 192 if (!statsMDC || strlen(statsMDC) == 0) {242 if (!statsMDC) { 193 243 psError(PS_ERR_IO, false, "Unable to get statistics MDC file.\n"); 194 244 psFree(stats);
Note:
See TracChangeset
for help on using the changeset viewer.
