IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12629


Ignore:
Timestamp:
Mar 28, 2007, 9:17:36 AM (19 years ago)
Author:
magnier
Message:

add option to force deep copy

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

Legend:

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

    r12589 r12629  
    990990// the mosaic image.
    991991
    992 bool pmChipMosaic(pmChip *target, const pmChip *source)
     992bool pmChipMosaic(pmChip *target, const pmChip *source, bool deepCopy)
    993993{
    994994    // Target exists, and has only a single cell
     
    10121012    psRegion *chipRegion = NULL;        // Region on the HDU that corresponds to the chip
    10131013    int xBin = 0, yBin = 0;             // Binning for the chip mosaic
    1014     if ((chipRegion = niceChip(&xBin, &yBin, source))) {
     1014    if (!deepCopy && (chipRegion = niceChip(&xBin, &yBin, source))) {
    10151015        // Case 1 --- we need only cut out the region
    10161016        psTrace("psModules.camera", 1, "Case 1 mosaicking: simple cut-out.\n");
     
    10471047            return false;
    10481048        }
    1049         chipRegion = psRegionAlloc(NAN, NAN, NAN, NAN); // We've cut and paste, so there's no valid trimsec
     1049        chipRegion = psRegionAlloc(0, 0, 0, 0); // We've cut and paste, so there's no valid trimsec
     1050        *chipRegion = psRegionForImage (mosaicImage, *chipRegion);
    10501051    }
    10511052    psTrace("psModules.camera", 1, "xBin,yBin: %d,%d\n", xBin, yBin);
     
    11051106
    11061107
    1107 bool pmFPAMosaic(pmFPA *target, const pmFPA *source)
     1108bool pmFPAMosaic(pmFPA *target, const pmFPA *source, bool deepCopy)
    11081109{
    11091110    // Target exists, and has only a single chip with single cell
     
    11331134    psRegion *fpaRegion = NULL;         // Region on the HDU that corresponds to the FPA
    11341135    int xBin = 0, yBin = 0;             // Binning for the FPA mosaic
    1135     if ((fpaRegion = niceFPA(&xBin, &yBin, source))) {
     1136    if (!deepCopy && (fpaRegion = niceFPA(&xBin, &yBin, source))) {
    11361137        // Case 1 --- we need only cut out the region
    11371138        psTrace("psModules.camera", 1, "Case 1 mosaicking: simple cut-out.\n");
  • trunk/psModules/src/camera/pmFPAMosaic.h

    r11253 r12629  
    44 * @author Paul Price, IfA
    55 *
    6  * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-01-24 02:54:14 $
     6 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     7 * @date $Date: 2007-03-28 19:17:36 $
    88 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2424/// the pixels, if possible.
    2525bool pmChipMosaic(pmChip *target,       ///< Target chip --- may contain only a single cell
    26                   const pmChip *source  ///< Source chip whose cells will be mosaicked
    27                  );
     26                  const pmChip *source,  ///< Source chip whose cells will be mosaicked
     27                  bool deepCopy         ///< require a deep copy (disregard 'nice' chip)
     28    );
    2829
    2930/// Mosaic all cells within an FPA
     
    3334/// CELL.X0 and CELL.Y0 offsets.  This is useful for getting an image of the FPA on the sky.  The mosaicking
    3435/// is done so as to avoid performing a deep copy of the pixels, if possible.
    35 bool pmFPAMosaic(pmFPA *target,         ///< Target FPA --- may contain only a single chip with a single cell
    36                  const pmFPA *source    ///< FPA whose chips and cells will be mosaicked
    37                 );
     36bool pmFPAMosaic(pmFPA *target, ///< Target FPA --- may contain only a single chip with a single cell
     37                 const pmFPA *source,   ///< FPA whose chips and cells will be mosaicked
     38                 bool deepCopy          ///< require a deep copy (disregard 'nice' chip)
     39                );                      //
    3840/// @}
    3941#endif
Note: See TracChangeset for help on using the changeset viewer.