- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/cnb_branches/cnb_branch_20090215/psphot merged eligible /trunk/psphot merged eligible /branches/cnb_branch_20090215/psphot 21495-22685 /branches/eam_branches/eam_branch_20090303/psphot 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psphot/src/psphotModelBackground.c
r21183 r23352 31 31 static bool backgroundModel(psImage *model, // Model image 32 32 psImage *modelStdev, // Model stdev image 33 ps Image *image, // Image for which to generate a background model34 p sImage *mask, // Mask for image33 psMetadata *analysis, // Analysis metadata for outputs 34 pmReadout *readout, // Readout for which to generate a background model 35 35 psImageBinning *binning, // Binning parameters 36 36 const pmConfig *config // Configuration … … 41 41 bool status = true; 42 42 43 psImage *image = readout->image, *mask = readout->mask; // Image and mask for readout 44 43 45 // select the appropriate recipe information 44 46 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); … … 49 51 assert (maskVal); 50 52 51 // user supplied seed, if available 52 unsigned long seed = psMetadataLookupS32 (&status, recipe, "IMSTATS_SEED"); 53 if (!status) { 54 seed = 0; 55 } 56 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, seed); 53 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); 57 54 58 55 // subtract this amount extra from the sky … … 140 137 141 138 // we save the binning structure for use in psphotMagnitudes 142 status = psMetadataAddPtr(recipe, PS_LIST_TAIL, "PSPHOT.BACKGROUND.BINNING", PS_DATA_UNKNOWN | PS_META_REPLACE, "Background binning", binning); 143 PS_ASSERT (status, false); 144 139 psMetadataAddPtr(analysis, PS_LIST_TAIL, "PSPHOT.BACKGROUND.BINNING", 140 PS_DATA_UNKNOWN | PS_META_REPLACE, "Background binning", binning); 145 141 146 142 psF32 **modelData = model->data.F32; … … 343 339 psImage *modelStdev = psImageAlloc(binning->nXruff, binning->nYruff, PS_TYPE_F32); // Standard deviation 344 340 345 if (!backgroundModel(model, modelStdev, ro-> image, ro->mask, binning, config)) {341 if (!backgroundModel(model, modelStdev, ro->analysis, ro, binning, config)) { 346 342 psFree(model); 347 343 psFree(modelStdev); … … 365 361 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, filename); 366 362 pmFPA *inFPA = file->fpa; 367 pmReadout *readout = pmFPAviewThisReadout (view, inFPA); 368 psImage *image = readout->image; 369 psImage *mask = readout->mask; 370 371 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 372 366 pmReadout *model = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL", inFPA, binning); 373 367 pmReadout *modelStdev = pmFPAGenerateReadout(config, view, "PSPHOT.BACKMDL.STDEV", inFPA, binning); 374 368 375 if (!backgroundModel(model->image, modelStdev->image, image, mask, binning, config)) {369 if (!backgroundModel(model->image, modelStdev->image, model->analysis, readout, binning, config)) { 376 370 psError(PS_ERR_UNKNOWN, false, "Unable to generate background model"); 377 371 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
