Camera Layout


Data Structures

struct  pmFPA
 Focal plane array (the entirety of the camera). More...
struct  pmChip
 A chip (contiguous detector element). More...
struct  pmCell
 Cell data structure. More...
struct  pmReadout
 A readout (individual read of a cell). More...
struct  pmFPAfile
struct  pmFPAview
 Identifier for FPA components. More...
struct  pmHDU
 An instance of the FITS Header Data Unit. More...

Defines

#define FPA_ASTROM   1
 Include astrometry information in the structures?

Enumerations

enum  pmFPAfilePlace { PM_FPA_BEFORE, PM_FPA_AFTER }
enum  pmFPAfileType {
  PM_FPA_FILE_NONE, PM_FPA_FILE_SX, PM_FPA_FILE_OBJ, PM_FPA_FILE_CMP, PM_FPA_FILE_CMF, PM_FPA_FILE_RAW, PM_FPA_FILE_IMAGE, PM_FPA_FILE_PSF, PM_FPA_FILE_JPEG, PM_FPA_FILE_KAPA,
  PM_FPA_FILE_MANAPLOT, PM_FPA_FILE_MASK, PM_FPA_FILE_WEIGHT, PM_FPA_FILE_FRINGE
}
enum  pmFPAfileMode { PM_FPA_MODE_NONE, PM_FPA_MODE_READ, PM_FPA_MODE_WRITE, PM_FPA_MODE_INTERNAL, PM_FPA_MODE_REFERENCE }
enum  pmFPAfileState { PM_FPA_STATE_OPEN = 0x01, PM_FPA_STATE_CLOSED = 0x02, PM_FPA_STATE_INACTIVE = 0x04 }
enum  pmFPALevel { PM_FPA_LEVEL_NONE, PM_FPA_LEVEL_FPA, PM_FPA_LEVEL_CHIP, PM_FPA_LEVEL_CELL, PM_FPA_LEVEL_READOUT }
 Specify the level of the FPA hierarchy. More...
enum  pmMaskValue { PM_MASK_CLEAR = 0x00, PM_MASK_TRAP = 0x01, PM_MASK_BADCOL = 0x02, PM_MASK_SAT = 0x04, PM_MASK_BAD = 0x08, PM_MASK_FLAT = 0x10, PM_MASK_MARK = 0x20, PM_MASK_EXT1 = 0x40, PM_MASK_EXT2 = 0x80 }
 Pixel mask values. More...

Functions

void pmCellFreeReadouts (pmCell *cell)
 Free all readouts within a cell.
void pmChipFreeCells (pmChip *chip)
 Free all cells within a chip.
void pmReadoutFreeData (pmReadout *readout)
 Free all data within a readout.
void pmCellFreeData (pmCell *cell)
 Free all data within a cell (all readouts as well as metadata).
void pmChipFreeData (pmChip *chip)
 Free all data within a chip (all cells as well as metadata).
void pmFPAFreeData (pmFPA *fpa)
 Free all data within an FPA (all chips as well as metadata).
pmReadoutpmReadoutAlloc (pmCell *cell)
 Allocate a readout associated with a cell.
pmCellpmCellAlloc (pmChip *chip, const char *name)
 Allocate a cell associated with a chip.
pmChippmChipAlloc (pmFPA *fpa, const char *name)
 Allocate a chip associated with an FPA.
pmFPApmFPAAlloc (const psMetadata *camera)
 Allocate an FPA.
bool pmFPACheckParents (pmFPA *fpa)
 Check parent links within an FPA.
bool pmFPAviewWriteJPEG (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAWriteJPEG (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipWriteJPEG (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellWriteJPEG (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutWriteJPEG (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAviewWriteMANAPLOT (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAWriteMANAPLOT (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipWriteMANAPLOT (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellWriteMANAPLOT (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutWriteMANAPLOT (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
pmFPApmFPAConstruct (const psMetadata *camera)
 Construct an FPA instance on the basis of a camera configuration.
bool pmFPAAddSourceFromView (pmFPA *fpa, const pmFPAview *phuView, const psMetadata *format)
 Add an (input or output) source to the focal plane hierarchy, specified by a view.
pmFPAviewpmFPAAddSourceFromHeader (pmFPA *fpa, psMetadata *phu, const psMetadata *format)
 Add an (input or output) source to the focal plane hierarchy, specified by a (primary) header.
pmFPAviewpmFPAIdentifySourceFromHeader (pmFPA *fpa, psMetadata *phu, const psMetadata *format)
 Identify a source in the focal plane hierarchy, specified by a (primary) header.
void pmFPAPrint (FILE *fd, const pmFPA *fpa, bool header, bool concepts)
 Print a representation of the FPA, including its headers and concepts.
pmFPALevel pmFPAPHULevel (const psMetadata *format)
 Return the PHU level for an FPA, given the format.
pmFPALevel pmFPAExtensionsLevel (const psMetadata *format)
 Return the Extensions level for an FPA, given the format.
bool pmFPACopy (pmFPA *target, const pmFPA *source)
 Copy an FPA and components, including the pixels, to a different representation of the same camera.
bool pmChipCopy (pmChip *target, const pmChip *source)
 Copy a chip and components, including the pixels, to a different representation of the same camera.
bool pmCellCopy (pmCell *target, const pmCell *source)
 Copy a cell and components, including the pixels, to a different representation of the same camera.
bool pmFPACopyStructure (pmFPA *target, const pmFPA *source, int xBin, int yBin)
 Copy an FPA, but not the pixels, to a different representation of the same camera.
bool pmChipCopyStructure (pmChip *target, const pmChip *source, int xBin, int yBin)
 Copy a chip, but not the pixels, to a different representation of the same camera.
bool pmCellCopyStructure (pmCell *target, const pmCell *source, int xBin, int yBin)
 Copy a cell, but not the pixels, to a different representation of the same camera.
psRegion * pmReadoutExtent (const pmReadout *readout)
 Return the extent of a readout.
psRegion * pmCellExtent (const pmCell *cell)
 Return the extent of a cell.
psRegion * pmChipExtent (const pmChip *chip)
 Return the extent of a chip.
psRegion * pmFPAExtent (const pmFPA *fpa)
 Return the extent of an FPA.
pmFPAfilepmFPAfileAlloc ()
pmReadoutpmFPAfileThisReadout (psMetadata *files, const pmFPAview *view, const char *name)
pmCellpmFPAfileThisCell (psMetadata *files, const pmFPAview *view, const char *name)
pmChippmFPAfileThisChip (psMetadata *files, const pmFPAview *view, const char *name)
bool pmFPAfileAddFileNames (psMetadata *files, char *name, char *value, int mode)
char * pmFPAfileNameFromRule (char *rule, pmFPAfile *file, const pmFPAview *view)
bool pmFPAfileCopyView (pmFPA *out, pmFPA *in, const pmFPAview *view)
bool pmFPAfileCopyStructureView (pmFPA *out, pmFPA *in, int xBin, int yBin, const pmFPAview *view)
pmFPAfileType pmFPAfileTypeFromString (const char *type)
pmFPAfilepmFPAfileDefineInput (pmConfig *config, pmFPA *fpa, const char *name)
pmFPAfilepmFPAfileDefineOutput (pmConfig *config, pmFPA *fpa, const char *name)
pmFPAfilepmFPAfileDefineFromArgs (bool *found, pmConfig *config, const char *filename, const char *argname)
pmFPAfilepmFPAfileBindFromArgs (bool *found, pmFPAfile *input, pmConfig *config, const char *filename, const char *argname)
pmFPAfilepmFPAfileDefineFromConf (bool *found, pmConfig *config, const char *filename)
pmFPAfilepmFPAfileDefineFromDetDB (bool *found, pmConfig *config, const char *filename, pmFPA *input, pmDetrendType type)
pmFPAfilepmFPAfileDefineFromFPA (pmConfig *config, pmFPA *src, int xBin, int yBin, const char *filename)
pmFPAfilepmFPAfileDefineNewCamera (pmConfig *config, const char *filename)
pmFPAfilepmFPAfileDefineChipMosaic (pmConfig *config, pmFPA *src, const char *filename)
 Create a new output pmFPAfile based upon a chip mosaic of an existing FPA.
pmFPAfilepmFPAfileDefineFPAMosaic (pmConfig *config, pmFPA *src, const char *filename)
 Create a new output pmFPAfile based upon an FPA mosaic of an existing FPA.
pmReadoutpmFPAfileDefineInternal (psMetadata *files, const char *name, int Nx, int Ny, int type)
bool pmFPAfileDropInternal (psMetadata *files, const char *name)
pmFPAfilepmFPAfileDefineSingleFromArgs (bool *found, pmConfig *config, const char *filename, const char *argname, int entry)
bool pmFPAviewReadFitsImage (const pmFPAview *view, pmFPAfile *file)
 Read an image into the current view.
bool pmFPAviewReadFitsMask (const pmFPAview *view, pmFPAfile *file)
 Read a mask into the current view.
bool pmFPAviewReadFitsWeight (const pmFPAview *view, pmFPAfile *file)
 Read a weight map into the current view.
bool pmFPAviewWriteFitsImage (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 Write the image for the specified view.
bool pmFPAviewWriteFitsMask (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 Write the mask for the specified view.
bool pmFPAviewWriteFitsWeight (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
 Write the weight map for the specified view.
bool pmFPAviewFreeData (const pmFPAview *view, pmFPAfile *file)
 Free the data for the specified view.
bool pmFPAviewReadFitsTable (const pmFPAview *view, pmFPAfile *file, const char *name)
 Read a table into the current view.
bool pmFPAviewWriteFitsTable (const pmFPAview *view, pmFPAfile *file, const char *name)
 Write the table for the specified view.
pmFPApmFPAfileSuitableFPA (const pmFPAfile *file, const pmFPAview *view, const pmConfig *config)
 Produce a suitable FPA for writing, on the basis of the input FPAfile.
bool pmFPAfileOpen (pmFPAfile *file, const pmFPAview *view, pmConfig *config)
bool pmFPAfileRead (pmFPAfile *file, const pmFPAview *view, pmConfig *config)
bool pmFPAfileCreate (pmFPAfile *file, const pmFPAview *view, pmConfig *config)
bool pmFPAfileWrite (pmFPAfile *file, const pmFPAview *view, pmConfig *config)
bool pmFPAfileClose (pmFPAfile *file, const pmFPAview *view)
bool pmFPAfileFreeData (pmFPAfile *file, const pmFPAview *view)
bool pmFPAfileActivate (psMetadata *files, bool state, char *name)
bool pmFPAfileIOChecks (pmConfig *config, const pmFPAview *view, pmFPAfilePlace place)
bool pmFPASetFileStatus (pmFPA *fpa, bool status)
 Set the file_exists flag for an FPA and components.
bool pmChipSetFileStatus (pmChip *chip, bool status)
 Set the file_exists flag for a chip and components.
bool pmCellSetFileStatus (pmCell *cell, bool status)
 Set the file_exists flag for a cell and components.
bool pmFPACheckFileStatus (const pmFPA *fpa)
 Return the file_exists status for an FPA and components.
bool pmChipCheckFileStatus (const pmChip *chip)
 Return the file_exists status for a chip and components.
bool pmCellCheckFileStatus (const pmCell *cell)
 Return the file_exists status for a chip and components.
bool pmFPASetDataStatus (pmFPA *fpa, bool status)
 Set the data_exists flag for an FPA and components.
bool pmChipSetDataStatus (pmChip *chip, bool status)
 Set the data_exists flag for a chip and components.
bool pmCellSetDataStatus (pmCell *cell, bool status)
 Set the data_exists flag for a cell and components.
bool pmFPASelectChip (pmFPA *fpa, int chipNum, bool exclusive)
 Select a chip within an FPA for processing.
bool pmChipSelectCell (pmChip *chip, int cellNum, bool exclusive)
 Select a chip within a chip for processing.
int pmFPAExcludeChip (pmFPA *fpa, int chipNum)
 Exclude a chip within an FPA from processing.
int pmChipExcludeCell (pmChip *chip, int cellNum)
 Exclude a cell within a chip from processing.
bool pmFPAReadHeader (pmFPA *fpa, psFits *fits)
 Read the FITS header (and ingest concepts) for an FPA, if it exists at this level.
bool pmChipReadHeader (pmChip *chip, psFits *fits)
 Read the FITS header (and ingest concepts) for a chip, if it exists at this level.
bool pmCellReadHeader (pmCell *cell, psFits *fits)
 Read the FITS header (and ingest concepts) for a cell, if it exists at this level.
const char * pmFPALevelToName (pmFPALevel level)
 Return the string representation of the FPA level.
pmFPALevel pmFPALevelFromName (const char *name)
 Return the enum representation of the FPA level.
bool pmReadoutSetMask (pmReadout *readout)
 Set a temporary readout mask using CELL.SATURATION and CELL.BAD.
bool pmReadoutSetWeight (pmReadout *readout, bool poisson)
 Set a temporary readout weight map using CELL.GAIN and CELL.READNOISE.
bool pmReadoutGenerateMask (pmReadout *readout)
 Generate a readout mask (suitable for output) using CELL.SATURATION and CELL.BAD.
bool pmReadoutGenerateWeight (pmReadout *readout, bool poisson)
 Generate a weight map (suitable for output) using CELL.GAIN and CELL.READNOISE.
bool pmReadoutGenerateMaskWeight (pmReadout *readout, bool poisson)
 Generate mask and weight map for a readout.
bool pmCellGenerateMaskWeight (pmCell *cell, bool poisson)
 Generate mask and weight maps for all readouts within a cell.
bool pmChipMosaic (pmChip *target, const pmChip *source)
 Mosaic all cells within a chip.
bool pmFPAMosaic (pmFPA *target, const pmFPA *source)
 Mosaic all cells within an FPA.
bool pmReadoutReadNext (pmReadout *readout, psFits *fits, int z, int numRows)
 Read a readout incrementally.
bool pmCellRead (pmCell *cell, psFits *fits, psDB *db)
 Read an entire cell.
bool pmChipRead (pmChip *chip, psFits *fits, psDB *db)
 Read a chip.
bool pmFPARead (pmFPA *fpa, psFits *fits, psDB *db)
 Read an FPA.
bool pmCellReadMask (pmCell *cell, psFits *fits, psDB *db)
 Read an entire cell into the mask.
bool pmChipReadMask (pmChip *chip, psFits *fits, psDB *db)
 Read an entire chip into the mask.
bool pmFPAReadMask (pmFPA *fpa, psFits *fits, psDB *db)
 Read an entire FPA into the mask.
bool pmCellReadWeight (pmCell *cell, psFits *fits, psDB *db)
 Read an entire cell into the weight.
bool pmChipReadWeight (pmChip *chip, psFits *fits, psDB *db)
 Read an entire chip into the weight.
bool pmFPAReadWeight (pmFPA *fpa, psFits *fits, psDB *db)
 Read an entire FPA into the weight.
int pmCellReadTable (pmCell *cell, psFits *fits, const char *name)
 Read a FITS table into the cell.
int pmChipReadTable (pmChip *chip, psFits *fits, const char *name)
 Read a FITS table into the component cells.
int pmFPAReadTable (pmFPA *fpa, psFits *fits, const char *name)
 Read a FITS table into the component cells.
int pmFPAFindChip (const pmFPA *fpa, const char *name)
 Find a chip by name; return the index.
int pmChipFindCell (const pmChip *chip, const char *name)
 Find a cell by name; return the index.
pmFPAviewpmFPAviewAlloc (int nRows)
 Allocator for pmFPAview.
bool pmFPAviewReset (pmFPAview *view)
 Reset a view to select all components.
pmFPALevel pmFPAviewLevel (const pmFPAview *view)
 Determine the current view level.
pmChippmFPAviewThisChip (const pmFPAview *view, const pmFPA *fpa)
 Return the currently selected chip for this view.
pmCellpmFPAviewThisCell (const pmFPAview *view, const pmFPA *fpa)
 Return the currently selected cell for this view.
pmReadoutpmFPAviewThisReadout (const pmFPAview *view, const pmFPA *fpa)
 Return the currently selected readout for this view.
pmChippmFPAviewNextChip (pmFPAview *view, const pmFPA *fpa, int nStep)
 Advance view to the next chip.
pmCellpmFPAviewNextCell (pmFPAview *view, const pmFPA *fpa, int nStep)
 Advance view to the next cell.
pmReadoutpmFPAviewNextReadout (pmFPAview *view, const pmFPA *fpa, int nStep)
 Advance view to the next readout.
pmHDUpmFPAviewThisHDU (const pmFPAview *view, const pmFPA *fpa)
 Return the HDU corresponding to the current view.
pmHDUpmFPAviewThisPHU (const pmFPAview *view, const pmFPA *fpa)
 Return the blank Primary HDU corresponding to the current view, if any.
bool pmReadoutWriteNext (pmReadout *readout, psFits *fits, int z)
 Write a readout incrementally.
bool pmCellWrite (pmCell *cell, psFits *fits, psDB *db, bool blank)
 Write a cell to a FITS file.
bool pmChipWrite (pmChip *chip, psFits *fits, psDB *db, bool blank, bool recurse)
 Write a chip to a FITS file.
bool pmFPAWrite (pmFPA *fpa, psFits *fits, psDB *db, bool blank, bool recurse)
 Write an FPA to a FITS file.
bool pmCellWriteMask (pmCell *cell, psFits *fits, psDB *db, bool blank)
 Write a cell mask to a FITS file.
bool pmChipWriteMask (pmChip *chip, psFits *fits, psDB *db, bool blank, bool recurse)
 Write a chip mask to a FITS file.
bool pmFPAWriteMask (pmFPA *fpa, psFits *fits, psDB *db, bool blank, bool recurse)
 Write an FPA mask to a FITS file.
bool pmCellWriteWeight (pmCell *cell, psFits *fits, psDB *db, bool blank)
 Write a cell weight to a FITS file.
bool pmChipWriteWeight (pmChip *chip, psFits *fits, psDB *db, bool blank, bool recurse)
 Write a chip weight to a FITS file.
bool pmFPAWriteWeight (pmFPA *fpa, psFits *fits, psDB *db, bool blank, bool recurse)
 Write an FPA weight to a FITS file.
int pmCellWriteTable (psFits *fits, const pmCell *cell, const char *name)
 Write a FITS table from the cell's analysis metadata.
int pmChipWriteTable (psFits *fits, const pmChip *chip, const char *name)
int pmFPAWriteTable (psFits *fits, const pmFPA *fpa, const char *name)
pmHDUpmHDUAlloc (const char *extname)
 Allocator for pmHDU.
bool pmHDUReadHeader (pmHDU *hdu, psFits *fits)
 Read the HDU header only.
bool pmHDURead (pmHDU *hdu, psFits *fits)
 Read the HDU header and pixels.
bool pmHDUReadMask (pmHDU *hdu, psFits *fits)
 Read the HDU header and mask.
bool pmHDUReadWeight (pmHDU *hdu, psFits *fits)
 Read the HDU header and weight map.
bool pmHDUWrite (pmHDU *hdu, psFits *fits)
 Write the HDU header and pixels.
bool pmHDUWriteMask (pmHDU *hdu, psFits *fits)
 Write the HDU header and mask.
bool pmHDUWriteWeight (pmHDU *hdu, psFits *fits)
 Write the HDU header and weight map.
bool pmHDUGenerateForCell (pmCell *cell)
 Generate an HDU (with CELL.TRIMSEC, CELL.BIASSEC and pixels) for a cell with pixels.
bool pmHDUGenerateForChip (pmChip *chip)
 Generate an HDU (with CELL.TRIMSEC, CELL.BIASSEC and pixels) for a cell with pixels.
bool pmHDUGenerateForFPA (pmFPA *fpa)
 The write functions for the FPA hierarchy use pmHDUWrite, which assumes that the images in the readouts are subimages of the pixels in the HDU structure.
pmHDUpmHDUGetLowest (const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
 Get the lowest HDU in the hierarchy.
pmHDUpmHDUGetHighest (const pmFPA *fpa, const pmChip *chip, const pmCell *cell)
 Get the highest HDU in the hierarchy.
pmHDUpmHDUFromFPA (const pmFPA *fpa)
 Given an FPA, return the HDU (or NULL if all HDUs reside below the FPA).
pmHDUpmHDUFromChip (const pmChip *chip)
 Given a chip, return the HDU (or NULL if it resides below the chip).
pmHDUpmHDUFromCell (const pmCell *cell)
 Given a cell, return the HDU.
pmHDUpmHDUFromReadout (const pmReadout *readout)
 Given a readout, return the HDU.
void pmHDUPrint (FILE *fd, const pmHDU *hdu, int level, bool header)
 Print details about an HDU.


Define Documentation

#define FPA_ASTROM   1

Include astrometry information in the structures?

Definition at line 22 of file pmFPA.h.


Enumeration Type Documentation

enum pmFPAfileMode

Enumerator:
PM_FPA_MODE_NONE 
PM_FPA_MODE_READ 
PM_FPA_MODE_WRITE 
PM_FPA_MODE_INTERNAL 
PM_FPA_MODE_REFERENCE 

Definition at line 44 of file pmFPAfile.h.

enum pmFPAfilePlace

Enumerator:
PM_FPA_BEFORE 
PM_FPA_AFTER 

Definition at line 22 of file pmFPAfile.h.

enum pmFPAfileState

Enumerator:
PM_FPA_STATE_OPEN 
PM_FPA_STATE_CLOSED 
PM_FPA_STATE_INACTIVE 

Definition at line 52 of file pmFPAfile.h.

enum pmFPAfileType

Enumerator:
PM_FPA_FILE_NONE 
PM_FPA_FILE_SX 
PM_FPA_FILE_OBJ 
PM_FPA_FILE_CMP 
PM_FPA_FILE_CMF 
PM_FPA_FILE_RAW 
PM_FPA_FILE_IMAGE 
PM_FPA_FILE_PSF 
PM_FPA_FILE_JPEG 
PM_FPA_FILE_KAPA 
PM_FPA_FILE_MANAPLOT 
PM_FPA_FILE_MASK 
PM_FPA_FILE_WEIGHT 
PM_FPA_FILE_FRINGE 

Definition at line 27 of file pmFPAfile.h.

enum pmFPALevel

Specify the level of the FPA hierarchy.

Enumerator:
PM_FPA_LEVEL_NONE  No particular level specified.
PM_FPA_LEVEL_FPA  Level corresponds to an FPA.
PM_FPA_LEVEL_CHIP  Level corresponds to a Chip.
PM_FPA_LEVEL_CELL  Level corresponds to a Cell.
PM_FPA_LEVEL_READOUT  Level corresponds to a Readout.

Definition at line 18 of file pmFPALevel.h.

enum pmMaskValue

Pixel mask values.

Enumerator:
PM_MASK_CLEAR  The pixel is not masked.
PM_MASK_TRAP  The pixel is a charge trap.
PM_MASK_BADCOL  The pixel is a bad column.
PM_MASK_SAT  The pixel is saturated.
PM_MASK_BAD  The pixel is low.
PM_MASK_FLAT  The pixel is non-positive in the flat-field.
PM_MASK_MARK  The pixel is marked as temporarily ignored.
PM_MASK_EXT1  This mask value is not used.
PM_MASK_EXT2  This mask value is not used.

Definition at line 21 of file pmFPAMaskWeight.h.


Function Documentation

pmCell* pmCellAlloc ( pmChip chip,
const char *  name 
)

Allocate a cell associated with a chip.

The name is used to set CELL.NAME within the concepts.

Parameters:
chip  Parent chip, or NULL
name  Name of cell, for CELL.NAME

bool pmCellCheckFileStatus ( const pmCell cell  ) 

Return the file_exists status for a chip and components.

Parameters:
cell  Cell for which to check status

bool pmCellCopy ( pmCell target,
const pmCell source 
)

Copy a cell and components, including the pixels, to a different representation of the same camera.

This function is useful for converting between different representations of the same camera. For example, between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per extension, spliced together). Components are spliced together as necessary.

Parameters:
target  The target cell
source  The source cell, to be copied

bool pmCellCopyStructure ( pmCell target,
const pmCell source,
int  xBin,
int  yBin 
)

Copy a cell, but not the pixels, to a different representation of the same camera.

This function the same as pmCellCopy, except that the pixels are not copied (though images of sufficient size are allocated in the target). Changes the CELL.XBIN and CELL.YBIN according to the provided binning factors.

Parameters:
target  The target cell
source  The source cell, to be copied
yBin  Binning factors in x and y

psRegion* pmCellExtent ( const pmCell cell  ) 

Return the extent of a cell.

The extent is determined from the extent of the component readouts, plus CELL.X0,Y0

Parameters:
cell  The cell of interest

void pmCellFreeData ( pmCell cell  ) 

Free all data within a cell (all readouts as well as metadata).

Parameters:
cell  Cell for which to free data

void pmCellFreeReadouts ( pmCell cell  ) 

Free all readouts within a cell.

Parameters:
cell  Cell for which to free readouts

bool pmCellGenerateMaskWeight ( pmCell cell,
bool  poisson 
)

Generate mask and weight maps for all readouts within a cell.

Calls pmReadoutGenerateMaskWeight for each readout within the cell.

Parameters:
cell  Cell for which to generate mask and weights
poisson  Use poisson weights (in addition to read noise)?

bool pmCellRead ( pmCell cell,
psFits *  fits,
psDB *  db 
)

Read an entire cell.

Reads the appropriate HDU, ingests concepts from the header, and portions pixels into readouts. Pixels are converted to F32.

bool pmCellReadHeader ( pmCell cell,
psFits *  fits 
)

Read the FITS header (and ingest concepts) for a cell, if it exists at this level.

Returns false if there was a problem. Returns true if it successfully read the header, or if the header was already there. No iteration to lower levels is performed.

Parameters:
cell  Cell for which to read header
fits  FITS file handle

bool pmCellReadMask ( pmCell cell,
psFits *  fits,
psDB *  db 
)

Read an entire cell into the mask.

Same as pmCellRead, but reads into the mask element of the readouts.

int pmCellReadTable ( pmCell cell,
psFits *  fits,
const char *  name 
)

Read a FITS table into the cell.

Given a name, which is combined with the chip and cell to identify the extension name ("NAME_CHIP_CELL"), read the FITS table into the cell analysis metadata (with key being the provided name). The header is also read and included in the cell analysis metadata under "name.HEADER".

Parameters:
cell  Cell for which to read table
fits  FITS file from which the table
name  Specifies the extension name, and target in the analysis metadata

bool pmCellReadWeight ( pmCell cell,
psFits *  fits,
psDB *  db 
)

Read an entire cell into the weight.

Same as pmCellRead, but reads into the weight element of the readouts.

bool pmCellSetDataStatus ( pmCell cell,
bool  status 
)

Set the data_exists flag for a cell and components.

Parameters:
cell  Cell for which to set status
status  Status to set

bool pmCellSetFileStatus ( pmCell cell,
bool  status 
)

Set the file_exists flag for a cell and components.

Parameters:
cell  Cell for which to set status
status  Status to set

bool pmCellWrite ( pmCell cell,
psFits *  fits,
psDB *  db,
bool  blank 
)

Write a cell to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU to the FITS file. This function should be called at the beginning of the output cell loop with blank=true in order to produce the correct file structure.

Parameters:
cell  Cell to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?

bool pmCellWriteJPEG ( pmCell cell,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmCellWriteMANAPLOT ( pmCell cell,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmCellWriteMask ( pmCell cell,
psFits *  fits,
psDB *  db,
bool  blank 
)

Write a cell mask to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU mask pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU mask to the FITS file. This function should be called at the beginning of the output cell loop with blank=true in order to produce the correct file structure.

Parameters:
cell  Cell to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?

int pmCellWriteTable ( psFits *  fits,
const pmCell cell,
const char *  name 
)

Write a FITS table from the cell's analysis metadata.

The FITS table (a psArray of psMetadatas) from the cell's analysis metadata (under "name") is written to the FITS file, at an extension specified by the name, chip name and cell name ("NAME_CHIP_CELL"). If a header is present in the analysis metadata ("name.HEADER"), then it is written also.

Parameters:
fits  FITS file to which to write
cell  Cell containing FITS table in the analysis metadata
name  Name for the table data, and the extension name

bool pmCellWriteWeight ( pmCell cell,
psFits *  fits,
psDB *  db,
bool  blank 
)

Write a cell weight to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU weight to the FITS file. This function should be called at the beginning of the output cell loop with blank=true in order to produce the correct file structure.

Parameters:
cell  Cell to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?

pmChip* pmChipAlloc ( pmFPA fpa,
const char *  name 
)

Allocate a chip associated with an FPA.

The name is used to set CHIP.NAME within the concepts

Parameters:
fpa  Parent FPA, or NULL
name  Name of chip, for CHIP.NAME

bool pmChipCheckFileStatus ( const pmChip chip  ) 

Return the file_exists status for a chip and components.

Parameters:
chip  Chip for which to check status

bool pmChipCopy ( pmChip target,
const pmChip source 
)

Copy a chip and components, including the pixels, to a different representation of the same camera.

This function is useful for converting between different representations of the same camera. For example, between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per extension, spliced together). Components are spliced together as necessary.

Parameters:
target  The target chip
source  The source chip, to be copied

bool pmChipCopyStructure ( pmChip target,
const pmChip source,
int  xBin,
int  yBin 
)

Copy a chip, but not the pixels, to a different representation of the same camera.

This function the same as pmChipCopy, except that the pixels are not copied (though images of sufficient size are allocated in the target). Changes the CELL.XBIN and CELL.YBIN according to the provided binning factors.

Parameters:
target  The target chip
source  The source chip, to be copied
yBin  Binning factors in x and y

int pmChipExcludeCell ( pmChip chip,
int  cellNum 
)

Exclude a cell within a chip from processing.

Parameters:
chip  Chip containing the chip of interest
cellNum  Cell number to exclude

psRegion* pmChipExtent ( const pmChip chip  ) 

Return the extent of a chip.

The extent is determined from the extent of the component cells, plus CHIP.X0,Y0

Parameters:
chip  The chip of interest

int pmChipFindCell ( const pmChip chip,
const char *  name 
)

Find a cell by name; return the index.

Looks for a cell within the chip with CELL.NAME matching the provided name. Returns the index of the cell, or -1 if it was not found.

void pmChipFreeCells ( pmChip chip  ) 

Free all cells within a chip.

Parameters:
chip  Chip for which to free cells

void pmChipFreeData ( pmChip chip  ) 

Free all data within a chip (all cells as well as metadata).

Parameters:
chip  Chip for which to free data

bool pmChipMosaic ( pmChip target,
const pmChip source 
)

Mosaic all cells within a chip.

Mosaics all cells within the source into a single cell within the target (which must have only a single cell). Cells are placed on the chip according to the CELL.X0 and CELL.Y0 offsets. This is useful for getting an image of the chip on the sky. The mosaicking is done so as to avoid performing a deep copy of the pixels, if possible.

Parameters:
target  Target chip --- may contain only a single cell
source  Source chip whose cells will be mosaicked

bool pmChipRead ( pmChip chip,
psFits *  fits,
psDB *  db 
)

Read a chip.

Iterates over component cells, reading each with pmCellRead.

bool pmChipReadHeader ( pmChip chip,
psFits *  fits 
)

Read the FITS header (and ingest concepts) for a chip, if it exists at this level.

Returns false if there was a problem. Returns true if it successfully read the header, or if the header was already there. No iteration to lower levels is performed.

Parameters:
chip  Chip for which to read header
fits  FITS file handle

bool pmChipReadMask ( pmChip chip,
psFits *  fits,
psDB *  db 
)

Read an entire chip into the mask.

Same as pmChipRead, but reads into the mask element of the readouts.

int pmChipReadTable ( pmChip chip,
psFits *  fits,
const char *  name 
)

Read a FITS table into the component cells.

Iterates over component cells, calling pmCellReadTable.

Parameters:
chip  Cell for which to read table
fits  FITS file from which the table
name  Specifies the extension name, and target in the analysis metadata

bool pmChipReadWeight ( pmChip chip,
psFits *  fits,
psDB *  db 
)

Read an entire chip into the weight.

Same as pmChipRead, but reads into the weight element of the readouts.

bool pmChipSelectCell ( pmChip chip,
int  cellNum,
bool  exclusive 
)

Select a chip within a chip for processing.

If exclusive is true, the specified cell is the only chip to be processed. A negative value for cellNum is valid and, in combinations with exclusive, de-selects all chips.

Parameters:
chip  Chip containing the cell of interest
cellNum  Cell number to select
exclusive  Process this cell exclusive of the others?

bool pmChipSetDataStatus ( pmChip chip,
bool  status 
)

Set the data_exists flag for a chip and components.

Parameters:
chip  Chip for which to set status
status  Status to set

bool pmChipSetFileStatus ( pmChip chip,
bool  status 
)

Set the file_exists flag for a chip and components.

Parameters:
chip  Chip for which to set status
status  Status to set

bool pmChipWrite ( pmChip chip,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write a chip to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output chip loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
chip  Chip to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

bool pmChipWriteJPEG ( pmChip chip,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmChipWriteMANAPLOT ( pmChip chip,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmChipWriteMask ( pmChip chip,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write a chip mask to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU mask pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU mask to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output chip loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
chip  Chip to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

int pmChipWriteTable ( psFits *  fits,
const pmChip chip,
const char *  name 
)

Parameters:
fits  FITS file to which to write
chip  Chip containing cells with tables to write
name  Name for the table data, and the extension name

bool pmChipWriteWeight ( pmChip chip,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write a chip weight to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU weight to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output chip loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
chip  Chip to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

pmFPAview* pmFPAAddSourceFromHeader ( pmFPA fpa,
psMetadata *  phu,
const psMetadata *  format 
)

Add an (input or output) source to the focal plane hierarchy, specified by a (primary) header.

Given an FPA, add an HDU by specifying a primary header, which is used to determine the FITS file contents, and therefore the proper location for the HDU. The camera format configuration is required in order to describe how the FPA is laid out in terms of disk files.

Parameters:
fpa  The FPA
phu  Primary header of file
format  Format of file

bool pmFPAAddSourceFromView ( pmFPA fpa,
const pmFPAview phuView,
const psMetadata *  format 
)

Add an (input or output) source to the focal plane hierarchy, specified by a view.

Given an FPA, add an HDU by specifying where it goes (i.e., by an FPAview). The camera format configuration is required in order to describe how the FPA is laid out in terms of disk files.

Parameters:
fpa  The FPA
phuView  The view, corresponding to the PHU
format  Format of file

pmFPA* pmFPAAlloc ( const psMetadata *  camera  ) 

Allocate an FPA.

Parameters:
camera  Camera configuration (to store in FPA)

bool pmFPACheckFileStatus ( const pmFPA fpa  ) 

Return the file_exists status for an FPA and components.

Parameters:
fpa  FPA for which to check status

bool pmFPACheckParents ( pmFPA fpa  ) 

Check parent links within an FPA.

Iterates through the FPA to verify that the "parent" links in the chip, cell and readout are set correctly. If there are any incorrect links, they are fixed, and the function returns false.

Parameters:
fpa  FPA to check

pmFPA* pmFPAConstruct ( const psMetadata *  camera  ) 

Construct an FPA instance on the basis of a camera configuration.

This is the function that creates the FPA hierarchy on the basis of the camera configuration. The "FPA" entry in the camera configuration specifies the chips (each of type STR) with their component cells listed as the corresponding values (whitespace separated). The FPA hierarchy is created devoid of any input/output sources (i.e., HDUs).

Parameters:
camera  The camera configuration

bool pmFPACopy ( pmFPA target,
const pmFPA source 
)

Copy an FPA and components, including the pixels, to a different representation of the same camera.

This function is useful for converting between different representations of the same camera. For example, between Megacam "RAW" (one amp per extension) and Megacam "SPLICED" formats (two amps = 1 chip per extension, spliced together). Components are spliced together as necessary.

Parameters:
target  The target FPA
source  The source FPA, to be copied

bool pmFPACopyStructure ( pmFPA target,
const pmFPA source,
int  xBin,
int  yBin 
)

Copy an FPA, but not the pixels, to a different representation of the same camera.

This function the same as pmFPACopy, except that the pixels are not copied (though images of sufficient size are allocated in the target). Changes the CELL.XBIN and CELL.YBIN according to the provided binning factors.

Parameters:
target  The target FPA
source  The source FPA, to be copied
yBin  Binning factors in x and y

int pmFPAExcludeChip ( pmFPA fpa,
int  chipNum 
)

Exclude a chip within an FPA from processing.

Parameters:
fpa  FPA containing the chip of interest
chipNum  Chip number to exclude

pmFPALevel pmFPAExtensionsLevel ( const psMetadata *  format  ) 

Return the Extensions level for an FPA, given the format.

psRegion* pmFPAExtent ( const pmFPA fpa  ) 

Return the extent of an FPA.

The extent is determined from the extent of the component chips.

Parameters:
fpa  The FPA of interest

bool pmFPAfileActivate ( psMetadata *  files,
bool  state,
char *  name 
)

bool pmFPAfileAddFileNames ( psMetadata *  files,
char *  name,
char *  value,
int  mode 
)

pmFPAfile* pmFPAfileAlloc (  ) 

pmFPAfile* pmFPAfileBindFromArgs ( bool *  found,
pmFPAfile input,
pmConfig config,
const char *  filename,
const char *  argname 
)

bool pmFPAfileClose ( pmFPAfile file,
const pmFPAview view 
)

bool pmFPAfileCopyStructureView ( pmFPA out,
pmFPA in,
int  xBin,
int  yBin,
const pmFPAview view 
)

bool pmFPAfileCopyView ( pmFPA out,
pmFPA in,
const pmFPAview view 
)

bool pmFPAfileCreate ( pmFPAfile file,
const pmFPAview view,
pmConfig config 
)

pmFPAfile* pmFPAfileDefineChipMosaic ( pmConfig config,
pmFPA src,
const char *  filename 
)

Create a new output pmFPAfile based upon a chip mosaic of an existing FPA.

The new pmFPAfile is inserted into the config->files metadata, freed and returned; so that the user does not have to (and should not!) free the result.

Parameters:
config  Configuration data
src  Source FPA
filename  Output (root) filename

pmFPAfile* pmFPAfileDefineFPAMosaic ( pmConfig config,
pmFPA src,
const char *  filename 
)

Create a new output pmFPAfile based upon an FPA mosaic of an existing FPA.

The new pmFPAfile is inserted into the config->files metadata, freed and returned; so that the user does not have to (and should not!) free the result.

Parameters:
config  Configuration data
src  Source FPA
filename  Output (root) filename

pmFPAfile* pmFPAfileDefineFromArgs ( bool *  found,
pmConfig config,
const char *  filename,
const char *  argname 
)

pmFPAfile* pmFPAfileDefineFromConf ( bool *  found,
pmConfig config,
const char *  filename 
)

pmFPAfile* pmFPAfileDefineFromDetDB ( bool *  found,
pmConfig config,
const char *  filename,
pmFPA input,
pmDetrendType  type 
)

pmFPAfile* pmFPAfileDefineFromFPA ( pmConfig config,
pmFPA src,
int  xBin,
int  yBin,
const char *  filename 
)

pmFPAfile* pmFPAfileDefineInput ( pmConfig config,
pmFPA fpa,
const char *  name 
)

pmReadout* pmFPAfileDefineInternal ( psMetadata *  files,
const char *  name,
int  Nx,
int  Ny,
int  type 
)

pmFPAfile* pmFPAfileDefineNewCamera ( pmConfig config,
const char *  filename 
)

pmFPAfile* pmFPAfileDefineOutput ( pmConfig config,
pmFPA fpa,
const char *  name 
)

pmFPAfile* pmFPAfileDefineSingleFromArgs ( bool *  found,
pmConfig config,
const char *  filename,
const char *  argname,
int  entry 
)

bool pmFPAfileDropInternal ( psMetadata *  files,
const char *  name 
)

bool pmFPAfileFreeData ( pmFPAfile file,
const pmFPAview view 
)

bool pmFPAfileIOChecks ( pmConfig config,
const pmFPAview view,
pmFPAfilePlace  place 
)

char* pmFPAfileNameFromRule ( char *  rule,
pmFPAfile file,
const pmFPAview view 
)

bool pmFPAfileOpen ( pmFPAfile file,
const pmFPAview view,
pmConfig config 
)

bool pmFPAfileRead ( pmFPAfile file,
const pmFPAview view,
pmConfig config 
)

pmFPA* pmFPAfileSuitableFPA ( const pmFPAfile file,
const pmFPAview view,
const pmConfig config 
)

Produce a suitable FPA for writing, on the basis of the input FPAfile.

A new FPA with a changed format is generated if required (file->format is set and file->camera is equal to the default, indicating a change in the format without changing the camera --- changes to the camera are handled using other systems --- see pmFPAfileDefineChipMosaic, pmFPAfileDefineFPAMosaic). Otherwise the file->fpa is returned (incremented).

Parameters:
file  File containing the fpa
view  View at which to produce the fpa
config  Configuration

pmCell* pmFPAfileThisCell ( psMetadata *  files,
const pmFPAview view,
const char *  name 
)

pmChip* pmFPAfileThisChip ( psMetadata *  files,
const pmFPAview view,
const char *  name 
)

pmReadout* pmFPAfileThisReadout ( psMetadata *  files,
const pmFPAview view,
const char *  name 
)

pmFPAfileType pmFPAfileTypeFromString ( const char *  type  ) 

bool pmFPAfileWrite ( pmFPAfile file,
const pmFPAview view,
pmConfig config 
)

int pmFPAFindChip ( const pmFPA fpa,
const char *  name 
)

Find a chip by name; return the index.

Looks for a chip within the FPA with CHIP.NAME matching the provided name. Returns the index of the chip, or -1 if it was not found.

Parameters:
fpa  FPA in which to find the chip
name  Name of the chip

void pmFPAFreeData ( pmFPA fpa  ) 

Free all data within an FPA (all chips as well as metadata).

Parameters:
fpa  FPA for which to free data

pmFPAview* pmFPAIdentifySourceFromHeader ( pmFPA fpa,
psMetadata *  phu,
const psMetadata *  format 
)

Identify a source in the focal plane hierarchy, specified by a (primary) header.

This is the same as pmFPAAddSourceFromHeader, except the input is not added into the FPA hierarchy. This function serves only to identify where in the hierarchy it should go, not prepare for reading, etc.

pmFPALevel pmFPALevelFromName ( const char *  name  ) 

Return the enum representation of the FPA level.

Parameters:
name  Level name

const char* pmFPALevelToName ( pmFPALevel  level  ) 

Return the string representation of the FPA level.

Parameters:
level  Level enum

bool pmFPAMosaic ( pmFPA target,
const pmFPA source 
)

Mosaic all cells within an FPA.

Mosaics all cells within the source into a single chip with single cell within the target (which must have only a single chip with single cell). Cells are placed on the FPA according to the CHIP.X0, CHIP.Y0, CELL.X0 and CELL.Y0 offsets. This is useful for getting an image of the FPA on the sky. The mosaicking is done so as to avoid performing a deep copy of the pixels, if possible.

Parameters:
target  Target FPA --- may contain only a single chip with a single cell
source  FPA whose chips and cells will be mosaicked

pmFPALevel pmFPAPHULevel ( const psMetadata *  format  ) 

Return the PHU level for an FPA, given the format.

void pmFPAPrint ( FILE *  fd,
const pmFPA fpa,
bool  header,
bool  concepts 
)

Print a representation of the FPA, including its headers and concepts.

This function is intended for testing and development purposes.

Parameters:
fd  File descriptor to which to print
fpa  FPA to print
header  Print headers?
concepts  Print concepts?

bool pmFPARead ( pmFPA fpa,
psFits *  fits,
psDB *  db 
)

Read an FPA.

Iterates over component chips, reading each with pmChipRead.

bool pmFPAReadHeader ( pmFPA fpa,
psFits *  fits 
)

Read the FITS header (and ingest concepts) for an FPA, if it exists at this level.

Returns false if there was a problem. Returns true if it successfully read the header, or if the header was already there. No iteration to lower levels is performed.

Parameters:
fpa  FPA for which to read header
fits  FITS file handle

bool pmFPAReadMask ( pmFPA fpa,
psFits *  fits,
psDB *  db 
)

Read an entire FPA into the mask.

Same as pmFPARead, but reads into the mask element of the readouts.

int pmFPAReadTable ( pmFPA fpa,
psFits *  fits,
const char *  name 
)

Read a FITS table into the component cells.

Iterates over component chips, calling pmChipReadTable.

Parameters:
fpa  Cell for which to read table
fits  FITS file from which the table
name  Specifies the extension name, and target in the analysis metadata

bool pmFPAReadWeight ( pmFPA fpa,
psFits *  fits,
psDB *  db 
)

Read an entire FPA into the weight.

Same as pmFPARead, but reads into the weight element of the readouts.

bool pmFPASelectChip ( pmFPA fpa,
int  chipNum,
bool  exclusive 
)

Select a chip within an FPA for processing.

If exclusive is true, the specified chip is the only chip to be processed. A negative value for chipNum is valid and, in combinations with exclusive, de-selects all chips.

Parameters:
fpa  FPA containing the chip of interest
chipNum  Chip number to select
exclusive  Process this chip exclusive of the others?

bool pmFPASetDataStatus ( pmFPA fpa,
bool  status 
)

Set the data_exists flag for an FPA and components.

Parameters:
fpa  FPA for which to set status
status  Status to set

bool pmFPASetFileStatus ( pmFPA fpa,
bool  status 
)

Set the file_exists flag for an FPA and components.

Parameters:
fpa  FPA for which to set status
status  Status to set

pmFPAview* pmFPAviewAlloc ( int  nRows  ) 

Allocator for pmFPAview.

Parameters:
nRows  Maximum number of rows per readout segment read, or 0 for all

bool pmFPAviewFreeData ( const pmFPAview view,
pmFPAfile file 
)

Free the data for the specified view.

Parameters:
view  View specifying level of interest
file  FPA file to free data

pmFPALevel pmFPAviewLevel ( const pmFPAview view  ) 

Determine the current view level.

Returns the level appropriate for the view

Parameters:
view  View to examine

pmCell* pmFPAviewNextCell ( pmFPAview view,
const pmFPA fpa,
int  nStep 
)

Advance view to the next cell.

Returns NULL if there is no next

Parameters:
view  Current view
fpa  FPA containing cells
nStep  Number of cells to increment

pmChip* pmFPAviewNextChip ( pmFPAview view,
const pmFPA fpa,
int  nStep 
)

Advance view to the next chip.

Returns NULL if there is no next

Parameters:
view  Current view
fpa  FPA containing chips
nStep  Number of chips to increment

pmReadout* pmFPAviewNextReadout ( pmFPAview view,
const pmFPA fpa,
int  nStep 
)

Advance view to the next readout.

Returns NULL if there is no next

Parameters:
view  Current view
fpa  FPA containing readouts
nStep  Number of readouts to increment

bool pmFPAviewReadFitsImage ( const pmFPAview view,
pmFPAfile file 
)

Read an image into the current view.

Parameters:
view  View specifying level of interest
file  FPA file into which to read

bool pmFPAviewReadFitsMask ( const pmFPAview view,
pmFPAfile file 
)

Read a mask into the current view.

Parameters:
view  View specifying level of interest
file  FPA file into which to read

bool pmFPAviewReadFitsTable ( const pmFPAview view,
pmFPAfile file,
const char *  name 
)

Read a table into the current view.

Parameters:
view  View specifying level of interest
file  FPA file into which to read
name  Name of table

bool pmFPAviewReadFitsWeight ( const pmFPAview view,
pmFPAfile file 
)

Read a weight map into the current view.

Parameters:
view  View specifying level of interest
file  FPA file into which to read

bool pmFPAviewReset ( pmFPAview view  ) 

Reset a view to select all components.

Parameters:
view  View to reset

pmCell* pmFPAviewThisCell ( const pmFPAview view,
const pmFPA fpa 
)

Return the currently selected cell for this view.

Returns NULL if the selection is not specific or invalid

Parameters:
view  Current view
fpa  FPA containing cell

pmChip* pmFPAviewThisChip ( const pmFPAview view,
const pmFPA fpa 
)

Return the currently selected chip for this view.

Returns NULL if the selection is not specific or invalid

Parameters:
view  Current view
fpa  FPA containing chip

pmHDU* pmFPAviewThisHDU ( const pmFPAview view,
const pmFPA fpa 
)

Return the HDU corresponding to the current view.

Uses the pmHDUFrom* functions, combined with the view.

Parameters:
view  Current view
fpa  FPA for view

pmHDU* pmFPAviewThisPHU ( const pmFPAview view,
const pmFPA fpa 
)

Return the blank Primary HDU corresponding to the current view, if any.

Similar to pmFPAviewThisHDU, except returns NULL if no HDU is found, or the HDU is not a blank Primary HDU

Parameters:
view  Current view
fpa  FPA for view

pmReadout* pmFPAviewThisReadout ( const pmFPAview view,
const pmFPA fpa 
)

Return the currently selected readout for this view.

Returns NULL if the selection is not specific or invalid

Parameters:
view  Current view
fpa  FPA containing readout

bool pmFPAviewWriteFitsImage ( const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

Write the image for the specified view.

Parameters:
view  View specifying level of interest
file  FPA file to write
config  Configuration

bool pmFPAviewWriteFitsMask ( const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

Write the mask for the specified view.

Parameters:
view  View specifying level of interest
file  FPA file to write
config  Configuration

bool pmFPAviewWriteFitsTable ( const pmFPAview view,
pmFPAfile file,
const char *  name 
)

Write the table for the specified view.

Parameters:
view  View specifying level of interest
file  FPA file to write
name  Name of table

bool pmFPAviewWriteFitsWeight ( const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

Write the weight map for the specified view.

Parameters:
view  View specifying level of interest
file  FPA file to write
config  Configuration

bool pmFPAviewWriteJPEG ( const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmFPAviewWriteMANAPLOT ( const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmFPAWrite ( pmFPA fpa,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write an FPA to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output FPA loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
fpa  FPA to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

bool pmFPAWriteJPEG ( pmFPA fpa,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmFPAWriteMANAPLOT ( pmFPA fpa,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmFPAWriteMask ( pmFPA fpa,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write an FPA mask to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU mask pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU mask to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output FPA loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
fpa  FPA to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

int pmFPAWriteTable ( psFits *  fits,
const pmFPA fpa,
const char *  name 
)

Parameters:
fits  FITS file to which to write
fpa  FPA containing cells with tables to write
name  Name for the table data, and the extension name

bool pmFPAWriteWeight ( pmFPA fpa,
psFits *  fits,
psDB *  db,
bool  blank,
bool  recurse 
)

Write an FPA weight to a FITS file.

Generates CELL.TRIMSEC, CELL.BIASSEC and the HDU weight pixels if required. A blank (i.e., image-less header) is written only if specifically requested. Writes the concepts to the various locations, and then the HDU weight to the FITS file, optionally recursing to lower levels. This function should be called at the beginning of the output FPA loop with blank=true and recurse=false in order to produce the correct file structure.

Parameters:
fpa  FPA to write
fits  FITS file to which to write
db  Database handle for "concepts" update
blank  Write a blank PHU?
recurse  Recurse to lower levels?

pmHDU* pmHDUAlloc ( const char *  extname  ) 

Allocator for pmHDU.

Parameters:
extname  Extension name, or NULL for PHU

pmHDU* pmHDUFromCell ( const pmCell cell  ) 

Given a cell, return the HDU.

Parameters:
cell  Cell for which to find HDU

pmHDU* pmHDUFromChip ( const pmChip chip  ) 

Given a chip, return the HDU (or NULL if it resides below the chip).

Parameters:
chip  Chip for which to find HDU

pmHDU* pmHDUFromFPA ( const pmFPA fpa  ) 

Given an FPA, return the HDU (or NULL if all HDUs reside below the FPA).

Parameters:
fpa  FPA for which to find HDU

pmHDU* pmHDUFromReadout ( const pmReadout readout  ) 

Given a readout, return the HDU.

Parameters:
readout  Readout for which to find HDU

bool pmHDUGenerateForCell ( pmCell cell  ) 

Generate an HDU (with CELL.TRIMSEC, CELL.BIASSEC and pixels) for a cell with pixels.

The write functions for the FPA hierarchy use pmHDUWrite, which assumes that the images in the readouts are subimages of the pixels in the HDU structure. If this is not the case, the HDU pixels can be generated using some simple assumptions. Splices the images and overscans together without regard for CELL.X0 and CELL.Y0 (for a proper mosaic, see pmFPAMosaic), though it should respect CELL.READDIR (so that the bias and trim sections match properly). A warning may be generated after running this function if the bias and trim sections are specified in the camera format by default values rather than in the header. Failure of this function is often due to a bad camera format file.

Parameters:
cell  The cell for which to generate an HDU

bool pmHDUGenerateForChip ( pmChip chip  ) 

Generate an HDU (with CELL.TRIMSEC, CELL.BIASSEC and pixels) for a cell with pixels.

The write functions for the FPA hierarchy use pmHDUWrite, which assumes that the images in the readouts are subimages of the pixels in the HDU structure. If this is not the case, the HDU pixels can be generated using some simple assumptions. Splices the images and overscans together without regard for CELL.X0 and CELL.Y0 (for a proper mosaic, see pmFPAMosaic), though it should respect CELL.READDIR (so that the bias and trim sections match properly). A warning may be generated after running this function if the bias and trim sections are specified in the camera format by default values rather than in the header. Failure of this function is often due to a bad camera format file.

Parameters:
chip  The chip for which to generate an HDU

bool pmHDUGenerateForFPA ( pmFPA fpa  ) 

The write functions for the FPA hierarchy use pmHDUWrite, which assumes that the images in the readouts are subimages of the pixels in the HDU structure.

If this is not the case, the HDU pixels can be generated using some simple assumptions. Splices the images and overscans together without regard for CELL.X0 and CELL.Y0 (for a proper mosaic, see pmFPAMosaic), though it should respect CELL.READDIR (so that the bias and trim sections match properly). A warning may be generated after running this function if the bias and trim sections are specified in the camera format by default values rather than in the header. Failure of this function is often due to a bad camera format file.

Parameters:
fpa  The fpa for which to generate an HDU

pmHDU* pmHDUGetHighest ( const pmFPA fpa,
const pmChip chip,
const pmCell cell 
)

Get the highest HDU in the hierarchy.

The highest HDU in the hierarchy will be the PHU (might get NULL if not all levels are supplied)

Parameters:
fpa  The FPA
chip  The chip, or NULL
cell  The cell, or NULL

pmHDU* pmHDUGetLowest ( const pmFPA fpa,
const pmChip chip,
const pmCell cell 
)

Get the lowest HDU in the hierarchy.

The lowest HDU in the hierarchy will be the one with the actual pixels (if all levels are supplied).

Parameters:
fpa  The FPA
chip  The chip, or NULL
cell  The cell, or NULL

void pmHDUPrint ( FILE *  fd,
const pmHDU hdu,
int  level,
bool  header 
)

Print details about an HDU.

This is intended for testing or development use.

Parameters:
fd  File descriptor to which to print
hdu  HDU to print
level  Level at which to print
header  Print header?

bool pmHDURead ( pmHDU hdu,
psFits *  fits 
)

Read the HDU header and pixels.

Moves to the appropriate extension

Parameters:
hdu  HDU to read
fits  FITS file to read from

bool pmHDUReadHeader ( pmHDU hdu,
psFits *  fits 
)

Read the HDU header only.

Moves to the appropriate extension

Parameters:
hdu  HDU for which to read header
fits  FITS file from which to read

bool pmHDUReadMask ( pmHDU hdu,
psFits *  fits 
)

Read the HDU header and mask.

Moves to the appropriate extension

Parameters:
hdu  HDU to read
fits  FITS file to read from

bool pmHDUReadWeight ( pmHDU hdu,
psFits *  fits 
)

Read the HDU header and weight map.

Moves to the appropriate extension

Parameters:
hdu  HDU to read
fits  FITS file to read from

bool pmHDUWrite ( pmHDU hdu,
psFits *  fits 
)

Write the HDU header and pixels.

Parameters:
hdu  HDU to write
fits  FITS file to write to

bool pmHDUWriteMask ( pmHDU hdu,
psFits *  fits 
)

Write the HDU header and mask.

Parameters:
hdu  HDU to write
fits  FITS file to write to

bool pmHDUWriteWeight ( pmHDU hdu,
psFits *  fits 
)

Write the HDU header and weight map.

Parameters:
hdu  HDU to write
fits  FITS file to write to

pmReadout* pmReadoutAlloc ( pmCell cell  ) 

Allocate a readout associated with a cell.

Parameters:
cell  Parent cell, or NULL

psRegion* pmReadoutExtent ( const pmReadout readout  ) 

Return the extent of a readout.

The extent is determined from an image, if present, or the CELL.TRIMSEC otherwise.

Parameters:
readout  The readout of interest

void pmReadoutFreeData ( pmReadout readout  ) 

Free all data within a readout.

Parameters:
readout  Readout for which to free data

bool pmReadoutGenerateMask ( pmReadout readout  ) 

Generate a readout mask (suitable for output) using CELL.SATURATION and CELL.BAD.

Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD). The mask that is produced is suitable for output (complete with HDU entry). This is intended for most operations.

Parameters:
readout  Readout for which to generate mask

bool pmReadoutGenerateMaskWeight ( pmReadout readout,
bool  poisson 
)

Generate mask and weight map for a readout.

Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout

Parameters:
readout  Readout for which to generate mask and weights
poisson  Use poisson weights (in addition to read noise)?

bool pmReadoutGenerateWeight ( pmReadout readout,
bool  poisson 
)

Generate a weight map (suitable for output) using CELL.GAIN and CELL.READNOISE.

Calculates weights (actually variances) for each pixel using photon statistics and the cell gain (CELL.GAIN) and read noise (CELL.READNOISE). The weight map that is produced within the readout is suitable for output (complete with HDU entry). This is intended for most operations.

Parameters:
readout  Readout for which to generate weight
poisson  Use poisson weights (in addition to read noise)?

bool pmReadoutReadNext ( pmReadout readout,
psFits *  fits,
int  z,
int  numRows 
)

Read a readout incrementally.

Multiple calls to this function moves through a readout within a cell incrementally. It is required to pass the readout previously acquired (or a newly-allocated one) in order to preserve state information (where the read is at). Only a maximum of numRows rows are read at a time. Returns true if pixels are read, and false otherwise. To facilitate looping, no error is generated for reading a plane that doesn't exist. Note that this function doesn't put pixels in the HDU. It is therefore NOT COMPATIBLE with pmCellWrite, pmChipWrite, and pmFPAWrite (or any function that uses or creates an HDU for that matter). Use pmReadoutWriteNext to write the data that's read by this function. This function is intended for reading in many readouts into memory at once (e.g., for stacking) where the input is not written out.

bool pmReadoutSetMask ( pmReadout readout  ) 

Set a temporary readout mask using CELL.SATURATION and CELL.BAD.

Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD). The mask that is produced within the readout is temporary --- it is not added to the HDU. This is intended for when the user is iterating using pmReadoutReadNext, in which case the HDU can't be generated.

Parameters:
readout  Readout for which to set mask

bool pmReadoutSetWeight ( pmReadout readout,
bool  poisson 
)

Set a temporary readout weight map using CELL.GAIN and CELL.READNOISE.

Calculates weights (actually variances) for each pixel using photon statistics and the cell gain (CELL.GAIN) and read noise (CELL.READNOISE). The weight map that is produced within the readout is temporary --- it is not added to the HDU. This is intended for when the user is iterating using pmReadoutReadNext, in which case the HDU can't be generated.

Parameters:
readout  Readout for which to set weight
poisson  Use poisson weights (in addition to read noise)?

bool pmReadoutWriteJPEG ( pmReadout readout,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmReadoutWriteMANAPLOT ( pmReadout readout,
const pmFPAview view,
pmFPAfile file,
pmConfig config 
)

bool pmReadoutWriteNext ( pmReadout readout,
psFits *  fits,
int  z 
)

Write a readout incrementally.

Writes a readout to a FITS file, perhaps incrementally (if it has been read in using pmReadoutReadNext). Relies on the FITS header to specify how many image planes there are, and the width and height.

Parameters:
readout  Readout to write
fits  FITS file to which to write
z  Image plane to write


Generated on Fri Feb 2 22:35:59 2007 for Pan-STARRS Module Library by  doxygen 1.5.1