IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2008, 1:00:32 PM (18 years ago)
Author:
Paul Price
Message:

Read functions for readouts need to take a database handle so they can read the concepts.

File:
1 edited

Legend:

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

    r18026 r18030  
    9797        return false;
    9898    }
    99     if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS |
    100                             PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE, true, NULL)) {
     99    if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS, true, NULL)) {
    101100        psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");
    102101        return false;
     
    142141                                  pmReadout *readout, // Readout of interest
    143142                                  int numScans, // Number of scans to read at a time
    144                                   fpaReadType type // Type of image
     143                                  fpaReadType type, // Type of image
     144                                  psDB *db // Database handle for concepts
    145145    )
    146146{
     
    151151    psImage *image = *readoutImageByType(readout, type); // Appropriate image from readout
    152152
     153    if (!pmConceptsReadCell(readout->parent, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE,
     154                            true, db)) {
     155        psError(PS_ERR_IO, false, "Failed to read concepts for cell.");
     156        return false;
     157    }
    153158    // Header and concepts have been read by a call to cellNumReadouts(), so we can just assume they're there.
    154159
     
    202207                        int z,          // Plane number
    203208                        int numScans,   // Number of scans to read at a time
    204                         fpaReadType type // Type of image
     209                        fpaReadType type, // Type of image
     210                        psDB *db        // Database handle for concepts
    205211    )
    206212{
     
    230236    int next;                           // Next position
    231237    int last;                           // Last position
    232     if (!readoutScanProperties(&next, &last, readout, numScans, type)) {
     238    if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {
    233239        psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties.");
    234240        return false;
     
    387393                             int numScans, // Number of scans (row or col depends on CELL.READDIR); 0 for all
    388394                             int overlap, // Number of scans (row/col) to overlap between scans
    389                              fpaReadType type // Type of image
     395                             fpaReadType type, // Type of image
     396                             psDB *db   // Database handle for concepts
    390397    )
    391398{
     
    417424    int next;                           // Next position
    418425    int last;                           // Last position
    419     if (!readoutScanProperties(&next, &last, readout, numScans, type)) {
     426    if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {
    420427        psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties.");
    421428        return false;
     
    888895
    889896
    890 bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans)
     897bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
    891898{
    892899    PS_ASSERT_PTR_NON_NULL(readout, false);
    893900    PS_ASSERT_FITS_NON_NULL(fits, false);
    894901
    895     return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE);
    896 }
    897 
    898 bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap)
     902    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, db);
     903}
     904
     905bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
    899906{
    900907    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    903910    PS_ASSERT_INT_NONNEGATIVE(numScans, false);
    904911
    905     return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE);
    906 }
    907 
    908 bool pmReadoutRead(pmReadout *readout, psFits *fits, int z)
     912    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, db);
     913}
     914
     915bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, psDB *db)
    909916{
    910917    PS_ASSERT_PTR_NON_NULL(readout, false);
    911918    PS_ASSERT_FITS_NON_NULL(fits, false);
    912919
    913     return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE);
     920    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, db);
    914921}
    915922
     
    951958//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    952959
    953 bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans)
     960bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
    954961{
    955962    PS_ASSERT_PTR_NON_NULL(readout, false);
    956963    PS_ASSERT_FITS_NON_NULL(fits, false);
    957964
    958     return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK);
    959 }
    960 
    961 bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap)
     965    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, db);
     966}
     967
     968bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
    962969{
    963970    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    966973    PS_ASSERT_INT_NONNEGATIVE(numScans, false);
    967974
    968     return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK);
    969 }
    970 
    971 bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z)
     975    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, db);
     976}
     977
     978bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, psDB *db)
    972979{
    973980    PS_ASSERT_PTR_NON_NULL(readout, false);
    974981    PS_ASSERT_FITS_NON_NULL(fits, false);
    975982
    976     return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK);
     983    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, db);
    977984}
    978985
     
    10051012//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    10061013
    1007 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans)
     1014bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
    10081015{
    10091016    PS_ASSERT_PTR_NON_NULL(readout, false);
    10101017    PS_ASSERT_FITS_NON_NULL(fits, false);
    10111018
    1012     return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT);
    1013 }
    1014 
    1015 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap)
     1019    return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, db);
     1020}
     1021
     1022bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db)
    10161023{
    10171024    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    10201027    PS_ASSERT_INT_NONNEGATIVE(numScans, false);
    10211028
    1022     return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT);
    1023 }
    1024 
    1025 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z)
     1029    return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, db);
     1030}
     1031
     1032bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, psDB *db)
    10261033{
    10271034    PS_ASSERT_PTR_NON_NULL(readout, false);
    10281035    PS_ASSERT_FITS_NON_NULL(fits, false);
    10291036
    1030     return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT);
     1037    return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, db);
    10311038}
    10321039
Note: See TracChangeset for help on using the changeset viewer.