IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 14, 2011, 1:17:03 PM (15 years ago)
Author:
bills
Message:

more progress on psvideophot. Added program dumpvideo to dump a given videocell and it's
associated video extension table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psvideophot/src/psvideoLoop.c

    r31813 r32553  
    4444    }
    4545
     46    psString class_id = psMetadataLookupStr(&status, config->arguments, "CLASS_ID");
     47    psString cell_id = psMetadataLookupStr(&status, config->arguments, "CELL_ID");
     48
    4649
    4750    pmConfigCamerasCull(config, NULL);
     
    5962    while ((chip = pmFPAviewNextChip(view, input->fpa, 1)) != NULL) {
    6063        psLogMsg ("psvideophotLoop", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
     64        psString chipName = psMetadataLookupStr(&status, chip->concepts, "CHIP.NAME");
     65        if (strcmp(chipName, class_id)) {
     66            continue;
     67        }
    6168        if (!chip->process || !chip->file_exists) {
    62             continue;
     69            ESCAPE("target chip has no data");
    6370        }
    6471        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    6572            ESCAPE("load failure for Chip");
    6673        }
     74        (void) class_id;
    6775
    6876        double threshold = THRESHOLD;
     
    7280        while ((cell = pmFPAviewNextCell(view, input->fpa, 1)) != NULL) {
    7381            psLogMsg ("psvideophotLoop", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     82            psString cellName = psMetadataLookupStr(&status, cell->concepts, "CELL.NAME");
     83            if (strcmp(cellName, cell_id)) {
     84                continue;
     85            }
    7486            if (!cell->process || !cell->file_exists) {
    75                 continue;
     87                ESCAPE("target cell has no data");
    7688            }
    7789            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    7890                ESCAPE("load failure for Cell");
    7991            }
     92
     93            psLogMsg("psvideophotLoop", 1, "Found target cell %s %d. %ld readouts\n", cellName, view->cell, cell->readouts->n);
    8094
    8195            // Put version information into the header
     
    87101
    88102            if (cell->readouts->n <2) {
    89               continue;
     103              psLogMsg("psvideophotLoop", 1, "cell %s has only %ld readouts\n", cellName, cell->readouts->n);
     104              ESCAPE("invalid video Cell");
    90105            }
    91 
    92             psString cellName = psMetadataLookupStr(&status, cell->concepts, "CELL.NAME");
    93             psLogMsg("psvideophotLoop", 1, "Found video cell %s %d\n", cellName, view->cell);
    94106
    95107            // get the position of this cell on the chip
     
    114126
    115127            // go find the video extension data
    116             psString video_extension_name = NULL;
    117             psStringAppend(&video_extension_name, "video_table_%s", cellName);
     128            psString video_extension_name = psMetadataLookupStr(&status, config->arguments, "VIDEOEXTNAME");
     129            if (!video_extension_name) {
     130                psStringAppend(&video_extension_name, "video_table_%s", cellName);
     131            }
    118132            psArray *video_table = readVideoTable(input, video_extension_name);
    119133            if (!video_table) {
     
    121135                ESCAPE("invalid image file");
    122136            }
     137            psFree(video_extension_name);
    123138            psMetadataAddArray(cell->analysis, PS_LIST_TAIL, "VIDEO_DATA", 0, "", video_table);
    124139
Note: See TracChangeset for help on using the changeset viewer.