- Timestamp:
- Jul 17, 2014, 12:30:45 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-ops-20130712/psModules
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
src/objects (modified) (1 prop)
-
src/objects/pmModelUtils.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ops-20130712/psModules
- Property svn:mergeinfo deleted
-
branches/eam_branches/ipp-ops-20130712/psModules/src/objects
- Property svn:ignore
-
old new 12 12 pmSourceIO_CMF_PS1_V1.v1.c 13 13 pmSourceIO_CMF_PS1_V4.c 14 pmSourceIO_CMF_PS1_V5.c 14 15 pmSourceIO_CMF_PS1_SV1.c 15 16 pmSourceIO_CMF_PS1_SV2.c 17 pmSourceIO_CMF_PS1_SV3.c 16 18 pmSourceIO_CMF_PS1_DV1.c 17 19 pmSourceIO_CMF_PS1_DV2.c 18 20 pmSourceIO_CMF_PS1_DV3.c 19 21 pmSourceIO_CMF_PS1_DV4.c
-
- Property svn:ignore
-
branches/eam_branches/ipp-ops-20130712/psModules/src/objects/pmModelUtils.c
r36288 r37066 32 32 #include "pmMoments.h" 33 33 #include "pmModelFuncs.h" 34 #include "pmModelClass.h" 34 35 #include "pmModel.h" 35 36 #include "pmModelUtils.h" 36 #include "pmModelClass.h"37 37 #include "pmSourceMasks.h" 38 38 #include "pmSourceExtendedPars.h" 39 39 #include "pmSourceDiffStats.h" 40 40 #include "pmSourceSatstar.h" 41 #include "pmSourceLensing.h" 41 42 #include "pmSource.h" 42 43 #include "pmSourceFitModel.h" … … 44 45 45 46 #include "pmErrorCodes.h" 46 47 // XX static bool useModelVar = false;48 // XX49 // XX void pmModelSetModelVarOption (bool option) {50 // XX useModelVar = option;51 // XX }52 // XX bool pmModelGetModelVarOption (void) {53 // XX return useModelVar;54 // XX }55 47 56 48 /***************************************************************************** … … 67 59 68 60 // set model parameters for this source based on PSF information 69 if (!modelEXT-> modelFromPSF (modelPSF, modelEXT, psf)) {61 if (!modelEXT->class->modelFromPSF (modelPSF, modelEXT, psf)) { 70 62 psTrace ("psModules.objects", 3, "Failed to set model params from PSF"); 71 63 psFree(modelPSF); … … 88 80 89 81 // set model parameters for this source based on PSF information 90 if (!modelPSF-> modelParamsFromPSF (modelPSF, psf, Xo, Yo, Io)) {82 if (!modelPSF->class->modelParamsFromPSF (modelPSF, psf, Xo, Yo, Io)) { 91 83 psFree(modelPSF); 92 84 return NULL; … … 108 100 109 101 // determine the normalized flux 110 float normFlux = model-> modelFlux (model->params);102 float normFlux = model->class->modelFlux (model->params); 111 103 assert (isfinite(normFlux)); 112 104 assert (normFlux > 0); … … 119 111 120 112 bool pmModelUseReff (pmModelType type) { 121 bool useReff = false; 122 useReff |= (type == pmModelClassGetType ("PS_MODEL_SERSIC"));123 useReff |= (type == pmModelClassGetType ("PS_MODEL_DEV"));124 useReff |= (type == pmModelClassGetType ("PS_MODEL_EXP"));113 114 pmModelClass *class = pmModelClassSelect (type); 115 psAssert (class, "undefined model class?"); 116 bool useReff = class->useReff; 125 117 return useReff; 126 118 } … … 128 120 // this function and the one below handle the two cases, where the model shape is uses R_eff or Sigma 129 121 bool pmModelAxesToParams (float *Sxx, float *Sxy, float *Syy, psEllipseAxes axes, bool useReff) { 122 123 // restrict axex to 0.5 here not below 124 if (axes.minor < 0.2) axes.minor = 0.2; 125 if (axes.major < 0.2) axes.major = 0.2; 130 126 131 127 psEllipseShape shape = psEllipseAxesToShape (axes); … … 137 133 // set the shape parameters 138 134 if (useReff) { 139 *Sxx = PS_MAX(0.5, shape.sx); 140 *Syy = PS_MAX(0.5, shape.sy); 135 // *Sxx = PS_MAX(0.5, shape.sx); 136 // *Syy = PS_MAX(0.5, shape.sy); 137 *Sxx = shape.sx; 138 *Syy = shape.sy; 141 139 *Sxy = shape.sxy * 2.0; 142 140 } else { 143 *Sxx = PS_MAX(0.5, M_SQRT2*shape.sx); 144 *Syy = PS_MAX(0.5, M_SQRT2*shape.sy); 141 // *Sxx = PS_MAX(0.5, M_SQRT2*shape.sx); 142 // *Syy = PS_MAX(0.5, M_SQRT2*shape.sy); 143 *Sxx = M_SQRT2*shape.sx; 144 *Syy = M_SQRT2*shape.sy; 145 145 *Sxy = shape.sxy; 146 146 } … … 193 193 if (!isfinite(axes.minor)) return false; 194 194 if (!isfinite(axes.theta)) return false; 195 if (axes.major == 0) return false; 195 196 196 197 // Mxx, Mxy, Myy define the elliptical shape, but Mrf defines the width
Note:
See TracChangeset
for help on using the changeset viewer.
