Changeset 25401
- Timestamp:
- Sep 15, 2009, 3:58:51 PM (17 years ago)
- Location:
- branches/eam_branches/20090715/ppMops
- Files:
-
- 1 deleted
- 3 edited
- 6 copied
-
ICDlite.txt (copied) (copied from trunk/ppMops/ICDlite.txt )
-
src/Makefile.am (modified) (1 diff)
-
src/ppMops.c (modified) (4 diffs)
-
src/ppMops.h (modified) (1 diff)
-
src/ppMopsArguments.c (copied) (copied from trunk/ppMops/src/ppMopsArguments.c )
-
src/ppMopsData.c (deleted)
-
src/ppMopsDetections.c (copied) (copied from trunk/ppMops/src/ppMopsDetections.c )
-
src/ppMopsMerge.c (copied) (copied from trunk/ppMops/src/ppMopsMerge.c )
-
src/ppMopsRead.c (copied) (copied from trunk/ppMops/src/ppMopsRead.c )
-
src/ppMopsWrite.c (copied) (copied from trunk/ppMops/src/ppMopsWrite.c )
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/ppMops/src/Makefile.am
r24307 r25401 28 28 ppMops.c \ 29 29 ppMopsVersion.c \ 30 ppMopsData.c 30 ppMopsArguments.c \ 31 ppMopsDetections.c \ 32 ppMopsRead.c \ 33 ppMopsWrite.c \ 34 ppMopsMerge.c 31 35 32 36 noinst_HEADERS = \ -
branches/eam_branches/20090715/ppMops/src/ppMops.c
r25022 r25401 6 6 int main(int argc, char *argv[]) 7 7 { 8 if (argc != 4) { 9 fprintf(stderr, "Insufficient arguments.\n"); 10 fprintf(stderr, "Usage: %s DETECTIONS ZP OUTPUT\n", argv[0]); 8 psLibInit(NULL); 9 10 ppMopsArguments *args = ppMopsArgumentsParse(argc, argv); // Parsed arguments 11 if (!args) { 12 psErrorStackPrint(stderr, "Error parsing arguments"); 11 13 exit(PS_EXIT_CONFIG_ERROR); 12 14 } 13 15 14 ppMopsData *data = ppMopsDataAlloc(); // Configuration data 15 data->detections = psStringCopy(argv[1]); 16 data->zp = atof(argv[2]); 17 data->output = psStringCopy(argv[3]); 18 19 if (!isfinite(data->zp)) { 20 psErrorStackPrint(stderr, "Zero point is unknown\n"); 21 exit(PS_EXIT_CONFIG_ERROR); 22 } 16 psArray *detections = ppMopsRead(args); // Detections from each input 17 if (!detections) { 18 psErrorStackPrint(stderr, "Unable to read detections"); 19 exit(PS_EXIT_SYS_ERROR); 20 } 21 22 ppMopsDetections *merged = ppMopsMerge(detections); // Merged detections 23 psFree(detections); 24 if (!merged) { 25 psErrorStackPrint(stderr, "Unable to merge detections"); 26 exit(PS_EXIT_SYS_ERROR); 27 } 28 29 if (!ppMopsWrite(merged, args)) { 30 psErrorStackPrint(stderr, "Unable to write detections"); 31 exit(PS_EXIT_SYS_ERROR); 32 } 33 34 psFree(merged); 35 psFree(args); 36 37 psLibFinalize(); 38 39 return PS_EXIT_SUCCESS; 40 } 41 42 43 #if 0 44 ps 45 23 46 24 47 psArray *detections = NULL; // Detections … … 120 143 double alt = psMetadataLookupF64(NULL, header, "FPA.ALT"); 121 144 double az = psMetadataLookupF64(NULL, header, "FPA.AZ"); 122 int imageid = psMetadataLookupS32(NULL, header, "IMAGEID");145 psS64 imageid = psMetadataLookupS64(NULL, header, "IMAGEID"); 123 146 double mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + exptime / 2.0 / 3600 / 24; 124 147 125 148 float psf = plateScale * 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + 126 149 psMetadataLookupF32(NULL, header, "FWHM_MIN")); 127 128 // XXX This is wrong129 int fpaid = psMetadataLookupS32(NULL, header, "IMAGEID");130 131 150 132 151 psMetadataAddStr(outHeader, PS_LIST_TAIL, "RA", 0, "Right ascension of boresight", ra); … … 139 158 psMetadataAddF64(outHeader, PS_LIST_TAIL, "TEL_ALT", 0, "Telescope altitude", alt); 140 159 psMetadataAddF64(outHeader, PS_LIST_TAIL, "TEL_AZ", 0, "Telescope azimuth", az); 141 psMetadataAddS32(outHeader, PS_LIST_TAIL, "DIFFIMID", 0, "Difference image identifier", imageid); 142 psMetadataAddS32(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure identifier", fpaid); 160 psMetadataAddS64(outHeader, PS_LIST_TAIL, "DIFFIMID", 0, "Difference image identifier", imageid); 161 psMetadataAddStr(outHeader, PS_LIST_TAIL, "FPA_ID", 0, "Exposure name", data->exp_name); 162 psMetadataAddS64(outHeader, PS_LIST_TAIL, "EXP_ID", 0, "Exposure identifier", data->exp_id); 163 psMetadataAddBool(outHeader, PS_LIST_TAIL, "POSITIVE", 0, "Positive subtraction?", data->direction); 143 164 psMetadataAddStr(outHeader, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE); 144 165 psMetadataAddF32(outHeader, PS_LIST_TAIL, "STARPSF", 0, "Stellar PSF (arcsec)", psf); 145 166 146 167 // These are completely fake 147 psMetadataAddF32(outHeader, PS_LIST_TAIL, "LIMITMAG", 0, "Limiting magnitude (FAKE)", 25.0);168 psMetadataAddF32(outHeader, PS_LIST_TAIL, "LIMITMAG", 0, "Limiting magnitude (FAKE)", 99.0); 148 169 psMetadataAddF32(outHeader, PS_LIST_TAIL, "DE1", 0, "Detection efficiency (FAKE)", 0.0); 149 170 psMetadataAddF32(outHeader, PS_LIST_TAIL, "DE2", 0, "Detection efficiency (FAKE)", 0.0); … … 210 231 psFree(data); 211 232 212 return PS_EXIT_SUCCESS; 213 } 233 #endif 234 -
branches/eam_branches/20090715/ppMops/src/ppMops.h
r24385 r25401 11 11 PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_SKY_FAILURE) // Flags to exclude 12 12 13 14 13 // Configuration data 15 14 typedef struct { 16 psString detections; // Detections filename 17 float zp; // Magnitude zero point 15 psArray *input; // Input filenames 16 psString exp_name; // Exposure name 17 psS64 exp_id; // Exposure identifier 18 psS64 chip_id; // Chip stage identifier 19 psS64 cam_id; // Camera stage identifier 20 psS64 fake_id; // Fake stage identifier 21 psS64 warp_id; // Warp stage identifier 22 psS64 diff_id; // Diff stage identifier 23 bool positive; // Sense of subtraction, T=positive, F=negative 24 float zp, zpErr; // Magnitude zero point and error 25 float rmsAstrom; // Astrometric solution RMS 18 26 psString output; // Output filename 19 } ppMops Data;27 } ppMopsArguments; 20 28 21 // Allocator 22 ppMopsData *ppMopsDataAlloc(void); 29 /// Parse arguments 30 ppMopsArguments *ppMopsArgumentsParse(int argc, char *argv[]); 31 32 typedef struct { 33 psString raBoresight, decBoresight; // RA,Dec of telescope boresight 34 psString filter; // Filter for exposure 35 float airmass; // Airmass of exposure 36 float exptime; // Exposure time 37 double posangle; // Position angle 38 double alt, az; // Telescope altitude and azimuth 39 double mjd; // Modified Julian Date 40 float seeing; // Seeing of exposure 41 long num; // Number of detections 42 psVector *x, *y; // Image coordinates 43 psVector *ra, *dec; // Sky coordinates 44 psVector *raErr, *decErr; // Error in sky coordinates 45 psVector *mag, *magErr; // Magnitude and associated error 46 psVector *extended; // Measure of extendedness 47 psVector *angle, *angleErr; // Angle of trail and associated error 48 psVector *length, *lengthErr; // Length of trail and associated error 49 psVector *flags; // psphot flags 50 psVector *diffSkyfileId; // Identifier for source image 51 psVector *naxis1, *naxis2; // Size of image 52 psVector *mask; // Mask for detections 53 } ppMopsDetections; 54 55 ppMopsDetections *ppMopsDetectionsAlloc(long num); 56 57 /// Copy a detection 58 bool ppMopsDetectionsCopySingle(ppMopsDetections *target, const ppMopsDetections *source, long index); 59 60 /// Purge the detections list of masked detections 61 bool ppMopsDetectionsPurge(ppMopsDetections *detections); 62 63 64 /// Read detections 65 psArray *ppMopsRead(const ppMopsArguments *args); 66 67 /// Merge detections 68 ppMopsDetections *ppMopsMerge(const psArray *detections); 69 70 /// Write detections 71 bool ppMopsWrite(const ppMopsDetections *detections, const ppMopsArguments *args); 23 72 24 73
Note:
See TracChangeset
for help on using the changeset viewer.
