Changeset 27819
- Timestamp:
- May 2, 2010, 11:32:52 AM (16 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 1 added
- 13 edited
-
Makefile.am (modified) (2 diffs)
-
psphot.h (modified) (2 diffs)
-
psphotEllipticalContour.c (modified) (2 diffs)
-
psphotEllipticalProfile.c (modified) (4 diffs)
-
psphotExtendedSourceAnalysis.c (modified) (6 diffs)
-
psphotPetrosian.c (modified) (2 diffs)
-
psphotPetrosianRadialBins.c (modified) (7 diffs)
-
psphotPetrosianStats.c (modified) (4 diffs)
-
psphotPetrosianVisual.c (modified) (6 diffs)
-
psphotRadialBins.c (added)
-
psphotRadialProfile.c (modified) (4 diffs)
-
psphotRadialProfileByAngles.c (modified) (2 diffs)
-
psphotRadiiFromProfiles.c (modified) (3 diffs)
-
psphotVisual.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/Makefile.am
r27660 r27819 185 185 psphotEllipticalContour.c \ 186 186 psphotEllipticalProfile.c \ 187 psphotRadialBins.c \ 187 188 psphotPetrosian.c \ 188 189 psphotPetrosianRadialBins.c \ 189 190 psphotPetrosianStats.c \ 191 psphotPetrosianVisual.c \ 190 192 psphotEfficiency.c 191 193 … … 197 199 # psphotAnnuli.c \ 198 200 # psphotKron.c \ 199 # psphotPetrosianVisual.c \200 201 # 201 202 -
trunk/psphot/src/psphot.h
r27673 r27819 245 245 float psphotRadiusFromProfile (pmSource *source, psVector *radius, psVector *flux, float fluxMin, float fluxMax); 246 246 bool psphotRadiiFromProfiles (pmSource *source, float fluxMin, float fluxMax); 247 bool psphotEllipticalProfile (pmSource *source );247 bool psphotEllipticalProfile (pmSource *source, bool RAW_RADIUS); 248 248 bool psphotEllipticalContour (pmSource *source); 249 249 … … 281 281 282 282 // XXX visualization functions related to radial profiles (disabled) 283 // bool psphotPetrosianVisualProfileByAngle (psVector *radius, psVector *flux); 284 // bool psphotPetrosianVisualProfileRadii (psVector *radius, psVector *flux, psVector *radiusBin, psVector *fluxBin, float peakFlux, float RadiusRef); 285 // bool psphotPetrosianVisualEllipticalContour (pmPetrosian *petrosian); 286 // bool psphotPetrosianVisualStats (psVector *radBin, psVector *fluxBin, 287 // psVector *refRadius, psVector *meanSB, 288 // psVector *petRatio, psVector *petRatioErr, psVector *fluxSum, 289 // float petRadius, float ratioForRadius, 290 // float petFlux, float radiusForFlux); 283 bool psphotPetrosianVisualProfileByAngle (psVector *radius, psVector *flux); 284 bool psphotPetrosianVisualProfileRadii (psVector *radius, psVector *flux, psVector *radiusBin, psVector *fluxBin, float peakFlux, float RadiusRef); 285 bool psphotPetrosianVisualEllipticalContour (pmSourceRadialFlux *radFlux, pmSourceExtendedPars *extpars); 286 bool psphotPetrosianVisualStats (psVector *radBin, psVector *fluxBin, 287 psVector *refRadius, psVector *meanSB, 288 psVector *petRatio, psVector *petRatioErr, psVector *fluxSum, 289 float petRadius, float ratioForRadius, 290 float petFlux, float radiusForFlux); 291 292 bool psphotRadialBins (psMetadata *recipe, pmSource *source, float radiusMax, float skynoise); 291 293 292 294 // structures & functions to support psf-convolved model fitting -
trunk/psphot/src/psphotEllipticalContour.c
r25755 r27819 7 7 bool psphotEllipticalContour (pmSource *source) { 8 8 9 pmSourceRadialProfile *profile = source->extpars->profile; 9 psAssert (source, "missing source"); 10 psAssert (source->extpars, "missing extpars"); 11 psAssert (source->extpars->radFlux, "missing radFlux"); 12 13 pmSourceRadialFlux *profile = source->extpars->radFlux; 14 pmSourceExtendedPars *extpars = source->extpars; 10 15 11 16 // use LMM to fit theta vs radius to an ellipse … … 85 90 /// XXX rationalize? if epsilon > 1, flip major and minor axes (rotate by 90 degrees) 86 91 if (params->data.F32[PAR_EPSILON] < 1.0) { 87 profile->axes.major = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON];88 profile->axes.minor = params->data.F32[PAR_RMIN];89 profile->axes.theta = params->data.F32[PAR_PHI];92 extpars->axes.major = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON]; 93 extpars->axes.minor = params->data.F32[PAR_RMIN]; 94 extpars->axes.theta = params->data.F32[PAR_PHI]; 90 95 } else { 91 profile->axes.major = params->data.F32[PAR_RMIN];92 profile->axes.minor = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON];93 profile->axes.theta = params->data.F32[PAR_PHI] + 0.5*M_PI;96 extpars->axes.major = params->data.F32[PAR_RMIN]; 97 extpars->axes.minor = params->data.F32[PAR_RMIN] / params->data.F32[PAR_EPSILON]; 98 extpars->axes.theta = params->data.F32[PAR_PHI] + 0.5*M_PI; 94 99 } 95 100 96 101 psTrace ("psphot", 4, "# fitted values:\n"); 97 psTrace ("psphot", 4, "Phi: %f\n", profile->axes.theta*PS_DEG_RAD);98 psTrace ("psphot", 4, "Rmaj: %f\n", profile->axes.major);99 psTrace ("psphot", 4, "Rmin: %f\n", profile->axes.minor);102 psTrace ("psphot", 4, "Phi: %f\n", extpars->axes.theta*PS_DEG_RAD); 103 psTrace ("psphot", 4, "Rmaj: %f\n", extpars->axes.major); 104 psTrace ("psphot", 4, "Rmin: %f\n", extpars->axes.minor); 100 105 101 106 // show the results 102 // psphotPetrosianVisualEllipticalContour (p etrosian);107 // psphotPetrosianVisualEllipticalContour (profile, extpars); 103 108 104 109 psFree (x); -
trunk/psphot/src/psphotEllipticalProfile.c
r25755 r27819 1 1 # include "psphotInternal.h" 2 2 3 bool psphotEllipticalProfile (pmSource *source ) {3 bool psphotEllipticalProfile (pmSource *source, bool RAW_RADIUS) { 4 4 5 pmSourceRadialProfile *profile = source->extpars->profile; 5 psAssert (source, "missing source"); 6 psAssert (source->extpars, "missing extpars"); 7 psAssert (source->pixels, "missing pixels"); 8 9 pmSourceExtendedPars *extpars = source->extpars; 10 11 if (!source->extpars->ellipticalFlux) { 12 source->extpars->ellipticalFlux = pmSourceEllipticalFluxAlloc(); 13 } 14 pmSourceEllipticalFlux *profile = source->extpars->ellipticalFlux; 6 15 7 16 profile->radiusElliptical = psVectorAllocEmpty(100, PS_TYPE_F32); … … 21 30 22 31 psEllipseAxes axes; 23 axes.major = M_SQRT1_2; 24 axes.minor = M_SQRT1_2 * (profile->axes.minor / profile->axes.major); 32 if (RAW_RADIUS) { 33 // force circular profile 34 axes.major = M_SQRT1_2; 35 axes.minor = M_SQRT1_2; 36 } else { 37 axes.major = M_SQRT1_2; 38 axes.minor = M_SQRT1_2 * (extpars->axes.minor / extpars->axes.major); 39 } 25 40 26 41 // axes.major = 1.0; 27 // axes.minor = profile->axes.minor / profile->axes.major;42 // axes.minor = extpars->axes.minor / extpars->axes.major; 28 43 29 axes.theta = profile->axes.theta;44 axes.theta = extpars->axes.theta; 30 45 psEllipseShape shape = psEllipseAxesToShape (axes); 31 46 … … 46 61 47 62 float r2 = 0.5*PS_SQR(x/Sxx) + 0.5*PS_SQR(y/Syy) + x*y*Sxy; 63 float Rraw = hypot(x, y); 48 64 49 65 psVectorAppend(radius, sqrt(r2)); 50 66 psVectorAppend(flux, source->pixels->data.F32[iy][ix]); 51 67 52 float Rraw = hypot(x, y);53 68 psVectorAppend(radiusRaw, Rraw); 54 69 psVectorAppend(fluxRaw, source->pixels->data.F32[iy][ix]); … … 67 82 // } 68 83 69 // psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, 0.0);84 psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->flux, 0.0); 70 85 // psphotPetrosianVisualProfileByAngle (radius, flux); 71 86 -
trunk/psphot/src/psphotExtendedSourceAnalysis.c
r26894 r27819 39 39 int Nkron = 0; 40 40 41 psTimerStart ("psphot.extended"); 42 41 43 // find the currently selected readout 42 44 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest … … 66 68 float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE"); 67 69 68 # if (0)69 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN70 // XXX use this to set skynoise71 pmReadout *backModel = psphotSelectBackground (config, view);72 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);73 # endif74 75 70 // S/N limit to perform full non-linear fits 76 71 float SN_LIM = psMetadataLookupF32 (&status, recipe, "EXTENDED_SOURCE_SN_LIM"); … … 81 76 bool doAnnuli = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_ANNULI"); 82 77 bool doKron = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_KRON"); 78 79 # if (0) 80 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN 81 // XXX use this to set skynoise 82 pmReadout *backModel = psphotSelectBackground (config, view); 83 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view); 84 # endif 83 85 84 86 // source analysis is done in S/N order (brightest first) … … 119 121 Next ++; 120 122 123 // force source image to be a bit larger... 124 float radius = source->peak->xf - source->pixels->col0; 125 radius = PS_MAX (radius, source->peak->yf - source->pixels->row0); 126 radius = PS_MAX (radius, source->pixels->numRows - source->peak->yf + source->pixels->row0); 127 radius = PS_MAX (radius, source->pixels->numCols - source->peak->xf + source->pixels->col0); 128 pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, 1.5*radius); 129 121 130 // if we request any of these measurements, we require the radial profile 122 131 if (doPetrosian || doIsophotal || doAnnuli || doKron) { … … 134 143 if (doPetrosian) { 135 144 if (!psphotPetrosian (source, recipe, skynoise, maskVal)) { 136 psTrace ("psphot", 5, " measuredpetrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My);145 psTrace ("psphot", 5, "FAILED petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); 137 146 } else { 138 147 psTrace ("psphot", 5, "measured petrosian flux & radius for source at %7.1f, %7.1f", source->moments->Mx, source->moments->My); … … 169 178 170 179 if (source->extpars) { 171 pmSourceRadialProfileFreeVectors(source->extpars->profile); 180 psFree(source->extpars->radFlux); 181 psFree(source->extpars->ellipticalFlux); 172 182 } 173 183 } 174 184 175 psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot "), Next);185 psLogMsg ("psphot", PS_LOG_INFO, "extended source analysis: %f sec for %d objects\n", psTimerMark ("psphot.extended"), Next); 176 186 psLogMsg ("psphot", PS_LOG_INFO, " %d petrosian\n", Npetro); 177 187 psLogMsg ("psphot", PS_LOG_INFO, " %d isophotal\n", Nisophot); -
trunk/psphot/src/psphotPetrosian.c
r25755 r27819 7 7 8 8 psAssert (source->extpars, "need to run psphotRadialProfile first"); 9 psAssert (source->extpars-> profile, "need to run psphotRadialProfile first");9 psAssert (source->extpars->ellipticalFlux, "need to run psphotRadialProfile first"); 10 10 11 11 // integrate the radial profile for radial bins defined for the petrosian measurement: … … 24 24 psTrace ("psphot", 3, "source at %f,%f: petrosian radius: %f, flux: %f, axis ratio: %f, angle: %f", 25 25 source->peak->xf, source->peak->yf, 26 source->extpars->petrosian _80->radius,27 source->extpars->petrosian _80->flux,28 source->extpars-> profile->axes.minor/source->extpars->profile->axes.major,29 source->extpars-> profile->axes.theta*PS_DEG_RAD);26 source->extpars->petrosianRadius, 27 source->extpars->petrosianFlux, 28 source->extpars->axes.minor/source->extpars->axes.major, 29 source->extpars->axes.theta*PS_DEG_RAD); 30 30 31 31 return true; -
trunk/psphot/src/psphotPetrosianRadialBins.c
r25755 r27819 1 1 # include "psphotInternal.h" 2 float InterpolateValues (float X0, float Y0, float X1, float Y1, float X); 2 3 3 4 // convert the flux vs elliptical radius to annular bins … … 5 6 // we are guaranteed to be limited by either the seeing (1 - few pixels) or by the pixels 6 7 // themselves. this function does not attempt to measure the radial profiles accurately 7 // for radii that are smaller than a minimum (currently 1.0 pixels).8 // for radii that are smaller than ~2 pixels 8 9 9 10 // for small radii, we are measuring the mean surface brightness in non-overlapping radial … … 13 14 // track the non-overlapping radius values. 14 15 16 // Photo interpolates the image of interest to place the peak on the center of the central 17 // pixel, and then uses the exact fractions of the pixels in each of the first few annuli. 18 // Seems like a reasonable thing, but is there any significance to the difference? 19 15 20 // XXX move the resulting elements from profile to extpars->petrosian? 16 21 bool psphotPetrosianRadialBins (pmSource *source, float radiusMax, float skynoise) { 17 22 18 p mSourceRadialProfile *profile = source->extpars->profile;19 20 float skyModelErrorSQ = PS_SQR(skynoise);21 22 psVector *radius = profile->radiusElliptical;23 psVector *flux = profile->fluxElliptical;23 psAssert (source, "missing source"); 24 psAssert (source->extpars, "missing extpars"); 25 psAssert (source->extpars->ellipticalFlux, "missing ellipticalFlux"); 26 27 psVector *radius = source->extpars->ellipticalFlux->radiusElliptical; 28 psVector *flux = source->extpars->ellipticalFlux->fluxElliptical; 24 29 25 30 // sort incoming vectors by radius 26 31 pmSourceRadialProfileSortPair (radius, flux); 32 33 if (!source->extpars->petProfile) { 34 source->extpars->petProfile = pmSourceRadialProfileAlloc(); 35 } 36 pmSourceRadialProfile *profile = source->extpars->petProfile; 37 38 float skyModelErrorSQ = PS_SQR(skynoise); 27 39 28 40 int nMax = radiusMax; … … 107 119 psVector *values = psVectorAllocEmpty (flux->n, PS_TYPE_F32); 108 120 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 109 // psStats *stats = psStatsAlloc(PS_STAT_FITTED_MEAN_V4 | PS_STAT_FITTED_STDEV_V4);110 111 // integrate flux, radius for each of these bins. since flux is sorted by radius,112 // we can do this fairly quickly113 121 114 122 bool done = false; … … 133 141 dvalue = NAN; 134 142 } 135 // binSB->data.F32[nOut] = stats->sampleMedian; 143 136 144 binSB->data.F32[nOut] = value; 137 145 binSBstdev->data.F32[nOut] = sqrt(PS_SQR(dvalue) / values->n + skyModelErrorSQ); 138 // binSB->data.F32[nOut] = stats->fittedMean;139 // binSBstdev->data.F32[nOut] = sqrt(PS_SQR(stats->fittedStdev) / values->n + skyModelErrorSQ);140 146 141 147 // error in the SB is the stdev per bin / sqrt (number of pixels) … … 143 149 // residual flux, but the sky from the sky model) 144 150 145 psTrace ("psphot", 5, "%3d %5.1f %5.1f : %5.1f %5.2f\n", 146 nOut, radAlp->data.F32[nOut], radBet->data.F32[nOut], binSB->data.F32[nOut], binSBstdev->data.F32[nOut]); 151 psTrace ("psphot", 5, "%3d %5.1f %5.1f : %5.1f %5.2f\n", nOut, radAlp->data.F32[nOut], radBet->data.F32[nOut], binSB->data.F32[nOut], binSBstdev->data.F32[nOut]); 147 152 148 153 nOut ++; … … 163 168 // XXX I think this misses the last radial bin -- do we care? 164 169 170 // interpolate any bins that were empty (extrapolate to center if needed) 171 if (!isfinite(binSB->data.F32[0]) && !isfinite(binSB->data.F32[1])) { 172 psWarning ("center 2 bins of source at %f, %f are NAN, skipping this source", source->peak->xf, source->peak->yf); 173 // XXX raise a flag 174 psFree(binSB); 175 psFree(binSBstdev); 176 psFree(binRad); 177 psFree(binArea); 178 psFree(radMin); 179 psFree(radMax); 180 psFree(radAlp); 181 psFree(radBet); 182 psFree(values); 183 psFree(stats); 184 return false; 185 } 186 187 // if center bin is empty assume same SB as next radius (probably true due to PSF) 188 if (!isfinite(binSB->data.F32[0])) { 189 binSB->data.F32[0] = binSB->data.F32[1]; 190 binSBstdev->data.F32[0] = binSBstdev->data.F32[1]; 191 } 192 193 // interpolate any bins that were empty (if center if needed) 194 for (int i = 1; i < binSB->n - 1; i++) { 195 if (isfinite(binSB->data.F32[i])) continue; 196 binSB->data.F32[i] = InterpolateValues (binRad->data.F32[i-1], binSB->data.F32[i-1], binRad->data.F32[i+1], binSB->data.F32[i+1], binRad->data.F32[i]); 197 binSBstdev->data.F32[i] = InterpolateValues (binRad->data.F32[i-1], binSBstdev->data.F32[i-1], binRad->data.F32[i+1], binSBstdev->data.F32[i+1], binRad->data.F32[i]); 198 } 199 200 psFree(profile->binSB); 201 psFree(profile->binSBstdev); 202 psFree(profile->radialBins); 203 psFree(profile->area); 204 165 205 // save the vectors 166 206 profile->radialBins = binRad; -
trunk/psphot/src/psphotPetrosianStats.c
r25755 r27819 10 10 bool psphotPetrosianStats (pmSource *source) { 11 11 12 pmSourceRadialProfile *profile = source->extpars->profile; 13 14 float petRadius = NAN; 15 float petFlux = NAN; 12 psAssert (source, "missing source"); 13 psAssert (source->extpars, "missing extpars"); 14 psAssert (source->extpars->petProfile, "missing petProfile"); 15 16 pmSourceRadialProfile *profile = source->extpars->petProfile; 16 17 17 18 psVector *binSB = profile->binSB; … … 28 29 psVector *areaSum = psVectorAllocEmpty(binSB->n, PS_TYPE_F32); 29 30 31 float petRadius = NAN; 32 float petFlux = NAN; 33 30 34 bool anyPetro = false; 31 35 bool manyPetro = false; … … 38 42 int lowestSignificantRadius = 0; 39 43 float lowestSignificantRatio = 1.0; 44 45 // find the Petrosian Radius and Petrosian Flux 40 46 41 47 int nOut = 0; … … 142 148 } 143 149 144 if (!source->extpars->petrosian_80) { 145 source->extpars->petrosian_80 = pmSourceExtendedFluxAlloc (); 146 } 147 pmSourceExtendedFlux *petrosian = source->extpars->petrosian_80; 150 // now measure the radii R90 and R50 where flux = 0.9 (or 0.5) * petFlux; 151 float flux90 = 0.9 * petFlux; 152 float flux50 = 0.5 * petFlux; 153 float R50 = NAN; 154 float R90 = NAN; 155 bool found50 = false; 156 bool found90 = false; 157 // XXX use bisection to do this faster: 158 for (int i = 0; !(found50 && found90) && i < refRadius->n; i++) { 159 if (!found50 && (fluxSum->data.F32[i] > flux50)) { 160 if (i == 0) { 161 psWarning ("does this case make any sense? (fluxSum[0] > flux50)"); 162 continue; 163 } else { 164 R50 = InterpolateValues (fluxSum->data.F32[i-1], refRadius->data.F32[i-1], fluxSum->data.F32[i], refRadius->data.F32[i], flux50); 165 found50 = true; 166 } 167 } 168 if (!found90 && (fluxSum->data.F32[i] > flux90)) { 169 if (i == 0) { 170 psWarning ("does this case make any sense? (fluxSum[0] > flux90)"); 171 continue; 172 } else { 173 R90 = InterpolateValues (fluxSum->data.F32[i-1], refRadius->data.F32[i-1], fluxSum->data.F32[i], refRadius->data.F32[i], flux90); 174 found90 = true; 175 } 176 } 177 } 178 148 179 149 180 // XXX save flags (anyPetro, manyPetro) 150 petrosian->radius = petRadius; 151 petrosian->flux = petFlux; 152 153 // psphotPetrosianVisualStats (binRad, binSB, refRadius, meanSB, petRatio, petRatioErr, fluxSum, petRadius, PETROSIAN_RATIO, petFlux, apRadius); 181 source->extpars->petrosianRadius = petRadius; 182 source->extpars->petrosianFlux = petFlux; 183 source->extpars->petrosianR50 = R50; 184 source->extpars->petrosianR90 = R90; 185 186 // XXX add the errors 187 source->extpars->petrosianRadiusErr = NAN; 188 source->extpars->petrosianFluxErr = NAN; 189 source->extpars->petrosianR50Err = NAN; 190 source->extpars->petrosianR90Err = NAN; 191 192 fprintf (stderr, "source @ %f,%f\n", source->peak->xf, source->peak->yf); 193 psphotPetrosianVisualStats (binRad, binSB, refRadius, meanSB, petRatio, petRatioErr, fluxSum, petRadius, PETROSIAN_RATIO, petFlux, apRadius); 154 194 155 195 psFree(fluxSum); -
trunk/psphot/src/psphotPetrosianVisual.c
r25755 r27819 1 1 # include "psphotInternal.h" 2 # define FORCE_VISUAL 0 2 3 3 4 // this function displays representative images as the psphot analysis progresses: … … 54 55 55 56 // return true; 56 if (! pmVisualIsVisual()) return true;57 if (!FORCE_VISUAL && !pmVisualIsVisual()) return true; 57 58 58 59 if (kapa2 == -1) { … … 101 102 102 103 // return true; 103 if (! pmVisualIsVisual()) return true;104 if (!FORCE_VISUAL && !pmVisualIsVisual()) return true; 104 105 105 106 if (kapa == -1) { … … 172 173 KapaSection section; 173 174 174 if (!pmVisualIsVisual()) return true; 175 if (!FORCE_VISUAL && !pmVisualIsVisual()) return true; 176 177 if (kapa2 == -1) { 178 kapa2 = KapaOpenNamedSocket ("kapa", "psphot:stats"); 179 if (kapa2 == -1) { 180 fprintf (stderr, "failure to open kapa; visual mode disabled\n"); 181 pmVisualSetVisual(false); 182 return false; 183 } 184 } 185 186 KapaClearPlots (kapa2); 187 KapaInitGraph (&graphdata); 188 KapaSetFont (kapa2, "courier", 14); 189 190 // radius vs flux 191 // radius vs mean SB 192 // radius vs petRatio 193 194 // *** section 1: radius vs mean SB 195 section.dx = 1.00; 196 section.dy = 0.33; 197 section.x = 0.00; 198 section.y = 0.00; 199 section.name = psStringCopy ("meanSB"); 200 KapaSetSection (kapa2, §ion); 201 psFree (section.name); 202 203 graphdata.color = KapaColorByName ("black"); 204 pmVisualLimitsFromVectors (&graphdata, radBin, fluxBin); 205 KapaSetLimits (kapa2, &graphdata); 206 207 KapaBox (kapa2, &graphdata); 208 KapaSendLabel (kapa2, "radius", KAPA_LABEL_XM); 209 KapaSendLabel (kapa2, "mean SB", KAPA_LABEL_YM); 210 211 graphdata.color = KapaColorByName ("black"); 212 graphdata.style = 2; 213 graphdata.ptype = 0; 214 graphdata.size = 1.0; 215 KapaPrepPlot (kapa2, radBin->n, &graphdata); 216 KapaPlotVector (kapa2, radBin->n, radBin->data.F32, "x"); 217 KapaPlotVector (kapa2, radBin->n, fluxBin->data.F32, "y"); 218 219 graphdata.color = KapaColorByName ("red"); 220 graphdata.style = 2; 221 graphdata.ptype = 1; 222 graphdata.size = 2.0; 223 KapaPrepPlot (kapa2, refRadius->n, &graphdata); 224 KapaPlotVector (kapa2, refRadius->n, refRadius->data.F32, "x"); 225 KapaPlotVector (kapa2, refRadius->n, meanSB->data.F32, "y"); 226 227 // *** section 2: radius vs petrosian ratio 228 section.dx = 1.00; 229 section.dy = 0.33; 230 section.x = 0.00; 231 section.y = 0.33; 232 section.name = psStringCopy ("ratio"); 233 KapaSetSection (kapa2, §ion); 234 psFree (section.name); 235 236 graphdata.color = KapaColorByName ("black"); 237 graphdata.ymax = +1.05; 238 graphdata.ymin = -0.05; 239 pmVisualLimitsFromVectors (&graphdata, radBin, NULL); 240 KapaSetLimits (kapa2, &graphdata); 241 242 KapaBox (kapa2, &graphdata); 243 KapaSendLabel (kapa2, "radius", KAPA_LABEL_XM); 244 KapaSendLabel (kapa2, "ratio", KAPA_LABEL_YM); 245 246 graphdata.color = KapaColorByName ("black"); 247 graphdata.style = 2; 248 graphdata.ptype = 0; 249 graphdata.size = 1.0; 250 graphdata.etype = 0x01; 251 KapaPrepPlot (kapa2, refRadius->n, &graphdata); 252 KapaPlotVector (kapa2, refRadius->n, refRadius->data.F32, "x"); 253 KapaPlotVector (kapa2, refRadius->n, petRatio->data.F32, "y"); 254 KapaPlotVector (kapa2, refRadius->n, petRatioErr->data.F32, "dym"); 255 KapaPlotVector (kapa2, refRadius->n, petRatioErr->data.F32, "dyp"); 256 graphdata.etype = 0; 257 258 graphdata.color = KapaColorByName ("red"); 259 graphdata.style = 2; 260 graphdata.ptype = 2; 261 graphdata.size = 2.0; 262 KapaPrepPlot (kapa2, 1, &graphdata); 263 KapaPlotVector (kapa2, 1, &petRadius, "x"); 264 KapaPlotVector (kapa2, 1, &ratioForRadius, "y"); 265 266 // *** section 3: radius vs integrated flux 267 section.dx = 1.00; 268 section.dy = 0.33; 269 section.x = 0.00; 270 section.y = 0.66; 271 section.name = psStringCopy ("flux"); 272 KapaSetSection (kapa2, §ion); 273 psFree (section.name); 274 275 graphdata.color = KapaColorByName ("black"); 276 pmVisualLimitsFromVectors (&graphdata, radBin, fluxSum); 277 KapaSetLimits (kapa2, &graphdata); 278 279 KapaBox (kapa2, &graphdata); 280 KapaSendLabel (kapa2, "radius", KAPA_LABEL_XM); 281 KapaSendLabel (kapa2, "integrated flux", KAPA_LABEL_YM); 282 283 graphdata.color = KapaColorByName ("black"); 284 graphdata.style = 2; 285 graphdata.ptype = 0; 286 graphdata.size = 1.0; 287 KapaPrepPlot (kapa2, refRadius->n, &graphdata); 288 KapaPlotVector (kapa2, refRadius->n, refRadius->data.F32, "x"); 289 KapaPlotVector (kapa2, refRadius->n, fluxSum->data.F32, "y"); 290 291 graphdata.color = KapaColorByName ("red"); 292 graphdata.ptype = 2; 293 graphdata.style = 2; 294 graphdata.size = 2.0; 295 KapaPrepPlot (kapa2, 1, &graphdata); 296 KapaPlotVector (kapa2, 1, &radiusForFlux, "x"); 297 KapaPlotVector (kapa2, 1, &petFlux, "y"); 298 299 // pause and wait for user input: 300 // continue, save (provide name), ?? 301 char key[10]; 302 fprintf (stdout, "[c]ontinue? "); 303 if (!fgets(key, 8, stdin)) { 304 psWarning("Unable to read option"); 305 } 306 return true; 307 } 308 309 bool psphotPetrosianVisualEllipticalContour (pmSourceRadialFlux *radFlux, pmSourceExtendedPars *extpars) { 310 311 Graphdata graphdata; 312 313 if (!FORCE_VISUAL && !pmVisualIsVisual()) return true; 175 314 176 315 if (kapa == -1) { … … 187 326 KapaSetFont (kapa, "courier", 14); 188 327 189 // radius vs flux 190 // radius vs mean SB 191 // radius vs petRatio 192 193 // *** section 1: radius vs mean SB 194 section.dx = 1.00; 195 section.dy = 0.33; 196 section.x = 0.00; 197 section.y = 0.00; 198 section.name = psStringCopy ("meanSB"); 199 KapaSetSection (kapa, §ion); 200 psFree (section.name); 201 202 graphdata.color = KapaColorByName ("black"); 203 pmVisualLimitsFromVectors (&graphdata, radBin, fluxBin); 328 psVector *theta = radFlux->theta; 329 psVector *radius = radFlux->isophotalRadii; 330 331 // find Rmin and Rmax for the initial guess 332 float Rmin = radius->data.F32[0]; 333 float Rmax = radius->data.F32[0]; 334 335 psVector *Rx = psVectorAlloc(radius->n, PS_TYPE_F32); 336 psVector *Ry = psVectorAlloc(radius->n, PS_TYPE_F32); 337 338 for (int i = 0; i < theta->n; i++) { 339 Rx->data.F32[i] = radius->data.F32[i]*cos(theta->data.F32[i]); 340 Ry->data.F32[i] = radius->data.F32[i]*sin(theta->data.F32[i]); 341 342 // check the radius range 343 Rmin = MIN (Rmin, radius->data.F32[i]); 344 Rmax = MAX (Rmax, radius->data.F32[i]); 345 } 346 347 psVector *rx = psVectorAlloc(361, PS_TYPE_F32); 348 psVector *ry = psVectorAlloc(361, PS_TYPE_F32); 349 350 float epsilon = extpars->axes.minor / extpars->axes.major; 351 352 for (int i = 0; i < 361; i++) { 353 354 float alpha = PS_RAD_DEG * i; 355 356 float cs_alpha = cos(alpha); 357 float sn_alpha = sin(alpha); 358 359 float cs_phi = cos(alpha - extpars->axes.theta); 360 float sn_phi = sin(alpha - extpars->axes.theta); 361 362 float r = 1.0 / sqrt(SQ(sn_phi) + SQ(epsilon*cs_phi)); 363 364 // generate the model fit here 365 rx->data.F32[i] = extpars->axes.minor * cs_alpha * r; 366 ry->data.F32[i] = extpars->axes.minor * sn_alpha * r; 367 } 368 369 graphdata.color = KapaColorByName ("black"); 370 graphdata.xmin = -1.1*Rmax; 371 graphdata.ymin = -1.1*Rmax; 372 graphdata.xmax = +1.1*Rmax; 373 graphdata.ymax = +1.1*Rmax; 204 374 KapaSetLimits (kapa, &graphdata); 205 375 206 376 KapaBox (kapa, &graphdata); 207 KapaSendLabel (kapa, "radius", KAPA_LABEL_XM); 208 KapaSendLabel (kapa, "mean SB", KAPA_LABEL_YM); 209 210 graphdata.color = KapaColorByName ("black"); 211 graphdata.style = 2; 212 graphdata.ptype = 0; 213 graphdata.size = 1.0; 214 KapaPrepPlot (kapa, radBin->n, &graphdata); 215 KapaPlotVector (kapa, radBin->n, radBin->data.F32, "x"); 216 KapaPlotVector (kapa, radBin->n, fluxBin->data.F32, "y"); 377 KapaSendLabel (kapa, "R_x", KAPA_LABEL_XM); 378 KapaSendLabel (kapa, "R_y", KAPA_LABEL_YM); 217 379 218 380 graphdata.color = KapaColorByName ("red"); 219 381 graphdata.style = 2; 220 graphdata.ptype = 1;221 graphdata.size = 2.0;222 KapaPrepPlot (kapa, refRadius->n, &graphdata);223 KapaPlotVector (kapa, refRadius->n, refRadius->data.F32, "x");224 KapaPlotVector (kapa, refRadius->n, meanSB->data.F32, "y");225 226 // *** section 2: radius vs petrosian ratio227 section.dx = 1.00;228 section.dy = 0.33;229 section.x = 0.00;230 section.y = 0.33;231 section.name = psStringCopy ("ratio");232 KapaSetSection (kapa, §ion);233 psFree (section.name);234 235 graphdata.color = KapaColorByName ("black");236 graphdata.ymax = +1.05;237 graphdata.ymin = -0.05;238 pmVisualLimitsFromVectors (&graphdata, radBin, NULL);239 KapaSetLimits (kapa, &graphdata);240 241 KapaBox (kapa, &graphdata);242 KapaSendLabel (kapa, "radius", KAPA_LABEL_XM);243 KapaSendLabel (kapa, "ratio", KAPA_LABEL_YM);244 245 graphdata.color = KapaColorByName ("black");246 graphdata.style = 2;247 graphdata.ptype = 0;248 graphdata.size = 1.0;249 graphdata.etype = 0x01;250 KapaPrepPlot (kapa, refRadius->n, &graphdata);251 KapaPlotVector (kapa, refRadius->n, refRadius->data.F32, "x");252 KapaPlotVector (kapa, refRadius->n, petRatio->data.F32, "y");253 KapaPlotVector (kapa, refRadius->n, petRatioErr->data.F32, "dym");254 KapaPlotVector (kapa, refRadius->n, petRatioErr->data.F32, "dyp");255 graphdata.etype = 0;256 257 graphdata.color = KapaColorByName ("red");258 graphdata.style = 2;259 382 graphdata.ptype = 2; 260 graphdata.size = 2.0; 261 KapaPrepPlot (kapa, 1, &graphdata); 262 KapaPlotVector (kapa, 1, &petRadius, "x"); 263 KapaPlotVector (kapa, 1, &ratioForRadius, "y"); 264 265 // *** section 3: radius vs integrated flux 266 section.dx = 1.00; 267 section.dy = 0.33; 268 section.x = 0.00; 269 section.y = 0.66; 270 section.name = psStringCopy ("flux"); 271 KapaSetSection (kapa, §ion); 272 psFree (section.name); 273 274 graphdata.color = KapaColorByName ("black"); 275 pmVisualLimitsFromVectors (&graphdata, radBin, fluxSum); 276 KapaSetLimits (kapa, &graphdata); 277 278 KapaBox (kapa, &graphdata); 279 KapaSendLabel (kapa, "radius", KAPA_LABEL_XM); 280 KapaSendLabel (kapa, "integrated flux", KAPA_LABEL_YM); 281 282 graphdata.color = KapaColorByName ("black"); 283 graphdata.style = 2; 284 graphdata.ptype = 0; 285 graphdata.size = 1.0; 286 KapaPrepPlot (kapa, refRadius->n, &graphdata); 287 KapaPlotVector (kapa, refRadius->n, refRadius->data.F32, "x"); 288 KapaPlotVector (kapa, refRadius->n, fluxSum->data.F32, "y"); 289 290 graphdata.color = KapaColorByName ("red"); 291 graphdata.ptype = 2; 292 graphdata.style = 2; 293 graphdata.size = 2.0; 294 KapaPrepPlot (kapa, 1, &graphdata); 295 KapaPlotVector (kapa, 1, &radiusForFlux, "x"); 296 KapaPlotVector (kapa, 1, &petFlux, "y"); 383 graphdata.size = 1.0; 384 KapaPrepPlot (kapa, Rx->n, &graphdata); 385 KapaPlotVector (kapa, Rx->n, Rx->data.F32, "x"); 386 KapaPlotVector (kapa, Rx->n, Ry->data.F32, "y"); 387 388 graphdata.color = KapaColorByName ("black"); 389 graphdata.style = 0; 390 graphdata.ptype = 0; 391 graphdata.size = 1.0; 392 KapaPrepPlot (kapa, rx->n, &graphdata); 393 KapaPlotVector (kapa, rx->n, rx->data.F32, "x"); 394 KapaPlotVector (kapa, rx->n, ry->data.F32, "y"); 297 395 298 396 // pause and wait for user input: … … 306 404 } 307 405 308 bool psphotPetrosianVisualEllipticalContour (pmPetrosian *petrosian) {309 310 Graphdata graphdata;311 312 if (!pmVisualIsVisual()) return true;313 314 if (kapa == -1) {315 kapa = KapaOpenNamedSocket ("kapa", "psphot:plots");316 if (kapa == -1) {317 fprintf (stderr, "failure to open kapa; visual mode disabled\n");318 pmVisualSetVisual(false);319 return false;320 }321 }322 323 KapaClearPlots (kapa);324 KapaInitGraph (&graphdata);325 KapaSetFont (kapa, "courier", 14);326 327 psVector *theta = petrosian->theta;328 psVector *radius = petrosian->isophotalRadii;329 330 // find Rmin and Rmax for the initial guess331 float Rmin = radius->data.F32[0];332 float Rmax = radius->data.F32[0];333 334 psVector *Rx = psVectorAlloc(radius->n, PS_TYPE_F32);335 psVector *Ry = psVectorAlloc(radius->n, PS_TYPE_F32);336 337 for (int i = 0; i < theta->n; i++) {338 Rx->data.F32[i] = radius->data.F32[i]*cos(theta->data.F32[i]);339 Ry->data.F32[i] = radius->data.F32[i]*sin(theta->data.F32[i]);340 341 // check the radius range342 Rmin = MIN (Rmin, radius->data.F32[i]);343 Rmax = MAX (Rmax, radius->data.F32[i]);344 }345 346 psVector *rx = psVectorAlloc(361, PS_TYPE_F32);347 psVector *ry = psVectorAlloc(361, PS_TYPE_F32);348 349 float epsilon = petrosian->axes.minor / petrosian->axes.major;350 351 for (int i = 0; i < 361; i++) {352 353 float alpha = PS_RAD_DEG * i;354 355 float cs_alpha = cos(alpha);356 float sn_alpha = sin(alpha);357 358 float cs_phi = cos(alpha - petrosian->axes.theta);359 float sn_phi = sin(alpha - petrosian->axes.theta);360 361 float r = 1.0 / sqrt(SQ(sn_phi) + SQ(epsilon*cs_phi));362 363 // generate the model fit here364 rx->data.F32[i] = petrosian->axes.minor * cs_alpha * r;365 ry->data.F32[i] = petrosian->axes.minor * sn_alpha * r;366 }367 368 graphdata.color = KapaColorByName ("black");369 graphdata.xmin = -1.1*Rmax;370 graphdata.ymin = -1.1*Rmax;371 graphdata.xmax = +1.1*Rmax;372 graphdata.ymax = +1.1*Rmax;373 KapaSetLimits (kapa, &graphdata);374 375 KapaBox (kapa, &graphdata);376 KapaSendLabel (kapa, "R_x", KAPA_LABEL_XM);377 KapaSendLabel (kapa, "R_y", KAPA_LABEL_YM);378 379 graphdata.color = KapaColorByName ("red");380 graphdata.style = 2;381 graphdata.ptype = 2;382 graphdata.size = 1.0;383 KapaPrepPlot (kapa, Rx->n, &graphdata);384 KapaPlotVector (kapa, Rx->n, Rx->data.F32, "x");385 KapaPlotVector (kapa, Rx->n, Ry->data.F32, "y");386 387 graphdata.color = KapaColorByName ("black");388 graphdata.style = 0;389 graphdata.ptype = 0;390 graphdata.size = 1.0;391 KapaPrepPlot (kapa, rx->n, &graphdata);392 KapaPlotVector (kapa, rx->n, rx->data.F32, "x");393 KapaPlotVector (kapa, rx->n, ry->data.F32, "y");394 395 // pause and wait for user input:396 // continue, save (provide name), ??397 char key[10];398 fprintf (stdout, "[c]ontinue? ");399 if (!fgets(key, 8, stdin)) {400 psWarning("Unable to read option");401 }402 return true;403 }404 405 406 # endif -
trunk/psphot/src/psphotRadialProfile.c
r25755 r27819 3 3 bool psphotRadialProfile (pmSource *source, psMetadata *recipe, float skynoise, psImageMaskType maskVal) { 4 4 5 bool status; 6 5 7 // allocate pmSourceExtendedParameters, if not already defined 6 8 if (!source->extpars) { 7 9 source->extpars = pmSourceExtendedParsAlloc (); 8 }9 10 if (!source->extpars->profile) {11 source->extpars->profile = pmSourceRadialProfileAlloc ();12 10 } 13 11 … … 17 15 float fluxMin = 0.0; 18 16 float fluxMax = source->peak->flux; 17 18 bool RAW_RADIUS = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_RAW_RADIUS"); 19 19 20 20 // generate a series of radial profiles at Nsec evenly spaced angles. the profile flux … … 28 28 // use the radial profiles to determine the radius of a given isophote. this isophote 29 29 // is used to determine the elliptical shape of the object, so it has a relatively high 30 // value (nominally 50% of the peak)30 // value (nominally 25% of the peak) 31 31 if (!psphotRadiiFromProfiles (source, fluxMin, fluxMax)) { 32 32 psError (PS_ERR_UNKNOWN, false, "failed to measure isophotal radii from profiles"); … … 42 42 // generate a single, normalized radial profile following the elliptical contours. 43 43 // the radius is normalized by the axis ratio so that on the major axis, 1 pixel = 1 pixel 44 if (!psphotEllipticalProfile (source )) {44 if (!psphotEllipticalProfile (source, RAW_RADIUS)) { 45 45 psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile"); 46 return false; 47 } 48 49 // generated profile in averaged bins 50 if (!psphotRadialBins (recipe, source, Rmax, skynoise)) { 51 psError (PS_ERR_UNKNOWN, false, "failed to generate radial bins"); 46 52 return false; 47 53 } -
trunk/psphot/src/psphotRadialProfileByAngles.c
r25755 r27819 12 12 bool psphotRadialProfilesByAngles (pmSource *source, int Nsec, float Rmax) { 13 13 14 psAssert (source->extpars, "define extpars"); 15 14 16 // we want to have an even number of sectors so we can do 180 deg symmetrizing 15 17 Nsec = (Nsec % 2) ? Nsec + 1 : Nsec; 16 18 float dtheta = 2.0*M_PI / Nsec; 17 19 18 pmSourceRadialProfile *profile = source->extpars->profile; 20 if (!source->extpars->radFlux) { 21 source->extpars->radFlux = pmSourceRadialFluxAlloc(); 22 } 23 pmSourceRadialFlux *profile = source->extpars->radFlux; 19 24 psFree(profile->radii); 20 25 psFree(profile->fluxes); … … 24 29 profile->fluxes = psArrayAllocEmpty(Nsec); 25 30 profile->theta = psVectorAllocEmpty(Nsec, PS_TYPE_F32); 26 27 31 28 32 for (int i = 0; i < Nsec; i++) { -
trunk/psphot/src/psphotRadiiFromProfiles.c
r25755 r27819 5 5 bool psphotRadiiFromProfiles (pmSource *source, float fluxMin, float fluxMax) { 6 6 7 pmSourceRadialProfile *profile = source->extpars->profile; 7 psAssert (source, "missing source"); 8 psAssert (source->extpars, "missing extpars"); 9 psAssert (source->extpars->radFlux, "missing radFlux"); 10 11 pmSourceRadialFlux *profile = source->extpars->radFlux; 8 12 9 13 psFree(profile->isophotalRadii); … … 146 150 147 151 // show the results 148 // psphotPetrosianVisualProfileRadii (radius, flux, radiusBinned, fluxBinned, Ro);152 // psphotPetrosianVisualProfileRadii (radius, flux, radiusBinned, fluxBinned, fluxMax, Ro); 149 153 150 154 psFree(fluxBinned); … … 152 156 return Ro; 153 157 } 158 159 160 -
trunk/psphot/src/psphotVisual.c
r27532 r27819 446 446 KapaSetFont (myKapa, "courier", 14); 447 447 448 section.bg = KapaColorByName ("none"); // XXX probably should be 'none' 449 448 450 float SN_LIM = psMetadataLookupF32(&status, recipe, "PSF_SN_LIM"); 449 451 … … 538 540 KapaSetLimits (myKapa, &graphdata); 539 541 542 graphdata.padXm = NAN; 543 graphdata.padYm = NAN; 544 graphdata.padXp = 0.5; 545 graphdata.padYp = 0.5; 540 546 KapaBox (myKapa, &graphdata); 547 541 548 KapaSendLabel (myKapa, "M_xx| (pixels)", KAPA_LABEL_XM); 542 549 KapaSendLabel (myKapa, "M_yy| (pixels)", KAPA_LABEL_YM); … … 547 554 graphdata.style = 2; 548 555 KapaPrepPlot (myKapa, nF, &graphdata); 556 549 557 KapaPlotVector (myKapa, nF, xFaint->data.F32, "x"); 550 558 KapaPlotVector (myKapa, nF, yFaint->data.F32, "y"); … … 562 570 section.dy = 0.25; 563 571 section.x = 0.00; 564 section.y = 0. 80;572 section.y = 0.75; 565 573 section.name = psStringCopy ("MagMyy"); 566 574 KapaSetSection (myKapa, §ion); … … 574 582 KapaSetLimits (myKapa, &graphdata); 575 583 584 graphdata.padXm = 0.5; 585 graphdata.padYm = NAN; 586 graphdata.padXp = NAN; 587 graphdata.padYp = 0.5; 576 588 strcpy (graphdata.labels, "0210"); 577 589 KapaBox (myKapa, &graphdata); … … 598 610 section.dx = 0.25; 599 611 section.dy = 0.75; 600 section.x = 0. 80;612 section.x = 0.75; 601 613 section.y = 0.00; 602 614 section.name = psStringCopy ("MagMxx"); … … 611 623 KapaSetLimits (myKapa, &graphdata); 612 624 625 graphdata.padXm = NAN; 626 graphdata.padYm = 0.5; 627 graphdata.padXp = 0.5; 628 graphdata.padYp = NAN; 613 629 strcpy (graphdata.labels, "2001"); 614 630 KapaBox (myKapa, &graphdata); … … 1350 1366 assert (maskVal); 1351 1367 1368 section.bg = KapaColorByName ("none"); // XXX probably should be 'none' 1369 1352 1370 KapaClearPlots (myKapa); 1353 1371 // first section : mag vs CR nSigma … … 1586 1604 KapaSetFont (myKapa, "courier", 14); 1587 1605 1606 section.bg = KapaColorByName ("none"); // XXX probably should be 'none' 1607 1588 1608 // select the max psfX,Y values for the plot limits 1589 1609 float Xmin = 1000.0, Xmax = 0.0; … … 1754 1774 KapaSetLimits (myKapa, &graphdata); 1755 1775 1776 graphdata.padXm = NAN; 1777 graphdata.padYm = NAN; 1778 graphdata.padXp = 0.5; 1779 graphdata.padYp = 0.5; 1756 1780 KapaBox (myKapa, &graphdata); 1757 1781 KapaSendLabel (myKapa, "M_xx| (pixels)", KAPA_LABEL_XM); … … 1822 1846 KapaSetLimits (myKapa, &graphdata); 1823 1847 1848 graphdata.padXm = 0.5; 1849 graphdata.padYm = NAN; 1850 graphdata.padXp = NAN; 1851 graphdata.padYp = 0.5; 1824 1852 strcpy (graphdata.labels, "0210"); 1825 1853 KapaBox (myKapa, &graphdata); … … 1870 1898 section.dx = 0.25; 1871 1899 section.dy = 0.60; 1872 section.x = 0. 80;1900 section.x = 0.75; 1873 1901 section.y = 0.00; 1874 1902 section.name = psStringCopy ("MagMxx"); … … 1883 1911 KapaSetLimits (myKapa, &graphdata); 1884 1912 1913 graphdata.padXm = NAN; 1914 graphdata.padYm = 0.5; 1915 graphdata.padXp = 0.5; 1916 graphdata.padYp = NAN; 1885 1917 strcpy (graphdata.labels, "2001"); 1886 1918 KapaBox (myKapa, &graphdata); … … 1930 1962 // fourth section: MagSigma 1931 1963 section.dx = 0.75; 1932 section.dy = 0. 15;1964 section.dy = 0.20; 1933 1965 section.x = 0.00; 1934 section.y = 0.6 5;1966 section.y = 0.60; 1935 1967 section.name = psStringCopy ("MagSigma"); 1936 1968 KapaSetSection (myKapa, §ion); … … 1944 1976 KapaSetLimits (myKapa, &graphdata); 1945 1977 1978 graphdata.padXm = 0.5; 1979 graphdata.padYm = NAN; 1980 graphdata.padXp = 0.5; 1981 graphdata.padYp = 0.5; 1946 1982 strcpy (graphdata.labels, "0100"); 1947 1983 KapaBox (myKapa, &graphdata); … … 2053 2089 psFree (mDEF); 2054 2090 psFree (sDEF); 2091 2092 psFree (xLOW); 2093 psFree (yLOW); 2094 psFree (mLOW); 2095 psFree (sLOW); 2055 2096 2056 2097 psFree (xCR); … … 2297 2338 if (!source) continue; 2298 2339 if (!source->extpars) continue; 2299 if (!source->extpars->profile) continue; 2300 if (!source->extpars->petrosian_80) continue; 2301 2302 pmSourceRadialProfile *profile = source->extpars->profile; 2303 pmSourceExtendedFlux *petrosian = source->extpars->petrosian_80; 2340 if (!source->extpars->petProfile) continue; 2341 2342 float petrosianRadius = source->extpars->petrosianRadius; 2343 psEllipseAxes *axes = &source->extpars->axes; 2304 2344 2305 2345 overlay[Noverlay].type = KII_OVERLAY_CIRCLE; 2306 2346 overlay[Noverlay].x = source->peak->xf; 2307 2347 overlay[Noverlay].y = source->peak->yf; 2308 overlay[Noverlay].dx = 2.0*petrosian->radius;2309 overlay[Noverlay].dy = 2.0*petrosian->radius*profile->axes.minor/profile->axes.major;2310 overlay[Noverlay].angle = profile->axes.theta * PS_DEG_RAD;2348 overlay[Noverlay].dx = 1.0*petrosianRadius; 2349 overlay[Noverlay].dy = 1.0*petrosianRadius*axes->minor/axes->major; 2350 overlay[Noverlay].angle = axes->theta * PS_DEG_RAD; 2311 2351 overlay[Noverlay].text = NULL; 2312 2352 Noverlay ++; 2313 2353 CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 100); 2314 2354 2315 overlay[Noverlay].type = KII_OVERLAY_CIRCLE;2316 overlay[Noverlay].x = source->peak->xf;2317 overlay[Noverlay].y = source->peak->yf;2318 overlay[Noverlay].dx = 4.0*petrosian->radius;2319 overlay[Noverlay].dy = 4.0*petrosian->radius*profile->axes.minor/profile->axes.major;2320 overlay[Noverlay].angle = profile->axes.theta * PS_DEG_RAD;2321 overlay[Noverlay].text = NULL;2322 Noverlay ++;2323 CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 100);2355 // overlay[Noverlay].type = KII_OVERLAY_CIRCLE; 2356 // overlay[Noverlay].x = source->peak->xf; 2357 // overlay[Noverlay].y = source->peak->yf; 2358 // overlay[Noverlay].dx = 2.0*petrosianRadius; 2359 // overlay[Noverlay].dy = 2.0*petrosianRadius*axes->minor/axes->major; 2360 // overlay[Noverlay].angle = axes->theta * PS_DEG_RAD; 2361 // overlay[Noverlay].text = NULL; 2362 // Noverlay ++; 2363 // CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 100); 2324 2364 } 2325 2365
Note:
See TracChangeset
for help on using the changeset viewer.
