IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2008, 4:03:31 PM (18 years ago)
Author:
eugene
Message:

update from changes on eam_branch_20080511 : adding photometry of fake sources, force photometry; major cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimPhotom.c

    r17628 r18011  
    88    pmReadout *readout;
    99
     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   
    1015    psphotModelClassInit ();
    1116
    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");
    1423    if (!status) {
    15         psError(PSPHOT_ERR_CONFIG, false, "PSPHOT.INPUT I/O file is not defined");
     24        psError(PSPHOT_ERR_CONFIG, false, "PPSIM.FAKE.CHIP I/O file is not defined");
    1625        return false;
    1726    }
    1827
    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);
    2438
    2539    // iterate over the cells and readout for this chip
     
    3347
    3448            // run the actual photometry analysis
    35             if (!psphotReadout (config, view)) {
     49            if (!ppSimPhotomReadoutFake (config, view)) {
    3650                psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    3751                return false;
    3852            }
     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);
    3958        }
    4059    }
Note: See TracChangeset for help on using the changeset viewer.