Changeset 9599
- Timestamp:
- Oct 16, 2006, 5:00:30 PM (20 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPARead.c (modified) (14 diffs)
-
pmFPARead.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPARead.c
r9584 r9599 16 16 17 17 #include "pmFPARead.h" 18 19 #define MAX(x,y) ((x) > (y) ? (x) : (y))20 #define MIN(x,y) ((x) < (y) ? (x) : (y))21 18 22 19 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 45 42 return false; 46 43 } 47 psRegion region = psRegionSet( MAX(trimsec->x0 - readout->col0, 0), // x048 MIN(trimsec->x1 - readout->col0, image->numCols), // x149 MAX(trimsec->y0 - readout->row0, 0), // y050 MIN(trimsec->y1 - readout->row0, image->numRows) // y144 psRegion region = psRegionSet(PS_MAX(trimsec->x0 - readout->col0, 0), // x0 45 PS_MIN(trimsec->x1 - readout->col0, image->numCols), // x1 46 PS_MAX(trimsec->y0 - readout->row0, 0), // y0 47 PS_MIN(trimsec->y1 - readout->row0, image->numRows) // y1 51 48 ); 52 49 if (readout->image) { … … 71 68 return false; 72 69 } 73 psRegion region = psRegionSet( MAX(biassec->x0 - readout->col0, 0), // x074 MIN(biassec->x1 - readout->col0, image->numCols), // x175 MAX(biassec->y0 - readout->row0, 0), // y076 MIN(biassec->y1 - readout->row0, image->numRows) // y170 psRegion region = psRegionSet(PS_MAX(biassec->x0 - readout->col0, 0), // x0 71 PS_MIN(biassec->x1 - readout->col0, image->numCols), // x1 72 PS_MAX(biassec->y0 - readout->row0, 0), // y0 73 PS_MIN(biassec->y1 - readout->row0, image->numRows) // y1 77 74 ); 78 75 psImage *overscan = psMemIncrRefCounter(psImageSubset(image, region)); … … 162 159 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 163 160 164 // Read the next readout; return true if we read pixels in. 165 // 166 // Note that this doesn't put pixels in the HDU. It is therefore NOT COMPATIBLE with pmCellWrite, 167 // pmChipWrite, and pmFPAWrite (or any function that uses or creates an HDU for that matter). 168 // Use pmReadoutWriteNext to write the data that's read by this function. 169 bool pmReadoutReadNext(pmReadout *readout, // Readout into which to read 170 psFits *fits, // FITS file from which to read 171 int z, // Readout number/plane; zero-offset indexing 172 int numScans // The number of scans to read 173 ) 161 bool pmReadoutReadNext(pmReadout *readout, psFits *fits, int z, int numScans) 174 162 { 175 163 PS_ASSERT_PTR_NON_NULL(readout, false); … … 284 272 // Blow away existing data. 285 273 // Do this before returning, so that we're not returning data from a previous read 286 #if 1287 274 psFree(readout->image); 288 275 readout->image = NULL; 289 #endif290 276 291 277 while (readout->bias->n > 0) { … … 321 307 322 308 323 // Read in the cell, and allocate the readouts 324 bool pmCellRead(pmCell *cell, // Cell to read into 325 psFits *fits, // FITS file from which to read 326 psDB *db // Database handle, for "concepts" ingest 327 ) 309 bool pmCellRead(pmCell *cell, psFits *fits, psDB *db) 328 310 { 329 311 PS_ASSERT_PTR_NON_NULL(cell, false); … … 383 365 } 384 366 385 // Read in the component cells 386 bool pmChipRead(pmChip *chip, // Chip to read into 387 psFits *fits, // FITS file from which to read 388 psDB *db // Database handle, for "concepts" ingest 389 ) 367 bool pmChipRead(pmChip *chip, psFits *fits, psDB *db) 390 368 { 391 369 PS_ASSERT_PTR_NON_NULL(chip, false); … … 410 388 } 411 389 412 // Read in the component chips 413 bool pmFPARead(pmFPA *fpa, // FPA to read into 414 psFits *fits, // FITS file from which to read 415 psDB *db // Database handle, for "concepts" ingest 416 ) 390 bool pmFPARead(pmFPA *fpa, psFits *fits, psDB *db) 417 391 { 418 392 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 442 416 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 443 417 444 // Read the mask into the cell, and allocate the readouts 445 bool pmCellReadMask(pmCell *cell, // Cell to read into 446 psFits *fits, // FITS file from which to read 447 psDB *db // Database handle, for "concepts" ingest 448 ) 418 bool pmCellReadMask(pmCell *cell, psFits *fits, psDB *db) 449 419 { 450 420 PS_ASSERT_PTR_NON_NULL(cell, false); … … 497 467 } 498 468 499 // Read the mask into the component cells 500 bool pmChipReadMask(pmChip *chip, // Chip to read into 501 psFits *fits, // FITS file from which to read 502 psDB *db // Database handle, for "concepts" ingest 503 ) 469 bool pmChipReadMask(pmChip *chip, psFits *fits, psDB *db) 504 470 { 505 471 PS_ASSERT_PTR_NON_NULL(chip, false); … … 524 490 } 525 491 526 // Read the mask into the component chips 527 bool pmFPAReadMask(pmFPA *fpa, // FPA to read into 528 psFits *fits, // FITS file from which to read 529 psDB *db // Database handle, for "concepts" ingest 530 ) 492 bool pmFPAReadMask(pmFPA *fpa, psFits *fits, psDB *db) 531 493 { 532 494 PS_ASSERT_PTR_NON_NULL(fpa, false); … … 555 517 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 556 518 557 // Read the weight map into the cell, and allocate the readouts 558 bool pmCellReadWeight(pmCell *cell, // Cell to read into 559 psFits *fits, // FITS file from which to read 560 psDB *db // Database handle, for "concepts" ingest 561 ) 519 bool pmCellReadWeight(pmCell *cell, psFits *fits, psDB *db) 562 520 { 563 521 PS_ASSERT_PTR_NON_NULL(cell, false); … … 610 568 } 611 569 612 // Read the weight map into the component cells 613 bool pmChipReadWeight(pmChip *chip, // Chip to read into 614 psFits *fits, // FITS file from which to read 615 psDB *db // Database handle, for "concepts" ingest 616 ) 570 bool pmChipReadWeight(pmChip *chip, psFits *fits, psDB *db) 617 571 { 618 572 PS_ASSERT_PTR_NON_NULL(chip, false); … … 637 591 } 638 592 639 // Read the weight map into the component chips 640 bool pmFPAReadWeight(pmFPA *fpa, // FPA to read into 641 psFits *fits, // FITS file from which to read 642 psDB *db // Database handle, for "concepts" ingest 643 ) 593 bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, psDB *db) 644 594 { 645 595 PS_ASSERT_PTR_NON_NULL(fpa, false); -
trunk/psModules/src/camera/pmFPARead.h
r7555 r9599 1 /// @file pmFPAMosaic.h 2 /// 3 /// @brief Functions to mosaic FPA components into a single entity 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 03:00:30 $ 11 /// 12 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii 13 /// 14 1 15 #ifndef PM_FPA_READ_H 2 16 #define PM_FPA_READ_H 3 17 4 #include "pslib.h"18 #include <pslib.h> 5 19 #include "pmFPA.h" 6 20 21 /// Read a readout incrementally 22 /// 23 /// Multiple calls to this function moves through a readout within a cell incrementally. It is required to 24 /// pass the readout previously acquired (or a newly-allocated one) in order to preserve state information 25 /// (where the read is at). Only a maximum of numRows rows are read at a time. Returns true if pixels are 26 /// read, and false otherwise. To facilitate looping, no error is generated for reading a plane that doesn't 27 /// exist. Note that this function doesn't put pixels in the HDU. It is therefore NOT COMPATIBLE with 28 /// pmCellWrite, pmChipWrite, and pmFPAWrite (or any function that uses or creates an HDU for that matter). 29 /// Use pmReadoutWriteNext to write the data that's read by this function. This function is intended for 30 /// reading in many readouts into memory at once (e.g., for stacking) where the input is not written out. 7 31 bool pmReadoutReadNext(pmReadout *readout, // Readout into which to read 8 32 psFits *fits, // FITS file from which to read … … 11 35 ); 12 36 37 /// Read an entire cell 38 /// 39 /// Reads the appropriate HDU, ingests concepts from the header, and portions pixels into readouts. Pixels 40 /// are converted to F32. 13 41 bool pmCellRead(pmCell *cell, // Cell to read into 14 42 psFits *fits, // FITS file from which to read … … 16 44 ); 17 45 46 /// Read a chip 47 /// 48 /// Iterates over component cells, reading each with pmCellRead. 18 49 bool pmChipRead(pmChip *chip, // Chip to read into 19 50 psFits *fits, // FITS file from which to read … … 21 52 ); 22 53 54 /// Read an FPA 55 /// 56 /// Iterates over component chips, reading each with pmChipRead. 23 57 bool pmFPARead(pmFPA *fpa, // FPA to read into 24 58 psFits *fits, // FITS file from which to read … … 26 60 ); 27 61 62 /// Read an entire cell into the mask 63 /// 64 /// Same as pmCellRead, but reads into the mask element of the readouts. 28 65 bool pmCellReadMask(pmCell *cell, // Cell to read into 29 66 psFits *fits, // FITS file from which to read … … 31 68 ); 32 69 70 /// Read an entire chip into the mask 71 /// 72 /// Same as pmChipRead, but reads into the mask element of the readouts. 33 73 bool pmChipReadMask(pmChip *chip, // Chip to read into 34 74 psFits *fits, // FITS file from which to read … … 36 76 ); 37 77 78 /// Read an entire FPA into the mask 79 /// 80 /// Same as pmFPARead, but reads into the mask element of the readouts. 38 81 bool pmFPAReadMask(pmFPA *fpa, // FPA to read into 39 82 psFits *fits, // FITS file from which to read … … 41 84 ); 42 85 86 /// Read an entire cell into the weight 87 /// 88 /// Same as pmCellRead, but reads into the weight element of the readouts. 43 89 bool pmCellReadWeight(pmCell *cell, // Cell to read into 44 90 psFits *fits, // FITS file from which to read … … 46 92 ); 47 93 94 /// Read an entire chip into the weight 95 /// 96 /// Same as pmChipRead, but reads into the weight element of the readouts. 48 97 bool pmChipReadWeight(pmChip *chip, // Chip to read into 49 98 psFits *fits, // FITS file from which to read … … 51 100 ); 52 101 102 /// Read an entire FPA into the weight 103 /// 104 /// Same as pmFPARead, but reads into the weight element of the readouts. 53 105 bool pmFPAReadWeight(pmFPA *fpa, // FPA to read into 54 106 psFits *fits, // FITS file from which to read … … 56 108 ); 57 109 58 bool pmCellReadPHU(pmCell *cell, // Cell to read into59 psFits *fits // FITS file from which to read60 );61 62 bool pmChipReadPHU(pmChip *chip, // Chip to read into63 psFits *fits // FITS file from which to read64 );65 66 bool pmFPAReadPHU(pmFPA *fpa, // FPA to read into67 psFits *fits // FITS file from which to read68 );69 70 71 #if 072 bool pmFPARead(pmFPA *fpa, // FPA to read into73 psFits *fits, // FITS file from which to read74 psMetadata *phu, // Primary header75 psDB *db // Database handle, for concept ingest76 );77 78 psString p_pmFPATranslateName(const psString name, // The name to translate79 const pmCell *cell // The cell for which to translate80 );81 82 psString p_pmFPATranslateFileExt(psString *extName, // Extension name, to be returned83 const psString filenameExt, // The string to parse into filename and ext84 const pmCell *cell // The cell85 );86 87 bool pmFPAReadMask(pmFPA *fpa, // FPA to read into88 psFits *source // Source FITS file (for the original data)89 );90 91 bool pmFPAReadWeight(pmFPA *fpa, // FPA to read into92 psFits *source // Source FITS file (for the original data)93 );94 110 #endif 95 96 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
