Changeset 24245
- Timestamp:
- May 26, 2009, 2:51:35 PM (17 years ago)
- Location:
- trunk/ppMops/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMops/src/ppMops.c
r24242 r24245 46 46 47 47 // 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 50 51 double plateScale = 0.0; // Average plate scale 51 for (int i = 0; i < num Rows; i++) {52 for (int i = 0; i < numIn; i++) { 52 53 psMetadata *inRow = detections->data[i]; // Input row 53 54 psMetadata *outRow = output->data[i] = psMetadataAlloc(); // Output row … … 64 65 psU32 flags = psMetadataLookupU32(NULL, inRow, "FLAGS"); 65 66 67 if (flags & SOURCE_MASK) { 68 continue; 69 } 70 71 numOut++; 66 72 plateScale += scale; 67 73 … … 86 92 psMetadataAddF64(outRow, PS_LIST_TAIL, "LEN_SIG", 0, "Length error (arcsec)", 0.0); 87 93 } 88 plateScale /= numRows; 94 output->n = numOut; 95 plateScale /= numOut; 89 96 psFree(detections); 90 97 … … 101 108 double az = psMetadataLookupF64(NULL, header, "FPA.AZ"); 102 109 int imageid = psMetadataLookupS32(NULL, header, "IMAGEID"); 110 double mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + exptime / 2.0 / 3600 / 24; 103 111 104 112 float psf = plateScale * 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + … … 111 119 psMetadataAddF64(outHeader, PS_LIST_TAIL, "RA", 0, "Right ascension of boresight", ra); 112 120 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); 113 122 psMetadataAddStr(outHeader, PS_LIST_TAIL, "FILTER", 0, "Filter name", filter); 114 123 psMetadataAddF64(outHeader, PS_LIST_TAIL, "EXPTIME", 0, "Exposure time (sec)", exptime); -
trunk/ppMops/src/ppMops.h
r24242 r24245 7 7 #define OBSERVATORY_CODE 566 // IAU Observatory Code 8 8 #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 ) 9 16 10 17 // Configuration data
Note:
See TracChangeset
for help on using the changeset viewer.
