Changeset 42012 for branches/eam_branches/ipp-20211108
- Timestamp:
- Feb 6, 2022, 10:39:31 AM (4 years ago)
- Location:
- branches/eam_branches/ipp-20211108/psModules/src/objects
- Files:
-
- 8 edited
-
models/pmModel_GAUSS.c (modified) (1 diff)
-
models/pmModel_HSC_V1.c (modified) (1 diff)
-
models/pmModel_PGAUSS.c (modified) (1 diff)
-
models/pmModel_PS1_V1.c (modified) (1 diff)
-
models/pmModel_QGAUSS.c (modified) (1 diff)
-
models/pmModel_RGAUSS.c (modified) (1 diff)
-
pmModelUtils.c (modified) (2 diffs)
-
pmModelUtils.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_GAUSS.c
r36857 r42012 203 203 204 204 // set the shape parameters 205 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 205 // the last parameter is the scaling factor for Moments to shape parameter radius guess 206 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 1.0)) { 206 207 return false; 207 208 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_HSC_V1.c
r40491 r42012 223 223 224 224 // set the shape parameters 225 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 225 // the last parameter is the scaling factor for Moments to shape parameter radius guess 226 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 1.0)) { 226 227 return false; 227 228 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_PGAUSS.c
r36857 r42012 204 204 205 205 // set the shape parameters 206 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 206 // the last parameter is the scaling factor for Moments to shape parameter radius guess 207 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 1.0)) { 207 208 return false; 208 209 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_PS1_V1.c
r38280 r42012 223 223 224 224 // set the shape parameters 225 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 225 // the last parameter is the scaling factor for Moments to shape parameter radius guess 226 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 1.0)) { 226 227 return false; 227 228 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_QGAUSS.c
r38280 r42012 224 224 225 225 // set the shape parameters 226 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 226 // the last parameter is the scaling factor for Moments to shape parameter radius guess 227 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 1.5)) { 227 228 return false; 228 229 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/models/pmModel_RGAUSS.c
r36857 r42012 213 213 214 214 // set the shape parameters 215 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false)) { 215 // the last parameter is the scaling factor for Moments to shape parameter radius guess 216 if (!pmModelSetShape(&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], source->moments, false, 2.0)) { 216 217 return false; 217 218 } -
branches/eam_branches/ipp-20211108/psModules/src/objects/pmModelUtils.c
r36859 r42012 179 179 // Reff says if this is a model which uses R_eff (like exp or dev) instead of Sigma 180 180 // set the parameter values SXX, SXY, SYY 181 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff) { 181 // Scale allows some models to increase the guess size relative to Mxx,Myy 182 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff, float Scale) { 182 183 183 184 psEllipseMoments emoments; … … 190 191 191 192 if (!isfinite(axes.major)) return false; 192 if (axes.major == 0) return false;193 193 if (!isfinite(axes.minor)) return false; 194 194 if (!isfinite(axes.theta)) return false; 195 if (axes.major == 0) return false; 196 195 196 // set a lower limit to avoid absurd solutions.. 197 // NOTE: I should set the lower limit based on the PSF size, if known 198 float Rmajor = PS_MAX(1.0, Scale * axes.major); 199 float Rminor = Rmajor * (axes.minor / axes.major); 200 axes.major = Rmajor; 201 axes.minor = Rminor; 202 203 // EAM 2022.02.05 : Mrf is often much too large, disable this for now 197 204 // Mxx, Mxy, Myy define the elliptical shape, but Mrf defines the width 198 float scale = (isfinite(moments->Mrf) && (moments->Mrf > 0.0)) ? moments->Mrf / axes.major : 1.0;199 axes.major *= scale;200 axes.minor *= scale;205 // float scale = (isfinite(moments->Mrf) && (moments->Mrf > 0.0)) ? moments->Mrf / axes.major : 1.0; 206 // axes.major *= scale; 207 // axes.minor *= scale; 201 208 202 209 pmModelAxesToParams (Sxx, Sxy, Syy, axes, useReff); -
branches/eam_branches/ipp-20211108/psModules/src/objects/pmModelUtils.h
r35768 r42012 44 44 bool pmModelSetPosition (float *Xo, float *Yo, pmSource *source); 45 45 bool pmModelSetNorm (float *Io, pmSource *source); 46 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff );46 bool pmModelSetShape (float *Sxx, float *Sxy, float *Syy, pmMoments *moments, bool useReff, float Scale); 47 47 48 48 bool pmModelUseReff (pmModelType type);
Note:
See TracChangeset
for help on using the changeset viewer.
