IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 29, 2012, 5:09:48 PM (14 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/eam_branches/ipp-20120405/psModules
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/psModules

  • branches/eam_branches/ipp-20120405/psModules/src/camera/pmFPAfile.c

    r33690 r33951  
    382382        // Number of the file in list
    383383        psString num = NULL;            // Number to use
    384         psStringAppend(&num, "%03d", file->fileID);
     384        psStringAppend(&num, "%" PRId64, file->fileID);
    385385        psStringSubstitute(&newRule, num, "{FILE.ID}");
    386386        psFree(num);
  • branches/eam_branches/ipp-20120405/psModules/src/camera/pmFPAfile.h

    r33690 r33951  
    114114
    115115    int fileIndex;                      // Index of file
    116     int fileID;                         // internal sequence number
     116    psS64 fileID;                       // internal sequence number
    117117
    118118    psS64 imageId, sourceId;            // Image and source identifiers
  • branches/eam_branches/ipp-20120405/psModules/src/detrend/pmDetrendDB.c

    r31067 r33951  
    107107        DETREND_STRING_CASE(ASTROM);
    108108        DETREND_STRING_CASE(NOISEMAP);
     109        DETREND_STRING_CASE(VIDEOMASK);
     110        DETREND_STRING_CASE(VIDEODARK);
    109111        DETREND_STRING_CASE(LINEARITY);
    110112    default:
  • branches/eam_branches/ipp-20120405/psModules/src/detrend/pmDetrendDB.h

    r29833 r33951  
    3636    PM_DETREND_TYPE_ASTROM,
    3737    PM_DETREND_TYPE_NOISEMAP,
     38    PM_DETREND_TYPE_VIDEOMASK,
     39    PM_DETREND_TYPE_VIDEODARK,
    3840    PM_DETREND_TYPE_LINEARITY,
    3941} pmDetrendType;
  • branches/eam_branches/ipp-20120405/psModules/src/objects/pmSource.c

    r33947 r33951  
    3939#include "pmSourceExtendedPars.h"
    4040#include "pmSourceDiffStats.h"
     41#include "pmSourcePhotometry.h"
    4142#include "pmSource.h"
    4243
     
    163164    source->radialAper = NULL;
    164165    source->parent = NULL;
     166    source->tmpPtr = NULL;
    165167    source->imageID = -1;
    166168    source->nFrames = 0;
     
    11701172    PAR[PM_PAR_SYY] = oldshape.sy;
    11711173    PAR[PM_PAR_SXY] = oldshape.sxy;
     1174
     1175    return true;
     1176}
     1177
     1178bool pmSourceSmoothOp (pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy)
     1179{
     1180//    assert (mode & PM_MODEL_OP_NOISE);
     1181    PS_ASSERT_PTR_NON_NULL(source, false);
     1182    PS_ASSERT_PTR_NON_NULL(source->peak, false);
     1183    PS_ASSERT_PTR_NON_NULL(target, false);
     1184
     1185    if (add) {
     1186        psTrace ("psphot", 3, "adding smoothed object at %f,%f\n", source->peak->xf, source->peak->yf);
     1187    } else {
     1188        psTrace ("psphot", 3, "removing smooted object at %f,%f\n", source->peak->xf, source->peak->yf);
     1189    }
     1190
     1191    pmModel *model = pmSourceGetModel(NULL, source);
     1192    if (!model) {
     1193        return false;
     1194    }
     1195    pmSourceSmoothOpModel (model, source, mode, target, sigma, add, maskVal, dx, dy);
     1196
     1197    return true;
     1198}
     1199
     1200bool pmSourceSmoothOpModel (pmModel *model, pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy)
     1201{
     1202    bool status;
     1203    psEllipseShape oldshape;
     1204    psEllipseShape newshape;
     1205    psEllipseAxes axes;
     1206
     1207    if (add) {
     1208        psTrace ("psphot", 4, "adding smoothed object at %f,%f\n", model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS]);
     1209    } else {
     1210        psTrace ("psphot", 4, "removing smoothed object at %f,%f\n", model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS]);
     1211    }
     1212
     1213    psF32 *PAR = model->params->data.F32;
     1214
     1215    // Isn't this hanging around somewhere?
     1216    float oldFlux = NAN;
     1217    if (!pmSourcePhotometryModel (NULL, &oldFlux, model)) return false;
     1218
     1219    // save original values
     1220    float oldI0  = PAR[PM_PAR_I0];
     1221    float oldsxx = PAR[PM_PAR_SXX];
     1222    float oldsyy = PAR[PM_PAR_SYY];
     1223    float oldsxy = PAR[PM_PAR_SXY];
     1224
     1225    // Since we are going to scale the flux correctly we need to get our
     1226    // factors of sqrt(2) right
     1227    oldshape.sx  = oldsxx / M_SQRT2;
     1228    oldshape.sy  = oldsyy / M_SQRT2;
     1229    oldshape.sxy = oldsxy;
     1230
     1231    // XXX can this be done more intelligently?
     1232    if (oldI0 == 0.0) return false;
     1233    if (!isfinite(oldI0)) return false;
     1234
     1235    // increase size and height of source
     1236    axes = psEllipseShapeToAxes (oldshape, 20.0);
     1237    axes.major = sqrt(PS_SQR(axes.major) + PS_SQR(sigma));
     1238    axes.minor = sqrt(PS_SQR(axes.minor) + PS_SQR(sigma));
     1239    newshape = psEllipseAxesToShape (axes);
     1240    PAR[PM_PAR_SXX] = newshape.sx * M_SQRT2;
     1241    PAR[PM_PAR_SYY] = newshape.sy * M_SQRT2;
     1242    PAR[PM_PAR_SXY] = newshape.sxy;
     1243
     1244    PAR[PM_PAR_I0]  = 1.0;
     1245
     1246    float newFlux;
     1247    if (!pmSourcePhotometryModel (NULL, &newFlux, model)) return false;
     1248
     1249    PAR[PM_PAR_I0]  = oldFlux / newFlux;
     1250
     1251    if (add) {
     1252        status = pmModelAddWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy);
     1253    } else {
     1254        status = pmModelSubWithOffset (target, source->maskObj, model, mode, maskVal, dx, dy);
     1255    }
     1256
     1257    // restore original values
     1258    PAR[PM_PAR_I0]  = oldI0;
     1259    PAR[PM_PAR_SXX] = oldsxx;
     1260    PAR[PM_PAR_SYY] = oldsyy;
     1261    PAR[PM_PAR_SXY] = oldsxy;
    11721262
    11731263    return true;
  • branches/eam_branches/ipp-20120405/psModules/src/objects/pmSource.h

    r33947 r33951  
    118118    psArray *radialAper;                ///< radial flux in circular apertures
    119119    pmSource *parent;                   ///< reference to the master source from which this is derived
     120    psPtr *tmpPtr;                      ///< pointer that may be used to store data in a particular module. e.g. psphotKronIterate.
    120121    int imageID;
    121122    psU16 nFrames;
     
    303304bool pmSourceNoiseOp (pmSource *source, pmModelOpMode mode, float FACTOR, float SIZE, bool add, psImageMaskType maskVal, int dx, int dy);
    304305
     306bool pmSourceSmoothOp (pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy);
     307bool pmSourceSmoothOpModel (pmModel *model, pmSource *source, pmModelOpMode mode, psImage *target, float sigma, bool add, psImageMaskType maskVal, int dx, int dy);
     308
    305309bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psImageMaskType maskVal, int dx, int dy);
    306310bool pmSourceCacheModel (pmSource *source, psImageMaskType maskVal);
  • branches/eam_branches/ipp-20120405/psModules/src/objects/pmSourceMoments.c

    r32347 r33951  
    319319    }
    320320
    321     source->moments->Mrf = RF/RS;
    322321    source->moments->Mrh = RH/RS;
    323322
    324     // if Mrf (first radial moment) is very small, we are getting into low-significance
     323    // if Mrf = RF/RS (first radial moment) is very small, we are getting into low-significance
    325324    // territory.  saturate at minKronRadius.  conversely, if Mrf is >> radius for faint
    326325    // sources, we are clearly making an error.  saturate at radius.
    327     float kronRefRadius = MAX(minKronRadius, source->moments->Mrf);
     326    float kronRefRadius = MAX(minKronRadius, RF/RS);
    328327    if (source->moments->SN < 10) {
    329328        kronRefRadius = MIN(radius, kronRefRadius);
    330329    }
     330    source->moments->Mrf = kronRefRadius;
    331331
    332332    // *** now calculate the kron flux values using the 1st radial moment
Note: See TracChangeset for help on using the changeset viewer.