IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 22, 2006, 2:23:08 PM (20 years ago)
Author:
Paul Price
Message:

Adding pmHDUGenerate to make an HDU (image) from the cells contained below. Altered pmFPACopy to use pmHDUGenerate functions. The motivation for pmHDUGenerate is that when we go through an FPA bit by bit, creating an output FPA, we don't know the size of the resultant output images until we're done with the whole lot. So we simply create the cells, and call pmHDUGenerateFromFPA (etc) to generate the HDU image which is then written out. It takes care of the TRIMSEC, BIASSEC, etc.

File:
1 edited

Legend:

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

    r7017 r7168  
    1010#include "pmFPAview.h"
    1111#include "pmFPAUtils.h"
     12#include "pmHDUUtils.h"
    1213
    1314//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    690691    psTrace(__func__, 1, "FPA:\n");
    691692    if (fpa->hdu) {
    692         psTrace(__func__, 2, "---> FPA is extension %s.\n", fpa->hdu->extname);
    693         if (! fpa->hdu->images) {
    694             psTrace(__func__, 2, "---> NO PIXELS read in for extension %s\n", fpa->hdu->extname);
    695         }
    696         if (header) {
    697             if (fpa->hdu->header) {
    698                 psTrace(__func__, 2, "---> Header:\n");
    699                 psMetadataPrint(fpa->hdu->header, 8);
    700             } else {
    701                 psTrace(__func__, 2, "---> NO HEADER read in for extension %s\n", fpa->hdu->extname);
    702             }
    703         }
     693        pmHDUPrint(fpa->hdu, 2, header);
    704694    }
    705695    if (concepts) {
     
    713703        pmChip *chip = chips->data[i]; // The chip
    714704        if (chip->hdu) {
    715             psTrace(__func__, 4, "---> Chip is extension %s.\n", chip->hdu->extname);
    716             if (header) {
    717                 if (chip->hdu->header) {
    718                     psTrace(__func__, 4, "---> Header:\n");
    719                     psMetadataPrint(chip->hdu->header, 8);
    720                 } else {
    721                     psTrace(__func__, 4, "---> NO HEADER read in for extension %s\n", chip->hdu->extname);
    722                 }
    723             }
    724             if (! chip->hdu->images) {
    725                 psTrace(__func__, 4, "---> NO PIXELS read in for extension %s\n", chip->hdu->extname);
    726             }
     705            pmHDUPrint(chip->hdu, 4, header);
    727706        }
    728707        if (concepts) {
     
    736715            pmCell *cell = cells->data[j]; // The cell
    737716            if (cell->hdu) {
    738                 psTrace(__func__, 6, "---> Cell is extension %s.\n", cell->hdu->extname);
    739                 if (header) {
    740                     if (cell->hdu->header) {
    741                         psTrace(__func__, 6, "---> Header:\n");
    742                         psMetadataPrint(cell->hdu->header, 8);
    743                     } else {
    744                         psTrace(__func__, 6, "---> NO HEADER read in for extension %s\n", cell->hdu->extname);
    745                     }
    746                 }
    747                 if (! cell->hdu->images) {
    748                     psTrace(__func__, 6, "---> NO PIXELS read in for extension %s\n", cell->hdu->extname);
    749                 }
     717                pmHDUPrint(cell->hdu, 6, header);
    750718            }
    751719            if (concepts) {
     
    753721            }
    754722
    755             psTrace(__func__, 7, "Readouts:\n");
    756723            psArray *readouts = cell->readouts; // Array of readouts
    757724            for (int k = 0; k < readouts->n; k++) {
    758725                pmReadout *readout = readouts->data[k]; // The readout
    759                 psTrace(__func__, 8, "row0: %d\n", readout->row0);
     726                psTrace(__func__, 6, "Readout %d:\n", k);
     727                psTrace(__func__, 7, "row0: %d\n", readout->row0);
     728                psTrace(__func__, 7, "col0: %d\n", readout->col0);
    760729                psImage *image = readout->image; // The image
    761730                psList *bias = readout->bias; // The list of bias images
    762731                if (image) {
    763                     psTrace(__func__, 8, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 +
     732                    psTrace(__func__, 7, "Image: [%d:%d,%d:%d] (%dx%d)\n", image->col0, image->col0 +
    764733                            image->numCols, image->row0, image->row0 + image->numRows, image->numCols,
    765734                            image->numRows);
     
    769738                    psImage *biasImage = NULL; // Bias image from iteration
    770739                    while ((biasImage = psListGetAndIncrement(biasIter))) {
    771                         psTrace(__func__, 8, "Bias:  [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0,
     740                        psTrace(__func__, 7, "Bias:  [%d:%d,%d:%d] (%dx%d)\n", biasImage->col0,
    772741                                biasImage->col0 + biasImage->numCols, biasImage->row0,
    773742                                biasImage->row0 + biasImage->numRows, biasImage->numCols, biasImage->numRows);
Note: See TracChangeset for help on using the changeset viewer.