Changeset 27888
- Timestamp:
- May 9, 2010, 6:01:15 PM (16 years ago)
- Location:
- branches/eam_branches/psphot.20100506/src
- Files:
-
- 8 edited
-
psphotCleanup.c (modified) (1 diff)
-
psphotStackImageLoop.c (modified) (1 diff)
-
psphotStackMatchPSFs.c (modified) (2 diffs)
-
psphotStackMatchPSFsPrepare.c (modified) (1 diff)
-
psphotStackMatchPSFsUtils.c (modified) (4 diffs)
-
psphotStackOptions.c (modified) (1 diff)
-
psphotStackPSF.c (modified) (1 diff)
-
psphotStackParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.20100506/src/psphotCleanup.c
r27833 r27888 19 19 pmConceptsDone (); 20 20 pmConfigDone (); 21 psLibFinalize(); 21 22 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "psphot"); 22 23 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "psphot"); -
branches/eam_branches/psphot.20100506/src/psphotStackImageLoop.c
r27884 r27888 53 53 54 54 // XXX for now, we assume there is only a single chip in the PHU: 55 if ( !psphotStackReadout (config, view)) {55 if (0 && !psphotStackReadout (config, view)) { 56 56 psError(psErrorCodeLast(), false, "failure in psphotStackReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 57 57 psFree (view); -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c
r27884 r27888 58 58 } 59 59 } 60 61 psFree (options); 60 62 return true; 61 63 } … … 78 80 pmReadout *readoutOut = pmFPAviewThisReadout(view, fileOut->fpa); 79 81 if (readoutOut == NULL) { 80 readoutOut = pmFPAGenerateReadout(config, view, "PSPHOT.STACK.OUTPUT.IMAGE", fileSrc->fpa, NULL, 0);82 readoutOut = pmFPAGenerateReadout(config, view, "PSPHOT.STACK.OUTPUT.IMAGE", fileSrc->fpa, NULL, index); 81 83 psAssert (readoutOut, "missing readout?"); 82 84 } -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsPrepare.c
r27884 r27888 83 83 } 84 84 85 // determine the input seeing85 // determine the input seeing 86 86 bool determineSeeing (pmPSF *psf, psphotStackOptions *options, int index) { 87 87 -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c
r27884 r27888 45 45 } 46 46 47 # define SN_MIN 50.0 47 48 psArray *stackSourcesFilter(psArray *sources, // Source list to filter 48 49 int exclusion // Exclusion zone, pixels … … 62 63 continue; 63 64 } 65 if (!source->peak) continue; 66 if (source->peak->SN < SN_MIN) continue; 64 67 coordsFromSource(&x->data.F32[numGood], &y->data.F32[numGood], source); 65 68 numGood++; … … 77 80 continue; 78 81 } 82 if (!source->peak) continue; 83 if (source->peak->SN < SN_MIN) continue; 79 84 float xSource, ySource; // Coordinates of source 80 85 coordsFromSource(&xSource, &ySource, source); … … 325 330 326 331 // These values are specified specifically for stacking 327 const char *stampsName = psMetadataLookupStr( NULL, config->arguments, "STAMPS");// Stamps filename332 const char *stampsName = psMetadataLookupStr(&mdok, config->arguments, "STAMPS");// Stamps filename 328 333 329 334 psVector *widthsCopy = NULL; -
branches/eam_branches/psphot.20100506/src/psphotStackOptions.c
r27884 r27888 5 5 if (options == NULL) return; 6 6 7 // free the psf 7 8 psFree (options->psf); 8 psFree (options->inputSeeing); 9 10 // free the array elements 11 psFree (options->psfs); 9 12 psFree (options->sourceLists); 10 psFree (options->norm);11 13 psFree (options->kernels); 12 14 psFree (options->regions); 15 16 // free the vector elements 17 psFree (options->inputMask); 18 psFree (options->inputSeeing); 19 psFree (options->norm); 13 20 psFree (options->matchChi2); 14 21 psFree (options->weightings); -
branches/eam_branches/psphot.20100506/src/psphotStackPSF.c
r27883 r27888 4 4 { 5 5 bool mdok = false; 6 pmPSF *psf = NULL; 6 7 7 #ifndef TESTING8 8 // Get the recipe values 9 psMetadata * recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSTACK"); // ppStackrecipe10 psAssert( recipe, "We've thrown an error on this before.");9 psMetadata *psphotRecipe = psMetadataLookupMetadata(NULL, config->recipes, "PSPHOT"); // psphot recipe 10 psAssert(psphotRecipe, "We've thrown an error on this before."); 11 11 12 int psfInstances = psMetadataLookupS32(NULL, recipe, "PSF.INSTANCES"); // Number of instances for PSF 13 float psfRadius = psMetadataLookupF32(NULL, recipe, "PSF.RADIUS"); // Radius for PSF 14 const char *psfModel = psMetadataLookupStr(NULL, recipe, "PSF.MODEL"); // Model for PSF 15 int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF 12 bool autoPSF = psMetadataLookupBool (&mdok, psphotRecipe, "PSPHOT.STACK.TARGET.PSF.AUTO"); 16 13 17 psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in 18 if (!mdok || !maskValStr) { 19 psError(PSPHOT_ERR_CONFIG, false, "Unable to find MASK.VAL in recipe"); 20 return false; 14 if (autoPSF) { 15 // Get the recipe values 16 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSTACK"); // ppStack recipe 17 psAssert(recipe, "We've thrown an error on this before."); 18 19 int psfInstances = psMetadataLookupS32(NULL, recipe, "PSF.INSTANCES"); // Number of instances for PSF 20 float psfRadius = psMetadataLookupF32(NULL, recipe, "PSF.RADIUS"); // Radius for PSF 21 const char *psfModel = psMetadataLookupStr(NULL, recipe, "PSF.MODEL"); // Model for PSF 22 int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF 23 24 psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in 25 if (!mdok || !maskValStr) { 26 psError(PSPHOT_ERR_CONFIG, false, "Unable to find MASK.VAL in recipe"); 27 return false; 28 } 29 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask 30 31 for (int i = 0; i < psfs->n; i++) { 32 if (inputMask->data.U8[i]) { 33 psFree(psfs->data[i]); 34 psfs->data[i] = NULL; 35 } 36 } 37 38 // Solve for the target PSF 39 psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel, psfOrder, psfOrder, maskVal); 40 if (!psf) { 41 psError(PSPHOT_ERR_PSF, false, "Unable to determine output PSF."); 42 return NULL; 43 } 44 45 } else { 46 47 // externally-defined PSF 48 // XXX need to test for compatibility of target with inputs 49 50 float targetFWHM = psMetadataLookupF32 (&mdok, psphotRecipe, "PSPHOT.STACK.TARGET.PSF.FWHM"); 51 psAssert (isfinite(targetFWHM), "missing psphot recipe value PSPHOT.STACK.TARGET.PSF.FWHM"); 52 53 float Sxx = sqrt(2.0)*targetFWHM / 2.35; 54 55 // XXX probably should make the model type (and par 7) optional from recipe 56 psf = pmPSFBuildSimple("PS_MODEL_PS1_V1", Sxx, Sxx, 0.0, 1.0); 57 if (!psf) { 58 psError(PSPHOT_ERR_PSF, false, "Unable to build dummy PSF."); 59 return NULL; 60 } 21 61 } 22 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask23 24 for (int i = 0; i < psfs->n; i++) {25 if (inputMask->data.U8[i]) {26 psFree(psfs->data[i]);27 psfs->data[i] = NULL;28 }29 }30 31 // Solve for the target PSF32 pmPSF *psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel, psfOrder, psfOrder, maskVal);33 if (!psf) {34 psError(PSPHOT_ERR_PSF, false, "Unable to determine output PSF.");35 return NULL;36 }37 #else38 // Dummy PSF39 pmPSF *psf = pmPSFBuildSimple("PS_MODEL_PS1_V1", 4.0, 4.0, 0.0, 1.0);40 if (!psf) {41 psError(PSPHOT_ERR_PSF, false, "Unable to build dummy PSF.");42 return NULL;43 }44 #endif45 62 46 63 return psf; -
branches/eam_branches/psphot.20100506/src/psphotStackParseCamera.c
r27884 r27888 125 125 } 126 126 outputMask->save = true; 127 outputMask->fileID = i; // this is used to generate output names 127 128 128 129 pmFPAfile *outputVariance = pmFPAfileDefineOutput(config, outputImage->fpa, "PSPHOT.STACK.OUTPUT.VARIANCE"); … … 136 137 } 137 138 outputVariance->save = true; 139 outputVariance->fileID = i; // this is used to generate output names 138 140 139 141 // the output sources are carried on the outputImage->fpa structures
Note:
See TracChangeset
for help on using the changeset viewer.
