Changeset 18011 for trunk/ppSim/src/ppSimPhotom.c
- Timestamp:
- Jun 8, 2008, 4:03:31 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimPhotom.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimPhotom.c
r17628 r18011 8 8 pmReadout *readout; 9 9 10 psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, PPSIM_RECIPE); // Recipe 11 12 bool doPhotom = psMetadataLookupBool(&status, recipe, "PHOTOM"); // Density of fakes 13 if (!doPhotom) return true; 14 10 15 psphotModelClassInit (); 11 16 12 // find or define a pmFPAfile PSPHOT.INPUT 13 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 17 int blankMask = 0; // XXX not sure what this should be set to... 18 ppSimMosaicChip(config, blankMask, view, "PPSIM.FORCE.CHIP", "PPSIM.INPUT"); 19 ppSimMosaicChip(config, blankMask, view, "PPSIM.FAKE.CHIP", "PPSIM.OUTPUT"); 20 21 // use PPSIM.FAKE.CHIP as the base since it is guaranteed to exist (derived from PPSIM.OUTPUT) 22 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PPSIM.FAKE.CHIP"); 14 23 if (!status) { 15 psError(PSPHOT_ERR_CONFIG, false, "P SPHOT.INPUTI/O file is not defined");24 psError(PSPHOT_ERR_CONFIG, false, "PPSIM.FAKE.CHIP I/O file is not defined"); 16 25 return false; 17 26 } 18 27 19 // we make a new copy of the output chip to keep psphot from modifying the output image 20 // XXX is this needed for ppSim? (yes, unless we do not do photometry and make a simulated image) 21 pmChip *oldChip = pmFPAviewThisChip (view, input->src); 22 pmChip *newChip = pmFPAviewThisChip (view, input->fpa); 23 pmChipCopy (newChip, oldChip); 28 // XXX If we want to be able to write out both the positive and residual images, we will 29 // need to define an additional pmFPAfile container, and then make a copy as is done for 30 // PPIMAGE.CHIP -> PSPHOT.INPUT in ppImage. At the moment, PPSIM.CHIP will write out the 31 // mosaicked image with the sources subtracted. 32 33 // XXX if input -> PSPHOT.INPUT, which is tied to PPSIM.CHIP with pmFPAfileDefineFromFile, 34 // then the following code creates the chip copy: 35 // pmChip *oldChip = pmFPAviewThisChip (view, input->src); 36 // pmChip *newChip = pmFPAviewThisChip (view, input->fpa); 37 // pmChipCopy (newChip, oldChip); 24 38 25 39 // iterate over the cells and readout for this chip … … 33 47 34 48 // run the actual photometry analysis 35 if (!p sphotReadout(config, view)) {49 if (!ppSimPhotomReadoutFake (config, view)) { 36 50 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 37 51 return false; 38 52 } 53 if (!ppSimPhotomReadoutForce (config, view)) { 54 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 55 return false; 56 } 57 // ppSimDetectionLimits (config, view); 39 58 } 40 59 }
Note:
See TracChangeset
for help on using the changeset viewer.
