IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9599


Ignore:
Timestamp:
Oct 16, 2006, 5:00:30 PM (20 years ago)
Author:
Paul Price
Message:

Documenting pmFPARead.[ch]

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

Legend:

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

    r9584 r9599  
    1616
    1717#include "pmFPARead.h"
    18 
    19 #define MAX(x,y) ((x) > (y) ? (x) : (y))
    20 #define MIN(x,y) ((x) < (y) ? (x) : (y))
    2118
    2219//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    4542        return false;
    4643    }
    47     psRegion region = psRegionSet(MAX(trimsec->x0 - readout->col0, 0), // x0
    48                                   MIN(trimsec->x1 - readout->col0, image->numCols), // x1
    49                                   MAX(trimsec->y0 - readout->row0, 0), // y0
    50                                   MIN(trimsec->y1 - readout->row0, image->numRows) // y1
     44    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
    5148                                 );
    5249    if (readout->image) {
     
    7168            return false;
    7269        }
    73         psRegion region = psRegionSet(MAX(biassec->x0 - readout->col0, 0), // x0
    74                                       MIN(biassec->x1 - readout->col0, image->numCols), // x1
    75                                       MAX(biassec->y0 - readout->row0, 0), // y0
    76                                       MIN(biassec->y1 - readout->row0, image->numRows) // y1
     70        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
    7774                                     );
    7875        psImage *overscan = psMemIncrRefCounter(psImageSubset(image, region));
     
    162159//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    163160
    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                       )
     161bool pmReadoutReadNext(pmReadout *readout, psFits *fits, int z, int numScans)
    174162{
    175163    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    284272    // Blow away existing data.
    285273    // Do this before returning, so that we're not returning data from a previous read
    286     #if 1
    287274    psFree(readout->image);
    288275    readout->image = NULL;
    289     #endif
    290276
    291277    while (readout->bias->n > 0) {
     
    321307
    322308
    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                )
     309bool pmCellRead(pmCell *cell, psFits *fits, psDB *db)
    328310{
    329311    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    383365}
    384366
    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                )
     367bool pmChipRead(pmChip *chip, psFits *fits, psDB *db)
    390368{
    391369    PS_ASSERT_PTR_NON_NULL(chip, false);
     
    410388}
    411389
    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               )
     390bool pmFPARead(pmFPA *fpa, psFits *fits, psDB *db)
    417391{
    418392    PS_ASSERT_PTR_NON_NULL(fpa, false);
     
    442416//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    443417
    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                    )
     418bool pmCellReadMask(pmCell *cell, psFits *fits, psDB *db)
    449419{
    450420    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    497467}
    498468
    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                    )
     469bool pmChipReadMask(pmChip *chip, psFits *fits, psDB *db)
    504470{
    505471    PS_ASSERT_PTR_NON_NULL(chip, false);
     
    524490}
    525491
    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                   )
     492bool pmFPAReadMask(pmFPA *fpa, psFits *fits, psDB *db)
    531493{
    532494    PS_ASSERT_PTR_NON_NULL(fpa, false);
     
    555517//////////////////////////////////////////////////////////////////////////////////////////////////////////////
    556518
    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                      )
     519bool pmCellReadWeight(pmCell *cell, psFits *fits, psDB *db)
    562520{
    563521    PS_ASSERT_PTR_NON_NULL(cell, false);
     
    610568}
    611569
    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                      )
     570bool pmChipReadWeight(pmChip *chip, psFits *fits, psDB *db)
    617571{
    618572    PS_ASSERT_PTR_NON_NULL(chip, false);
     
    637591}
    638592
    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                     )
     593bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, psDB *db)
    644594{
    645595    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
    115#ifndef PM_FPA_READ_H
    216#define PM_FPA_READ_H
    317
    4 #include "pslib.h"
     18#include <pslib.h>
    519#include "pmFPA.h"
    620
     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.
    731bool pmReadoutReadNext(pmReadout *readout, // Readout into which to read
    832                       psFits *fits,    // FITS file from which to read
     
    1135                      );
    1236
     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.
    1341bool pmCellRead(pmCell *cell,           // Cell to read into
    1442                psFits *fits,           // FITS file from which to read
     
    1644               );
    1745
     46/// Read a chip
     47///
     48/// Iterates over component cells, reading each with pmCellRead.
    1849bool pmChipRead(pmChip *chip,           // Chip to read into
    1950                psFits *fits,           // FITS file from which to read
     
    2152               );
    2253
     54/// Read an FPA
     55///
     56/// Iterates over component chips, reading each with pmChipRead.
    2357bool pmFPARead(pmFPA *fpa,              // FPA to read into
    2458               psFits *fits,            // FITS file from which to read
     
    2660              );
    2761
     62/// Read an entire cell into the mask
     63///
     64/// Same as pmCellRead, but reads into the mask element of the readouts.
    2865bool pmCellReadMask(pmCell *cell,           // Cell to read into
    2966                    psFits *fits,           // FITS file from which to read
     
    3168                   );
    3269
     70/// Read an entire chip into the mask
     71///
     72/// Same as pmChipRead, but reads into the mask element of the readouts.
    3373bool pmChipReadMask(pmChip *chip,           // Chip to read into
    3474                    psFits *fits,           // FITS file from which to read
     
    3676                   );
    3777
     78/// Read an entire FPA into the mask
     79///
     80/// Same as pmFPARead, but reads into the mask element of the readouts.
    3881bool pmFPAReadMask(pmFPA *fpa,              // FPA to read into
    3982                   psFits *fits,            // FITS file from which to read
     
    4184                  );
    4285
     86/// Read an entire cell into the weight
     87///
     88/// Same as pmCellRead, but reads into the weight element of the readouts.
    4389bool pmCellReadWeight(pmCell *cell,           // Cell to read into
    4490                      psFits *fits,           // FITS file from which to read
     
    4692                     );
    4793
     94/// Read an entire chip into the weight
     95///
     96/// Same as pmChipRead, but reads into the weight element of the readouts.
    4897bool pmChipReadWeight(pmChip *chip,           // Chip to read into
    4998                      psFits *fits,           // FITS file from which to read
     
    51100                     );
    52101
     102/// Read an entire FPA into the weight
     103///
     104/// Same as pmFPARead, but reads into the weight element of the readouts.
    53105bool pmFPAReadWeight(pmFPA *fpa,              // FPA to read into
    54106                     psFits *fits,            // FITS file from which to read
     
    56108                    );
    57109
    58 bool pmCellReadPHU(pmCell *cell,        // Cell to read into
    59                    psFits *fits         // FITS file from which to read
    60                   );
    61 
    62 bool pmChipReadPHU(pmChip *chip,        // Chip to read into
    63                    psFits *fits         // FITS file from which to read
    64                   );
    65 
    66 bool pmFPAReadPHU(pmFPA *fpa,           // FPA to read into
    67                   psFits *fits          // FITS file from which to read
    68                  );
    69 
    70 
    71 #if 0
    72 bool pmFPARead(pmFPA *fpa,              // FPA to read into
    73                psFits *fits,            // FITS file from which to read
    74                psMetadata *phu,         // Primary header
    75                psDB *db                 // Database handle, for concept ingest
    76               );
    77 
    78 psString p_pmFPATranslateName(const psString name, // The name to translate
    79                               const pmCell *cell // The cell for which to translate
    80                              );
    81 
    82 psString p_pmFPATranslateFileExt(psString *extName, // Extension name, to be returned
    83                                  const psString filenameExt, // The string to parse into filename and ext
    84                                  const pmCell *cell // The cell
    85                                 );
    86 
    87 bool pmFPAReadMask(pmFPA *fpa,          // FPA to read into
    88                    psFits *source       // Source FITS file (for the original data)
    89                   );
    90 
    91 bool pmFPAReadWeight(pmFPA *fpa,        // FPA to read into
    92                      psFits *source     // Source FITS file (for the original data)
    93                     );
    94110#endif
    95 
    96 #endif
Note: See TracChangeset for help on using the changeset viewer.