IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25162


Ignore:
Timestamp:
Aug 20, 2009, 5:24:15 PM (17 years ago)
Author:
Paul Price
Message:

Working on merging multiple detection lists into single list for each exposure. Input part written and compiles.

Location:
branches/pap_mops/ppMops/src
Files:
5 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_mops/ppMops/src/Makefile.am

    r24307 r25162  
    2828        ppMops.c                \
    2929        ppMopsVersion.c         \
    30         ppMopsData.c                   
     30        ppMopsArguments.c       \
     31        ppMopsDetections.c      \
     32        ppMopsRead.c            \
     33        ppMopsWrite.c           \
     34        ppMopsMerge.c
    3135
    3236noinst_HEADERS = \
  • branches/pap_mops/ppMops/src/ppMops.c

    r25100 r25162  
    66int main(int argc, char *argv[])
    77{
    8     if (argc != 7) {
    9         fprintf(stderr, "Insufficient arguments.\n");
    10         fprintf(stderr, "Usage: %s DETECTIONS ZP EXP_ID EXP_NAME DIRECTION OUTPUT\n", argv[0]);
     8    ppMopsArguments *args = ppMopsArgumentsParse(argc, argv); // Parsed arguments
     9    if (!args) {
     10        psErrorStackPrint(stderr, "Error parsing arguments");
    1111        exit(PS_EXIT_CONFIG_ERROR);
    1212    }
    1313
    14     ppMopsData *data = ppMopsDataAlloc(); // Configuration data
    15     data->detections = psStringCopy(argv[1]);
    16     data->zp = atof(argv[2]);
    17     data->exp_id = atoll(argv[3]);
    18     data->exp_name = psStringCopy(argv[4]);
    19     data->direction = atoi(argv[5]);
    20     data->output = psStringCopy(argv[6]);
    21 
    22     if (!isfinite(data->zp)) {
    23         psErrorStackPrint(stderr, "Zero point is unknown\n");
    24         exit(PS_EXIT_CONFIG_ERROR);
    25     }
     14    psArray *detections = ppMopsRead(args); // Detections from each input
     15    if (!detections) {
     16        psErrorStackPrint(stderr, "Unable to read detections");
     17        exit(PS_EXIT_SYS_ERROR);
     18    }
     19
     20#if 0
     21    ps
     22
    2623
    2724    psArray *detections = NULL;         // Detections
     
    211208    psFree(data);
    212209
     210#endif
     211
    213212    return PS_EXIT_SUCCESS;
    214213}
  • branches/pap_mops/ppMops/src/ppMops.h

    r25100 r25162  
    1111                     PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_SKY_FAILURE) // Flags to exclude
    1212
    13 
    1413// Configuration data
    1514typedef struct {
    16     psString detections;                // Detections filename
    17     float zp;                           // Magnitude zero point
     15    psArray *input;                     // Input filenames
     16    psString exp_name;                  // Exposure name
    1817    psS64 exp_id;                       // Exposure identifier
    19     psString exp_name;                  // Exposure name
    20     bool direction;                     // Direction of subtraction, 1=positive, 0=negative
     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
    2126    psString output;                    // Output filename
    22 } ppMopsData;
     27} ppMopsArguments;
    2328
    24 // Allocator
    25 ppMopsData *ppMopsDataAlloc(void);
     29/// Parse arguments
     30ppMopsArguments *ppMopsArgumentsParse(int argc, char *argv[]);
     31
     32typedef 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} ppMopsDetections;
     52
     53ppMopsDetections *ppMopsDetectionsAlloc(long num);
     54
     55/// Read detections
     56psArray *ppMopsRead(const ppMopsArguments *args);
     57
     58/// Merge detections
     59ppMopsDetections *ppMopsDetectionsMerge(const psArray *detections);
     60
     61/// Write detections
     62bool ppMopsWrite(const ppMopsDetections *detections, const ppMopsArguments *args);
    2663
    2764
Note: See TracChangeset for help on using the changeset viewer.