IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 10, 2010, 5:24:37 PM (16 years ago)
Author:
eugene
Message:

functions called by the psphotReadoutXXX functions now take a filerule so psphotStack can select the correct targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/psphotMergeSources.c

    r27657 r27909  
    66
    77// for now, let's store the detections on the readout->analysis for each readout
    8 bool psphotMergeSources (pmConfig *config, const pmFPAview *view)
     8bool psphotMergeSources (pmConfig *config, const pmFPAview *view, const char *filerule)
    99{
    1010    bool status = true;
     
    1515    // loop over the available readouts
    1616    for (int i = 0; i < num; i++) {
    17         if (!psphotMergeSourcesReadout (config, view, "PSPHOT.INPUT", i)) {
    18             psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for PSPHOT.INPUT entry %d", i);
     17        if (!psphotMergeSourcesReadout (config, view, filerule, i)) {
     18            psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for %s entry %d", filerule, i);
    1919            return false;
    2020        }
     
    2424
    2525// add newly selected sources to the existing list of sources
    26 bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filename, int index) {
     26bool psphotMergeSourcesReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index) {
    2727
    2828    bool status;
    2929
    3030    // find the currently selected readout
    31     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     31    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest
    3232    psAssert (file, "missing file?");
    3333
     
    7171// only expect a single entry for PSPHOT.INPUT.CMF and PSPHOT.SOURCES.TEXT, so we can only
    7272// associate input sources with a single entry for PSPHOT.INPUT
    73 bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view) {
     73bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) {
    7474
    7575    bool status;
     
    7979
    8080    // find the currently selected readout
    81     pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", index); // File of interest
     81    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest
    8282    psAssert (file, "missing file?");
    8383
     
    130130    // load data from input TXT file:
    131131    {
    132         pmChip *chipTXT = pmFPAfileThisChip (config->files, view, "PSPHOT.INPUT");
     132        pmChip *chipTXT = pmFPAfileThisChip (config->files, view, filerule);
    133133        if (!chipTXT) goto finish;
    134134
     
    167167
    168168// extract the input sources corresponding to this readout
    169 // XXX this function needs to be updated to work with the new context of pshot inputs
     169// XXX this function needs to be updated to work with the new context of psphot inputs
    170170psArray *psphotLoadPSFSources (pmConfig *config, const pmFPAview *view) {
    171171
     
    197197// psphotDetectionsFromSources to psphotSourceStats and are now stored on
    198198// detections->newSources.
    199 bool psphotRepairLoadedSources (pmConfig *config, const pmFPAview *view) {
    200 
    201     // find the currently selected readout
    202     pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest
     199bool psphotRepairLoadedSources (pmConfig *config, const pmFPAview *view, const char *filerule) {
     200
     201    // find the currently selected readout
     202    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
    203203    psAssert (file, "missing file?");
    204204
     
    227227// generate the detection structure for the supplied array of sources
    228228// XXX this currently assumes there is a single input file
    229 bool psphotDetectionsFromSources (pmConfig *config, const pmFPAview *view, psArray *sources) {
    230 
    231     // find the currently selected readout
    232     pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest
     229bool psphotDetectionsFromSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *sources) {
     230
     231    // find the currently selected readout
     232    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
    233233    psAssert (file, "missing file?");
    234234
     
    335335}
    336336
    337 bool psphotCheckExtSources (pmConfig *config, const pmFPAview *view) {
     337bool psphotCheckExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) {
    338338
    339339    bool status;
     
    343343
    344344    // find the currently selected readout
    345     pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", 0); // File of interest
     345    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, 0); // File of interest
    346346    psAssert (file, "missing file?");
    347347
     
    373373
    374374        // find the detections (by peak and/or footprint) in the image.
    375         if (!psphotFindDetections (config, view, true)) {
     375        if (!psphotFindDetections (config, view, filerule, true)) {
    376376            psError(PSPHOT_ERR_CONFIG, false, "unable to find detections in this image");
    377             return psphotReadoutCleanup (config, view);
     377            return psphotReadoutCleanup (config, view, filerule);
    378378        }
    379379
    380380        // construct sources and measure basic stats
    381         psphotSourceStats (config, view, true);
     381        psphotSourceStats (config, view, filerule, true);
    382382
    383383        // find blended neighbors of very saturated stars
    384         psphotDeblendSatstars (config, view);
     384        psphotDeblendSatstars (config, view, filerule);
    385385
    386386        // mark blended peaks PS_SOURCE_BLEND
    387         if (!psphotBasicDeblend (config, view)) {
     387        if (!psphotBasicDeblend (config, view, filerule)) {
    388388            psLogMsg ("psphot", 3, "failed on deblend analysis");
    389             return psphotReadoutCleanup (config, view);
     389            return psphotReadoutCleanup (config, view, filerule);
    390390        }
    391391
    392392        // classify sources based on moments, brightness
    393         if (!psphotRoughClass (config, view)) {
     393        if (!psphotRoughClass (config, view, filerule)) {
    394394            psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
    395             return psphotReadoutCleanup (config, view);
    396         }
    397     }
    398 
    399     return true;
    400 }
     395            return psphotReadoutCleanup (config, view, filerule);
     396        }
     397    }
     398
     399    return true;
     400}
Note: See TracChangeset for help on using the changeset viewer.