Changeset 29453
- Timestamp:
- Oct 17, 2010, 9:18:24 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100823/ppStack/src
- Files:
-
- 3 edited
-
ppStack.c (modified) (1 diff)
-
ppStackMatch.c (modified) (1 diff)
-
ppStackPSF.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/ppStack/src/ppStack.c
r27319 r29453 124 124 psLibFinalize(); 125 125 pmVisualClose(); 126 pmVisualCleanup (); 126 127 127 128 exitValue = ppStackExitCode(exitValue); -
branches/eam_branches/ipp-20100823/ppStack/src/ppStackMatch.c
r29217 r29453 320 320 } 321 321 } else { 322 // we need to register the FWHM values for use downstream 323 pmSubtractionSetFWHMs(options->inputSeeing->data.F32[index], options->targetSeeing); 324 322 325 // Scale the input parameters 323 326 psVector *widthsCopy = psVectorCopy(NULL, widths, PS_TYPE_F32); // Copy of kernel widths 324 if (scale && !pmSubtractionParamsScale(&size, &footprint, widthsCopy, 325 options->inputSeeing->data.F32[index], 326 options->targetSeeing, scaleRef, scaleMin, scaleMax)) { 327 if (scale && !pmSubtractionParamsScale(&size, &footprint, widthsCopy, scaleRef, scaleMin, scaleMax)) { 327 328 psError(psErrorCodeLast(), false, "Unable to scale kernel parameters"); 328 329 psFree(fake); -
branches/eam_branches/ipp-20100823/ppStack/src/ppStackPSF.c
r27004 r29453 15 15 { 16 16 bool mdok = false; 17 pmPSF *psf = NULL; 17 18 18 #ifndef TESTING19 19 // Get the recipe values 20 20 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe 21 21 psAssert(recipe, "We've thrown an error on this before."); 22 22 23 int psfInstances = psMetadataLookupS32(NULL, recipe, "PSF.INSTANCES"); // Number of instances for PSF 24 float psfRadius = psMetadataLookupF32(NULL, recipe, "PSF.RADIUS"); // Radius for PSF 25 const char *psfModel = psMetadataLookupStr(NULL, recipe, "PSF.MODEL"); // Model for PSF 26 int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF 27 28 psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in 29 if (!mdok || !maskValStr) { 30 psError(PPSTACK_ERR_CONFIG, false, "Unable to find MASK.VAL in recipe"); 31 return false; 32 } 33 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask 34 35 for (int i = 0; i < psfs->n; i++) { 36 if (inputMask->data.U8[i]) { 37 psFree(psfs->data[i]); 38 psfs->data[i] = NULL; 39 } 23 bool autosize = psMetadataLookupBool(&mdok, recipe, "PSF.AUTOSIZE"); // Spatial order for PSF 24 if (!mdok) { 25 // older config files which lack PSF.AUTOSIZE used TRUE as the default 26 autosize = true; 40 27 } 41 28 42 // Solve for the target PSF 43 pmPSF *psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel, psfOrder, psfOrder, maskVal); 44 if (!psf) { 45 psError(PPSTACK_ERR_PSF, false, "Unable to determine output PSF."); 46 return NULL; 29 char *psfModel = psMetadataLookupStr(NULL, recipe, "PSF.MODEL"); // Model for PSF 30 31 if (autosize) { 32 33 int psfInstances = psMetadataLookupS32(NULL, recipe, "PSF.INSTANCES"); // Number of instances for PSF 34 float psfRadius = psMetadataLookupF32(NULL, recipe, "PSF.RADIUS"); // Radius for PSF 35 int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF 36 37 psString maskValStr = psMetadataLookupStr(&mdok, recipe, "MASK.VAL"); // Name of bits to mask going in 38 if (!mdok || !maskValStr) { 39 psError(PPSTACK_ERR_CONFIG, false, "Unable to find MASK.VAL in recipe"); 40 return NULL; 41 } 42 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask 43 44 for (int i = 0; i < psfs->n; i++) { 45 if (inputMask->data.U8[i]) { 46 psFree(psfs->data[i]); 47 psfs->data[i] = NULL; 48 } 49 } 50 51 // Solve for the target PSF 52 psf = pmPSFEnvelope(numCols, numRows, psfs, psfInstances, psfRadius, psfModel, psfOrder, psfOrder, maskVal); 53 if (!psf) { 54 psError(PPSTACK_ERR_PSF, false, "Unable to determine output PSF."); 55 return NULL; 56 } 57 } else { 58 59 // Manually defined target PSF 60 float psfFWHM = psMetadataLookupF32(&mdok, recipe, "PSF.OUTPUT.FWHM"); // Radius for PSF 61 if (!mdok) { 62 psfFWHM = 4.0; 63 } 64 65 float Mxx = M_SQRT2 * psfFWHM / 2.35; 66 67 psf = pmPSFBuildSimple(psfModel, Mxx, Mxx, 0.0, 0.0); 68 if (!psf) { 69 psError(PPSTACK_ERR_PSF, false, "Unable to build dummy PSF."); 70 return NULL; 71 } 47 72 } 48 #else49 // Dummy PSF50 pmPSF *psf = pmPSFBuildSimple("PS_MODEL_PS1_V1", 4.0, 4.0, 0.0, 1.0);51 if (!psf) {52 psError(PPSTACK_ERR_PSF, false, "Unable to build dummy PSF.");53 return NULL;54 }55 #endif56 73 57 74 return psf;
Note:
See TracChangeset
for help on using the changeset viewer.
