Object Detection / Analysis Functions


Data Structures

struct  pmGrowthCurve
struct  pmModel
 pmModel data structure More...
struct  pmModelGroup
struct  pmMoments
 pmMoments data structure More...
struct  pmPeak
 pmPeak data structure More...
struct  pmPSF
 pmPSF data structure More...
struct  pmPSFtry
 This structure contains a pointer to the collection of sources which will be used to test the PSF model form. More...
struct  pmSource
 pmSource data structure More...
struct  pmPSFClump
 pmPSFClump data structure More...
struct  pmSourcePlotLayout

Defines

#define PM_PAR_SKY   0
 Symbolic names for the elements of [d]params Note: these are defines not enums as a given element of [d]params may/will correspond to different parameters in different contexts Sky.
#define PM_PAR_I0   1
 Central intensity.
#define PM_PAR_XPOS   2
 X centre of object.
#define PM_PAR_YPOS   3
 Y centre of object.
#define PM_PAR_SXX   4
 shape X^2 moment
#define PM_PAR_SYY   5
 shape Y^2 moment
#define PM_PAR_SXY   6
 shape XY moment
#define PM_PAR_7   7
 ??? Unknown parameter
#define PM_PAR_8   8
 ??? Unknown parameter

Typedefs

typedef int pmModelType
typedef psMinimizeLMChi2Func pmModelFunc
typedef psMinimizeLMLimitFunc pmModelLimits
typedef psF64(*) pmModelFlux (const psVector *params)
typedef psF64(*) pmModelRadius (const psVector *params, double flux)
typedef bool(*) pmModelGuessFunc (pmModel *model, pmSource *source)
typedef bool(*) pmModelFromPSFFunc (pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf)
typedef bool(*) pmModelFitStatusFunc (pmModel *model)

Enumerations

enum  pmModelStatus { PM_MODEL_UNTRIED, PM_MODEL_SUCCESS, PM_MODEL_NONCONVERGE, PM_MODEL_OFFIMAGE, PM_MODEL_BADARGS }
enum  pmPeakType { PM_PEAK_LONE, PM_PEAK_EDGE, PM_PEAK_FLAT, PM_PEAK_UNDEF }
 pmPeakType More...
enum  pmPSFApTrendOptions { PM_PSF_APTREND_ERROR = 0, PM_PSF_APTREND_NONE, PM_PSF_APTREND_CONSTANT, PM_PSF_APTREND_SKYBIAS, PM_PSF_APTREND_SKYSAT, PM_PSF_APTREND_XY_LIN, PM_PSF_APTREND_XY_QUAD, PM_PSF_APTREND_SKY_XY_LIN, PM_PSF_APTREND_SKYSAT_XY_LIN, PM_PSF_APTREND_ALL }
enum  pmPSFtryMaskValues { PSFTRY_MASK_CLEAR = 0x00, PSFTRY_MASK_OUTLIER = 0x01, PSFTRY_MASK_EXT_FAIL = 0x02, PSFTRY_MASK_PSF_FAIL = 0x04, PSFTRY_MASK_BAD_PHOT = 0x08, PSFTRY_MASK_ALL = 0x0f }
 pmPSFtryMaskValues More...
enum  pmSourceType { PM_SOURCE_TYPE_UNKNOWN, PM_SOURCE_TYPE_DEFECT, PM_SOURCE_TYPE_SATURATED, PM_SOURCE_TYPE_STAR, PM_SOURCE_TYPE_EXTENDED }
 pmSourceType enumeration More...
enum  pmSourceMode {
  PM_SOURCE_MODE_DEFAULT = 0x0000, PM_SOURCE_MODE_PSFMODEL = 0x0001, PM_SOURCE_MODE_EXTMODEL = 0x0002, PM_SOURCE_MODE_SUBTRACTED = 0x0004, PM_SOURCE_MODE_FITTED = 0x0008, PM_SOURCE_MODE_FAIL = 0x0010, PM_SOURCE_MODE_POOR = 0x0020, PM_SOURCE_MODE_PAIR = 0x0040, PM_SOURCE_MODE_PSFSTAR = 0x0080, PM_SOURCE_MODE_SATSTAR = 0x0100,
  PM_SOURCE_MODE_BLEND = 0x0200, PM_SOURCE_MODE_LINEAR = 0x0400, PM_SOURCE_MODE_TEMPSUB = 0x0800, PM_SOURCE_MODE_EXTERNAL = 0x1000
}
enum  pmSourceFitMode { PM_SOURCE_FIT_NORM, PM_SOURCE_FIT_PSF, PM_SOURCE_FIT_EXT, PM_SOURCE_FIT_PSF_AND_SKY, PM_SOURCE_FIT_EXT_AND_SKY }
enum  pmSourcePhotometryMode { PM_SOURCE_PHOT_NONE = 0x0000, PM_SOURCE_PHOT_GROWTH = 0x0001, PM_SOURCE_PHOT_APCORR = 0x0002, PM_SOURCE_PHOT_WEIGHT = 0x0004, PM_SOURCE_PHOT_INTERP = 0x0008 }
 The function returns both the magnitude of the fit, defined as -2.5log(flux), where the flux is integrated under the model, theoretically from a radius of 0 to infinity. More...

Functions

pmGrowthCurvepmGrowthCurveAlloc (psF32 minRadius, psF32 maxRadius, psF32 refRadius)
psF32 pmGrowthCurveCorrect (pmGrowthCurve *growth, psF32 radius)
pmModelpmModelAlloc (pmModelType type)
 pmModelAlloc()
pmModelpmModelCopy (pmModel *model)
psF32 pmModelEval (pmModel *model, psImage *image, psS32 col, psS32 row)
bool pmModelAdd (psImage *image, psImage *mask, pmModel *model, bool center, bool sky)
 pmModelAdd()
bool pmModelSub (psImage *image, psImage *mask, pmModel *model, bool center, bool sky)
 pmModelSub()
bool pmModelFitStatus (pmModel *model)
 pmModelFitStatus()
pmModelGrouppmModelGroupAlloc (int nModels)
bool pmModelGroupInit (void)
void pmModelGroupCleanup (void)
void pmModelGroupAdd (pmModelGroup *model)
int pmModelParameterCount (pmModelType type)
char * pmModelGetType (pmModelType type)
pmModelType pmModelSetType (char *name)
 This function returns the internal model type code for the user-space model names.
pmModelFunc pmModelFunc_GetFunction (pmModelType type)
 pmModelFunc is the function used to determine the value of the model at a specific coordinate, and is the one used by psMinimizeLMChi2.
pmModelFlux pmModelFlux_GetFunction (pmModelType type)
 pmModelFlux returns the total integrated flux for the given input parameters.
pmModelRadius pmModelRadius_GetFunction (pmModelType type)
 pmModelRadius returns the scaling radius at which the flux of the model matches the specified flux.
pmModelLimits pmModelLimits_GetFunction (pmModelType type)
 pmModelLimits sets the parameter limit vectors for the function.
pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type)
 pmModelGuessFunc generates an initial guess for the model based on the provided source statistics (moments and pixel values as needed).
pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type)
 pmModelFromPSFFunc takes as input a representation of the psf and a value for the model and fills in the PSF parameters of the model.
pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction (pmModelType type)
 pmModelFitStatusFunc returns a true or false values based on the success or failure of a model fit.
pmModelpmSourceModelGuess (pmSource *source, pmModelType model)
 pmSourceModelGuess()
pmMomentspmMomentsAlloc ()
 pmMomentsAlloc()
pmPeakpmPeakAlloc (int x, int y, float counts, pmPeakType type)
 pmPeakAlloc()
bool pmIsPeak (const psPtr ptr)
psVector * pmFindVectorPeaks (const psVector *vector, float threshold)
 pmFindVectorPeaks()
psArray * pmFindImagePeaks (const psImage *image, float threshold)
 pmFindImagePeaks()
psList * pmCullPeaks (psList *peaks, float maxValue, const psRegion valid)
 pmCullPeaks()
psArray * pmPeaksSubset (psArray *peaks, float maxvalue, const psRegion valid)
 pmPeaksSubset()
int pmPeaksCompareAscend (const void **a, const void **b)
int pmPeaksCompareDescend (const void **a, const void **b)
pmPSFpmPSFAlloc (pmModelType type, bool poissonErrors, psPolynomial2D *psfTrendMask)
 Allocator for the pmPSF structure.
pmModelpmModelFromPSF (pmModel *model, pmPSF *psf)
 This function constructs a pmModel instance based on the pmPSF description of the PSF.
bool pmPSFMaskApTrend (psPolynomial4D *trend, pmPSFApTrendOptions option)
pmPSFApTrendOptions pmPSFApTrendOptionFromName (char *name)
double pmPSF_SXYfromModel (psF32 *modelPar)
double pmPSF_SXYtoModel (psF32 *fittedPar)
bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore)
pmPSFpmPSFBuildSimple (char *typeName, float sxx, float syy, float sxy,...)
psMetadata * pmPSFtoMetadata (psMetadata *metadata, pmPSF *psf)
pmPSFpmPSFfromMetadata (psMetadata *metadata)
bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
pmPSFtrypmPSFtryAlloc (psArray *sources, char *modelName, bool poissonErrors, psPolynomial2D *psfTrendMask)
 pmPSFtryAlloc()
pmPSFtrypmPSFtryModel (psArray *sources, char *modelName, float RADIUS, bool poissonErrors, psPolynomial2D *psfTrendMask, bool applyWeights)
 pmPSFtryModel()
bool pmPSFtryMetric (pmPSFtry *psfTry, float RADIUS)
 pmPSFtryMetric()
bool pmPSFtryMetric_Alt (pmPSFtry *try, float RADIUS)
 pmPSFtryMetric_Alt()
bool pmPSFFromPSFtry (pmPSFtry *psfTry, bool applyWeights)
 This function takes a collection of pmModel fitted models from across a single image and builds a pmPSF representation of the PSF.
pmSourcepmSourceAlloc ()
 pmSourceAlloc()
pmSourcepmSourceCopy (pmSource *source)
 pmSourceCopy()
void pmSourceFreePixels (pmSource *source)
bool pmIsSource (const psPtr ptr)
bool pmSourceDefinePixels (pmSource *mySource, const pmReadout *readout, psF32 x, psF32 y, psF32 Radius)
 pmSourceDefinePixels()
bool pmSourceRedefinePixels (pmSource *mySource, const pmReadout *readout, psF32 x, psF32 y, psF32 Radius)
pmPSFClump pmSourcePSFClump (psArray *source, psMetadata *metadata)
 pmSourcePSFClump()
bool pmSourceRoughClass (psArray *source, psMetadata *metadata, pmPSFClump clump)
 pmSourceRoughClass()
bool pmSourceMoments (pmSource *source, float radius)
 pmSourceMoments()
pmModelpmSourceSelectModel (pmSource *source)
psArray * pmSourceContour (psImage *image, int xc, int yc, float threshold)
psArray * pmSourceContour_Crude (pmSource *source, const psImage *image, float level)
 pmSourceContour()
bool pmSourceFitModelInit (float nIter, float tol, float weight, bool poissonErrors)
bool pmSourceFitModel (pmSource *source, pmModel *model, pmSourceFitMode mode)
 pmSourceFitModel()
bool pmSourceFitSetInit (pmModelType type)
void pmSourceFitSetClear (void)
bool pmSourceFitSet_CheckLimits (psMinConstraintMode mode, int nParam, float *params, float *betas)
psF32 pmSourceFitSet_Function (psVector *deriv, const psVector *params, const psVector *x)
bool pmSourceFitSet (pmSource *source, psArray *modelSet, pmSourceFitMode mode)
 pmSourceFitSet()
int pmSourceDophotType (pmSource *source)
bool pmSourcesWriteRAW (psArray *sources, char *filename)
bool pmSourcesWriteOBJ (psArray *sources, char *filename)
bool pmSourcesWriteSX (psArray *sources, char *filename)
bool pmSourcesWriteCMP (psArray *sources, char *filename, psMetadata *header)
bool pmSourcesWriteCMF (psFits *fits, psArray *sources, psMetadata *header, char *extname)
psArray * pmSourcesReadCMP (char *filename, psMetadata *header)
psArray * pmSourcesReadCMF (psFits *fits, psMetadata *header)
bool pmSourcesWritePSFs (psArray *sources, char *filename)
bool pmSourcesWriteEXTs (psArray *sources, char *filename, bool require)
bool pmSourcesWriteNULLs (psArray *sources, char *filename)
bool pmMomentsWriteText (psArray *sources, char *filename)
bool pmPeaksWriteText (psArray *peaks, char *filename)
bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmSourcePhotometryModel (float *fitMag, pmModel *model)
bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask)
bool pmSourceMagnitudesInit (psMetadata *config)
bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode)
double pmSourceCrossProduct (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum)
double pmSourceCrossWeight (const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum)
bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask)
bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight)
pmModelpmSourceGetModel (bool *isPSF, const pmSource *source)
double pmSourceWeight (const pmSource *Mi, int term, const bool unweighted_sum)
pmSourcePlotLayoutpmSourcePlotLayoutAlloc ()
bool pmFPAviewWriteSourcePlot (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
bool pmFPAWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)
bool pmChipWriteSourcePlot (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)
bool pmSourcePlotPSFModel (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)
bool pmSourcePlotMoments (const pmFPAview *view, pmFPAfile *file, pmConfig *config, pmSourcePlotLayout *layout)
bool pmSourceLocalSky (pmSource *source, psStatsOptions statsOptions, float Radius)
 pmSourceLocalSky()
bool pmSourceLocalSkyVariance (pmSource *source, psStatsOptions statsOptions, float Radius)


Define Documentation

#define PM_PAR_7   7

??? Unknown parameter

Definition at line 63 of file pmModel.h.

#define PM_PAR_8   8

??? Unknown parameter

Definition at line 64 of file pmModel.h.

#define PM_PAR_I0   1

Central intensity.

Definition at line 57 of file pmModel.h.

#define PM_PAR_SKY   0

Symbolic names for the elements of [d]params Note: these are defines not enums as a given element of [d]params may/will correspond to different parameters in different contexts Sky.

Definition at line 56 of file pmModel.h.

#define PM_PAR_SXX   4

shape X^2 moment

Definition at line 60 of file pmModel.h.

#define PM_PAR_SXY   6

shape XY moment

Definition at line 62 of file pmModel.h.

#define PM_PAR_SYY   5

shape Y^2 moment

Definition at line 61 of file pmModel.h.

#define PM_PAR_XPOS   2

X centre of object.

Definition at line 58 of file pmModel.h.

#define PM_PAR_YPOS   3

Y centre of object.

Definition at line 59 of file pmModel.h.


Typedef Documentation

typedef bool(*) pmModelFitStatusFunc(pmModel *model)

Definition at line 53 of file pmModelGroup.h.

typedef psF64(*) pmModelFlux(const psVector *params)

Definition at line 29 of file pmModelGroup.h.

typedef bool(*) pmModelFromPSFFunc(pmModel *modelPSF, pmModel *modelEXT, pmPSF *psf)

Definition at line 49 of file pmModelGroup.h.

typedef psMinimizeLMChi2Func pmModelFunc

Definition at line 23 of file pmModelGroup.h.

typedef bool(*) pmModelGuessFunc(pmModel *model, pmSource *source)

Definition at line 43 of file pmModelGroup.h.

typedef psMinimizeLMLimitFunc pmModelLimits

Definition at line 26 of file pmModelGroup.h.

typedef psF64(*) pmModelRadius(const psVector *params, double flux)

Definition at line 34 of file pmModelGroup.h.

typedef int pmModelType

Definition at line 19 of file pmModel.h.


Enumeration Type Documentation

enum pmModelStatus

Enumerator:
PM_MODEL_UNTRIED  model fit not yet attempted
PM_MODEL_SUCCESS  model fit succeeded
PM_MODEL_NONCONVERGE  model fit did not converge
PM_MODEL_OFFIMAGE  model fit drove out of range
PM_MODEL_BADARGS  model fit called with invalid args

Definition at line 21 of file pmModel.h.

enum pmPeakType

pmPeakType

A peak pixel may have several features which may be determined when the peak is found or measured. These are specified by the pmPeakType enum. PM_PEAK_LONE represents a single pixel which is higher than its 8 immediate neighbors. The PM_PEAK_EDGE represents a peak pixel which touching the image edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific number of neighbors at the same value, within some tolarence:

Enumerator:
PM_PEAK_LONE  Isolated peak.
PM_PEAK_EDGE  Peak on edge.
PM_PEAK_FLAT  Peak has equal-value neighbors.
PM_PEAK_UNDEF  Undefined.

Definition at line 33 of file pmPeaks.h.

enum pmPSFApTrendOptions

Enumerator:
PM_PSF_APTREND_ERROR 
PM_PSF_APTREND_NONE 
PM_PSF_APTREND_CONSTANT 
PM_PSF_APTREND_SKYBIAS 
PM_PSF_APTREND_SKYSAT 
PM_PSF_APTREND_XY_LIN 
PM_PSF_APTREND_XY_QUAD 
PM_PSF_APTREND_SKY_XY_LIN 
PM_PSF_APTREND_SKYSAT_XY_LIN 
PM_PSF_APTREND_ALL 

Definition at line 19 of file pmPSF.h.

enum pmPSFtryMaskValues

pmPSFtryMaskValues

The following datatype defines the masks used by the pmPSFtry analysis to identify sources which should or should not be included in the analysis.

Enumerator:
PSFTRY_MASK_CLEAR  Add comment.
PSFTRY_MASK_OUTLIER  1: outlier in psf polynomial fit (provided by psPolynomials)
PSFTRY_MASK_EXT_FAIL  2: ext model failed to converge
PSFTRY_MASK_PSF_FAIL  3: psf model failed to converge
PSFTRY_MASK_BAD_PHOT  4: invalid source photometry
PSFTRY_MASK_ALL  Add comment.

Definition at line 64 of file pmPSFtry.h.

enum pmSourceFitMode

Enumerator:
PM_SOURCE_FIT_NORM 
PM_SOURCE_FIT_PSF 
PM_SOURCE_FIT_EXT 
PM_SOURCE_FIT_PSF_AND_SKY 
PM_SOURCE_FIT_EXT_AND_SKY 

Definition at line 16 of file pmSourceFitModel.h.

enum pmSourceMode

Enumerator:
PM_SOURCE_MODE_DEFAULT 
PM_SOURCE_MODE_PSFMODEL 
PM_SOURCE_MODE_EXTMODEL 
PM_SOURCE_MODE_SUBTRACTED 
PM_SOURCE_MODE_FITTED 
PM_SOURCE_MODE_FAIL 
PM_SOURCE_MODE_POOR 
PM_SOURCE_MODE_PAIR 
PM_SOURCE_MODE_PSFSTAR 
PM_SOURCE_MODE_SATSTAR 
PM_SOURCE_MODE_BLEND 
PM_SOURCE_MODE_LINEAR 
PM_SOURCE_MODE_TEMPSUB  XXX get me a better name!
PM_SOURCE_MODE_EXTERNAL  XXX get me a better name!

Definition at line 51 of file pmSource.h.

enum pmSourcePhotometryMode

The function returns both the magnitude of the fit, defined as -2.5log(flux), where the flux is integrated under the model, theoretically from a radius of 0 to infinity.

In practice, we integrate the model beyond 50sigma. The aperture magnitude is defined as -2.5log(flux) , where the flux is summed for all pixels which are not excluded by the aperture mask. The model flux is calculated by calling the model-specific function provided by pmModelFlux_GetFunction.

XXX: must code this.

Enumerator:
PM_SOURCE_PHOT_NONE 
PM_SOURCE_PHOT_GROWTH 
PM_SOURCE_PHOT_APCORR 
PM_SOURCE_PHOT_WEIGHT 
PM_SOURCE_PHOT_INTERP 

Definition at line 30 of file pmSourcePhotometry.h.

enum pmSourceType

pmSourceType enumeration

A given source may be identified as most-likely to be one of several source types. The pmSource entry pmSourceType defines the current best-guess for this source.

XXX: The values given below are currently illustrative and will require some modification as the source classification code is developed. (TBD)

Enumerator:
PM_SOURCE_TYPE_UNKNOWN  a cosmic-ray
PM_SOURCE_TYPE_DEFECT  a cosmic-ray
PM_SOURCE_TYPE_SATURATED  random saturated pixels
PM_SOURCE_TYPE_STAR  a good-quality star
PM_SOURCE_TYPE_EXTENDED  an extended object (eg, galaxy)

Definition at line 43 of file pmSource.h.


Function Documentation

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

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

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

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

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

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

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

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

bool pmChipWriteSourcePlot ( pmFPA fpa,
const pmFPAview view,
pmFPAfile file,
pmConfig config,
pmSourcePlotLayout layout 
)

psList* pmCullPeaks ( psList *  peaks,
float  maxValue,
const psRegion  valid 
)

pmCullPeaks()

Eliminate peaks from the psList that have a peak value above the given maximum, or fall outside the valid region.

Parameters:
peaks  The psList of peaks to be culled
maxValue  Cull peaks above this value
valid  Cull peaks otside this psRegion

psArray* pmFindImagePeaks ( const psImage *  image,
float  threshold 
)

pmFindImagePeaks()

Find all local peaks in the given image above the given threshold. This function should find all row peaks using pmFindVectorPeaks, then test each row peak and exclude peaks which are not local peaks. A peak is a local peak if it has a higher value than all 8 neighbors. If the peak has the same value as its +y neighbor or +x neighbor, it is NOT a local peak. If any other neighbors have an equal value, the peak is considered a valid peak. Note two points: first, the +x neighbor condition is already enforced by pmFindVectorPeaks. Second, these rules have the effect of making flat-topped regions have single peaks at the (+x,+y) corner. When selecting the peaks, their type must also be set. The result of this function is an array of pmPeak entries.

Parameters:
image  The input image where peaks will be found (float)
threshold  Threshold above which to find a peak

psVector* pmFindVectorPeaks ( const psVector *  vector,
float  threshold 
)

pmFindVectorPeaks()

Find all local peaks in the given vector above the given threshold. A peak is defined as any element with a value greater than its two neighbors and with a value above the threshold. Two types of special cases must be addressed. Equal value elements: If an element has the same value as the following element, it is not considered a peak. If an element has the same value as the preceding element (but not the following), then it is considered a peak. Note that this rule (arbitrarily) identifies flat regions by their trailing edge. Edge cases: At start of the vector, the element must be higher than its neighbor. At the end of the vector, the element must be higher or equal to its neighbor. These two rules again places the peak associated with a flat region which touches the image edge at the image edge. The result of this function is a vector containing the coordinates (element number) of the detected peaks (type psU32).

Parameters:
vector  The input vector (float)
threshold  Threshold above which to find a peak

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

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

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

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

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

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

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

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

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

bool pmFPAWriteSourcePlot ( pmFPA fpa,
const pmFPAview view,
pmFPAfile file,
pmConfig config,
pmSourcePlotLayout layout 
)

pmGrowthCurve* pmGrowthCurveAlloc ( psF32  minRadius,
psF32  maxRadius,
psF32  refRadius 
)

psF32 pmGrowthCurveCorrect ( pmGrowthCurve growth,
psF32  radius 
)

bool pmGrowthCurveGenerate ( pmReadout readout,
pmPSF psf,
bool  ignore 
)

bool pmIsPeak ( const psPtr  ptr  ) 

bool pmIsSource ( const psPtr  ptr  ) 

bool pmModelAdd ( psImage *  image,
psImage *  mask,
pmModel model,
bool  center,
bool  sky 
)

pmModelAdd()

Add the given source model flux to/from the provided image. The boolean option center selects if the source is re-centered to the image center or if it is placed at its centroid location. The boolean option sky selects if the background sky is applied (TRUE) or not. The pixel range in the target image is at most the pixel range specified by the source.pixels image. The success status is returned.

Parameters:
image  The output image (float)
mask  The image pixel mask (valid == 0)
model  The input pmModel
center  A boolean flag that determines whether pixels are centered
sky  A boolean flag that determines if the sky is subtracted

pmModel* pmModelAlloc ( pmModelType  type  ) 

pmModelAlloc()

pmModel* pmModelCopy ( pmModel model  ) 

psF32 pmModelEval ( pmModel model,
psImage *  image,
psS32  col,
psS32  row 
)

bool pmModelFitStatus ( pmModel model  ) 

pmModelFitStatus()

This function wraps the call to the model-specific function returned by pmModelFitStatusFunc_GetFunction. The model-specific function examines the model parameters, parameter errors, Chisq, S/N, and other parameters available from model to decide if the particular fit was successful or not.

XXX: Must code this.

Parameters:
model  Model to be used

pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction ( pmModelType  type  ) 

pmModelFitStatusFunc returns a true or false values based on the success or failure of a model fit.

The success is determined by quantities such as the chisq or the signal-to-noise.

pmModelFlux pmModelFlux_GetFunction ( pmModelType  type  ) 

pmModelFlux returns the total integrated flux for the given input parameters.

pmModel* pmModelFromPSF ( pmModel model,
pmPSF psf 
)

This function constructs a pmModel instance based on the pmPSF description of the PSF.

The input is a pmModel with at least the values of the centroid coordinates (possibly normalization if this is needed) defined. The values of the PSF-dependent parameters are specified for the specific realization based on the coordinates of the object.

Parameters:
model  Add comment
psf  Add comment

pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction ( pmModelType  type  ) 

pmModelFromPSFFunc takes as input a representation of the psf and a value for the model and fills in the PSF parameters of the model.

The input primarily relies upon the centroid coordinates of the input model, though the normalization may potentially be used.

pmModelFunc pmModelFunc_GetFunction ( pmModelType  type  ) 

pmModelFunc is the function used to determine the value of the model at a specific coordinate, and is the one used by psMinimizeLMChi2.

char* pmModelGetType ( pmModelType  type  ) 

Parameters:
type  Add comment.

void pmModelGroupAdd ( pmModelGroup model  ) 

pmModelGroup* pmModelGroupAlloc ( int  nModels  ) 

void pmModelGroupCleanup ( void   ) 

bool pmModelGroupInit ( void   ) 

pmModelGuessFunc pmModelGuessFunc_GetFunction ( pmModelType  type  ) 

pmModelGuessFunc generates an initial guess for the model based on the provided source statistics (moments and pixel values as needed).

pmModelLimits pmModelLimits_GetFunction ( pmModelType  type  ) 

pmModelLimits sets the parameter limit vectors for the function.

int pmModelParameterCount ( pmModelType  type  ) 

Parameters:
type  Add comment.

pmModelRadius pmModelRadius_GetFunction ( pmModelType  type  ) 

pmModelRadius returns the scaling radius at which the flux of the model matches the specified flux.

This presumes that the model is a function of an elliptical contour.

pmModelType pmModelSetType ( char *  name  ) 

This function returns the internal model type code for the user-space model names.

Parameters:
name  Add comment.

bool pmModelSub ( psImage *  image,
psImage *  mask,
pmModel model,
bool  center,
bool  sky 
)

pmModelSub()

Subtract the given source model flux to/from the provided image. The boolean option center selects if the source is re-centered to the image center or if it is placed at its centroid location. The boolean option sky selects if the background sky is applied (TRUE) or not. The pixel range in the target image is at most the pixel range specified by the source.pixels image. The success status is returned.

Parameters:
image  The output image (float)
mask  The image pixel mask (valid == 0)
model  The input pmModel
center  A boolean flag that determines whether pixels are centered
sky  A boolean flag that determines if the sky is subtracted

pmMoments* pmMomentsAlloc (  ) 

pmMomentsAlloc()

bool pmMomentsWriteText ( psArray *  sources,
char *  filename 
)

pmPeak* pmPeakAlloc ( int  x,
int  y,
float  counts,
pmPeakType  type 
)

pmPeakAlloc()

Returns:
pmPeak* newly allocated pmPeak with all internal pointers set to NULL
Parameters:
x  Row-coordinate in image space
y  Col-coordinate in image space
counts  The value of the peak pixel
type  The type of peak pixel

int pmPeaksCompareAscend ( const void **  a,
const void **  b 
)

int pmPeaksCompareDescend ( const void **  a,
const void **  b 
)

psArray* pmPeaksSubset ( psArray *  peaks,
float  maxvalue,
const psRegion  valid 
)

pmPeaksSubset()

Create a new peaks array, removing certain types of peaks from the input array of peaks based on the given criteria. Peaks should be eliminated if they have a peak value above the given maximum value limit or if the fall outside the valid region. The result of the function is a new array with a reduced number of peaks.

Parameters:
peaks  Add comment.
maxvalue  Add comment.
valid  Add comment.

bool pmPeaksWriteText ( psArray *  peaks,
char *  filename 
)

double pmPSF_SXYfromModel ( psF32 *  modelPar  ) 

double pmPSF_SXYtoModel ( psF32 *  fittedPar  ) 

pmPSF* pmPSFAlloc ( pmModelType  type,
bool  poissonErrors,
psPolynomial2D *  psfTrendMask 
)

Allocator for the pmPSF structure.

pmPSFApTrendOptions pmPSFApTrendOptionFromName ( char *  name  ) 

pmPSF* pmPSFBuildSimple ( char *  typeName,
float  sxx,
float  syy,
float  sxy,
  ... 
)

pmPSF* pmPSFfromMetadata ( psMetadata *  metadata  ) 

bool pmPSFFromPSFtry ( pmPSFtry psfTry,
bool  applyWeights 
)

This function takes a collection of pmModel fitted models from across a single image and builds a pmPSF representation of the PSF.

The input array of model fits may consist of entries to be ignored (noted by a non-zero mask entry). The analysis of the models fits a 2D polynomial for each parameter to the collection of model parameters as a function of position (and normalization?). In this process, some of the input models may be marked as outliers and excluded from the fit. These elements will be marked with a specific mask value (1 == PSFTRY_MASK_OUTLIER).

bool pmPSFMaskApTrend ( psPolynomial4D *  trend,
pmPSFApTrendOptions  option 
)

psMetadata* pmPSFtoMetadata ( psMetadata *  metadata,
pmPSF psf 
)

pmPSFtry* pmPSFtryAlloc ( psArray *  sources,
char *  modelName,
bool  poissonErrors,
psPolynomial2D *  psfTrendMask 
)

pmPSFtryAlloc()

Allocate a pmPSFtry data structure.

bool pmPSFtryMetric ( pmPSFtry psfTry,
float  RADIUS 
)

pmPSFtryMetric()

This function is used to measure the PSF model metric for the set of results contained in the pmPSFtry structure.

Parameters:
psfTry  Add comment.
RADIUS  Add comment.

bool pmPSFtryMetric_Alt ( pmPSFtry try,
float  RADIUS 
)

pmPSFtryMetric_Alt()

This function is used to measure the PSF model metric for the set of results contained in the pmPSFtry structure (alternative implementation).

Parameters:
try  Add comment.
RADIUS  Add comment.

pmPSFtry* pmPSFtryModel ( psArray *  sources,
char *  modelName,
float  RADIUS,
bool  poissonErrors,
psPolynomial2D *  psfTrendMask,
bool  applyWeights 
)

pmPSFtryModel()

This function takes the input collection of sources and performs a complete analysis to determine a PSF model of the given type (specified by model name). The result is a pmPSFtry with the results of the analysis.

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

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

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

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

pmSource* pmSourceAlloc (  ) 

pmSourceAlloc()

bool pmSourceChisq ( pmModel model,
psImage *  image,
psImage *  mask,
psImage *  weight 
)

psArray* pmSourceContour ( psImage *  image,
int  xc,
int  yc,
float  threshold 
)

psArray* pmSourceContour_Crude ( pmSource source,
const psImage *  image,
float  level 
)

pmSourceContour()

Find points in a contour for the given source at the given level. If type is PM_CONTOUR_CRUDE, the contour is found by starting at the source peak, running along each pixel row until the level is crossed, then interpolating to the level coordinate for that row. This is done for each row, with the starting point determined by the midpoint of the previous row, until the starting point has a value below the contour level. The returned contour consists of two vectors giving the x and y coordinates of the contour levels. This function may be used as part of the model guess inputs. Other contour types may be specified in the future for more refined contours (TBD)

Parameters:
source  The input pmSource
image  The input image (float) (this arg should be removed)
level  The level of the contour

pmSource* pmSourceCopy ( pmSource source  ) 

pmSourceCopy()

double pmSourceCrossProduct ( const pmSource Mi,
const pmSource Mj,
const bool  unweighted_sum 
)

double pmSourceCrossWeight ( const pmSource Mi,
const pmSource Mj,
const bool  unweighted_sum 
)

bool pmSourceDefinePixels ( pmSource mySource,
const pmReadout readout,
psF32  x,
psF32  y,
psF32  Radius 
)

pmSourceDefinePixels()

Define psImage subarrays for the source located at coordinates x,y on the image set defined by readout. The pixels defined by this operation consist of a square window (of full width 2Radius+1) centered on the pixel which contains the given coordinate, in the frame of the readout. The window is defined to have limits which are valid within the boundary of the readout image, thus if the radius would fall outside the image pixels, the subimage is truncated to only consist of valid pixels. If readout->mask or readout->weight are not NULL, matching subimages are defined for those images as well. This function fails if no valid pixels can be defined (x or y less than Radius, for example). This function should be used to define a region of interest around a source, including both source and sky pixels.

Parameters:
mySource  source to be re-defined
readout  base the source on this readout
x  center coords of source
y  center coords of source
Radius  size of box on source

int pmSourceDophotType ( pmSource source  ) 

bool pmSourceFitModel ( pmSource source,
pmModel model,
pmSourceFitMode  mode 
)

pmSourceFitModel()

Fit the requested model to the specified source. The starting guess for the model is given by the input source.model parameter values. The pixels of interest are specified by the source.pixels and source.mask entries. This function calls psMinimizeLMChi2() on the image data. The function returns TRUE on success or FALSE on failure.

Parameters:
source  The input pmSource
model  model to be fitted
mode  define parameters to be fitted

bool pmSourceFitModelInit ( float  nIter,
float  tol,
float  weight,
bool  poissonErrors 
)

Parameters:
nIter  max number of allowed iterations
tol  convergence criterion
weight  use this weight for constant-weight fits

bool pmSourceFitSet ( pmSource source,
psArray *  modelSet,
pmSourceFitMode  mode 
)

pmSourceFitSet()

Fit the requested model to the specified source. The starting guess for the model is given by the input source.model parameter values. The pixels of interest are specified by the source.pixels and source.mask entries. This function calls psMinimizeLMChi2() on the image data. The function returns TRUE on success or FALSE on failure.

Parameters:
source  The input pmSource
modelSet  model to be fitted
mode  define parameters to be fitted

bool pmSourceFitSet_CheckLimits ( psMinConstraintMode  mode,
int  nParam,
float *  params,
float *  betas 
)

psF32 pmSourceFitSet_Function ( psVector *  deriv,
const psVector *  params,
const psVector *  x 
)

void pmSourceFitSetClear ( void   ) 

bool pmSourceFitSetInit ( pmModelType  type  ) 

void pmSourceFreePixels ( pmSource source  ) 

pmModel* pmSourceGetModel ( bool *  isPSF,
const pmSource source 
)

bool pmSourceLocalSky ( pmSource source,
psStatsOptions  statsOptions,
float  Radius 
)

pmSourceLocalSky()

Measure the local sky in the vicinity of the given source. The Radius defines the square aperture in which the moments will be measured. This function assumes the source pixels have been defined, and that the value of Radius here is smaller than the value of Radius used to define the pixels. The annular region not contained within the radius defined here is used to measure the local background in the vicinity of the source. The local background measurement uses the specified statistic passed in via the statsOptions entry. This function allocates the pmMoments structure. The resulting sky is used to set the value of the pmMoments.sky element of the provided pmSource structure.

Parameters:
source  The input image (float)
statsOptions  The statistic used in calculating the background sky
Radius  The inner radius of the square annulus to exclude

bool pmSourceLocalSkyVariance ( pmSource source,
psStatsOptions  statsOptions,
float  Radius 
)

Parameters:
source  The input image (float)
statsOptions  The statistic used in calculating the background sky
Radius  The inner radius of the square annulus to exclude

bool pmSourceMagnitudes ( pmSource source,
pmPSF psf,
pmSourcePhotometryMode  mode 
)

bool pmSourceMagnitudesInit ( psMetadata *  config  ) 

pmModel* pmSourceModelGuess ( pmSource source,
pmModelType  model 
)

pmSourceModelGuess()

Convert available data to an initial guess for the given model. This function allocates a pmModel entry for the pmSource structure based on the provided model selection. The method of defining the model parameter guesses are specified for each model below. The guess values are placed in the model parameters. The function returns TRUE on success or FALSE on failure.

Parameters:
source  The input pmSource
model  The type of model to be created.

bool pmSourceMoments ( pmSource source,
float  radius 
)

pmSourceMoments()

Measure source moments for the given source, using the value of source.moments.sky provided as the local background value and the peak coordinates as the initial source location. The resulting moment values are applied to the source.moments entry, and the source is returned. The moments are measured within the given circular radius of the source.peak coordinates. The return value indicates the success (TRUE) of the operation.

Parameters:
source  The input pmSource for which moments will be computed
radius  Use a circle of pixels around the peak

bool pmSourcePhotometryAper ( float *  apMag,
pmModel model,
psImage *  image,
psImage *  mask 
)

Parameters:
apMag  aperture flux magnitude
model  model used for photometry
image  image pixels to be used
mask  mask of pixels to ignore

bool pmSourcePhotometryModel ( float *  fitMag,
pmModel model 
)

Parameters:
fitMag  integrated fit magnitude
model  model used for photometry

bool pmSourcePixelWeight ( float *  pixWeight,
pmModel model,
psImage *  image,
psImage *  mask 
)

pmSourcePlotLayout* pmSourcePlotLayoutAlloc (  ) 

bool pmSourcePlotMoments ( const pmFPAview view,
pmFPAfile file,
pmConfig config,
pmSourcePlotLayout layout 
)

bool pmSourcePlotPSFModel ( const pmFPAview view,
pmFPAfile file,
pmConfig config,
pmSourcePlotLayout layout 
)

pmPSFClump pmSourcePSFClump ( psArray *  source,
psMetadata *  metadata 
)

pmSourcePSFClump()

We use the source moments to make an initial, approximate source classification, and as part of the information needed to build a PSF model for the image. As long as the PSF shape does not vary excessively across the image, the sources which are represented by a PSF (the start) will have very similar second moments. The function pmSourcePSFClump searches a collection of sources with measured moments for a group with moments which are all very similar. The function returns a pmPSFClump structure, representing the centroid and size of the clump in the sigma_x, sigma_y second-moment plane.

The goal is to identify and characterize the stellar clump within the sigma_x, sigma_y second-moment plane. To do this, an image is constructed to represent this plane. The units of sigma_x and sigma_y are in image pixels. A pixel in this analysis image represents 0.1 pixels in the input image. The dimensions of the image need only be 10 pixels. The peak pixel in this image (above a threshold of half of the image maximum) is found. The coordinates of this peak pixel represent the 2D mode of the sigma_x, sigma_y distribution. The sources with sigma_x, sigma_y within 0.2 pixels of this value are then * used to calculate the median and standard deviation of the sigma_x, sigma_y values. These resulting values are returned via the pmPSFClump structure.

The return value indicates the success (TRUE) of the operation.

XXX: Limit the S/N of the candidate sources (part of Metadata)? (TBD). XXX: Save the clump parameters on the Metadata (TBD)

Parameters:
source  The input pmSource
metadata  Contains classification parameters

bool pmSourceRedefinePixels ( pmSource mySource,
const pmReadout readout,
psF32  x,
psF32  y,
psF32  Radius 
)

Parameters:
mySource  source to be re-defined
readout  base the source on this readout
x  center coords of source
y  center coords of source
Radius  size of box on source

bool pmSourceRoughClass ( psArray *  source,
psMetadata *  metadata,
pmPSFClump  clump 
)

pmSourceRoughClass()

Based on the specified data values, make a guess at the source classification. The sources are provides as a psArray of pmSource entries. Definable parameters needed to make the classification are provided to the routine with the psMetadata structure. The rules (in SDRS) refer to values which can be extracted from the metadata using the given keywords. Except as noted, the data type for these parameters are psF32.

Parameters:
source  The input pmSource
metadata  Contains classification parameters
clump  Statistics about the PSF clump

pmModel* pmSourceSelectModel ( pmSource source  ) 

psArray* pmSourcesReadCMF ( psFits *  fits,
psMetadata *  header 
)

psArray* pmSourcesReadCMP ( char *  filename,
psMetadata *  header 
)

bool pmSourcesWriteCMF ( psFits *  fits,
psArray *  sources,
psMetadata *  header,
char *  extname 
)

bool pmSourcesWriteCMP ( psArray *  sources,
char *  filename,
psMetadata *  header 
)

bool pmSourcesWriteEXTs ( psArray *  sources,
char *  filename,
bool  require 
)

bool pmSourcesWriteNULLs ( psArray *  sources,
char *  filename 
)

bool pmSourcesWriteOBJ ( psArray *  sources,
char *  filename 
)

bool pmSourcesWritePSFs ( psArray *  sources,
char *  filename 
)

bool pmSourcesWriteRAW ( psArray *  sources,
char *  filename 
)

bool pmSourcesWriteSX ( psArray *  sources,
char *  filename 
)

double pmSourceWeight ( const pmSource Mi,
int  term,
const bool  unweighted_sum 
)


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