IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 19, 2007, 4:40:44 PM (19 years ago)
Author:
Paul Price
Message:

Extensive changes to APIs to allow use of a nominated value to mask
against (the maskVal). Previously, the mask values were either
hard-coded (e.g., PM_MASK_SAT) or taken as anything non-zero. The
code is tested with psModules (which has similar changes) and does not
crash, but neither is it successful in marking all bad pixels. For
this reason, I have left the "gutter" pixels (cell gaps) set to 0
instead of NAN in pmFPAMosaic.

File:
1 edited

Legend:

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

    r12792 r13900  
    11# include "psphotInternal.h"
    22
    3 psArray *psphotSourceStats (pmReadout *readout, psMetadata *recipe, psArray *peaks)
     3psArray *psphotSourceStats (pmReadout *readout, psMetadata *recipe, psArray *peaks, psMaskType maskVal, psMaskType mark)
    44{
    55    bool     status  = false;
     
    4040
    4141        // skip faint sources
    42         if (source->peak->SN < MIN_SN) {
     42        if (source->peak->SN < MIN_SN) {
    4343            psArrayAdd (sources, 100, source);
    4444            psFree (source);
    45             continue;
    46         }
     45            continue;
     46        }
    4747
    4848        // measure a local sky value
    4949        // XXX EAM : this should use ROBUST not SAMPLE median, but it is broken
    50         status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER);
     50        status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, mark);
    5151        if (!status) {
    5252          psFree (source);
    53           Nfail ++;
     53          Nfail ++;
    5454          continue;
    5555        }
     
    5757        // measure the local sky variance (needed if noise is not sqrt(signal))
    5858        // XXX EAM : this should use ROBUST not SAMPLE median, but it is broken
    59         status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER);
     59        status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, mark);
    6060        if (!status) {
    6161          psFree (source);
    62           Nfail ++;
     62          Nfail ++;
    6363          continue;
    6464        }
     
    7070            psArrayAdd (sources, 100, source);
    7171            psFree (source);
    72             Nmoments ++;
     72            Nmoments ++;
    7373            continue;
    7474        }
     
    8383            psArrayAdd (sources, 100, source);
    8484            psFree (source);
    85             Nmoments ++;
     85            Nmoments ++;
    8686            continue;
    8787        }
    8888
    8989        psFree (source);
    90         Nfail ++;
     90        Nfail ++;
    9191        continue;
    9292    }
Note: See TracChangeset for help on using the changeset viewer.