IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2008, 12:16:38 PM (18 years ago)
Author:
Paul Price
Message:

Changing use of psDB* to pmConfig* so that the database handle only has to be set up when required.

File:
1 edited

Legend:

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

    r18139 r18163  
    166166static bool fpaViewReadFitsImage(const pmFPAview *view, // FPA view, specifying the level of interest
    167167                                 pmFPAfile *file, // FPA file of interest
    168                                  psDB *db,
    169                                  bool (*fpaReadFunc)(pmFPA*, psFits*, psDB*), // Function to read FPA
    170                                  bool (*chipReadFunc)(pmChip*, psFits*, psDB*), // Function to read chip
    171                                  bool (*cellReadFunc)(pmCell*, psFits*, psDB*) // Function to read cell
     168                                 pmConfig *config, // Configuration
     169                                 bool (*fpaReadFunc)(pmFPA*, psFits*, pmConfig*), // Function to read FPA
     170                                 bool (*chipReadFunc)(pmChip*, psFits*, pmConfig*), // Function to read chip
     171                                 bool (*cellReadFunc)(pmCell*, psFits*, pmConfig*) // Function to read cell
    172172                                )
    173173{
     
    179179
    180180    if (view->chip == -1) {
    181         return fpaReadFunc(fpa, fits, db);
     181        return fpaReadFunc(fpa, fits, config);
    182182    }
    183183
     
    189189
    190190    if (view->cell == -1) {
    191         return chipReadFunc(chip, fits, db);
     191        return chipReadFunc(chip, fits, config);
    192192    }
    193193
     
    199199
    200200    if (view->readout == -1) {
    201         return cellReadFunc(cell, fits, db);
     201        return cellReadFunc(cell, fits, config);
    202202    }
    203203    psError(PS_ERR_UNKNOWN, true, "Bad view: %d,%d", view->chip, view->cell);
     
    215215
    216216    if (view->nRows == 0) {
    217         pmReadoutRead (readout, fits, db);
     217        pmReadoutRead (readout, fits, config);
    218218    } else {
    219219        pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL);
     
    228228    PS_ASSERT_PTR_NON_NULL(view, false);
    229229    PS_ASSERT_PTR_NON_NULL(file, false);
    230     return fpaViewReadFitsImage(view, file, config->database, pmFPARead, pmChipRead, pmCellRead);
     230    return fpaViewReadFitsImage(view, file, config, pmFPARead, pmChipRead, pmCellRead);
    231231}
    232232
     
    235235    PS_ASSERT_PTR_NON_NULL(view, false);
    236236    PS_ASSERT_PTR_NON_NULL(file, false);
    237     return fpaViewReadFitsImage(view, file, config->database, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
     237    return fpaViewReadFitsImage(view, file, config, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
    238238}
    239239
     
    242242    PS_ASSERT_PTR_NON_NULL(view, false);
    243243    PS_ASSERT_PTR_NON_NULL(file, false);
    244     return fpaViewReadFitsImage(view, file, config->database, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
     244    return fpaViewReadFitsImage(view, file, config, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
    245245}
    246246
     
    249249    PS_ASSERT_PTR_NON_NULL(view, false);
    250250    PS_ASSERT_PTR_NON_NULL(file, false);
    251     return fpaViewReadFitsImage(view, file, config->database, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
     251    return fpaViewReadFitsImage(view, file, config, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
    252252}
    253253
     
    256256    PS_ASSERT_PTR_NON_NULL(view, false);
    257257    PS_ASSERT_PTR_NON_NULL(file, false);
    258     return fpaViewReadFitsImage(view, file, config->database, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
     258    return fpaViewReadFitsImage(view, file, config, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
    259259}
    260260
     
    267267static bool fpaViewWriteFitsImage(const pmFPAview *view, // FPA view, specifying the level of interest
    268268                                  pmFPAfile *file, // FPA file of interest
    269                                   const pmConfig *config, // Configuration
    270                                   bool (*fpaWriteFunc)(pmFPA*, psFits*, psDB*, bool, bool), // Func for FPA
    271                                   bool (*chipWriteFunc)(pmChip*, psFits*, psDB*, bool, bool), // Func for chip
    272                                   bool (*cellWriteFunc)(pmCell*, psFits*, psDB*, bool) // Func for cell
     269                                  pmConfig *config, // Configuration
     270                                  bool (*fpaWriteFunc)(pmFPA*, psFits*, pmConfig*, bool, bool), // Func FPA
     271                                  bool (*chipWriteFunc)(pmChip*, psFits*, pmConfig*, bool, bool),// Func chip
     272                                  bool (*cellWriteFunc)(pmCell*, psFits*, pmConfig*, bool) // Func cell
    273273                                 )
    274274{
     
    283283    switch (pmFPAviewLevel(view)) {
    284284    case PM_FPA_LEVEL_FPA: {
    285             bool success = fpaWriteFunc(fpa, fits, NULL, false, true);
     285            bool success = fpaWriteFunc(fpa, fits, config, false, true);
    286286            psFree(fpa);
    287287            return success;
     
    289289    case PM_FPA_LEVEL_CHIP: {
    290290            pmChip *chip = pmFPAviewThisChip(view, fpa); // Chip of interest
    291             bool success = chipWriteFunc(chip, fits, NULL, false, true);
     291            bool success = chipWriteFunc(chip, fits, config, false, true);
    292292            psFree(fpa);
    293293            return success;
     
    295295    case PM_FPA_LEVEL_CELL: {
    296296            pmCell *cell = pmFPAviewThisCell(view, fpa); // Cell of interest
    297             bool success = cellWriteFunc(cell, fits, NULL, false);
     297            bool success = cellWriteFunc(cell, fits, config, false);
    298298            psFree(fpa);
    299299            return success;
     
    327327}
    328328
    329 bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     329bool pmFPAviewWriteFitsImage(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    330330{
    331331    PS_ASSERT_PTR_NON_NULL(view, false);
     
    334334}
    335335
    336 bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     336bool pmFPAviewWriteFitsMask(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    337337{
    338338    PS_ASSERT_PTR_NON_NULL(view, false);
     
    341341}
    342342
    343 bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     343bool pmFPAviewWriteFitsWeight(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    344344{
    345345    PS_ASSERT_PTR_NON_NULL(view, false);
     
    348348}
    349349
    350 bool pmFPAviewWriteFitsDark(const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     350bool pmFPAviewWriteFitsDark(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    351351{
    352352    PS_ASSERT_PTR_NON_NULL(view, false);
Note: See TracChangeset for help on using the changeset viewer.