IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2014, 12:30:45 PM (12 years ago)
Author:
eugene
Message:

merge changes (from past YEAR) into trunk

Location:
branches/eam_branches/ipp-ops-20130712/psModules
Files:
3 edited

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  
        1212pmSourceIO_CMF_PS1_V1.v1.c
        1313pmSourceIO_CMF_PS1_V4.c
         14pmSourceIO_CMF_PS1_V5.c
        1415pmSourceIO_CMF_PS1_SV1.c
        1516pmSourceIO_CMF_PS1_SV2.c
         17pmSourceIO_CMF_PS1_SV3.c
        1618pmSourceIO_CMF_PS1_DV1.c
        1719pmSourceIO_CMF_PS1_DV2.c
        1820pmSourceIO_CMF_PS1_DV3.c
        19 
         21pmSourceIO_CMF_PS1_DV4.c
  • branches/eam_branches/ipp-ops-20130712/psModules/src/objects/pmModelUtils.c

    r36288 r37066  
    3232#include "pmMoments.h"
    3333#include "pmModelFuncs.h"
     34#include "pmModelClass.h"
    3435#include "pmModel.h"
    3536#include "pmModelUtils.h"
    36 #include "pmModelClass.h"
    3737#include "pmSourceMasks.h"
    3838#include "pmSourceExtendedPars.h"
    3939#include "pmSourceDiffStats.h"
    4040#include "pmSourceSatstar.h"
     41#include "pmSourceLensing.h"
    4142#include "pmSource.h"
    4243#include "pmSourceFitModel.h"
     
    4445
    4546#include "pmErrorCodes.h"
    46 
    47 // XX static bool useModelVar = false;
    48 // XX
    49 // XX void pmModelSetModelVarOption (bool option) {
    50 // XX   useModelVar = option;
    51 // XX }
    52 // XX bool pmModelGetModelVarOption (void) {
    53 // XX   return useModelVar;
    54 // XX }
    5547
    5648/*****************************************************************************
     
    6759
    6860    // 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)) {
    7062        psTrace ("psModules.objects", 3, "Failed to set model params from PSF");
    7163        psFree(modelPSF);
     
    8880
    8981    // 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)) {
    9183        psFree(modelPSF);
    9284        return NULL;
     
    108100
    109101    // determine the normalized flux
    110     float normFlux = model->modelFlux (model->params);
     102    float normFlux = model->class->modelFlux (model->params);
    111103    assert (isfinite(normFlux));
    112104    assert (normFlux > 0);
     
    119111
    120112bool 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;
    125117    return useReff;
    126118}
     
    128120// this function and the one below handle the two cases, where the model shape is uses R_eff or Sigma
    129121bool 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;
    130126
    131127    psEllipseShape shape = psEllipseAxesToShape (axes);
     
    137133    // set the shape parameters
    138134    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;
    141139        *Sxy  = shape.sxy * 2.0;
    142140    } 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;
    145145        *Sxy  = shape.sxy;
    146146    }
     
    193193    if (!isfinite(axes.minor)) return false;
    194194    if (!isfinite(axes.theta)) return false;
     195    if (axes.major == 0) return false;
    195196
    196197    // Mxx, Mxy, Myy define the elliptical shape, but Mrf defines the width
Note: See TracChangeset for help on using the changeset viewer.