Changeset 9589
- Timestamp:
- Oct 16, 2006, 3:16:17 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPACopy.c (modified) (15 diffs)
-
pmFPACopy.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPACopy.c
r8848 r9589 22 22 // Bin a region down by specified factors in x and y 23 23 static void binRegion(psRegion *region, // Region to be binned 24 int xBin, int yBin // Binning in x and y24 int xBin, int yBin // Binning in x and y 25 25 ) 26 26 { … … 38 38 39 39 // Find the blank (image-less) PHU, given a cell. 40 static pmHDU *findBlankPHU(const pmCell *cell // The cell for which to find the PHU40 static pmHDU *findBlankPHU(const pmCell *cell // The cell for which to find the PHU 41 41 ) 42 42 { … … 63 63 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 64 64 65 // Common engine for pmCellCopy and pmCellCopyStructure 66 // Does the actual splitting/splicing that's required to copy an FPA to a different representation. 65 67 static bool cellCopy(pmCell *target, // The target cell 66 pmCell *source,// The source cell, to be copied68 const pmCell *source, // The source cell, to be copied 67 69 bool pixels, // Copy the pixels? 68 70 int xBin, int yBin // (Relative) binning factors in x and y … … 249 251 psTrace("psModules.camera", 3, "CELL.X0: Before: %d After: %d\n", xZero, 250 252 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); 252 255 xZero -= (readout->image->numCols - 1) * xParity * xBin; // Change the parity on the X0 position 253 256 psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.X0"); // CELL.X0 from target … … 261 264 psTrace("psModules.camera", 3, "CELL.Y0: Before: %d After: %d\n", yZero, 262 265 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); 264 268 yZero -= (readout->image->numRows - 1) * yParity * yBin; // Change the parity on the Y0 position 265 269 psMetadataItem *newItem = psMetadataLookup(target->concepts, "CELL.Y0"); // CELL.Y0 from target … … 294 298 } 295 299 300 // Common engine for pmChipCopy and pmChipCopyStructure 301 // Iterate on the components 296 302 static bool chipCopy(pmChip *target, // The target chip 297 pmChip *source,// The source chip, to be copied303 const pmChip *source, // The source chip, to be copied 298 304 bool pixels, // Copy the pixels? 299 305 int xBin, int yBin // (Relative) binning factors in x and y … … 308 314 psArray *sourceCells = source->cells; // The source cells 309 315 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", 311 318 sourceCells->n, targetCells->n); 312 319 return false; … … 331 338 } 332 339 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 342 static 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 337 346 ) 338 347 { … … 345 354 psArray *sourceChips = source->chips; // The source chips 346 355 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", 348 358 sourceChips->n, targetChips->n); 349 359 return false; … … 371 381 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 372 382 373 bool pmFPACopy(pmFPA *target, // The target FPA 374 pmFPA *source // The source FPA, to be copied 375 ) 383 bool pmFPACopy(pmFPA *target, const pmFPA *source) 376 384 { 377 385 PS_ASSERT_PTR_NON_NULL(target, false); … … 380 388 } 381 389 382 bool pmChipCopy(pmChip *target, // The target chip 383 pmChip *source // The source chip, to be copied 384 ) 390 bool pmChipCopy(pmChip *target, const pmChip *source) 385 391 { 386 392 PS_ASSERT_PTR_NON_NULL(target, false); … … 389 395 } 390 396 391 bool pmCellCopy(pmCell *target, // The target cell 392 pmCell *source // The source cell, to be copied 393 ) 397 bool pmCellCopy(pmCell *target, const pmCell *source) 394 398 { 395 399 PS_ASSERT_PTR_NON_NULL(target, false); … … 399 403 400 404 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 ) 405 bool pmFPACopyStructure(pmFPA *target, const pmFPA *source, int xBin, int yBin) 405 406 { 406 407 PS_ASSERT_PTR_NON_NULL(target, false); … … 411 412 } 412 413 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 ) 414 bool pmChipCopyStructure(pmChip *target, const pmChip *source, int xBin, int yBin) 417 415 { 418 416 PS_ASSERT_PTR_NON_NULL(target, false); … … 423 421 } 424 422 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 ) 423 bool pmCellCopyStructure(pmCell *target, const pmCell *source, int xBin, int yBin) 429 424 { 430 425 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 1 15 #ifndef PM_FPA_COPY_H 2 16 #define PM_FPA_COPY_H 3 17 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. 23 bool pmFPACopy(pmFPA *target, ///< The target FPA 24 const pmFPA *source ///< The source FPA, to be copied 7 25 ); 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. 32 bool pmChipCopy(pmChip *target, ///< The target chip 33 const pmChip *source ///< The source chip, to be copied 13 34 ); 14 35 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. 41 bool 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. 51 bool 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 19 54 ); 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. 61 bool 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 23 64 ); 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. 71 bool 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 27 74 ); 28 75
Note:
See TracChangeset
for help on using the changeset viewer.
