IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2006, 11:47:06 PM (21 years ago)
Author:
Paul Price
Message:

Readouts now contain a subimage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_p0/psModules/src/astrom/pmFPARead.c

    r6077 r6080  
    11#include <stdio.h>
    22#include <strings.h>
     3#include <assert.h>
    34#include "pslib.h"
    45
     
    105106{
    106107    psArray *images = hdu->images;      // Array of images (each of which is a readout)
    107     psArray *masks = hdu->masks;        // Array of masks (one for each readout)
     108
     109    psRegion *trimsec = psMetadataLookupPtr(NULL, cell->concepts, "CELL.TRIMSEC");
     110    psList *biassecs = psMetadataLookupPtr(NULL, cell->concepts, "CELL.BIASSEC");
     111
    108112    // Iterate over each of the image planes
    109113    for (int i = 0; i < images->n; i++) {
    110114        psImage *image = images->data[i]; // The i-th plane
    111         psImage *mask = NULL;           // The mask
    112         if (masks) {
    113             mask = masks->data[i];
    114         }
    115 
    116115        pmReadout *readout = pmReadoutAlloc(cell);
    117         readout->image = image;
    118         readout->mask = mask;
    119         psFree(readout);
     116
     117        readout->image = psImageSubset(image, *trimsec); // The image corresponding to the trim region
     118
     119        // Get the list of overscans
     120        psListIterator *iter = psListIteratorAlloc(biassecs, PS_LIST_HEAD, false); // Iterator
     121        psRegion *biassec = NULL;       // A BIASSEC region from the list
     122        while ((biassec = psListGetAndIncrement(iter))) {
     123            psImage *overscan = psImageSubset(image, *biassec);
     124            psListAdd(readout->bias, PS_LIST_TAIL, overscan);
     125            psFree(overscan);
     126        }
     127        psFree(iter);
     128
     129        readout->mask = NULL;
     130        readout->weight = NULL;
     131
     132        psFree(readout);                // Drop reference
    120133    }
    121134
     
    164177        pmChip *chip = chips->data[i]; // The chip
    165178
    166         // Only read chips marked to "process"
    167         if (! chip->process) {
     179        // Only read chips marked to "read"
     180        if (! chip->process || chip->exists) {
    168181            psTrace(__func__, 2, "Ignoring chip %d...\n", i);
    169182            continue;
     
    187200            pmCell *cell = cells->data[j]; // The cell
    188201
    189             // Only read cells marked to "process"
    190             if (! cell->process) {
     202            // Only read cells marked to "read"
     203            if (! cell->process || cell->exists) {
    191204                psTrace(__func__, 3, "Ignoring chip %d...\n", i);
    192205                continue;
     
    400413    for (int chipNum = 0; chipNum < chips->n; chipNum++) {
    401414        pmChip *chip = chips->data[chipNum]; // The current chip of interest
    402         if (chip->process) {
     415        if (chip->process && !chip->exists) {
    403416            if (chip->hdu) {
    404417                hdu = chip->hdu;
     
    407420            for (int cellNum = 0; cellNum < cells->n; cellNum++) {
    408421                pmCell *cell = cells->data[cellNum]; // The current cell of interest
    409                 if (cell->process) {
     422                if (cell->process && !cell->exists) {
    410423                    if (cell->hdu) {
    411424                        hdu = cell->hdu;
     
    538551    for (int chipNum = 0; chipNum < chips->n; chipNum++) {
    539552        pmChip *chip = chips->data[chipNum]; // The current chip of interest
    540         if (chip->process) {
     553        if (chip->process && !chip->exists) {
    541554            if (chip->hdu) {
    542555                hdu = chip->hdu;
     
    545558            for (int cellNum = 0; cellNum < cells->n; cellNum++) {
    546559                pmCell *cell = cells->data[cellNum]; // The current cell of interest
    547                 if (cell->process) {
     560                if (cell->process && !cell->exists) {
    548561                    if (cell->hdu) {
    549562                        hdu = cell->hdu;
Note: See TracChangeset for help on using the changeset viewer.