IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 5, 2011, 11:02:53 AM (15 years ago)
Author:
eugene
Message:

merge updates from eam branch 20110404

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r31153 r31451  
    116116    source->psfImage = NULL;
    117117    source->moments = NULL;
    118     source->blends = NULL;
    119118    source->modelPSF = NULL;
    120119    source->modelEXT = NULL;
     
    124123    source->mode2 = PM_SOURCE_MODE_DEFAULT;
    125124    source->tmpFlags = 0;
    126     source->extpars = NULL;
    127     source->diffStats = NULL;
    128     source->radialAper = NULL;
    129     source->parent = NULL;
    130 
    131     source->region = psRegionSet(NAN, NAN, NAN, NAN);
    132     psMemSetDeallocator(source, (psFreeFunc) sourceFree);
    133125
    134126    // default values are NAN
    135127    source->psfMag           = NAN;
     128    source->psfMagErr        = NAN;
    136129    source->psfFlux          = NAN;
    137130    source->psfFluxErr       = NAN;
    138131    source->extMag           = NAN;   
    139     source->errMag           = NAN;
    140132    source->apMag            = NAN;
    141133    source->apMagRaw         = NAN;
     
    143135    source->apFlux           = NAN;
    144136    source->apFluxErr        = NAN;
    145     source->sky              = NAN;
    146     source->skyErr           = NAN;   
     137
    147138    source->pixWeightNotBad  = NAN;
    148139    source->pixWeightNotPoor = NAN;
     
    151142    source->crNsigma         = NAN;
    152143    source->extNsigma        = NAN;
     144    source->sky              = NAN;
     145    source->skyErr           = NAN;   
     146
     147    source->region = psRegionSet(NAN, NAN, NAN, NAN);
     148    source->blends = NULL;
     149    source->extpars = NULL;
     150    source->diffStats = NULL;
     151    source->radialAper = NULL;
     152    source->parent = NULL;
     153    source->imageID = -1;
     154
     155    psMemSetDeallocator(source, (psFreeFunc) sourceFree);
    153156
    154157    psTrace("psModules.objects", 10, "---- end ----\n");
     
    172175    if (in->peak != NULL) {
    173176        source->peak = pmPeakAlloc (in->peak->x, in->peak->y, in->peak->detValue, in->peak->type);
    174         source->peak->xf = in->peak->xf;
    175         source->peak->yf = in->peak->yf;
    176         source->peak->rawFlux         = in->peak->rawFlux;
    177         source->peak->rawFluxStdev    = in->peak->rawFluxStdev;
    178         source->peak->smoothFlux      = in->peak->smoothFlux;
    179         source->peak->smoothFluxStdev = in->peak->smoothFluxStdev;
    180         // source->peak->SN = in->peak->SN;
     177        pmPeakCopy(source->peak, in->peak);
    181178    }
    182179
     
    195192
    196193    // the maskObj is a unique mask array; create a new mask image
    197     source->maskObj = in->maskObj ? psImageCopy (NULL, in->maskObj, PS_TYPE_IMAGE_MASK) : NULL;
    198 
    199     source->type = in->type;
    200     source->mode = in->mode;
    201     source->imageID = in->imageID;
     194    source->maskObj = in->maskObj   ? psImageCopy (NULL, in->maskObj, PS_TYPE_IMAGE_MASK) : NULL;
     195
     196    // NOTE : because of the const id element, we cannot just assign *source = *in
     197
     198    source->type             = in->type;
     199    source->mode             = in->mode;
     200    source->mode2            = in->mode2;
     201    source->tmpFlags         = in->tmpFlags;
     202    source->psfMag           = in->psfMag;
     203    source->psfMagErr        = in->psfMagErr;
     204    source->psfFlux          = in->psfFlux;
     205    source->psfFluxErr       = in->psfFluxErr;
     206    source->extMag           = in->extMag;
     207    source->apMag            = in->apMag;
     208    source->apMagRaw         = in->apMagRaw;
     209    source->apRadius         = in->apRadius;
     210    source->apFlux           = in->apFlux;
     211    source->apFluxErr        = in->apFluxErr;
     212    source->pixWeightNotBad  = in->pixWeightNotBad;
     213    source->pixWeightNotPoor = in->pixWeightNotPoor;
     214    source->psfChisq         = in->psfChisq;
     215    source->crNsigma         = in->crNsigma;
     216    source->extNsigma        = in->extNsigma;
     217    source->sky              = in->sky;
     218    source->skyErr           = in->skyErr;
     219
     220    source->region           = in->region;
    202221
    203222    return(source);
     
    266285    extend |= (mySource->maskObj == NULL);
    267286    extend |= (mySource->maskView == NULL);
     287
     288    // if ((fabs(x - 2020) < 5) && (fabs(y - 366) < 5)) {
     289    //  if (extend) {
     290    //      fprintf (stderr, "extend T, %f, %f : %f, %f vs %f, %f : %f, %f\n",
     291    //               newRegion.x0, newRegion.y0, newRegion.x1, newRegion.y1,
     292    //               mySource->region.x0, mySource->region.y0, mySource->region.x1, mySource->region.y1);
     293    //  } else {
     294    //      fprintf (stderr, "extend F, %f, %f : %f, %f vs %f, %f : %f, %f\n",
     295    //               newRegion.x0, newRegion.y0, newRegion.x1, newRegion.y1,
     296    //               mySource->region.x0, mySource->region.y0, mySource->region.x1, mySource->region.y1);
     297    //  }
     298    // }
    268299
    269300    if (extend) {
     
    486517        // create vectors with Sx, Sy values in window
    487518        // clip sources based on S/N
    488         for (psS32 i = 0 ; i < sources->n ; i++)
     519        for (psS32 i = 0; i < sources->n; i++)
    489520        {
    490521            pmSource *tmpSrc = (pmSource *) sources->data[i];
     
    11751206    if (!source->moments) return false;          // can't if there are no moments
    11761207    if (!source->moments->nPixels) return false; // can't if the moments were not measured
    1177     if (source->mode && PM_SOURCE_MODE_MOMENTS_FAILURE) return false; // can't if the moments failed...
     1208    if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) return false; // can't if the moments failed...
    11781209
    11791210    if (source->mode & PM_SOURCE_MODE_SATSTAR) return true; // moments are best for SATSTARs
Note: See TracChangeset for help on using the changeset viewer.