IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2012, 1:08:16 PM (14 years ago)
Author:
bills
Message:

move definition of the vector of sigma values used to set the moments window to the
recipe. Eliminate the two largest values (12 and 18 pixels) for gpc1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceStats.c

    r33840 r34307  
    521521    float PSF_SN_LIM = 2.0*psMetadataLookupF32(&status, recipe, "PSF_SN_LIM"); psAssert (status, "missing PSF_SN_LIM");
    522522
    523     // XXX move this to a config file?
     523
    524524    # define NSIGMA 8
    525     float sigma[NSIGMA] = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0};
     525    // moved to config file
     526    // float sigma[NSIGMA]  = {1.0, 2.0, 3.0, 4.5, 6.0, 9.0, 12.0, 18.0};
     527    psVector  *sigmavec = psMetadataLookupPtr (&status, recipe, "PSF.SIGMA.VALUES"); psAssert(status, "missing PSF.SIGMA.VALUES");
     528    psAssert(sigmavec->n <= NSIGMA, "too many sigma values in recipe %ld maximum is %d", sigmavec->n, NSIGMA);
     529
     530    float sigma[NSIGMA];
    526531    float Sout[NSIGMA];
    527532    float Rmin[NSIGMA];
    528533    int   Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass
    529534
     535    // copy the data from vector to local array to keep the code below easier to read
     536    for (int i = 0 ; i < sigmavec->n; i++) {
     537        sigma[i] = sigmavec->data.F32[i];
     538    }
     539
    530540    // this sorts by peak->rawFlux
    531541    sources = psArraySort (sources, pmSourceSortByFlux);
    532542
    533543    // loop over radii:
    534     for (int i = 0; i < NSIGMA; i++) {
     544    for (int i = 0; i < sigmavec->n; i++) {
    535545
    536546        // XXX move max source number to config
     
    589599    float minS = Sout[0];
    590600    float maxS = Sout[0];
    591     for (int i = 0; i < NSIGMA; i++) {
     601    for (int i = 0; i < sigmavec->n; i++) {
    592602        minS = PS_MIN(Sout[i], minS);
    593603        maxS = PS_MAX(Sout[i], maxS);
    594604    }
    595     if (minS > 0.65) Sigma = sigma[NSIGMA-1];
     605    if (minS > 0.65) Sigma = sigma[sigmavec->n-1];
    596606    if (maxS < 0.65) Sigma = sigma[0];
    597607
    598     for (int i = 0; i < NSIGMA - 1 && isnan(Sigma); i++) {
     608    for (int i = 0; i < sigmavec->n - 1 && isnan(Sigma); i++) {
    599609        if (!isfinite(Sout[i]) || !isfinite(Sout[i+1])) continue;
    600610        if ((Sout[i] > 0.65) && (Sout[i+1] > 0.65)) continue;
Note: See TracChangeset for help on using the changeset viewer.