IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2006, 5:26:12 PM (20 years ago)
Author:
Paul Price
Message:

Printing ourselves, instead of using psTrace, so that we can actually print to the desired file descriptor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAConstruct.c

    r9588 r9699  
    797797
    798798
     799// Print spaces to indent
     800#define INDENT(FILE, LEVEL) \
     801{ \
     802    for (int i = 0; i < (LEVEL); i++) { \
     803        fprintf(FILE, " "); \
     804    } \
     805}
     806
    799807void pmFPAPrint(FILE *fd, const pmFPA *fpa, bool header, bool concepts)
    800808{
    801809    PS_ASSERT_PTR_NON_NULL(fpa,);
    802810
    803     psTrace("psModules.camera", 1, "FPA:\n");
     811    IDENT(fd, 1);
     812    fprintf(fd,  1, "FPA:\n");
    804813    if (fpa->hdu) {
    805814        pmHDUPrint(fd, fpa->hdu, 2, header);
     
    812821    // Iterate over the FPA
    813822    for (int i = 0; i < chips->n; i++) {
    814         psTrace("psModules.camera", 3, "Chip: %d\n", i);
     823        INDENT(fd, 3);
     824        fprintf(fd, "Chip: %d\n", i);
    815825        pmChip *chip = chips->data[i]; // The chip
    816826        if (chip->hdu) {
     
    824834        psArray *cells = chip->cells;   // Array of cells
    825835        for (int j = 0; j < cells->n; j++) {
    826             psTrace("psModules.camera", 5, "Cell: %d\n", j);
     836            INDENT(fd, 5);
     837            fprintf(fd, "Cell: %d\n", j);
    827838            pmCell *cell = cells->data[j]; // The cell
    828839            if (cell->hdu) {
     
    836847            for (int k = 0; k < readouts->n; k++) {
    837848                pmReadout *readout = readouts->data[k]; // The readout
    838                 psTrace("psModules.camera", 6, "Readout %d:\n", k);
    839                 psTrace("psModules.camera", 7, "row0: %d\n", readout->row0);
    840                 psTrace("psModules.camera", 7, "col0: %d\n", readout->col0);
     849                INDENT(fd, 6);
     850                fprintf(fd, "Readout %d:\n", k);
     851                INDENT(fd, 7);
     852                fprintf(fd, "col0: %d\n", readout->col0);
     853                INDENT(fd, 7);
     854                fprintf(fd, "row0: %d\n", readout->row0);
    841855                psImage *image = readout->image; // The image
    842856                psList *bias = readout->bias; // The list of bias images
    843857                if (image) {
    844                     psTrace("psModules.camera", 7, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 +
     858                    INDENT(fd, 7);
     859                    fprintf(fd, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 +
    845860                            image->numCols, image->row0, image->row0 + image->numRows, image->numCols,
    846861                            image->numRows);
     
    850865                    psImage *biasImage = NULL; // Bias image from iteration
    851866                    while ((biasImage = psListGetAndIncrement(biasIter))) {
    852                         psTrace("psModules.camera", 7, "Bias:  [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0,
     867                        INDENT(fd, 7);
     868                        fprintf(fd, "Bias:  [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0,
    853869                                biasImage->col0 + biasImage->numCols, biasImage->row0,
    854870                                biasImage->row0 + biasImage->numRows, biasImage->numCols, biasImage->numRows);
Note: See TracChangeset for help on using the changeset viewer.