IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 9:45:46 PM (15 years ago)
Author:
eugene
Message:

add forced photometry of positive sources; generate a background model for PPSUB.OUTPUT even if PSPHOT.BACKMDL exists (is certain to be for the wrong image)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubBackground.c

    r29003 r29937  
    3737    pmFPAview *view = ppSubViewReadout(); // View to readout
    3838    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output image
    39     pmReadout *modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL"); // Background model
    4039
    41     // Generate the background model, if required
     40    // Generate the background model
     41    if (!psphotModelBackground(config, view, "PPSUB.OUTPUT")) {
     42      psError(psErrorCodeLast(), false, "Unable to model background");
     43      psFree(view);
     44      return false;
     45    }
     46
     47    // select the model readout (should now exist)
     48    pmReadout *modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL");
    4249    if (!modelRO) {
    43         // Create the background model
    44         if (!psphotModelBackgroundReadoutFileIndex(config, view, "PPSUB.OUTPUT", 0)) {
    45             psError(psErrorCodeLast(), false, "Unable to model background");
    46             psFree(view);
    47             return false;
    48         }
    49         // select the model readout (should now exist)
    50         modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL");
    51         if (!modelRO) {
    52             psError(psErrorCodeLast(), false, "Unable to find background model");
    53             psFree(view);
    54             return false;
    55         }
     50      psError(psErrorCodeLast(), false, "Unable to find background model");
     51      psFree(view);
     52      return false;
    5653    }
    5754    psFree(view);
    5855
    59     psImageBinning *binning = psMetadataLookupPtr(&mdok, modelRO->analysis,
    60                                                   "PSPHOT.BACKGROUND.BINNING"); // Binning for model
     56    psImageBinning *binning = psMetadataLookupPtr(&mdok, modelRO->analysis, "PSPHOT.BACKGROUND.BINNING"); // Binning for model
    6157    psImage *modelImage = modelRO->image; // Background model
    6258    psImage *image = outRO->image; // Image of interest
     
    8379    }
    8480
    85     pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL");
    86     pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL.STDEV");
    87 
    8881    return true;
    8982}
Note: See TracChangeset for help on using the changeset viewer.