IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2008, 5:16:44 PM (18 years ago)
Author:
eugene
Message:

split fake and force photometry into separate functions and separate mosaicked images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080511/ppSim/src/ppSimPhotomFiles.c

    r17901 r17958  
    22
    33// define the needed / desired I/O files
    4 bool ppSimPhotomFiles (pmConfig *config, pmFPAfile *input) {
     4bool ppSimPhotomFiles (pmConfig *config, pmFPAfile *fakeFile, pmFPAfile *forceFile) {
    55
    66    bool status = false;
     
    1313        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    1414        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    15         pmFPAfile *output = pmFPAfileDefineFromFile (config, input, DX, DY, "PSPHOT.BACKMDL");
     15        pmFPAfile *output = pmFPAfileDefineFromFile (config, fakeFile, DX, DY, "PSPHOT.BACKMDL");
    1616        if (!output) {
    1717            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
     
    2424        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    2525        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    26         pmFPAfile *output = pmFPAfileDefineFromFile (config, input, DX, DY, "PSPHOT.BACKMDL.STDEV");
     26        pmFPAfile *output = pmFPAfileDefineFromFile (config, fakeFile, DX, DY, "PSPHOT.BACKMDL.STDEV");
    2727        if (!output) {
    2828            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");
     
    3333    // optionally save the full background image
    3434    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {
    35         pmFPAfile *output = pmFPAfileDefineFromFile (config, input,  1,  1, "PSPHOT.BACKGND");
     35        pmFPAfile *output = pmFPAfileDefineFromFile (config, fakeFile,  1,  1, "PSPHOT.BACKGND");
    3636        if (!output) {
    3737            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
     
    4242    // optionally save the background-subtracted image
    4343    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {
    44         pmFPAfile *output = pmFPAfileDefineFromFile (config, input,  1,  1, "PSPHOT.BACKSUB");
     44        pmFPAfile *output = pmFPAfileDefineFromFile (config, fakeFile,  1,  1, "PSPHOT.BACKSUB");
    4545        if (!output) {
    4646            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKSUB");
     
    5757    }
    5858
    59     // the fake sources are carried on the input->fpa structures
    60     pmFPAfile *outsources = pmFPAfileDefineOutputFromFile (config, input, "PPSIM.FAKE.SOURCES");
     59    // the fake sources are carried on the fakeFile->fpa structures (PPSIM.FAKE.CHIP)
     60    pmFPAfile *outsources = pmFPAfileDefineOutput (config, fakeFile->fpa, "PPSIM.FAKE.SOURCES");
    6161    if (!outsources) {
    6262        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PPSIM.FAKE.SOURCES");
     
    6565    outsources->save = true;
    6666
     67    // the forced sources are carried on the forceFile->fpa structures (PPSIM.FORCE.CHIP)
     68    pmFPAfile *outforced = pmFPAfileDefineOutput (config, forceFile->fpa, "PPSIM.FORCE.SOURCES");
     69    if (!outforced) {
     70        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PPSIM.FORCE.SOURCES");
     71        return false;
     72    }
     73    outforced->save = true;
     74
    6775    // we bind the psffile to the chip-mosaicked image so we have a reference to the image
    68     pmFPAfile *psffile = pmFPAfileBindFromArgs(&status, input, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
     76    pmFPAfile *psffile = pmFPAfileBindFromArgs(&status, fakeFile, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
    6977    if (!psffile) {
    7078      psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.PSF.LOAD");
Note: See TracChangeset for help on using the changeset viewer.