IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14811


Ignore:
Timestamp:
Sep 10, 2007, 2:44:14 PM (19 years ago)
Author:
Paul Price
Message:

Adding ability to get stamps from sources.

Location:
trunk/ppStack/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStack.h

    r14626 r14811  
    3737bool ppStackMatch(pmReadout *output,    ///< Convolved readout
    3838                  const pmReadout *input, ///< Readout to be convolved
     39                  const pmReadout *sourcesRO, ///< Readout with sources
    3940                  const pmConfig *config ///< Configuration
    4041    );
  • trunk/ppStack/src/ppStackArguments.c

    r14626 r14811  
    1919{
    2020    fprintf(stderr, "\nPan-STARRS Image combination\n\n");
    21     fprintf(stderr, "Usage: %s INPUTS.mdc OUTPUT_ROOT -target FWHM -stamps FILENAME\n"
     21    fprintf(stderr, "Usage: %s INPUTS.mdc OUTPUT_ROOT [-target FWHM] [-sources STAMPS.cmf]\n"
    2222            "where INPUTS.mdc contains various METADATAs, each with:\n"
    2323            "\tIMAGE(STR):     Image filename\n"
     
    101101    assert(config);
    102102
     103    pmConfigFileSetsMD(config->arguments, &argc, argv, "PPSTACK.SOURCES", "-sources", NULL);
     104
    103105    psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
    104106    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stamps", 0, "Stamps file with x,y,flux per line", NULL);
  • trunk/ppStack/src/ppStackCamera.c

    r14626 r14811  
    214214    }
    215215
     216    // Sources for use as stamps
     217    bool status = false;                // Found the file?
     218    pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.SOURCES", "PPSTACK.SOURCES");
     219    if (!status) {
     220        psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.SOURCES");
     221        return false;
     222    }
     223    if (sources && sources->type != PM_FPA_FILE_CMF) {
     224        psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF");
     225        return false;
     226    }
     227
    216228    // For photometry, we operate on the chip-mosaicked image
    217229    // we create a copy of the mosaicked image for psphot so we can write out a clean image
  • trunk/ppStack/src/ppStackMatch.c

    r14764 r14811  
    1111//#define TESTING
    1212
    13 bool ppStackMatch(pmReadout *output, const pmReadout *input, const pmConfig *config)
     13bool ppStackMatch(pmReadout *output, const pmReadout *input, const pmReadout *sourcesRO,
     14                  const pmConfig *config)
    1415{
    1516    // Look up appropriate values from the ppSub recipe
     
    5152    }
    5253
     54    psArray *sources = psMetadataLookupPtr(&mdok, sourcesRO->analysis, "PSPHOT.SOURCES"); // Sources in image
     55
    5356    // Do the image matching
    54     if (!pmSubtractionMatch(output, input, NULL, footprint, regionSize, spacing, threshold, stampsName,
    55                             target, type, size, order, widths, orders, inner, ringsOrder, binning, optimum,
    56                             optWidths, optOrder, optThresh, iter, rej, maskBad, maskBlank)) {
     57    if (!pmSubtractionMatch(output, input, NULL, footprint, regionSize, spacing, threshold, sources,
     58                            stampsName, target, type, size, order, widths, orders, inner, ringsOrder,
     59                            binning, optimum, optWidths, optOrder, optThresh, iter, rej, maskBad,
     60                            maskBlank)) {
    5761        psError(PS_ERR_UNKNOWN, false, "Unable to match images.");
    5862        return false;
  • trunk/ppStack/src/ppStackReadout.c

    r14765 r14811  
    3434    // Get the input sources
    3535    psArray *stack = psArrayAllocEmpty(ARRAY_BUFFER); // The stack of inputs
     36    pmReadout *sources = pmFPAfileThisReadout(config->files, view, "PPSTACK.SOURCES"); // Sources for stamps
    3637    psMetadataIterator *fileIter = psMetadataIteratorAlloc(config->files, PS_LIST_HEAD,
    3738                                                           "^PPSTACK.INPUT$"); // Iterator over input files
     
    8283        // Generate convolved version of input
    8384        pmReadout *convolved = pmReadoutAlloc(NULL); // Convolved version of input readout
    84         if (!ppStackMatch(convolved, ro, config)) {
     85        if (!ppStackMatch(convolved, ro, sources, config)) {
    8586            psError(PS_ERR_UNKNOWN, false, "Unable to match image %d.", fileNum);
    8687            psFree(stats);
Note: See TracChangeset for help on using the changeset viewer.