IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9589


Ignore:
Timestamp:
Oct 16, 2006, 3:16:17 PM (20 years ago)
Author:
Paul Price
Message:

Documenting pmFPACopy.[ch]. Adding const where appropriate.

Location:
trunk/psModules/src/camera
Files:
2 edited

Legend:

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

    r8848 r9589  
    2222// Bin a region down by specified factors in x and y
    2323static void binRegion(psRegion *region, // Region to be binned
    24                       int xBin, int yBin// Binning in x and y
     24                      int xBin, int yBin // Binning in x and y
    2525                     )
    2626{
     
    3838
    3939// Find the blank (image-less) PHU, given a cell.
    40 static pmHDU *findBlankPHU(const pmCell *cell// The cell for which to find the PHU
     40static pmHDU *findBlankPHU(const pmCell *cell // The cell for which to find the PHU
    4141                          )
    4242{
     
    6363//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    6464
     65// Common engine for pmCellCopy and pmCellCopyStructure
     66// Does the actual splitting/splicing that's required to copy an FPA to a different representation.
    6567static bool cellCopy(pmCell *target,     // The target cell
    66                      pmCell *source,    // The source cell, to be copied
     68                     const pmCell *source, // The source cell, to be copied
    6769                     bool pixels,        // Copy the pixels?
    6870                     int xBin, int yBin  // (Relative) binning factors in x and y
     
    249251        psTrace("psModules.camera", 3, "CELL.X0: Before: %d After: %d\n", xZero,
    250252                xZero - (readout->image->numCols - 1) * xParity * xBin);
    251         psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n", xParity, xBin, readout->image->numCols);
     253        psTrace("psModules.camera", 9, "(xParity: %d xBin: %d numCols: %d)\n",
     254                xParity, xBin, readout->image->numCols);
    252255        xZero -= (readout->image->numCols - 1) * xParity * xBin; // Change the parity on the X0 position
    253256        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target
     
    261264        psTrace("psModules.camera", 3, "CELL.Y0: Before: %d After: %d\n", yZero,
    262265                yZero - (readout->image->numRows - 1) * yParity * yBin);
    263         psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n", yParity, yBin, readout->image->numRows);
     266        psTrace("psModules.camera", 9, "(yParity: %d yBin: %d numRows: %d)\n",
     267                yParity, yBin, readout->image->numRows);
    264268        yZero -= (readout->image->numRows - 1) * yParity * yBin; // Change the parity on the Y0 position
    265269        psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target
     
    294298}
    295299
     300// Common engine for pmChipCopy and pmChipCopyStructure
     301// Iterate on the components
    296302static bool chipCopy(pmChip *target,          // The target chip
    297                      pmChip *source,          // The source chip, to be copied
     303                     const pmChip *source, // The source chip, to be copied
    298304                     bool pixels,             // Copy the pixels?
    299305                     int xBin, int yBin       // (Relative) binning factors in x and y
     
    308314    psArray *sourceCells = source->cells; // The source cells
    309315    if (targetCells->n != sourceCells->n) {
    310         psError(PS_ERR_IO, true, "Number of source cells (%ld) differs from the number of target cells (%ld)\n",
     316        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     317                "Number of source cells (%ld) differs from the number of target cells (%ld)\n",
    311318                sourceCells->n, targetCells->n);
    312319        return false;
     
    331338}
    332339
    333 static bool fpaCopy(pmFPA *target,            // The target FPA
    334                     pmFPA *source,            // The source FPA, to be copied
    335                     bool pixels,              // Copy the pixels?
    336                     int xBin, int yBin        // (Relative) binning factors in x and y
     340// Common engine for pmFPACopy and pmFPACopyStructure.
     341// Iterate on the components
     342static bool fpaCopy(pmFPA *target,      // The target FPA
     343                    const pmFPA *source, // The source FPA, to be copied
     344                    bool pixels,        // Copy the pixels?
     345                    int xBin, int yBin  // (Relative) binning factors in x and y
    337346                   )
    338347{
     
    345354    psArray *sourceChips = source->chips; // The source chips
    346355    if (targetChips->n != sourceChips->n) {
    347         psError(PS_ERR_IO, true, "Number of source chips (%ld) differs from the number of target chips (%ld)\n",
     356        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     357                "Number of source chips (%ld) differs from the number of target chips (%ld)\n",
    348358                sourceChips->n, targetChips->n);
    349359        return false;
     
    371381//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    372382
    373 bool pmFPACopy(pmFPA *target,            // The target FPA
    374                pmFPA *source             // The source FPA, to be copied
    375               )
     383bool pmFPACopy(pmFPA *target, const pmFPA *source)
    376384{
    377385    PS_ASSERT_PTR_NON_NULL(target, false);
     
    380388}
    381389
    382 bool pmChipCopy(pmChip *target,          // The target chip
    383                 pmChip *source           // The source chip, to be copied
    384                )
     390bool pmChipCopy(pmChip *target, const pmChip *source)
    385391{
    386392    PS_ASSERT_PTR_NON_NULL(target, false);
     
    389395}
    390396
    391 bool pmCellCopy(pmCell *target,          // The target cell
    392                 pmCell *source           // The source cell, to be copied
    393                )
     397bool pmCellCopy(pmCell *target, const pmCell *source)
    394398{
    395399    PS_ASSERT_PTR_NON_NULL(target, false);
     
    399403
    400404
    401 bool pmFPACopyStructure(pmFPA *target,   // The target FPA
    402                         pmFPA *source,   // The source FPA, to be copied
    403                         int xBin, int yBin // Binning factors in x and y
    404                        )
     405bool pmFPACopyStructure(pmFPA *target, const pmFPA *source, int xBin, int yBin)
    405406{
    406407    PS_ASSERT_PTR_NON_NULL(target, false);
     
    411412}
    412413
    413 bool pmChipCopyStructure(pmChip *target, // The target chip
    414                          pmChip *source, // The source chip, to be copied
    415                          int xBin, int yBin // Binning factors in x and y
    416                         )
     414bool pmChipCopyStructure(pmChip *target, const pmChip *source, int xBin, int yBin)
    417415{
    418416    PS_ASSERT_PTR_NON_NULL(target, false);
     
    423421}
    424422
    425 bool pmCellCopyStructure(pmCell *target, // The target cell
    426                          pmCell *source, // The source cell, to be copied
    427                          int xBin, int yBin // Binning factors in x and y
    428                         )
     423bool pmCellCopyStructure(pmCell *target, const pmCell *source, int xBin, int yBin)
    429424{
    430425    PS_ASSERT_PTR_NON_NULL(target, false);
  • trunk/psModules/src/camera/pmFPACopy.h

    r7278 r9589  
     1/// @file pmFPACopy.h
     2///
     3/// @brief Functions to copy FPA components.
     4///
     5/// @ingroup Camera
     6///
     7/// @author Paul Price, IfA
     8///
     9/// @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     10/// @date $Date: 2006-10-17 01:16:17 $
     11///
     12/// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
     13///
     14
    115#ifndef PM_FPA_COPY_H
    216#define PM_FPA_COPY_H
    317
    4 // Copy the FPA components, including the pixels
    5 bool pmFPACopy(pmFPA *target,            // The target FPA
    6                pmFPA *source             // The source FPA, to be copied
     18/// Copy an FPA and components, including the pixels, to a different representation of the same camera
     19///
     20/// This function is useful for converting between different representations of the same camera.  For example,
     21/// between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per
     22/// extension, spliced together).  Components are spliced together as necessary.
     23bool pmFPACopy(pmFPA *target,           ///< The target FPA
     24               const pmFPA *source      ///< The source FPA, to be copied
    725              );
    8 bool pmChipCopy(pmChip *target,          // The target chip
    9                 pmChip *source           // The source chip, to be copied
    10                );
    11 bool pmCellCopy(pmCell *target,          // The target cell
    12                 pmCell *source           // The source cell, to be copied
     26
     27/// Copy a chip and components, including the pixels, to a different representation of the same camera
     28///
     29/// This function is useful for converting between different representations of the same camera.  For example,
     30/// between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per
     31/// extension, spliced together).  Components are spliced together as necessary.
     32bool pmChipCopy(pmChip *target,         ///< The target chip
     33                const pmChip *source    ///< The source chip, to be copied
    1334               );
    1435
    15 // Versions that copy the structure and not the pixels; they also allow binning
    16 bool pmFPACopyStructure(pmFPA *target,   // The target FPA
    17                         pmFPA *source,   // The source FPA, to be copied
    18                         int xBin, int yBin     // Binning factors in x and y
     36/// Copy a cell and components, including the pixels, to a different representation of the same camera
     37///
     38/// This function is useful for converting between different representations of the same camera.  For example,
     39/// between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per
     40/// extension, spliced together).  Components are spliced together as necessary.
     41bool pmCellCopy(pmCell *target,         ///< The target cell
     42                const pmCell *source    ///< The source cell, to be copied
     43               );
     44
     45
     46/// Copy an FPA, but not the pixels, to a different representation of the same camera
     47///
     48/// This function the same as pmFPACopy, except that the pixels are not copied (though images of sufficient
     49/// size are allocated in the target).  Changes the CELL.XBIN and CELL.YBIN according to the provided binning
     50/// factors.
     51bool pmFPACopyStructure(pmFPA *target,   ///< The target FPA
     52                        const pmFPA *source, ///< The source FPA, to be copied
     53                        int xBin, int yBin ///< Binning factors in x and y
    1954                       );
    20 bool pmChipCopyStructure(pmChip *target, // The target chip
    21                          pmChip *source, // The source chip, to be copied
    22                          int xBin, int yBin   // Binning factors in x and y
     55
     56/// Copy a chip, but not the pixels, to a different representation of the same camera
     57///
     58/// This function the same as pmChipCopy, except that the pixels are not copied (though images of sufficient
     59/// size are allocated in the target).  Changes the CELL.XBIN and CELL.YBIN according to the provided binning
     60/// factors.
     61bool pmChipCopyStructure(pmChip *target, ///< The target chip
     62                         const pmChip *source, ///< The source chip, to be copied
     63                         int xBin, int yBin ///< Binning factors in x and y
    2364                        );
    24 bool pmCellCopyStructure(pmCell *target, // The target cell
    25                          pmCell *source, // The source cell, to be copied
    26                          int xBin, int yBin // Binning factors in x and y
     65
     66/// Copy a cell, but not the pixels, to a different representation of the same camera
     67///
     68/// This function the same as pmCellCopy, except that the pixels are not copied (though images of sufficient
     69/// size are allocated in the target).  Changes the CELL.XBIN and CELL.YBIN according to the provided binning
     70/// factors.
     71bool pmCellCopyStructure(pmCell *target, ///< The target cell
     72                         const pmCell *source, ///< The source cell, to be copied
     73                         int xBin, int yBin ///< Binning factors in x and y
    2774                        );
    2875
Note: See TracChangeset for help on using the changeset viewer.