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.

Location:
trunk/psModules/src/camera
Files:
2 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
  • trunk/psModules/src/camera/pmFPARead.h

    r16580 r18030  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-02-22 01:20:24 $
     6 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-06-09 22:59:02 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    1919                   psFits *fits,        ///< FITS file from which to read
    2020                   int z,               ///< Readout number/plane; zero-offset indexing
    21                    int numScans         ///< Number of scans (rows/cols) to read
     21                   int numScans,        ///< Number of scans (rows/cols) to read
     22                   psDB *db             ///< Database handle for concepts
    2223    );
    2324
     
    2930                        int z,          ///< Readout number/plane; zero-offset indexing
    3031                        int numScans,   ///< Number of scans (rows/cols) to read
    31                         int overlap     ///< Overlap between consecutive reads
     32                        int overlap,    ///< Overlap between consecutive reads
     33                        psDB *db        ///< Database handle for concepts
    3234    );
    3335
     
    3537bool pmReadoutRead(pmReadout *readout,  ///< Readout of interest
    3638                   psFits *fits,        ///< FITS file from which to read
    37                    int z               ///< Readout number/plane; zero-offset indexing
     39                   int z,               ///< Readout number/plane; zero-offset indexing
     40                   psDB *db             ///< Database handle for concepts
    3841    );
    3942
     
    9295                       psFits *fits,    ///< FITS file from which to read
    9396                       int z,           ///< Readout number/plane; zero-offset indexing
    94                        int numScans     ///< Number of scans (rows/cols) to read
     97                       int numScans,    ///< Number of scans (rows/cols) to read
     98                       psDB *db         ///< Database handle for concepts
    9599    );
    96100
     
    102106                            int z,      ///< Readout number/plane; zero-offset indexing
    103107                            int numScans, ///< Number of scans (rows/cols) to read
    104                             int overlap ///< Overlap between consecutive reads
     108                            int overlap, ///< Overlap between consecutive reads
     109                            psDB *db    ///< Database handle for concepts
    105110    );
    106111
     
    108113bool pmReadoutReadMask(pmReadout *readout, ///< Readout of interest
    109114                       psFits *fits,    ///< FITS file from which to read
    110                        int z            ///< Readout number/plane; zero-offset indexing
     115                       int z,           ///< Readout number/plane; zero-offset indexing
     116                       psDB *db         ///< Database handle for concepts
    111117    );
    112118
     
    141147                         psFits *fits,  ///< FITS file from which to read
    142148                         int z,         ///< Readout number/plane; zero-offset indexing
    143                          int numScans   ///< Number of scans (rows/cols) to read
     149                         int numScans,  ///< Number of scans (rows/cols) to read
     150                         psDB *db       ///< Database handle for concepts
    144151    );
    145152
     
    151158                              int z,    ///< Readout number/plane; zero-offset indexing
    152159                              int numScans, ///< Number of scans (rows/cols) to read
    153                               int overlap ///< Overlap between consecutive reads
     160                              int overlap, ///< Overlap between consecutive reads
     161                              psDB *db  ///< Database handle for concepts
    154162    );
    155163
     
    157165bool pmReadoutReadWeight(pmReadout *readout, ///< Readout of interest
    158166                         psFits *fits,  ///< FITS file from which to read
    159                          int z          ///< Readout number/plane; zero-offset indexing
     167                         int z,         ///< Readout number/plane; zero-offset indexing
     168                         psDB *db       ///< Database handle for concepts
    160169    );
    161170
Note: See TracChangeset for help on using the changeset viewer.