IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 17, 2009, 2:31:20 PM (17 years ago)
Author:
Paul Price
Message:

Cleaning up. Had trouble getting the output photometry file written out, but works now.

File:
1 edited

Legend:

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

    r21360 r21524  
    66 *
    77 *  @author IfA
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-06 01:37:17 $
     8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-18 00:31:20 $
    1010 *  Copyright 2009 Institute for Astronomy, University of Hawaii
    1111 */
    1212
     13#ifdef HAVE_CONFIG_H
     14#include <config.h>
     15#endif
     16
     17#include <stdio.h>
     18#include <pslib.h>
     19#include <psmodules.h>
     20#include <psphot.h>
     21
    1322#include "ppSub.h"
    1423
    15 /**
    16  * Based on ppImageSubtractBackground()
    17  */
    1824bool ppSubBackground(pmConfig *config, const pmFPAview *view)
    1925{
    20     psAssert(config, "Need configuration");
    21     psAssert(view, "Need view to chip");
     26    psAssert(config, "Require configuration");
     27    psAssert(view, "Require view");
    2228
    23     bool status; // Status of metadata lookups
     29    bool mdok; // Status of metadata lookups
    2430
    25     psMetadata *ppSubRecipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE);
     31    psMetadata *ppSubRecipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSub
    2632    psAssert(ppSubRecipe, "Need PPSUB recipe");
    27 
    28     psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes, PSPHOT_RECIPE);
     33    psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes, PSPHOT_RECIPE); // Recipe for psphot
    2934    psAssert(psphotRecipe, "Need PSPHOT recipe for binning");
    3035
    31     psImageMaskType maskBad = pmConfigMaskGet("BLANK", config);
     36    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask
    3237
    33     // select the output readout
    34     pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT");
     38    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output image
     39    pmReadout *modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL"); // Background model
    3540
    36     // select the model readout, if it exist already; if not, generate it
    37     pmReadout *modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL");
    38 
    39     // if necessary, generate the background model
     41    // Generate the background model, if required
    4042    if (!modelRO) {
    4143        // Create the background model
     
    4446            return false;
    4547        }
    46         // select the model readout (should now exist)
    47         modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL");
     48        // select the model readout (should now exist)
     49        modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL");
    4850        if (!modelRO) {
    4951            psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find background model");
     
    5153        }
    5254    }
    53     psImageBinning *binning = psMetadataLookupPtr(&status, psphotRecipe,
     55    psImageBinning *binning = psMetadataLookupPtr(&mdok, psphotRecipe,
    5456                                                  "PSPHOT.BACKGROUND.BINNING"); // Binning for model
    5557    psImage *modelImage = modelRO->image; // Background model
    56 
    5758    psImage *image = outRO->image; // Image of interest
    5859    psImage *mask = outRO->mask; // Mask of interest
Note: See TracChangeset for help on using the changeset viewer.