IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24245 for trunk/ppMops


Ignore:
Timestamp:
May 26, 2009, 2:51:35 PM (17 years ago)
Author:
Paul Price
Message:

Adding MJD-OBS to header, applying source mask.

Location:
trunk/ppMops/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMops/src/ppMops.c

    r24242 r24245  
    4646
    4747    // Translate the columns
    48     int numRows = detections->n;        // Number of rows
    49     psArray *output = psArrayAlloc(numRows); // Output table
     48    int numIn = detections->n;        // Number of rows in input
     49    int numOut = 0;                   // Number of rows in output
     50    psArray *output = psArrayAllocEmpty(numIn); // Output table
    5051    double plateScale = 0.0;                 // Average plate scale
    51     for (int i = 0; i < numRows; i++) {
     52    for (int i = 0; i < numIn; i++) {
    5253        psMetadata *inRow = detections->data[i]; // Input row
    5354        psMetadata *outRow = output->data[i] = psMetadataAlloc(); // Output row
     
    6465        psU32 flags = psMetadataLookupU32(NULL, inRow, "FLAGS");
    6566
     67        if (flags & SOURCE_MASK) {
     68            continue;
     69        }
     70
     71        numOut++;
    6672        plateScale += scale;
    6773
     
    8692        psMetadataAddF64(outRow, PS_LIST_TAIL, "LEN_SIG", 0, "Length error (arcsec)", 0.0);
    8793    }
    88     plateScale /= numRows;
     94    output->n = numOut;
     95    plateScale /= numOut;
    8996    psFree(detections);
    9097
     
    101108        double az = psMetadataLookupF64(NULL, header, "FPA.AZ");
    102109        int imageid = psMetadataLookupS32(NULL, header, "IMAGEID");
     110        double mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + exptime / 2.0 / 3600 / 24;
    103111
    104112        float psf = plateScale * 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") +
     
    111119        psMetadataAddF64(outHeader, PS_LIST_TAIL, "RA", 0, "Right ascension of boresight", ra);
    112120        psMetadataAddF64(outHeader, PS_LIST_TAIL, "DEC", 0, "Declination of boresight", dec);
     121        psMetadataAddF64(outHeader, PS_LIST_TAIL, "MJD-OBS", 0, "MJD of exposure midpoint", mjd);
    113122        psMetadataAddStr(outHeader, PS_LIST_TAIL, "FILTER", 0, "Filter name", filter);
    114123        psMetadataAddF64(outHeader, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (sec)", exptime);
  • trunk/ppMops/src/ppMops.h

    r24242 r24245  
    77#define OBSERVATORY_CODE 566                    // IAU Observatory Code
    88#define OUT_EXTNAME "MOPS_TRANSIENT_DETECTIONS" // Extension name for data in output
     9#define SOURCE_MASK (8 | /* FAIL */ \
     10                     1024 |  /* BADPSF */ \
     11                     2048 | /* DEFECT */ \
     12                     4096 | /* SATURATED */ \
     13                     8192 | /* CR_LIMIT */ \
     14                     65536 /* SKY_FAILURE */ \
     15                     )
    916
    1017// Configuration data
Note: See TracChangeset for help on using the changeset viewer.