Changeset 29937 for trunk/ppSub/src/ppSubBackground.c
- Timestamp:
- Dec 5, 2010, 9:45:46 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubBackground.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubBackground.c
r29003 r29937 37 37 pmFPAview *view = ppSubViewReadout(); // View to readout 38 38 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output image 39 pmReadout *modelRO = pmFPAfileThisReadout(config->files, view, "PSPHOT.BACKMDL"); // Background model40 39 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"); 42 49 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; 56 53 } 57 54 psFree(view); 58 55 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 61 57 psImage *modelImage = modelRO->image; // Background model 62 58 psImage *image = outRO->image; // Image of interest … … 83 79 } 84 80 85 pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL");86 pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL.STDEV");87 88 81 return true; 89 82 }
Note:
See TracChangeset
for help on using the changeset viewer.
