Changeset 30171
- Timestamp:
- Dec 24, 2010, 3:25:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/psphot/src/psphotRadialAperturesByObject.c
r30140 r30171 120 120 121 121 // allocate pmSourceExtendedParameters, if not already defined 122 if (!source->radialAper) { 123 source->radialAper = psArrayAlloc(nPSFsizes); 122 if (source->parent) { 123 if (!source->parent->radialAper) { 124 source->parent->radialAper = psArrayAlloc(nPSFsizes); 125 } 126 } else { 127 if (!source->radialAper) { 128 source->radialAper = psArrayAlloc(nPSFsizes); 129 } 124 130 } 125 131 … … 128 134 pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal); 129 135 } 136 137 // we need to change the view for the radial aperture analysis, but we want to recover exactly 138 // the original view; the following elements get destroyed by pmSourceRedefinePixels so save them: 139 psImage *oldMaskObj = psMemIncrRefCounter(source->maskObj); 140 psImage *oldModelFlux = psMemIncrRefCounter(source->modelFlux); 141 psImage *oldPSFimage = psMemIncrRefCounter(source->psfImage); 142 psRegion oldRegion = source->region; 143 130 144 Nradial ++; 131 145 … … 138 152 // radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0); 139 153 // radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0); 140 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, outerRadius + 2 , false);154 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, outerRadius + 2); 141 155 142 156 if (!psphotRadialApertureSource (source, recipe, skynoise, maskVal, radMax, nMatchedPSF)) { … … 145 159 source->mode |= PM_SOURCE_MODE_RADIAL_FLUX; 146 160 } 161 162 pmSourceRedefinePixelsByRegion (source, readout, oldRegion); 163 psFree(source->maskObj); source->maskObj = oldMaskObj; 164 psFree(source->modelFlux); source->modelFlux = oldModelFlux; 165 psFree(source->psfImage); source->psfImage = oldPSFimage; 147 166 148 167 // re-subtract the object, leave local sky
Note:
See TracChangeset
for help on using the changeset viewer.
