Changeset 21524 for trunk/ppSub/src/ppSubBackground.c
- Timestamp:
- Feb 17, 2009, 2:31:20 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubBackground.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubBackground.c
r21360 r21524 6 6 * 7 7 * @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 $ 10 10 * Copyright 2009 Institute for Astronomy, University of Hawaii 11 11 */ 12 12 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 13 22 #include "ppSub.h" 14 23 15 /**16 * Based on ppImageSubtractBackground()17 */18 24 bool ppSubBackground(pmConfig *config, const pmFPAview *view) 19 25 { 20 psAssert(config, " Needconfiguration");21 psAssert(view, " Need view to chip");26 psAssert(config, "Require configuration"); 27 psAssert(view, "Require view"); 22 28 23 bool status; // Status of metadata lookups29 bool mdok; // Status of metadata lookups 24 30 25 psMetadata *ppSubRecipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); 31 psMetadata *ppSubRecipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSub 26 32 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 29 34 psAssert(psphotRecipe, "Need PSPHOT recipe for binning"); 30 35 31 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); 36 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask 32 37 33 // select the output readout34 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 35 40 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 40 42 if (!modelRO) { 41 43 // Create the background model … … 44 46 return false; 45 47 } 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"); 48 50 if (!modelRO) { 49 51 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find background model"); … … 51 53 } 52 54 } 53 psImageBinning *binning = psMetadataLookupPtr(& status, psphotRecipe,55 psImageBinning *binning = psMetadataLookupPtr(&mdok, psphotRecipe, 54 56 "PSPHOT.BACKGROUND.BINNING"); // Binning for model 55 57 psImage *modelImage = modelRO->image; // Background model 56 57 58 psImage *image = outRO->image; // Image of interest 58 59 psImage *mask = outRO->mask; // Mask of interest
Note:
See TracChangeset
for help on using the changeset viewer.
