IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2009, 5:22:15 PM (17 years ago)
Author:
Paul Price
Message:

Putting the psImageBinning onto the recipe was causing the dump for the PSPHOT recipe to fail --- it was empty. Instead, we put it on an appropriate readout's analysis metadata.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotModelBackground.c

    r23259 r23287  
    3131static bool backgroundModel(psImage *model,  // Model image
    3232                            psImage *modelStdev, // Model stdev image
    33                             psImage *image, // Image for which to generate a background model
    34                             psImage *mask, // Mask for image
     33                            psMetadata *analysis, // Analysis metadata for outputs
     34                            pmReadout *readout, // Readout for which to generate a background model
    3535                            psImageBinning *binning, // Binning parameters
    3636                            const pmConfig *config // Configuration
     
    4040
    4141    bool status = true;
     42
     43    psImage *image = readout->image, *mask = readout->mask; // Image and mask for readout
    4244
    4345    // select the appropriate recipe information
     
    135137
    136138    // we save the binning structure for use in psphotMagnitudes
    137     status = psMetadataAddPtr(recipe, PS_LIST_TAIL, "PSPHOT.BACKGROUND.BINNING", PS_DATA_UNKNOWN | PS_META_REPLACE, "Background binning", binning);
    138     PS_ASSERT (status, false);
    139 
     139    psMetadataAddPtr(analysis, PS_LIST_TAIL, "PSPHOT.BACKGROUND.BINNING",
     140                     PS_DATA_UNKNOWN | PS_META_REPLACE, "Background binning", binning);
    140141
    141142    psF32 **modelData = model->data.F32;
     
    338339    psImage *modelStdev = psImageAlloc(binning->nXruff, binning->nYruff, PS_TYPE_F32); // Standard deviation
    339340
    340     if (!backgroundModel(model, modelStdev, ro->image, ro->mask, binning, config)) {
     341    if (!backgroundModel(model, modelStdev, ro->analysis, ro, binning, config)) {
    341342        psFree(model);
    342343        psFree(modelStdev);
     
    360361    pmFPAfile *file = psMetadataLookupPtr (&status, config->files, filename);
    361362    pmFPA *inFPA = file->fpa;
    362     pmReadout *readout = pmFPAviewThisReadout (view, inFPA);
    363     psImage *image = readout->image;
    364     psImage *mask  = readout->mask;
    365 
    366     psImageBinning *binning = backgroundBinning(image, config); // Image binning parameters
     363    pmReadout *readout = pmFPAviewThisReadout(view, inFPA);
     364
     365    psImageBinning *binning = backgroundBinning(readout->image, config); // Image binning parameters
    367366    pmReadout *model = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL", inFPA, binning);
    368367    pmReadout *modelStdev = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL.STDEV", inFPA, binning);
    369368
    370     if (!backgroundModel(model->image, modelStdev->image, image, mask, binning, config)) {
     369    if (!backgroundModel(model->image, modelStdev->image, model->analysis, readout, binning, config)) {
    371370        psError(PS_ERR_UNKNOWN, false, "Unable to generate background model");
    372371        return false;
Note: See TracChangeset for help on using the changeset viewer.