IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 13, 2008, 5:19:31 PM (18 years ago)
Author:
eugene
Message:

adding database fields to APIs as needed for concepts

File:
1 edited

Legend:

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

    r17911 r18139  
    166166static bool fpaViewReadFitsImage(const pmFPAview *view, // FPA view, specifying the level of interest
    167167                                 pmFPAfile *file, // FPA file of interest
     168                                 psDB *db,
    168169                                 bool (*fpaReadFunc)(pmFPA*, psFits*, psDB*), // Function to read FPA
    169170                                 bool (*chipReadFunc)(pmChip*, psFits*, psDB*), // Function to read chip
     
    178179
    179180    if (view->chip == -1) {
    180         return fpaReadFunc(fpa, fits, NULL);
     181        return fpaReadFunc(fpa, fits, db);
    181182    }
    182183
     
    188189
    189190    if (view->cell == -1) {
    190         return chipReadFunc(chip, fits, NULL);
     191        return chipReadFunc(chip, fits, db);
    191192    }
    192193
     
    198199
    199200    if (view->readout == -1) {
    200         return cellReadFunc(cell, fits, NULL);
     201        return cellReadFunc(cell, fits, db);
    201202    }
    202203    psError(PS_ERR_UNKNOWN, true, "Bad view: %d,%d", view->chip, view->cell);
     
    214215
    215216    if (view->nRows == 0) {
    216         pmReadoutRead (readout, fits, NULL);
     217        pmReadoutRead (readout, fits, db);
    217218    } else {
    218219        pmReadoutReadSegment (readout, fits, view->nRows, view->iRows, NULL, NULL);
     
    223224
    224225
    225 bool pmFPAviewReadFitsImage(const pmFPAview *view, pmFPAfile *file)
    226 {
    227     PS_ASSERT_PTR_NON_NULL(view, false);
    228     PS_ASSERT_PTR_NON_NULL(file, false);
    229     return fpaViewReadFitsImage(view, file, pmFPARead, pmChipRead, pmCellRead);
    230 }
    231 
    232 bool pmFPAviewReadFitsMask(const pmFPAview *view, pmFPAfile *file)
    233 {
    234     PS_ASSERT_PTR_NON_NULL(view, false);
    235     PS_ASSERT_PTR_NON_NULL(file, false);
    236     return fpaViewReadFitsImage(view, file, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
    237 }
    238 
    239 bool pmFPAviewReadFitsWeight(const pmFPAview *view, pmFPAfile *file)
    240 {
    241     PS_ASSERT_PTR_NON_NULL(view, false);
    242     PS_ASSERT_PTR_NON_NULL(file, false);
    243     return fpaViewReadFitsImage(view, file, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
    244 }
    245 
    246 bool pmFPAviewReadFitsDark(const pmFPAview *view, pmFPAfile *file)
    247 {
    248     PS_ASSERT_PTR_NON_NULL(view, false);
    249     PS_ASSERT_PTR_NON_NULL(file, false);
    250     return fpaViewReadFitsImage(view, file, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
    251 }
    252 
    253 bool pmFPAviewReadFitsHeaderSet(const pmFPAview *view, pmFPAfile *file)
    254 {
    255     PS_ASSERT_PTR_NON_NULL(view, false);
    256     PS_ASSERT_PTR_NON_NULL(file, false);
    257     return fpaViewReadFitsImage(view, file, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
     226bool pmFPAviewReadFitsImage(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
     227{
     228    PS_ASSERT_PTR_NON_NULL(view, false);
     229    PS_ASSERT_PTR_NON_NULL(file, false);
     230    return fpaViewReadFitsImage(view, file, config->database, pmFPARead, pmChipRead, pmCellRead);
     231}
     232
     233bool pmFPAviewReadFitsMask(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
     234{
     235    PS_ASSERT_PTR_NON_NULL(view, false);
     236    PS_ASSERT_PTR_NON_NULL(file, false);
     237    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadMask, pmChipReadMask, pmCellReadMask);
     238}
     239
     240bool pmFPAviewReadFitsWeight(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
     241{
     242    PS_ASSERT_PTR_NON_NULL(view, false);
     243    PS_ASSERT_PTR_NON_NULL(file, false);
     244    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadWeight, pmChipReadWeight, pmCellReadWeight);
     245}
     246
     247bool pmFPAviewReadFitsDark(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
     248{
     249    PS_ASSERT_PTR_NON_NULL(view, false);
     250    PS_ASSERT_PTR_NON_NULL(file, false);
     251    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadDark, pmChipReadDark, pmCellReadDark);
     252}
     253
     254bool pmFPAviewReadFitsHeaderSet(const pmFPAview *view, pmFPAfile *file, pmConfig *config)
     255{
     256    PS_ASSERT_PTR_NON_NULL(view, false);
     257    PS_ASSERT_PTR_NON_NULL(file, false);
     258    return fpaViewReadFitsImage(view, file, config->database, pmFPAReadHeaderSet, pmChipReadHeaderSet, pmCellReadHeaderSet);
    258259}
    259260
Note: See TracChangeset for help on using the changeset viewer.