Changeset 28421
- Timestamp:
- Jun 22, 2010, 1:11:00 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotImageLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotImageLoop.c
r27657 r28421 46 46 if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip."); 47 47 48 // Read WCS if easy. 49 // XXX Since we're mosaicking cells, we ignore the case where the WCS is defined for a cell. 50 { 51 pmChip *inChip = pmFPAviewThisChip(view, input->fpa); // Mosaicked chip 52 pmHDU *hduLow = pmHDUGetLowest(input->fpa, inChip, NULL); 53 if (hduLow && !pmAstromReadWCS(input->fpa, inChip, hduLow->header, 1.0)) { 54 psWarning("Unable to read WCS astrometry from header."); 55 psErrorClear(); 56 pmHDU *hduHigh = pmHDUGetHighest(input->fpa, inChip, NULL); 57 if (hduHigh && hduHigh != hduLow && 58 !pmAstromReadWCS(input->fpa, chip, hduHigh->header, 1.0)) { 59 psWarning("Unable to read WCS astrometry from primary header."); 60 psErrorClear(); 61 } 62 } 63 } 64 48 65 // try to load other supporting data (PSF, SRC, etc). 49 66 // do not re-load the following three files … … 67 84 68 85 // Update the header 69 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 70 if (hdu && hdu != lastHDU) { 71 psphotVersionHeaderFull(hdu->header); 72 lastHDU = hdu; 86 { 87 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 88 if (hdu && hdu != lastHDU) { 89 psphotVersionHeaderFull(hdu->header); 90 lastHDU = hdu; 91 } 73 92 } 74 93 75 // if an external mask is supplied, ensure that NAN pixels are also masked76 if (readout->mask) {77 psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels78 if (!pmReadoutMaskNonfinite(readout, maskSat)) {79 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels.");80 psFree(view);81 return false;82 }83 }94 // if an external mask is supplied, ensure that NAN pixels are also masked 95 if (readout->mask) { 96 psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels 97 if (!pmReadoutMaskNonfinite(readout, maskSat)) { 98 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels."); 99 psFree(view); 100 return false; 101 } 102 } 84 103 85 104 // run the actual photometry analysis on this chip/cell/readout … … 91 110 } 92 111 93 // drop all versions of the internal files94 status = true;95 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");96 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");97 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");98 if (!status) {99 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");100 psFree (view);101 return false;102 }112 // drop all versions of the internal files 113 status = true; 114 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL"); 115 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV"); 116 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 117 if (!status) { 118 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files"); 119 psFree (view); 120 return false; 121 } 103 122 } 104 123 // save output which is saved at the chip level
Note:
See TracChangeset
for help on using the changeset viewer.
