IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 2, 2009, 2:36:52 PM (17 years ago)
Author:
Paul Price
Message:

Merging branches/pap_mops into trunk. ppMops now merges multiple skycells, and these get published for MOPS as a single file per exposure. Tested and works.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppMops/src/ppMops.c

    r25100 r25256  
    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    psLibInit(NULL);
     9
     10    ppMopsArguments *args = ppMopsArgumentsParse(argc, argv); // Parsed arguments
     11    if (!args) {
     12        psErrorStackPrint(stderr, "Error parsing arguments");
    1113        exit(PS_EXIT_CONFIG_ERROR);
    1214    }
    1315
    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     }
     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
    2646
    2747    psArray *detections = NULL;         // Detections
     
    211231    psFree(data);
    212232
    213     return PS_EXIT_SUCCESS;
    214 }
     233#endif
     234
Note: See TracChangeset for help on using the changeset viewer.