IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2006, 3:24:14 PM (20 years ago)
Author:
Paul Price
Message:

ppImage now working again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageLoop.c

    r6396 r6747  
    11#include <stdio.h>
    22#include "pslib.h"
    3 #include "pmFPA.h"
    4 #include "pmFPARead.h"
    5 #include "pmChipMosaic.h"
    6 #include "pmFPAWrite.h"
     3#include "psmodules.h"
    74#include "ppImageDetrend.h"
    85#include "ppImage.h"
     
    1310// Read the entire FPA
    1411void readFPA(ppFile *file,              // File to read
    15              ppConfig *config           // Configuration, containing the DB handle
     12             pmConfig *config           // Configuration, containing the DB handle
    1613    )
    1714{
    1815    if (file->fpa && file->fits) {
    19         if (! pmFPARead(file->fpa, file->fits, file->phu, config->database)) {
    20             psErrorStackPrint(stderr, "Unable to populate camera from input FITS file\n");
    21             exit(EXIT_FAILURE);
    22         }
     16        pmFPARead(file->fpa, file->fits, config->database);
    2317    }
    2418}
     
    2620// Read a specified chip only
    2721void readChip(ppFile *file,             // File to read
    28               ppConfig *config,         // Configuration
     22              pmConfig *config,         // Configuration
    2923              int chipNum               // Chip number to read
    3024    )
    3125{
    32     pmFPASelectChip(file->fpa, chipNum);
    33     readFPA(file, config);
     26    pmFPA *fpa = file->fpa;             // The FPA
     27    if (fpa && file->fits) {
     28        pmChip *chip = fpa->chips->data[chipNum]; // The chip
     29        pmChipRead(chip, file->fits, config->database);
     30    }
    3431}
    3532
    3633
    37 void readCell(ppFile *file, ppConfig *config, int chipNum, int cellNum)
     34void readCell(ppFile *file, pmConfig *config, int chipNum, int cellNum)
    3835{
    39     pmChip *chip = file->fpa->chips->data[chipNum];
    40     pmChipSelectCell(chip, cellNum);
    41     readFPA(file, config);
     36    pmFPA *fpa = file->fpa;             // The FPA
     37    if (fpa && file->fits) {
     38        pmChip *chip = fpa->chips->data[chipNum]; // The chip
     39        if (chip) {
     40            pmCell *cell = chip->cells->data[cellNum]; // The cell
     41            pmCellRead(cell, file->fits, config->database);
     42        }
     43    }
    4244}
    4345
    4446
    45 bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config)
     47bool ppImageLoop(ppImageData *data, ppImageOptions *options, pmConfig *config)
    4648{
    4749    ppImageDetrend detrend;
     
    108110        }
    109111
     112#if 0
    110113        int numMosaicked = pmChipMosaic(inputChip, 1, 1); // Number of cells mosaicked together
    111114        psLogMsg(__func__, PS_LOG_INFO, "%d cells mosaicked.\n", numMosaicked);
    112 
    113         // XXX EAM: Photometry goes here!
    114115
    115116        // XXX A kludge to get the write to behave w.r.t. the concepts --- we've changed the camera format, so
     
    117118        const psMetadata *camera = data->input->fpa->camera;
    118119        data->input->fpa->camera = NULL;
    119         pmFPAWrite(data->output, data->input->fpa, config->database);
     120#endif
     121
     122        // XXX Photometry goes here!
     123
     124        pmChipWrite(inputChip, data->output, config->database);
     125
     126#if 0
    120127        data->input->fpa->camera = camera;
     128#endif
    121129
    122130        // Now I can blow away the mosaic so I can then read more.
Note: See TracChangeset for help on using the changeset viewer.