IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18137


Ignore:
Timestamp:
Jun 13, 2008, 4:16:47 PM (18 years ago)
Author:
eugene
Message:

supplying db handle to concept loading functions

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080613/psModules/src/camera/pmFPAHeader.c

    r18136 r18137  
    1717//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    1818
    19 bool pmCellReadHeader(pmCell *cell, psFits *fits, pmConfig *config)
     19bool pmCellReadHeader(pmCell *cell, psFits *fits, psDB *db)
    2020{
    2121    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    2323
    2424    if (!cell->hdu) {
    25         return pmChipReadHeader(cell->parent, fits);
     25        return pmChipReadHeader(cell->parent, fits, db);
    2626    }
    2727    if (!pmHDUReadHeader(cell->hdu, fits)) {
     
    3030    }
    3131
    32     return pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, false, config->database);
     32    return pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, false, db);
    3333}
    3434
    3535
    36 bool pmChipReadHeader(pmChip *chip, psFits *fits, pmConfig *config)
     36bool pmChipReadHeader(pmChip *chip, psFits *fits, psDB *db)
    3737{
    3838    PS_ASSERT_PTR_NON_NULL(chip, false);
     
    4040
    4141    if (!chip->hdu) {
    42         return pmFPAReadHeader(chip->parent, fits);
     42        return pmFPAReadHeader(chip->parent, fits, db);
    4343    }
    4444    if (!pmHDUReadHeader(chip->hdu, fits)) {
     
    4747    }
    4848
    49     if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, true, config->database)) {
     49    if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, true, db)) {
    5050        psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for chip.\n");
    5151        return false;
     
    5656
    5757
    58 bool pmFPAReadHeader(pmFPA *fpa, psFits *fits, pmConfig *config)
     58bool pmFPAReadHeader(pmFPA *fpa, psFits *fits, psDB *db)
    5959{
    6060    PS_ASSERT_PTR_NON_NULL(fpa, false);
     
    6969    }
    7070
    71     if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, config->database)) {
     71    if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, db)) {
    7272        psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for FPA.\n");
    7373        return false;
  • branches/eam_branch_20080613/psModules/src/camera/pmFPAHeader.h

    r18136 r18137  
    44 *  @author Paul Price, IfA
    55 *
    6  *  @version $Revision: 1.3.42.1 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-06-14 01:52:05 $
     6 *  @version $Revision: 1.3.42.2 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-06-14 02:14:35 $
    88 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2121bool pmFPAReadHeader(pmFPA *fpa,        ///< FPA for which to read header
    2222                     psFits *fits,       ///< FITS file handle
    23                      pmConfig *config
     23                     psDB *db
    2424                    );
    2525
     
    3030bool pmChipReadHeader(pmChip *chip,     ///< Chip for which to read header
    3131                      psFits *fits,      ///< FITS file handle
    32                      pmConfig *config
     32                     psDB *db
    3333                     );
    3434
     
    3939bool pmCellReadHeader(pmCell *cell,     ///< Cell for which to read header
    4040                      psFits *fits,      ///< FITS file handle
    41                      pmConfig *config
     41                     psDB *db
    4242                     );
    4343/// @}
  • branches/eam_branch_20080613/psModules/src/camera/pmFPARead.c

    r18030 r18137  
    8181// In the process, reads the header and concepts
    8282static bool cellNumReadouts(pmCell *cell,    // Cell of interest
    83                             psFits *fits     // FITS file
     83                            psFits *fits,    // FITS file
     84                            psDB *db
    8485    )
    8586{
     
    9394        return false;
    9495    }
    95     if (!pmCellReadHeader(cell, fits)) {
     96    if (!pmCellReadHeader(cell, fits, db)) {
    9697        psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
    9798        return false;
     
    228229        return false;
    229230    }
    230     int naxis3 = cellNumReadouts(cell, fits); // Number of planes
     231    int naxis3 = cellNumReadouts(cell, fits, db); // Number of planes
    231232    if (z >= naxis3) {
    232233        // No more to read
     
    415416    }
    416417
    417     int naxis3 = cellNumReadouts(cell, fits); // Number of image planes
     418    int naxis3 = cellNumReadouts(cell, fits, db); // Number of image planes
    418419    if (z >= naxis3) {
    419420        psError(PS_ERR_IO, false, "Desired image plane (%d) exceeds available number (%d).",
     
    719720// pmReadoutReadNext is maintained here (for now) to maintain backwards compatibility.
    720721// pmReadoutReadNext has been replaced by pmReadoutRead, pmReadoutReadChunk, pmReadoutMore
    721 bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans)
     722bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
    722723{
    723724    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    740741    }
    741742
    742     if (!pmCellReadHeader(cell, fits)) {
     743    if (!pmCellReadHeader(cell, fits, db)) {
    743744        psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
    744745        return false;
     
    921922}
    922923
    923 int pmCellNumReadouts(pmCell *cell, psFits *fits)
     924int pmCellNumReadouts(pmCell *cell, psFits *fits, psDB *db)
    924925{
    925926    PS_ASSERT_PTR_NON_NULL(cell, false);
    926927    PS_ASSERT_FITS_NON_NULL(fits, false);
    927928
    928     return cellNumReadouts(cell, fits);
     929    return cellNumReadouts(cell, fits, db);
    929930}
    930931
  • branches/eam_branch_20080613/psModules/src/camera/pmFPARead.h

    r18030 r18137  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-06-09 22:59:02 $
     6 * @version $Revision: 1.13.2.1 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-06-14 02:14:35 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    5656                       psFits *fits,    // FITS file from which to read
    5757                       int z,           // Readout number/plane; zero-offset indexing
    58                        int numRows      // The number of rows to read
     58                       int numRows,      // The number of rows to read
     59                       psDB *db
    5960                      );
    6061
     
    6263///
    6364/// This function is type-independent (doesn't matter if you are interested in the image/mask/weight).
    64 int pmCellNumReadouts(pmCell *cell, psFits *fits);
     65int pmCellNumReadouts(pmCell *cell, psFits *fits, psDB *db);
    6566
    6667/// Read an entire cell
  • trunk/ppStats/src/ppStatsCell.c

    r14149 r18137  
    4949        // extract from existing headers
    5050        if (cell->hdu) {
    51             if (fits && !pmCellReadHeader(cell, fits)) {
     51            if (fits && !pmCellReadHeader(cell, fits, config->database)) {
    5252                psError (PS_ERR_IO, false, "trouble reading cell header\n");
    5353                psFree(cellResults);
     
    6565    // Extract Concept values
    6666    if (psListLength(data->concepts) > 0) {
    67         if (fits && cell->hdu && !pmCellReadHeader(cell, fits)) {
     67        if (fits && cell->hdu && !pmCellReadHeader(cell, fits, config->database)) {
    6868            psError (PS_ERR_IO, false, "trouble reading cell header\n");
    6969            psFree(cellResults);
  • trunk/ppStats/src/ppStatsChip.c

    r14561 r18137  
    3838        // extract from existing headers
    3939        if (chip->hdu) {
    40             if (fits && !pmChipReadHeader(chip, fits)) {
     40            if (fits && !pmChipReadHeader(chip, fits, config->database)) {
    4141                psError (PS_ERR_IO, false, "trouble reading chip header\n");
    4242                psFree(chipResults);
     
    5454    // Extract Concept values
    5555    if (psListLength(data->concepts) > 0) {
    56         if (fits && chip->hdu && !pmChipReadHeader(chip, fits)) {
     56        if (fits && chip->hdu && !pmChipReadHeader(chip, fits, config->database)) {
    5757            psError (PS_ERR_IO, false, "trouble reading chip header\n");
    5858            psFree(chipResults);
  • trunk/ppStats/src/ppStatsLoop.c

    r14003 r18137  
    2121    // Iterate through the FPA
    2222    if (psListLength(data->headers) > 0 && fpa->hdu) {
    23         if (fits && !pmFPAReadHeader(fpa, fits)) {
     23        if (fits && !pmFPAReadHeader(fpa, fits, config->database)) {
    2424            psError(PS_ERR_IO, false, "Unable to read header for FPA.");
    2525            psFree(view);
     
    3232    }
    3333    if (psListLength(data->concepts) > 0) {
    34         if (fits && fpa->hdu && !pmFPAReadHeader(fpa, fits)) {
     34        if (fits && fpa->hdu && !pmFPAReadHeader(fpa, fits, config->database)) {
    3535            psError(PS_ERR_IO, false, "Unable to read header for FPA.");
    3636            psFree(view);
  • trunk/psModules/src/camera/pmFPAHeader.c

    r18031 r18137  
    1717//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    1818
    19 bool pmCellReadHeader(pmCell *cell, psFits *fits)
     19bool pmCellReadHeader(pmCell *cell, psFits *fits, psDB *db)
    2020{
    2121    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    2323
    2424    if (!cell->hdu) {
    25         return pmChipReadHeader(cell->parent, fits);
     25        return pmChipReadHeader(cell->parent, fits, db);
    2626    }
    2727    if (!pmHDUReadHeader(cell->hdu, fits)) {
     
    3030    }
    3131
    32     return pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, false, NULL);
     32    return pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, false, db);
    3333}
    3434
    3535
    36 bool pmChipReadHeader(pmChip *chip, psFits *fits)
     36bool pmChipReadHeader(pmChip *chip, psFits *fits, psDB *db)
    3737{
    3838    PS_ASSERT_PTR_NON_NULL(chip, false);
     
    4040
    4141    if (!chip->hdu) {
    42         return pmFPAReadHeader(chip->parent, fits);
     42        return pmFPAReadHeader(chip->parent, fits, db);
    4343    }
    4444    if (!pmHDUReadHeader(chip->hdu, fits)) {
     
    4747    }
    4848
    49     if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, true, NULL)) {
     49    if (!pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, true, db)) {
    5050        psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for chip.\n");
    5151        return false;
     
    5656
    5757
    58 bool pmFPAReadHeader(pmFPA *fpa, psFits *fits)
     58bool pmFPAReadHeader(pmFPA *fpa, psFits *fits, psDB *db)
    5959{
    6060    PS_ASSERT_PTR_NON_NULL(fpa, false);
     
    6969    }
    7070
    71     if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, NULL)) {
     71    if (!pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, db)) {
    7272        psError(PS_ERR_UNKNOWN, false, "Unable to read concepts for FPA.\n");
    7373        return false;
  • trunk/psModules/src/camera/pmFPAHeader.h

    r11253 r18137  
    44 *  @author Paul Price, IfA
    55 *
    6  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2007-01-24 02:54:14 $
     6 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-06-14 02:15:05 $
    88 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2020/// was already there.  No iteration to lower levels is performed.
    2121bool pmFPAReadHeader(pmFPA *fpa,        ///< FPA for which to read header
    22                      psFits *fits       ///< FITS file handle
     22                     psFits *fits,       ///< FITS file handle
     23                     psDB *db
    2324                    );
    2425
     
    2829/// was already there.  No iteration to lower levels is performed.
    2930bool pmChipReadHeader(pmChip *chip,     ///< Chip for which to read header
    30                       psFits *fits      ///< FITS file handle
     31                      psFits *fits,      ///< FITS file handle
     32                     psDB *db
    3133                     );
    3234
     
    3638/// was already there.  No iteration to lower levels is performed.
    3739bool pmCellReadHeader(pmCell *cell,     ///< Cell for which to read header
    38                       psFits *fits      ///< FITS file handle
     40                      psFits *fits,      ///< FITS file handle
     41                     psDB *db
    3942                     );
    4043/// @}
  • trunk/psModules/src/camera/pmFPARead.c

    r18030 r18137  
    8181// In the process, reads the header and concepts
    8282static bool cellNumReadouts(pmCell *cell,    // Cell of interest
    83                             psFits *fits     // FITS file
     83                            psFits *fits,    // FITS file
     84                            psDB *db
    8485    )
    8586{
     
    9394        return false;
    9495    }
    95     if (!pmCellReadHeader(cell, fits)) {
     96    if (!pmCellReadHeader(cell, fits, db)) {
    9697        psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
    9798        return false;
     
    228229        return false;
    229230    }
    230     int naxis3 = cellNumReadouts(cell, fits); // Number of planes
     231    int naxis3 = cellNumReadouts(cell, fits, db); // Number of planes
    231232    if (z >= naxis3) {
    232233        // No more to read
     
    415416    }
    416417
    417     int naxis3 = cellNumReadouts(cell, fits); // Number of image planes
     418    int naxis3 = cellNumReadouts(cell, fits, db); // Number of image planes
    418419    if (z >= naxis3) {
    419420        psError(PS_ERR_IO, false, "Desired image plane (%d) exceeds available number (%d).",
     
    719720// pmReadoutReadNext is maintained here (for now) to maintain backwards compatibility.
    720721// pmReadoutReadNext has been replaced by pmReadoutRead, pmReadoutReadChunk, pmReadoutMore
    721 bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans)
     722bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, psDB *db)
    722723{
    723724    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    740741    }
    741742
    742     if (!pmCellReadHeader(cell, fits)) {
     743    if (!pmCellReadHeader(cell, fits, db)) {
    743744        psError(PS_ERR_IO, false, "Unable to read header for cell!\n");
    744745        return false;
     
    921922}
    922923
    923 int pmCellNumReadouts(pmCell *cell, psFits *fits)
     924int pmCellNumReadouts(pmCell *cell, psFits *fits, psDB *db)
    924925{
    925926    PS_ASSERT_PTR_NON_NULL(cell, false);
    926927    PS_ASSERT_FITS_NON_NULL(fits, false);
    927928
    928     return cellNumReadouts(cell, fits);
     929    return cellNumReadouts(cell, fits, db);
    929930}
    930931
  • trunk/psModules/src/camera/pmFPARead.h

    r18030 r18137  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2008-06-09 22:59:02 $
     6 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2008-06-14 02:15:05 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    5656                       psFits *fits,    // FITS file from which to read
    5757                       int z,           // Readout number/plane; zero-offset indexing
    58                        int numRows      // The number of rows to read
     58                       int numRows,      // The number of rows to read
     59                       psDB *db
    5960                      );
    6061
     
    6263///
    6364/// This function is type-independent (doesn't matter if you are interested in the image/mask/weight).
    64 int pmCellNumReadouts(pmCell *cell, psFits *fits);
     65int pmCellNumReadouts(pmCell *cell, psFits *fits, psDB *db);
    6566
    6667/// Read an entire cell
Note: See TracChangeset for help on using the changeset viewer.