IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 9:45:46 PM (15 years ago)
Author:
eugene
Message:

add forced photometry of positive sources; generate a background model for PPSUB.OUTPUT even if PSPHOT.BACKMDL exists (is certain to be for the wrong image)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubLoop.c

    r29003 r29937  
    5757    }
    5858
     59    if (data->forcedPhot1) {
     60        bool foundDetections = false;
     61        if (!ppSubInputDetections(&foundDetections, "PPSUB.POS1.SOURCES", "PPSUB.INPUT", data)) {
     62            psError(psErrorCodeLast(), false, "Unable to measure positive detections (1)");
     63            return false;
     64        }
     65        // if nothing was found, don't bother doing the forced photometry below
     66        if (!foundDetections) {
     67            psWarning ("no sources found in positive image 1, skipping forced photometry");
     68            data->forcedPhot1 = false;
     69        }
     70    }
     71    if (data->forcedPhot2) {
     72        bool foundDetections = false;
     73        if (!ppSubInputDetections(&foundDetections, "PPSUB.POS2.SOURCES", "PPSUB.REF", data)) {
     74            psError(psErrorCodeLast(), false, "Unable to measure positive detections (2)");
     75            return false;
     76        }
     77        // if nothing was found, don't bother doing the forced photometry below
     78        if (!foundDetections) {
     79            psWarning ("no sources found in positive image 1, skipping forced photometry");
     80            data->forcedPhot1 = false;
     81        }
     82    }
     83
     84    // XXX if it exists, use the POS1, POS2 results for the FWHMs
    5985    if (!ppSubMatchPSFs(data)) {
    6086        psError(psErrorCodeLast(), false, "Unable to match PSFs.");
     
    7096        return false;
    7197    }
     98
     99    // XXX add in a positive image detection step here (if needed)
     100   
    72101
    73102    psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_MATCH", 0, "Time to match PSFs",
     
    153182    }
    154183    // dumpout(config, "diff.3.fits");
     184
     185    // forced photometry for positive image 1
     186    if (data->forcedPhot1 && !data->quality) {
     187        if (!ppSubReadoutForcedPhot("PPSUB.FORCED1.SOURCES", "PPSUB.OUTPUT", "PPSUB.POS1.SOURCES", data)) {
     188            psError(psErrorCodeLast(), false, "Unable to perform photometry.");
     189            return false;
     190        }
     191    }
     192
     193    // forced photometry for positive image 2
     194    if (data->forcedPhot2 && !data->quality) {
     195        if (!ppSubReadoutForcedPhot("PPSUB.FORCED2.SOURCES", "PPSUB.OUTPUT", "PPSUB.POS2.SOURCES", data)) {
     196            psError(psErrorCodeLast(), false, "Unable to perform photometry.");
     197            return false;
     198        }
     199    }
    155200
    156201    if (!ppSubFilesIterateUp(config, PPSUB_FILES_PHOT_SUB)) {
     
    227272    }
    228273
     274    pmFPAfileDropInternal(config->files, "PSPHOT.BACKGND");
     275    pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL");
     276    pmFPAfileDropInternal(config->files, "PSPHOT.BACKMDL.STDEV");
     277
    229278    return true;
    230279}
Note: See TracChangeset for help on using the changeset viewer.