IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2007, 3:42:08 PM (19 years ago)
Author:
Paul Price
Message:

Adding ability to read stamps from a file containing x,y on each line.

File:
1 edited

Legend:

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

    r14536 r14572  
    7575    psMaskType maskBlank = pmConfigMask(psMetadataLookupStr(NULL, config->arguments, "MASK.BLANK"),
    7676                                        config); // Mask for blank reg.
     77    const char *stampsFile = psMetadataLookupStr(NULL, config->arguments, "STAMPS"); // Filename for stamps
    7778
    7879    int numCols = input->numCols, numRows = input->numRows; // Image dimensions
     
    154155            for (int k = 0; k < iter && numRejected != 0; k++) {
    155156                psTrace("ppSub", 2, "Iteration %d...\n", k);
     157
    156158                psTrace("ppSub", 3, "Finding stamps...\n");
    157                 stamps = pmSubtractionFindStamps(stamps, refRO->image, subMask, region, threshold, spacing);
     159                if (stampsFile) {
     160                    iter = 1;           // There is no iterating because we use all the stamps we have
     161                    psArray *stampData = psVectorsReadFromFile(stampsFile, "%f %f"); // Stamp positions
     162                    psVector *xStamp = stampData->data[0]; // x coordinates
     163                    psVector *yStamp = stampData->data[1]; // y coordinates
     164                    // Correct for IRAF (unit-offset) positions to C (zero-offset) positions
     165                    psBinaryOp(xStamp, xStamp, "-", psScalarAlloc(1.0, PS_TYPE_F32));
     166                    psBinaryOp(yStamp, yStamp, "-", psScalarAlloc(1.0, PS_TYPE_F32));
     167
     168                    stamps = pmSubtractionSetStamps(xStamp, yStamp, NULL, subMask, region);
     169                } else {
     170                    stamps = pmSubtractionFindStamps(stamps, refRO->image, subMask, region,
     171                                                     threshold, spacing);
     172                }
    158173                if (!stamps) {
    159174                    psError(PS_ERR_UNKNOWN, false, "Unable to find stamps on reference image.");
Note: See TracChangeset for help on using the changeset viewer.