Mathematical Operations


Data Structures

struct  psClipParams
 Parameters for clipping. More...
struct  psEllipseAxes
struct  psEllipseMoments
struct  psEllipseShape
struct  psHistogram
 The basic histogram structure which contains bounds and bins. More...
struct  psMinimization
 A data structure for minimization routines. More...
struct  psMinConstraint
 A data structure for minimization routines. More...
struct  psPolynomial1D
 One-dimensional polynomial. More...
struct  psPolynomial2D
 Two-dimensional polynomial. More...
struct  psPolynomial3D
 Three-dimensional polynomial. More...
struct  psPolynomial4D
 Four-dimensional polynomial. More...
struct  p_chebyPolys
struct  psRandom
 Data structure for psRandom. More...
struct  psRegion
 Basic image region structure. More...
struct  psSparseConstraint
struct  psSparse
struct  psSparseBorder
struct  psSpline1D
 One-Dimensional Spline. More...
struct  psStats
 This is the generic statistics structure. More...
struct  psImage
 Basic image data structure. More...
struct  psScalar
 Basic scalar data structure. More...

Defines

#define M_PI   3.1415926535897932384626433832795029
#define M_PI_2   1.5707963267948966192313216916397514
#define M_PI_4   0.7853981633974483096156608458198757
#define M_1_PI   0.3183098861837906715377675267450287
#define M_2_PI   0.6366197723675813430755350534900574
#define DEG_TO_RAD(DEGREES)   ((DEGREES) * M_PI / 180.0)
#define MIN_TO_RAD(MINUTES)   ((MINUTES) * M_PI / (180.0 * 60.0))
#define SEC_TO_RAD(SECONDS)   ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))
#define RAD_TO_DEG(RADIANS)   ((RADIANS) * 180.0 / M_PI)
#define RAD_TO_MIN(RADIANS)   ((RADIANS) * 180.0 * 60.0 / M_PI)
#define RAD_TO_SEC(RADIANS)   ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)
#define PS_MAX(A, B)   (((A) > (B)) ? (A) : (B))
#define PS_MIN(A, B)   (((A) < (B)) ? (A) : (B))
#define PS_SQR(A)   ((A) * (A))
#define PS_SWAP(X, Y)   {double tmp=(X); (X) = (Y); (Y) = tmp;}
#define PS_NOT_U8(A)   (UCHAR_MAX-(A))
#define PS_NOT_U16(A)   (USHORT_MAX-(A))
#define PS_DETERMINE_BRACKET_STEP_SIZE   0.10
#define PS_MAX_LMM_ITERATIONS   100
#define PS_MAX_MINIMIZE_ITERATIONS   100
#define P_PSMINIMIZATION_SET_MAXITER(m, val)   *(int*)&m->maxIter = val
#define P_PSMINIMIZATION_SET_TOL(m, val)   *(float*)&m->tol = val
#define PS_ASSERT_POLY1D(NAME, RVAL)
#define PS_ASSERT_POLY_NON_NULL(NAME, RVAL)
#define PS_ASSERT_POLY_TYPE(NAME, TYPE, RVAL)
#define PS_ASSERT_POLY_VALID_TYPE(TYPE, RVAL)
#define PS_POLY_PRINT_1D(NAME)
#define PS_POLY_PRINT_2D(NAME)
#define PS_LEFT_SPLINE_DERIV   0.0
#define PS_RIGHT_SPLINE_DERIV   0.0
#define PS_ASSERT_SPLINE(NAME, RVAL)
#define PS_ASSERT_SPLINE_NON_NULL(NAME, RVAL)
#define P_PSIMAGE_SET_NUMCOLS(img, nc)   {*(int*)&img->numCols = nc;}
#define P_PSIMAGE_SET_NUMROWS(img, nr)   {*(int*)&img->numRows = nr;}
#define P_PSIMAGE_SET_TYPE(img, t)   {*(psMathType*)&img->type = t;}
#define PIXEL_INTERPOLATE_FCN_PROTOTYPE(SUFFIX, RETURNTYPE)
#define PIXEL_INTERPOLATE_FCNS(MODE)
#define PS_ASSERT_IMAGE_NON_NULL(NAME, RVAL)   PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, return RVAL)
#define PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, CLEANUP)
#define PS_ASSERT_IMAGE_NON_EMPTY(NAME, RVAL)   PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, return RVAL)
#define PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, CLEANUP)
#define PS_ASSERT_IMAGE_TYPE(NAME, TYPE, RVAL)
#define PS_ASSERT_IMAGES_SIZE_EQUAL(NAME1, NAME2, RVAL)
#define PS_ASSERT_IMAGE_SIZE(NAME1, NUM_COLS, NUM_ROWS, RVAL)
#define PS_IMAGE_PRINT_F32(NAME)
#define PS_IMAGE_PRINT_F64(NAME)

Typedefs

typedef int(*) psComparePtrFunc (const void **a, const void **b)
 A comparison function for sorting elements that are pointers to data, e.g., for psList of pointers to numeric values.
typedef int(*) psCompareFcn (const void *a, const void *b)
 A comparison function for sorting.
typedef float(*) psMinimizeLMChi2Func (psVector *deriv, const psVector *params, const psVector *x)
 Specifies the format of a user-defined function that the general Levenberg- Marquardt minimizer routine will accept.
typedef bool(*) psMinimizeLMLimitFunc (psMinConstraintMode mode, int nParam, float *params, float *beta)
 Specifies the format of a user-defined function which check the parameters against the allowed limits.
typedef float(*) psMinimizePowellFunc (const psVector *params, const psArray *coords)
 Specifies the format of a user-defined function that the general Powell minimizer routine will accept.
typedef psVector *(*) psMinimizeChi2PowellFunc (const psVector *params, const psArray *coords)
 Specifies the format of a user-defined function that the general Powell chi- squared minimizer routine will accept.

Enumerations

enum  psFFTFlags { PS_FFT_FORWARD = 1, PS_FFT_REVERSE = 2, PS_FFT_REAL_RESULT = 4 }
 Specify direction of FFT. More...
enum  psMinConstraintMode { PS_MINIMIZE_BETA_LIMIT, PS_MINIMIZE_PARAM_MIN, PS_MINIMIZE_PARAM_MAX }
enum  psPolynomialType { PS_POLYNOMIAL_ORD, PS_POLYNOMIAL_CHEB }
 Polynomial Type. More...
enum  psRandomType { PS_RANDOM_TAUS }
 Enumeration containing a flag for psRandom types. More...
enum  psStatsOptions {
  PS_STAT_NONE = 0x000000, PS_STAT_SAMPLE_MEAN = 0x000001, PS_STAT_SAMPLE_MEDIAN = 0x000002, PS_STAT_SAMPLE_STDEV = 0x000004, PS_STAT_SAMPLE_QUARTILE = 0x000008, PS_STAT_ROBUST_MEDIAN = 0x000010, PS_STAT_ROBUST_STDEV = 0x000020, PS_STAT_ROBUST_QUARTILE = 0x000040, PS_STAT_FITTED_MEAN = 0x000080, PS_STAT_FITTED_STDEV = 0x000100,
  PS_STAT_CLIPPED_MEAN = 0x000200, PS_STAT_CLIPPED_STDEV = 0x000400, PS_STAT_MAX = 0x000800, PS_STAT_MIN = 0x001000, PS_STAT_USE_RANGE = 0x002000, PS_STAT_USE_BINSIZE = 0x004000, PS_STAT_FITTED_MEAN_V2 = 0x008000, PS_STAT_FITTED_STDEV_V2 = 0x010000, PS_STAT_FITTED_MEAN_V3 = 0x020000, PS_STAT_FITTED_STDEV_V3 = 0x040000
}
 enumeration of statistical calculation options More...
enum  psImageInterpolateMode {
  PS_INTERPOLATE_FLAT, PS_INTERPOLATE_BILINEAR, PS_INTERPOLATE_BICUBE, PS_INTERPOLATE_GAUSS, PS_INTERPOLATE_LANCZOS2, PS_INTERPOLATE_LANCZOS3, PS_INTERPOLATE_LANCZOS4, PS_INTERPOLATE_BILINEAR_VARIANCE, PS_INTERPOLATE_LANCZOS2_VARIANCE, PS_INTERPOLATE_LANCZOS3_VARIANCE,
  PS_INTERPOLATE_LANCZOS4_VARIANCE
}
 enumeration of options in interpolation More...

Functions

psImagepsImageFFT (psImage *out, const psImage *image, psFFTFlags direction)
 Forward and reverse FFT calculations.
psImagepsImageReal (psImage *out, const psImage *in)
 extract the real portion of a complex image
psImagepsImageImaginary (psImage *out, const psImage *in)
 extract the imaginary portion of a complex image
psImagepsImageComplex (psImage *out, const psImage *real, const psImage *imag)
 creates a complex image from separate real and imaginary plane images
psImagepsImageConjugate (psImage *out, const psImage *in)
 computes the complex conjugate of an image
psImagepsImagePowerSpectrum (psImage *out, const psImage *in)
 computes the power spectrum of an image
psVectorpsVectorFFT (psVector *out, const psVector *in, psFFTFlags direction)
 Forward and reverse FFT calculations.
psVectorpsVectorReal (psVector *out, const psVector *in)
 extract the real portion of a complex vector
psVectorpsVectorImaginary (psVector *out, const psVector *in)
 extract the imaginary portion of a complex vector
psVectorpsVectorComplex (psVector *out, const psVector *real, const psVector *imag)
 creates a complex vector from separate real and imaginary vectors
psVectorpsVectorConjugate (psVector *out, const psVector *in)
 computes the complex conjugate of a vector
psVectorpsVectorPowerSpectrum (psVector *out, const psVector *in)
 computes the power spectrum of a vector
psMathTypepsBinaryOp (psPtr out, const psPtr in1, const char *op, const psPtr in2)
 Perform simple binary arithmetic with images or vectors.
long psClip (psClipParams *params, psVector *values, psVector *mask, const psVector *errors)
int psCompareS8Ptr (const void **a, const void **b)
 Compare function of psS8 data.
int psCompareS16Ptr (const void **a, const void **b)
 Compare function of psS16 data.
int psCompareS32Ptr (const void **a, const void **b)
 Compare function of psS32 data.
int psCompareS64Ptr (const void **a, const void **b)
 Compare function of psS64 data.
int psCompareU8Ptr (const void **a, const void **b)
 Compare function of psU8 data.
int psCompareU16Ptr (const void **a, const void **b)
 Compare function of psU16 data.
int psCompareU32Ptr (const void **a, const void **b)
 Compare function of psU32 data.
int psCompareU64Ptr (const void **a, const void **b)
 Compare function of psU64 data.
int psCompareF32Ptr (const void **a, const void **b)
 Compare function of psF32 data.
int psCompareF64Ptr (const void **a, const void **b)
 Compare function of psF64 data.
int psCompareDescendingS8Ptr (const void **a, const void **b)
 Compare function of psS8 data.
int psCompareDescendingS16Ptr (const void **a, const void **b)
 Compare function of psS16 data.
int psCompareDescendingS32Ptr (const void **a, const void **b)
 Compare function of psS32 data.
int psCompareDescendingS64Ptr (const void **a, const void **b)
 Compare function of psS64 data.
int psCompareDescendingU8Ptr (const void **a, const void **b)
 Compare function of psU8 data.
int psCompareDescendingU16Ptr (const void **a, const void **b)
 Compare function of psU16 data.
int psCompareDescendingU32Ptr (const void **a, const void **b)
 Compare function of psU32 data.
int psCompareDescendingU64Ptr (const void **a, const void **b)
 Compare function of psU64 data.
int psCompareDescendingF32Ptr (const void **a, const void **b)
 Compare function of psF32 data.
int psCompareDescendingF64Ptr (const void **a, const void **b)
 Compare function of psF64 data.
int psCompareS8 (const void *a, const void *b)
 Compare function of psS8 data.
int psCompareS16 (const void *a, const void *b)
 Compare function of psS16 data.
int psCompareS32 (const void *a, const void *b)
 Compare function of psS32 data.
int psCompareS64 (const void *a, const void *b)
 Compare function of psS64 data.
int psCompareU8 (const void *a, const void *b)
 Compare function of psU8 data.
int psCompareU16 (const void *a, const void *b)
 Compare function of psU16 data.
int psCompareU32 (const void *a, const void *b)
 Compare function of psU32 data.
int psCompareU64 (const void *a, const void *b)
 Compare function of psU64 data.
int psCompareF32 (const void *a, const void *b)
 Compare function of psF32 data.
int psCompareF64 (const void *a, const void *b)
 Compare function of psF64 data.
int psCompareDescendingS8 (const void *a, const void *b)
 Compare function of psS8 data.
int psCompareDescendingS16 (const void *a, const void *b)
 Compare function of psS16 data.
int psCompareDescendingS32 (const void *a, const void *b)
 Compare function of psS32 data.
int psCompareDescendingS64 (const void *a, const void *b)
 Compare function of psS64 data.
int psCompareDescendingU8 (const void *a, const void *b)
 Compare function of psU8 data.
int psCompareDescendingU16 (const void *a, const void *b)
 Compare function of psU16 data.
int psCompareDescendingU32 (const void *a, const void *b)
 Compare function of psU32 data.
int psCompareDescendingU64 (const void *a, const void *b)
 Compare function of psU64 data.
int psCompareDescendingF32 (const void *a, const void *b)
 Compare function of psF32 data.
int psCompareDescendingF64 (const void *a, const void *b)
 Compare function of psF64 data.
psEllipseMoments psEllipseAxesToMoments (psEllipseAxes axes)
psEllipseAxes psEllipseMomentsToAxes (psEllipseMoments moments, double maxAR)
psEllipseShape psEllipseAxesToShape (psEllipseAxes axes)
psEllipseAxes psEllipseShapeToAxes (psEllipseShape shape, double maxAR)
psHistogrampsHistogramAlloc (float lower, float upper, int n)
 Allocator for psHistogram where the bounds of the bins are implicitly specified through simply specifying an upper and lower limit along with the size of the bins.
bool psMemCheckHistogram (psPtr ptr)
 Checks the type of a particular pointer.
psHistogrampsHistogramAllocGeneric (const psVector *bounds)
 Allocator for psHistogram where the bounds of the bins are explicitly specified.
psHistogrampsVectorHistogram (psHistogram *out, const psVector *values, const psVector *errors, const psVector *mask, psMaskType maskVal)
 Calculate a histogram.
psS32 p_psVectorBinDisect (const psVector *bins, const psScalar *x)
 Performs a binary disection on a monotonically non-decreasing vector.
psScalarp_psVectorInterpolate (psScalar *out, const psVector *domain, const psVector *range, psS32 order, const psScalar *x)
 Interpolates a series of data points for evaluation at a specific coordinate.
bool p_psNormalizeVectorRange (psVector *myData, psF64 outLow, psF64 outHigh)
psImagepsMatrixLUD (psImage *out, psVector **perm, const psImage *in)
 LU Decomposition of psImage matrix.
psVectorpsMatrixLUSolve (psVector *out, const psImage *LU, const psVector *RHS, const psVector *perm)
 LU Solution of psImage matrix.
bool psMatrixGJSolve (psImage *A, psVector *b)
 Gauss-Jordan numerical solver.
bool psMatrixGJSolveF32 (psImage *A, psVector *b)
 Gauss-Jordan numerical solver for F32 input data.
psImagepsMatrixInvert (psImage *out, const psImage *in, float *determinant)
 Invert psImage matrix.
float psMatrixDeterminant (const psImage *in)
 Calculate psImage matrix determinant.
psImagepsMatrixMultiply (psImage *out, const psImage *in1, const psImage *in2)
 Performs psImage matrix multiplication.
psImagepsMatrixTranspose (psImage *out, const psImage *in)
 Transpose matrix.
psImagepsMatrixEigenvectors (psImage *out, const psImage *in)
 Calculate matrix eigenvectors.
psVectorpsMatrixToVector (psVector *outVector, const psImage *inImage)
 Convert matrix to vector.
psImagepsVectorToMatrix (psImage *outImage, const psVector *inVector)
 Convert vector to matrix.
psImagepsMatrixSVDSolve (psImage *evec, psVector *eval, const psImage *in)
 Single value decomposition, provided by Andy Becker.
psVectorpsStringMD5 (const char *string)
 Return an MD5 hash of the supplied string.
psVectorpsVectorMD5 (const psVector *vector)
 Return an MD5 hash of the supplied vector.
psVectorpsImageMD5 (const psImage *image)
 Return an MD5 hash of the supplied image.
psString psMD5toString (const psVector *hash)
 Convert an MD5 hash into a string, for printing.
psMinConstraintpsMinConstraintAlloc ()
psMinimizationpsMinimizationAlloc (int maxIter, float tol)
 Allocates a psMinimization structure.
bool psMemCheckMinimization (psPtr ptr)
bool psMinimizeLMChi2 (psMinimization *min, psImage *covar, psVector *params, psMinConstraint *constraint, const psArray *x, const psVector *y, const psVector *yWt, psMinimizeLMChi2Func func)
 Minimizes a specified function based on the Levenberg-Marquardt method.
bool psMinimizeGaussNewtonDelta (psVector *delta, const psVector *params, const psVector *paramMask, const psArray *x, const psVector *y, const psVector *yErr, psMinimizeLMChi2Func func)
psF32 p_psMinLM_SetABX (psImage *alpha, psVector *beta, const psVector *params, const psVector *paramMask, const psArray *x, const psVector *y, const psVector *dy, psMinimizeLMChi2Func func)
 Function used to set parameters for generating "best guess" in minimizing Chi-Squared value.
psBool p_psMinLM_GuessABP (psImage *Alpha, psVector *Beta, psVector *Params, const psImage *alpha, const psVector *beta, const psVector *params, const psVector *paramMask, psMinimizeLMLimitFunc checkLimits, psF32 lambda)
bool psVectorFitPolynomial1D (psPolynomial1D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x)
 Derive a polynomial fit.
bool psVectorFitPolynomial2D (psPolynomial2D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y)
bool psVectorFitPolynomial3D (psPolynomial3D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z)
bool psVectorFitPolynomial4D (psPolynomial4D *poly, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z, const psVector *t)
bool psVectorClipFitPolynomial1D (psPolynomial1D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x)
bool psVectorClipFitPolynomial2D (psPolynomial2D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y)
bool psVectorClipFitPolynomial3D (psPolynomial3D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z)
bool psVectorClipFitPolynomial4D (psPolynomial4D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z, const psVector *t)
bool psMinimizePowell (psMinimization *min, psVector *params, const psVector *paramMask, const psArray *coords, psMinimizePowellFunc func)
 Minimizes a specified function based on the Powell method.
bool psMinimizeChi2Powell (psMinimization *min, psVector *params, psMinConstraint *constraint, const psArray *coords, const psVector *value, const psVector *error, psMinimizeChi2PowellFunc model)
 Minimizes a specified function based on the Powell chi-squared method.
float psGaussian (float x, float mean, float sigma, bool normal)
 Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate.
psPolynomial1DpsPolynomial1DAlloc (psPolynomialType type, unsigned int nX)
 Allocates a psPolynomial1D structure with n terms.
psPolynomial2DpsPolynomial2DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY)
 Allocates a 2-D polynomial structure.
psPolynomial3DpsPolynomial3DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY, unsigned int nZ)
 Allocates a 3-D polynomial structure.
psPolynomial4DpsPolynomial4DAlloc (psPolynomialType type, unsigned int nX, unsigned int nY, unsigned int nZ, unsigned int nT)
 Allocates a 4-D polynomial structure.
bool psPolynomial2DRecycle (psPolynomial2D *poly, psPolynomialType type, unsigned int nX, unsigned int nY)
psPolynomial2DpsPolynomial2DCopy (psPolynomial2D *out, psPolynomial2D *poly)
psF64 psPolynomial1DEval (const psPolynomial1D *poly, psF64 x)
 Evaluates a 1-D polynomial at specific coordinates.
psF64 psPolynomial2DEval (const psPolynomial2D *poly, psF64 x, psF64 y)
 Evaluates a 2-D polynomial at specific coordinates.
psF64 psPolynomial3DEval (const psPolynomial3D *poly, psF64 x, psF64 y, psF64 z)
 Evaluates a 3-D polynomial at specific coordinates.
psF64 psPolynomial4DEval (const psPolynomial4D *poly, psF64 x, psF64 y, psF64 z, psF64 t)
 Evaluates a 4-D polynomial at specific coordinates.
psVectorpsPolynomial1DEvalVector (const psPolynomial1D *poly, const psVector *x)
 Evaluates a 1-D polynomial at specific sets of coordinates.
psVectorpsPolynomial2DEvalVector (const psPolynomial2D *poly, const psVector *x, const psVector *y)
 Evaluates a 2-D polynomial at specific sets of coordinates.
psVectorpsPolynomial3DEvalVector (const psPolynomial3D *poly, const psVector *x, const psVector *y, const psVector *z)
 Evaluates a 3-D polynomial at specific sets of coordinates.
psVectorpsPolynomial4DEvalVector (const psPolynomial4D *poly, const psVector *x, const psVector *y, const psVector *z, const psVector *t)
 Evaluates a 4-D polynomial at specific sets of coordinates.
bool psMemCheckPolynomial1D (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckPolynomial2D (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckPolynomial3D (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckPolynomial4D (psPtr ptr)
 Checks the type of a particular pointer.
psPolynomial1D ** p_psCreateChebyshevPolys (psS32 numPolys)
 Creates the specified number of chebyshev polys.
bool psVectorChiClipFitPolynomial4D (psPolynomial4D *poly, psStats *stats, const psVector *mask, psMaskType maskValue, const psVector *f, const psVector *fErr, const psVector *x, const psVector *y, const psVector *z, const psVector *t)
psPolynomial2DpsImageBicubeFit (const psImage *image, int x, int y)
psPlane psImageBicubeMin (const psPolynomial2D *poly)
psPolynomial2DpsPolynomial2D_dX (psPolynomial2D *out, psPolynomial2D *poly)
psPolynomial2DpsPolynomial2D_dY (psPolynomial2D *out, psPolynomial2D *poly)
psU64 p_psRandomGetSystemSeed ()
psRandompsRandomAlloc (psRandomType type, unsigned long seed)
 Allocates a psRandom struct.
void psRandomReset (psRandom *rand, unsigned long seed)
 Resets an existing psRandom struct.
double psRandomUniform (const psRandom *r)
 Random number generator based on a uniform distribution on [0,1).
double psRandomGaussian (const psRandom *r)
 Random number generator based on a Gaussian deviate, N(0,1).
double p_psRandomGaussian (const psRandom *r, double sigma)
 Random number generator based on a Gaussian deviate, N(0,1).
double psRandomPoisson (const psRandom *r, double mean)
 Random number generator based on a Poisson distribution with the given mean.
psRegionpsRegionAlloc (float x0, float x1, float y0, float y1)
 Create a pointer to a psRegion, with associated psMemBlock.
bool psMemCheckRegion (psPtr ptr)
 Checks the type of a particular pointer.
psRegion psRegionSet (float x0, float x1, float y0, float y1)
 Create a psRegion with the specified attributes.
psRegion psRegionFromString (const char *region)
 Create a psRegion with the attribute values given as a string.
psString psRegionToString (const psRegion region)
 Create a string of the standard IRAF form '[x0:x1,y0:y1]' from a psRegion.
psRegion psRegionForSquare (double x, double y, double radius)
 Defines a region corresponding to the square with center at coordinate x,y and with coderadius.
bool psRegionIsNaN (psRegion region)
 Test if any element of the region is NaN.
psRegion psRegionForImage (psImage *image, psRegion in)
 Sets an actual region based on image parameters.
psSparsepsSparseAlloc (int Nrows, int Nelem)
bool psSparseMatrixElement (psSparse *sparse, int i, int j, float value)
void psSparseVectorElement (psSparse *sparse, int i, float value)
psVectorpsSparseMatrixTimesVector (psVector *output, const psSparse *matrix, const psVector *vector)
bool psSparseResort (psSparse *sparse)
psVectorpsSparseSolve (psVector *output, psSparseConstraint constraint, const psSparse *sparse, int Niter)
psSparseBorderpsSparseBorderAlloc (psSparse *sparse, int Nborder)
bool psSparseBorderElementT (psSparseBorder *border, int i, int j, float value)
bool psSparseBorderElementB (psSparseBorder *border, int i, int j, float value)
bool psSparseBorderElementG (psSparseBorder *border, int i, float value)
psVectorpsSparseBorderLowerProduct (psVector *dG, psSparseBorder *border, psVector *xVec)
psVectorpsSparseBorderUpperProduct (psVector *dF, psSparseBorder *border, psVector *yVec)
psVectorpsSparseBorderSquareProduct (psVector *dG, psSparseBorder *border, psVector *yVec)
bool psSparseBorderUpperDelta (psSparseBorder *border, psVector *dF)
psVectorpsSparseBorderLowerDelta (psVector *Go, psSparseBorder *border, psVector *dG)
bool psSparseBorderMultiply (psVector **fIn, psVector **gIn, psSparseBorder *border, psVector *xVec, psVector *yVec)
bool psSparseBorderSolve (psVector **xFit, psVector **yFit, psSparseConstraint constraint, psSparseBorder *border, int Niter)
psSpline1DpsSpline1DAlloc ()
 Allocates a psSpline1D structure.
float psSpline1DEval (const psSpline1D *spline, float x)
 Evaluates 1-D spline polynomials at a specific coordinate.
psVectorpsSpline1DEvalVector (const psSpline1D *spline, const psVector *x)
 Evaluates 1-D spline polynomials at a set of specific coordinates.
psSpline1DpsVectorFitSpline1D (const psVector *x, const psVector *y)
 Derive a one-dimensional spline fit.
bool psMemCheckSpline1D (psPtr ptr)
 Checks the type of a particular pointer.
bool psVectorStats (psStats *stats, const psVector *in, const psVector *errors, const psVector *mask, psMaskType maskVal)
 Performs statistical calculations on a vector.
psStatspsStatsAlloc (psStatsOptions options)
 Allocator of the psStats structure.
bool psMemCheckStats (psPtr ptr)
 Checks the type of a particular pointer.
psStatsOptions psStatsOptionFromString (const char *string)
psString psStatsOptionToString (psStatsOptions option)
psStatspsStatsFromString (const char *string)
psString psStatsToString (const psStats *stats)
psStatsOptions psStatsSingleOption (psStatsOptions option)
double psStatsGetValue (const psStats *stats, psStatsOptions option)
psMathTypepsUnaryOp (psPtr out, const psPtr in, const char *op)
 Perform simple unary arithmetic with images or vectors.
psVectorpsVectorSmooth (psVector *output, const psVector *input, double sigma, double Nsigma)
psImagepsImageAlloc (int numCols, int numRows, psElemType type)
 Create an image of the specified size and type.
bool psMemCheckImage (psPtr ptr)
 Checks the type of a particular pointer.
bool psImageInit (psImage *image,...)
 Initializes the image with the given value.
bool psImageSet (psImage *image, int x, int y, double complex value)
 Sets the value of the image at the specified x,y position to value.
double complex psImageGet (const psImage *image, int x, int y)
 Returns the value of the image at the specified x,y position.
psImagepsImageRecycle (psImage *old, int numCols, int numRows, const psElemType type)
 Resize a given image to the given size/type.
bool p_psImageCopyToRawBuffer (void *buffer, const psImage *input, psElemType type)
 Copy an image to a new buffer.
int psImageFreeChildren (psImage *image)
 Frees all children of a psImage.
psF64 p_psImageGetElementF64 (psImage *image, int col, int row)
 get an element of an image as a psF64.
bool p_psImagePrint (int fd, psImage *a, char *name)
 print image pixel values.
double complex psImagePixelInterpolate (const psImage *input, float x, float y, const psImage *mask, psMaskType maskVal, double complex unexposedValue, psImageInterpolateMode mode)
 Interpolate image pixel value given floating point coordinates.
psScalarpsScalarAlloc (double complex value, psElemType type)
 Allocate a scalar.
bool psMemCheckScalar (psPtr ptr)
 Checks the type of a particular pointer.
psScalarpsScalarCopy (const psScalar *value)
 Copy a scalar.


Define Documentation

#define DEG_TO_RAD ( DEGREES   )     ((DEGREES) * M_PI / 180.0)

Definition at line 44 of file psConstants.h.

#define M_1_PI   0.3183098861837906715377675267450287

Definition at line 40 of file psConstants.h.

#define M_2_PI   0.6366197723675813430755350534900574

Definition at line 41 of file psConstants.h.

#define M_PI   3.1415926535897932384626433832795029

Definition at line 37 of file psConstants.h.

#define M_PI_2   1.5707963267948966192313216916397514

Definition at line 38 of file psConstants.h.

#define M_PI_4   0.7853981633974483096156608458198757

Definition at line 39 of file psConstants.h.

#define MIN_TO_RAD ( MINUTES   )     ((MINUTES) * M_PI / (180.0 * 60.0))

Definition at line 45 of file psConstants.h.

#define P_PSIMAGE_SET_NUMCOLS ( img,
nc   )     {*(int*)&img->numCols = nc;}

Definition at line 81 of file psImage.h.

#define P_PSIMAGE_SET_NUMROWS ( img,
nr   )     {*(int*)&img->numRows = nr;}

Definition at line 82 of file psImage.h.

#define P_PSIMAGE_SET_TYPE ( img,
 )     {*(psMathType*)&img->type = t;}

Definition at line 83 of file psImage.h.

#define P_PSMINIMIZATION_SET_MAXITER ( m,
val   )     *(int*)&m->maxIter = val

Definition at line 35 of file psMinimizeLMM.h.

#define P_PSMINIMIZATION_SET_TOL ( m,
val   )     *(float*)&m->tol = val

Definition at line 36 of file psMinimizeLMM.h.

#define PIXEL_INTERPOLATE_FCN_PROTOTYPE ( SUFFIX,
RETURNTYPE   ) 

Value:

inline RETURNTYPE p_psImagePixelInterpolate##SUFFIX( \
        const psImage* input,          /**< input image for interpolation */ \
        float x,                       /**< column location to derive value of */ \
        float y,                       /**< row location ot derive value of */ \
        const psImage* mask,           /**< if not NULL, the mask of the input image */ \
        psU32 maskVal,                 /**< the mask value */ \
        RETURNTYPE unexposedValue      /**< return value if x,y location is not in image. */ \
                                                   );

Definition at line 210 of file psImage.h.

#define PIXEL_INTERPOLATE_FCNS ( MODE   ) 

Value:

Definition at line 220 of file psImage.h.

#define PS_ASSERT_GENERAL_IMAGE_NON_EMPTY ( NAME,
CLEANUP   ) 

Value:

if ((NAME)->numCols < 1 || (NAME)->numRows < 1) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "Unallowable operation: psImage %s has zero rows or columns (%dx%d).", \
            #NAME, (NAME)->numCols, (NAME)->numRows); \
    CLEANUP; \
}

Definition at line 257 of file psImage.h.

#define PS_ASSERT_GENERAL_IMAGE_NON_NULL ( NAME,
CLEANUP   ) 

Value:

if ((NAME) == NULL || (NAME)->data.V == NULL) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: psImage %s or its data is NULL.", \
            #NAME); \
    CLEANUP; \
}

Definition at line 248 of file psImage.h.

#define PS_ASSERT_IMAGE_NON_EMPTY ( NAME,
RVAL   )     PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, return RVAL)

Definition at line 256 of file psImage.h.

#define PS_ASSERT_IMAGE_NON_NULL ( NAME,
RVAL   )     PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, return RVAL)

Definition at line 247 of file psImage.h.

#define PS_ASSERT_IMAGE_SIZE ( NAME1,
NUM_COLS,
NUM_ROWS,
RVAL   ) 

Value:

if (((NAME1)->numCols != NUM_COLS) || \
        ((NAME1)->numRows != NUM_ROWS)) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "Unallowable operation: psImages %s is not the correct size.", \
            #NAME1); \
    return(RVAL); \
}

Definition at line 282 of file psImage.h.

#define PS_ASSERT_IMAGE_TYPE ( NAME,
TYPE,
RVAL   ) 

Value:

if ((NAME)->type.type != TYPE) { \
    psError(PS_ERR_BAD_PARAMETER_TYPE, true, \
            "Unallowable operation: psImage %s has incorrect type.", \
            #NAME); \
    return(RVAL); \
}

Definition at line 265 of file psImage.h.

#define PS_ASSERT_IMAGES_SIZE_EQUAL ( NAME1,
NAME2,
RVAL   ) 

Value:

if (((NAME1)->numCols != (NAME2)->numCols) || \
        ((NAME1)->numRows != (NAME2)->numRows)) { \
    psError(PS_ERR_BAD_PARAMETER_SIZE, true, \
            "Unallowable operation: psImages %s and %s are not the same size.", \
            #NAME1, #NAME2); \
    return(RVAL); \
}

Definition at line 273 of file psImage.h.

#define PS_ASSERT_POLY1D ( NAME,
RVAL   ) 

Value:

if (false == psMemCheckPolynomial1D(NAME)) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: argument %s is not a psPolynomial1D struct.\n",\
            #NAME); \
    return(RVAL); \
} \

Definition at line 304 of file psPolynomial.h.

#define PS_ASSERT_POLY_NON_NULL ( NAME,
RVAL   ) 

Value:

if ((NAME) == NULL || (NAME)->coeff == NULL) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: polynomial %s or its coeffs is NULL.", \
            #NAME); \
    return(RVAL); \
} \

Definition at line 312 of file psPolynomial.h.

#define PS_ASSERT_POLY_TYPE ( NAME,
TYPE,
RVAL   ) 

Value:

if ((NAME)->type != TYPE) { \
    psError(PS_ERR_BAD_PARAMETER_TYPE, true, \
            "Unallowable operation: polynomial %s has wrong type.", #NAME); \
    return(RVAL); \
} \

Definition at line 320 of file psPolynomial.h.

#define PS_ASSERT_POLY_VALID_TYPE ( TYPE,
RVAL   ) 

Value:

if ((TYPE != PS_POLYNOMIAL_ORD) && \
        (TYPE != PS_POLYNOMIAL_CHEB)) { \
    psError(PS_ERR_BAD_PARAMETER_TYPE, true, \
            "Unallowable operation: invalid type %d for polynomial", TYPE); \
    return(RVAL); \
} \

Definition at line 327 of file psPolynomial.h.

#define PS_ASSERT_SPLINE ( NAME,
RVAL   ) 

Value:

if (false == psMemCheckSpline1D(NAME)) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: argument %s is not a psSpline1D struct.\n",\
            #NAME); \
    return(RVAL); \
} \

Definition at line 93 of file psSpline.h.

#define PS_ASSERT_SPLINE_NON_NULL ( NAME,
RVAL   ) 

Value:

if ((NAME) == NULL) { \
    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
            "Unallowable operation: psSpline1D %s is NULL.", \
            #NAME); \
    return(RVAL); \
} \

Definition at line 101 of file psSpline.h.

#define PS_DETERMINE_BRACKET_STEP_SIZE   0.10

Definition at line 32 of file psMinimizeLMM.h.

#define PS_IMAGE_PRINT_F32 ( NAME   ) 

Value:

printf("======== printing %s ========\n", #NAME); \
for (int i = 0 ; i < (NAME)->numRows ; i++) { \
    for (int j = 0 ; j < (NAME)->numCols ; j++) { \
        printf("%.2f ", (NAME)->data.F32[i][j]); \
    } \
    printf("\n"); \
}\

Definition at line 291 of file psImage.h.

#define PS_IMAGE_PRINT_F64 ( NAME   ) 

Value:

printf("======== printing %s ========\n", #NAME); \
for (int i = 0 ; i < (NAME)->numRows ; i++) { \
    for (int j = 0 ; j < (NAME)->numCols ; j++) { \
        printf("%.2f ", (NAME)->data.F64[i][j]); \
    } \
    printf("\n"); \
}\

Definition at line 300 of file psImage.h.

#define PS_LEFT_SPLINE_DERIV   0.0

Definition at line 29 of file psSpline.h.

#define PS_MAX ( A,
 )     (((A) > (B)) ? (A) : (B))

Definition at line 54 of file psConstants.h.

#define PS_MAX_LMM_ITERATIONS   100

Definition at line 33 of file psMinimizeLMM.h.

#define PS_MAX_MINIMIZE_ITERATIONS   100

Definition at line 34 of file psMinimizeLMM.h.

#define PS_MIN ( A,
 )     (((A) < (B)) ? (A) : (B))

Definition at line 57 of file psConstants.h.

#define PS_NOT_U16 (  )     (USHORT_MAX-(A))

Definition at line 67 of file psConstants.h.

#define PS_NOT_U8 (  )     (UCHAR_MAX-(A))

Definition at line 66 of file psConstants.h.

#define PS_POLY_PRINT_1D ( NAME   ) 

Value:

printf("Poly %s: (nX) is (%d)\n", #NAME, NAME->nX);\
for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\
    printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \
}\

Definition at line 335 of file psPolynomial.h.

#define PS_POLY_PRINT_2D ( NAME   ) 

Value:

printf("Poly %s: (nX, nY) is (%d, %d)\n", #NAME, NAME->nX, NAME->nY);\
for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\
    for (psS32 j = 0 ; j < NAME->nY+1 ; j++) {\
        printf("%s->coeff[%d][%d] is %f\n", #NAME, i, j, NAME->coeff[i][j]); \
    }\
}\

Definition at line 341 of file psPolynomial.h.

#define PS_RIGHT_SPLINE_DERIV   0.0

Definition at line 30 of file psSpline.h.

#define PS_SQR (  )     ((A) * (A))

Definition at line 60 of file psConstants.h.

#define PS_SWAP ( X,
 )     {double tmp=(X); (X) = (Y); (Y) = tmp;}

Definition at line 63 of file psConstants.h.

#define RAD_TO_DEG ( RADIANS   )     ((RADIANS) * 180.0 / M_PI)

Definition at line 47 of file psConstants.h.

#define RAD_TO_MIN ( RADIANS   )     ((RADIANS) * 180.0 * 60.0 / M_PI)

Definition at line 48 of file psConstants.h.

#define RAD_TO_SEC ( RADIANS   )     ((RADIANS) * 180.0 * 60.0 * 60.0 / M_PI)

Definition at line 49 of file psConstants.h.

#define SEC_TO_RAD ( SECONDS   )     ((SECONDS) * M_PI / (180.0 * 60.0 * 60.0))

Definition at line 46 of file psConstants.h.


Typedef Documentation

typedef int(*) psCompareFcn(const void *a,const void *b)

A comparison function for sorting.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Definition at line 37 of file psCompare.h.

typedef int(*) psComparePtrFunc(const void **a,const void **b)

A comparison function for sorting elements that are pointers to data, e.g., for psList of pointers to numeric values.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Definition at line 26 of file psCompare.h.

typedef psVector*(*) psMinimizeChi2PowellFunc(const psVector *params,const psArray *coords)

Specifies the format of a user-defined function that the general Powell chi- squared minimizer routine will accept.

Returns:
psVector*: Calculated values given the parameters and coordinates.

Definition at line 65 of file psMinimizePowell.h.

typedef float(*) psMinimizeLMChi2Func(psVector *deriv,const psVector *params,const psVector *x)

Specifies the format of a user-defined function that the general Levenberg- Marquardt minimizer routine will accept.

Returns:
float: the single float value of the function given the parameters, positions, and derivatives.

Definition at line 51 of file psMinimizeLMM.h.

typedef bool(*) psMinimizeLMLimitFunc(psMinConstraintMode mode,int nParam,float *params,float *beta)

Specifies the format of a user-defined function which check the parameters against the allowed limits.

used by the general Levenberg-Marquardt minimizer.

Returns:
float: the single float value of the function given the parameters, positions, and derivatives.

Definition at line 64 of file psMinimizeLMM.h.

typedef float(*) psMinimizePowellFunc(const psVector *params,const psArray *coords)

Specifies the format of a user-defined function that the general Powell minimizer routine will accept.

Returns:
float: the single float value of the function given the parameters and coordinate vectors.

Definition at line 42 of file psMinimizePowell.h.


Enumeration Type Documentation

enum psFFTFlags

Specify direction of FFT.

Enumerator:
PS_FFT_FORWARD  psImageFFT/psVectorFFT should perform a forward FFT.
PS_FFT_REVERSE  psImageFFT/psVectorFFT should perform a reverse FFT.
PS_FFT_REAL_RESULT  psImageFFT/psVectorFFT should perform a reverse FFT with a real result.

Definition at line 20 of file psVectorFFT.h.

enum psImageInterpolateMode

enumeration of options in interpolation

Enumerator:
PS_INTERPOLATE_FLAT  'flat' interpolation (nearest pixel)
PS_INTERPOLATE_BILINEAR  bi-linear interpolation
PS_INTERPOLATE_BICUBE  bi-cubic interpolation with 3x3 region (EAM)
PS_INTERPOLATE_GAUSS  bi-cubic interpolation with 3x3 region (EAM)
PS_INTERPOLATE_LANCZOS2  Sinc interpolation with 4x4 pixel kernel.
PS_INTERPOLATE_LANCZOS3  Sinc interpolation with 6x6 pixel kernel.
PS_INTERPOLATE_LANCZOS4  Sinc interpolation with 8x8 pixel kernel.
PS_INTERPOLATE_BILINEAR_VARIANCE  Variance version of PS_INTERPOLATE_BILINEAR.
PS_INTERPOLATE_LANCZOS2_VARIANCE  Variance version of PS_INTERPOLATE_LANCZOS2.
PS_INTERPOLATE_LANCZOS3_VARIANCE  Variance version of PS_INTERPOLATE_LANCZOS3.
PS_INTERPOLATE_LANCZOS4_VARIANCE  Variance version of PS_INTERPOLATE_LANCZOS4.

Definition at line 30 of file psImage.h.

enum psMinConstraintMode

Enumerator:
PS_MINIMIZE_BETA_LIMIT 
PS_MINIMIZE_PARAM_MIN 
PS_MINIMIZE_PARAM_MAX 

Definition at line 38 of file psMinimizeLMM.h.

enum psPolynomialType

Polynomial Type.

Enumeration for Polynomial types.

Enumerator:
PS_POLYNOMIAL_ORD  Ordinary Polynomial.
PS_POLYNOMIAL_CHEB  Chebyshev Polynomial.

Definition at line 49 of file psPolynomial.h.

enum psRandomType

Enumeration containing a flag for psRandom types.

Enumerator:
PS_RANDOM_TAUS  A maximally equidistributed combined Tausworthe generator.

Definition at line 32 of file psRandom.h.

enum psStatsOptions

enumeration of statistical calculation options

See also:
psStats, psVectorStats, psImageStats
Enumerator:
PS_STAT_NONE  Empty set.
PS_STAT_SAMPLE_MEAN  Sample Mean.
PS_STAT_SAMPLE_MEDIAN  Sample Median.
PS_STAT_SAMPLE_STDEV  Sample Standard Deviation.
PS_STAT_SAMPLE_QUARTILE  Sample Quartile.
PS_STAT_ROBUST_MEDIAN  Robust Median.
PS_STAT_ROBUST_STDEV  Robust Standarad Deviation.
PS_STAT_ROBUST_QUARTILE  Robust Quartile.
PS_STAT_FITTED_MEAN  Fitted Mean.
PS_STAT_FITTED_STDEV  Fitted Standard Deviation.
PS_STAT_CLIPPED_MEAN  Clipped Mean.
PS_STAT_CLIPPED_STDEV  Clipped Standard Deviation.
PS_STAT_MAX  Maximum.
PS_STAT_MIN  Minumum.
PS_STAT_USE_RANGE  Range.
PS_STAT_USE_BINSIZE  Binsize.
PS_STAT_FITTED_MEAN_V2  Fitted Mean.
PS_STAT_FITTED_STDEV_V2  Fitted Standard Deviation.
PS_STAT_FITTED_MEAN_V3  Fitted Mean.
PS_STAT_FITTED_STDEV_V3  Fitted Standard Deviation.

Definition at line 29 of file psStats.h.


Function Documentation

psPolynomial1D** p_psCreateChebyshevPolys ( psS32  numPolys  ) 

Creates the specified number of chebyshev polys.

Returns:
psPolynomial1D** The chebyshev polys.

bool p_psImageCopyToRawBuffer ( void *  buffer,
const psImage input,
psElemType  type 
)

Copy an image to a new buffer.

Returns:
True if image copied or false if error
Parameters:
buffer  the buffer used to copy the image
input  the input image to be copied
type  the datatype of the image to be copied

psF64 p_psImageGetElementF64 ( psImage image,
int  col,
int  row 
)

get an element of an image as a psF64.

Returns:
psF64 pixel value at specified location
Parameters:
image  input image
col  pixel column
row  pixel row

bool p_psImagePrint ( int  fd,
psImage a,
char *  name 
)

print image pixel values.

Returns:
bool TRUE is successful, otherwise FALSE.
Parameters:
fd  Destination file descriptor
a  image to print
name  name of the image (for title)

psBool p_psMinLM_GuessABP ( psImage Alpha,
psVector Beta,
psVector Params,
const psImage alpha,
const psVector beta,
const psVector params,
const psVector paramMask,
psMinimizeLMLimitFunc  checkLimits,
psF32  lambda 
)

psF32 p_psMinLM_SetABX ( psImage alpha,
psVector beta,
const psVector params,
const psVector paramMask,
const psArray x,
const psVector y,
const psVector dy,
psMinimizeLMChi2Func  func 
)

Function used to set parameters for generating "best guess" in minimizing Chi-Squared value.

Returns:
psF32: Chi-squared value for new guess
Parameters:
alpha  alpha guess
beta  beta guess
params  params guess
paramMask  param mask
x  Measurement ordinates
y  Measurement coordinates
dy  Weights calculated from y-errors
func  Specified function

bool p_psNormalizeVectorRange ( psVector myData,
psF64  outLow,
psF64  outHigh 
)

double p_psRandomGaussian ( const psRandom r,
double  sigma 
)

Random number generator based on a Gaussian deviate, N(0,1).

Uses gsl_ran_gaussian.

XXX: I created this since the above psLib spec for p_psRandomGaussian had no argument for sigma. Verify that with IfA.

Returns:
double: Random number.
Parameters:
r  psRandom struct for RNG

psU64 p_psRandomGetSystemSeed (  ) 

psS32 p_psVectorBinDisect ( const psVector bins,
const psScalar x 
)

Performs a binary disection on a monotonically non-decreasing vector.

Searches through an array of data for a specified value.

Returns:
psS32 corresponding index number of specified value
Parameters:
bins  Array of non-decreasing values
x  Target value to find

psScalar* p_psVectorInterpolate ( psScalar out,
const psVector domain,
const psVector range,
psS32  order,
const psScalar x 
)

Interpolates a series of data points for evaluation at a specific coordinate.

Uses a Lagrange interpolation method.

Returns:
psScalar* Lagrange interpolation value at given location
Parameters:
out  Output scalar, or NULL
domain  Domain (x coords) for interpolation
range  Range (y coords) for interpolation
order  Order of interpolation function
x  Location at which to evaluate

psMathType* psBinaryOp ( psPtr  out,
const psPtr  in1,
const char *  op,
const psPtr  in2 
)

Perform simple binary arithmetic with images or vectors.

Performs addition, subtraction, multiplication, division, power, minumum, and maximum arithmetic operations with images and vectors. Uses the form:

out = in1 op in2,

Where op is: "=", "+", "-", "*", "/", "^", "min", or "max"

This function only supports vector-vector or image-image operations.

Returns:
psType* : Pointer to either psImage or psVector.
Parameters:
out  Output type, either psImage or psVector.
in1  First input, either psImage or psVector.
op  Operator.
in2  Second input, either psImage or psVector.

long psClip ( psClipParams params,
psVector values,
psVector mask,
const psVector errors 
)

Parameters:
params  Clip parameters
values  Values to inspect and clip
mask  Mask for values
errors  Errors for values

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

Compare function of psF32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF32 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or lessg than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF64 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or lessg than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS16 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS16 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS32 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS64 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS8 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS8 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU16 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU16 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU32 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or lessg than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU64 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or lessg than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU8 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU8 data.

For use with psListSort for descending ordering.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively greater than, equal to, or less than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF32 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psF64 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS16 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS16 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS32 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS64 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS8 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psS8 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU16 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU16 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU32 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU32 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU64 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU64 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU8 data.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

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

Compare function of psU8 data.

For use with psListSort.

Returns:
int an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters:
a  first comparison target
b  second comparison target

psEllipseMoments psEllipseAxesToMoments ( psEllipseAxes  axes  ) 

psEllipseShape psEllipseAxesToShape ( psEllipseAxes  axes  ) 

psEllipseAxes psEllipseMomentsToAxes ( psEllipseMoments  moments,
double  maxAR 
)

psEllipseAxes psEllipseShapeToAxes ( psEllipseShape  shape,
double  maxAR 
)

float psGaussian ( float  x,
float  mean,
float  sigma,
bool  normal 
)

Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate.

Note that this is not a Gaussian deviate. The evaluated Gaussian is:

\[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \]

Returns:
float value on the gaussian curve given the input parameters
Parameters:
x  Value at which to evaluate
mean  Mean for the Gaussian
sigma  Standard deviation for the Gaussian
normal  Indicates whether result should be normalized

psHistogram* psHistogramAlloc ( float  lower,
float  upper,
int  n 
)

Allocator for psHistogram where the bounds of the bins are implicitly specified through simply specifying an upper and lower limit along with the size of the bins.

Returns:
psHistogram* Newly allocated psHistogram
Parameters:
lower  Lower limit for the bins
upper  Upper limit for the bins
n  Number of bins

psHistogram* psHistogramAllocGeneric ( const psVector bounds  ) 

Allocator for psHistogram where the bounds of the bins are explicitly specified.

Returns:
psHistogram* Newly allocated psHistogram
Parameters:
bounds  Bounds for the bins

psImage* psImageAlloc ( int  numCols,
int  numRows,
psElemType  type 
)

Create an image of the specified size and type.

Uses psLib memory allocation functions to create an image struct of the specified size and type.

Returns:
psImage* : Pointer to psImage.
Parameters:
numCols  Number of columns in image.
numRows  Number of rows in image.
type  Type of data for image.

psPolynomial2D* psImageBicubeFit ( const psImage image,
int  x,
int  y 
)

psPlane psImageBicubeMin ( const psPolynomial2D poly  ) 

psImage* psImageComplex ( psImage out,
const psImage real,
const psImage imag 
)

creates a complex image from separate real and imaginary plane images

Returns:
psImage* resulting complex image
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
real  the real plane image
imag  the imaginary plane image

psImage* psImageConjugate ( psImage out,
const psImage in 
)

computes the complex conjugate of an image

Returns:
psImage* the complex conjugate of the 'in' image
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
in  the psImage to compute conjugate of

psImage* psImageFFT ( psImage out,
const psImage image,
psFFTFlags  direction 
)

Forward and reverse FFT calculations.

This takes as input the image of interest (in) and the direction (direction), which is specified by an enumerated type psFftDirection. The input image may be of type psF32 or psC32, the result is always psC32. If the input vector is psF32, the direction must be forward.

Returns:
psImage* the FFT transformation result
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
image  the psImage to apply transform to
direction  the direction of the transform

int psImageFreeChildren ( psImage image  ) 

Frees all children of a psImage.

Returns:
int Number of children freed.
Parameters:
image  psImage in which all children shall be deallocated

double complex psImageGet ( const psImage image,
int  x,
int  y 
)

Returns the value of the image at the specified x,y position.

A negative value for the x or y positions means index from the end.

Returns:
complex: The value at the specified x,y position.
Parameters:
image  the image from which to get
x  x-position
y  y-position

psImage* psImageImaginary ( psImage out,
const psImage in 
)

extract the imaginary portion of a complex image

Returns:
psImage* imaginary portion of the input image.
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
in  the psImage to extract imaginary portion from

bool psImageInit ( psImage image,
  ... 
)

Initializes the image with the given value.

The input data is cast to match the image datatype.

Returns:
bool: True on success, otherwise false.
Parameters:
image  the image to be initialized

psVector* psImageMD5 ( const psImage image  ) 

Return an MD5 hash of the supplied image.

The MD5 hash is returned in a U8 vector of size 16.

Parameters:
image  Image to hash

double complex psImagePixelInterpolate ( const psImage input,
float  x,
float  y,
const psImage mask,
psMaskType  maskVal,
double complex  unexposedValue,
psImageInterpolateMode  mode 
)

Interpolate image pixel value given floating point coordinates.

Returns:
complex Pixel value interpolated from image or unexposedValue if given x,y doesn't coorespond to a valid image location
Parameters:
input  input image for interpolation
x  column location to derive value of
y  row location ot derive value of
mask  if not NULL, the mask of the input image
maskVal  the mask value
unexposedValue  return value if x,y location is not in image.
mode  interpolation mode

psImage* psImagePowerSpectrum ( psImage out,
const psImage in 
)

computes the power spectrum of an image

Returns:
psImage* the power spectrum of the 'in' image
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
in  the psImage to power spectrum of

psImage* psImageReal ( psImage out,
const psImage in 
)

extract the real portion of a complex image

Returns:
psImage* real portion of the input image.
Parameters:
out  a psImage to recycle. If NULL, a new psImage is made.
in  the psImage to extract real portion from

psImage* psImageRecycle ( psImage old,
int  numCols,
int  numRows,
const psElemType  type 
)

Resize a given image to the given size/type.

Returns:
psImage* Resized psImage.
Parameters:
old  the psImage to recycle by resizing image buffer
numCols  the desired number of columns in image
numRows  the desired number of rows in image
type  the desired datatype of the image

bool psImageSet ( psImage image,
int  x,
int  y,
double complex  value 
)

Sets the value of the image at the specified x,y position to value.

A negative value for the x or y positions means index from the end.

Returns:
bool: True on success, otherwise false.
Parameters:
image  the image to set
x  x-position
y  y-position
value  specified value to set

float psMatrixDeterminant ( const psImage in  ) 

Calculate psImage matrix determinant.

Calculates the determinant of a psImage matrix and returns the single precision floating point result. The input image must be square. This function operates only with the psF64 data type. GSL indexes the top row as the zero row, not the bottom.

Returns:
float: Determinant from psImage.
Parameters:
in  Image used to calculate determinant.

psImage* psMatrixEigenvectors ( psImage out,
const psImage in 
)

Calculate matrix eigenvectors.

Calculates the eigenvectors for a matrix. The input image must be symmetric and square. If the user specifies NULL as the outImage argument, then it will automatically be created. This function operates only with the psF64 data type. GSL indexes the top row as the zero row, not the bottom.

Returns:
psImage* : Pointer to matrix of Eigenvectors.
Parameters:
out  Eigenvectors to return, or NULL.
in  Input image.

bool psMatrixGJSolve ( psImage A,
psVector b 
)

Gauss-Jordan numerical solver.

Returns:
bool: True if successful.
Parameters:
A  Matrix to be solved
b  Vector of values

bool psMatrixGJSolveF32 ( psImage A,
psVector b 
)

Gauss-Jordan numerical solver for F32 input data.

Returns:
bool: True if successful.
Parameters:
A  Matrix to be solved
b  Vector of values

psImage* psMatrixInvert ( psImage out,
const psImage in,
float *  determinant 
)

Invert psImage matrix.

Inverts a psImage matrix and returns the determinant as an option through the argument list. If the user specifies NULL as the outImage argument, then it will automatically be created. The input image must be square. This function operates only with the psF64 data type. Input and output arguments should not be the same. GSL indexes the top row as the zero row, not the bottom.

Returns:
psImage* : Pointer to inverted psImage.
Parameters:
out  Image to return, or NULL for in-place substitution.
in  Image to be inverted
determinant  Determinant to return, or NULL

psImage* psMatrixLUD ( psImage out,
psVector **  perm,
const psImage in 
)

LU Decomposition of psImage matrix.

Performs a LU decomposition on a psImage matrix and returns the LU matrix. If the user specifies NULL for the outImage or outPerm arguments, then they will be automatically created. The input image must be square. This function operates only with the psF64 data type. Input and output arguments should not be the same. GSL indexes the top row as the zero row, not the bottom.

Returns:
psImage* : Pointer to LU decomposed psImage.
Parameters:
out  Image to return, or NULL.
perm  Output permutation vector used by psMatrixLUSolve.
in  Image to decompose.

psVector* psMatrixLUSolve ( psVector out,
const psImage LU,
const psVector RHS,
const psVector perm 
)

LU Solution of psImage matrix.

Solves for and returns the psVector, {x} in the equation [A]{x} = {b}. If the user specifies NULL as the outVector argument, then it will automatically be created. The input image must be square. This function operates only with the psF64 data type. Input and output arguments should not be the same. GSL indexes the top row as the zero row, not the bottom.

Returns:
psVector* : Pointer to psVector solution of matrix equation.
Parameters:
out  Vector to return, or NULL.
LU  LU-decomposed matrix.
RHS  Vector right-hand-side of equation.
perm  Permutation vector resulting from psMatrixLUD function.

psImage* psMatrixMultiply ( psImage out,
const psImage in1,
const psImage in2 
)

Performs psImage matrix multiplication.

Performs a classical matrix multiplication involving row and column operations. Input images must be square and the same size. If the user specifies NULL as the outImage argument, then it will automatically be created. This function operates only with the psF64 data type. GSL indexes the top row as the zero row, not the bottom.

Returns:
psImage* : Pointer to resulting psImage.
Parameters:
out  Matrix to return, or NULL.
in1  First input image.
in2  Second input image.

psImage* psMatrixSVDSolve ( psImage evec,
psVector eval,
const psImage in 
)

Single value decomposition, provided by Andy Becker.

psVector* psMatrixToVector ( psVector outVector,
const psImage inImage 
)

Convert matrix to vector.

Converts a 1-d psImage matrix into a vector. If the user specifies NULL as the outVector argument, then it will automatically be created based on the input image (PS_DIMEN_VECTOR for an input image with 1 col or PS_DIMENT_TRANSV for an input image with 1 row). Either the number of rows or the number of colums of the input matrix must be 1. This function operates only with the psF64 data type.

Returns:
psVector* : Pointer to psVector.
Parameters:
outVector  Vector to return, or NULL.
inImage  Image to convert.

psImage* psMatrixTranspose ( psImage out,
const psImage in 
)

Transpose matrix.

Performs psImage matrix transpose by substituting existing rows for columns. The input image must be square. If the user specifies NULL as the outImage argument, then it will automaticallty be created. This function operates only with the psF64 data type. GSL indexes the top row as the zero row, not the bottom.

Returns:
psImage* : Pointer to transposed psImage.
Parameters:
out  Image to return, or NULL
in  Image to transpose

psString psMD5toString ( const psVector hash  ) 

Convert an MD5 hash into a string, for printing.

Parameters:
hash  Hash to stringify

bool psMemCheckHistogram ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psHistogram structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckImage ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psImage structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckMinimization ( psPtr  ptr  ) 

Parameters:
ptr  the pointer whose type to check

bool psMemCheckPolynomial1D ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPolynomial1D structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPolynomial2D ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPolynomial2D structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPolynomial3D ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPolynomial3D structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPolynomial4D ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPolynomial4D structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckRegion ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psRegion structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckScalar ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psScalar structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckSpline1D ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psSpline1D structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckStats ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psStats structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

psMinConstraint* psMinConstraintAlloc (  ) 

psMinimization* psMinimizationAlloc ( int  maxIter,
float  tol 
)

Allocates a psMinimization structure.

Returns:
psMinimization* : a new psMinimization struct
Parameters:
maxIter  Number of minimization iterations to perform.
tol  Requested error tolerance

bool psMinimizeChi2Powell ( psMinimization min,
psVector params,
psMinConstraint constraint,
const psArray coords,
const psVector value,
const psVector error,
psMinimizeChi2PowellFunc  model 
)

Minimizes a specified function based on the Powell chi-squared method.

Returns:
bool: True is successful.
Parameters:
min  Minimization specification
params  "Best guess" for parameters that minimize func
coords  Measurement coordinates
value  Measured values at the coordinates
error  Errors in the measure values (or NULL)
model  Specified function

bool psMinimizeGaussNewtonDelta ( psVector delta,
const psVector params,
const psVector paramMask,
const psArray x,
const psVector y,
const psVector yErr,
psMinimizeLMChi2Func  func 
)

bool psMinimizeLMChi2 ( psMinimization min,
psImage covar,
psVector params,
psMinConstraint constraint,
const psArray x,
const psVector y,
const psVector yWt,
psMinimizeLMChi2Func  func 
)

Minimizes a specified function based on the Levenberg-Marquardt method.

Returns:
bool: True if successful.
Parameters:
min  Minimization specification
covar  Covariance matrix
params  "Best Guess" for the parameters that minimize func
constraint  Constraints on the parameters
x  Measurement ordinates of multiple vectors
y  Measurement coordinates
yWt  Errors in the measurement coordinates
func  Specified function

bool psMinimizePowell ( psMinimization min,
psVector params,
const psVector paramMask,
const psArray coords,
psMinimizePowellFunc  func 
)

Minimizes a specified function based on the Powell method.

Returns:
bool: True if successful.
Parameters:
min  Minimization specification
params  "Best guess" for parameters that minimize func
paramMask  Parameters to be held fixed by minimizer
coords  Measurement coordinates
func  Specified function

psPolynomial1D* psPolynomial1DAlloc ( psPolynomialType  type,
unsigned int  nX 
)

Allocates a psPolynomial1D structure with n terms.

Returns:
psPolynomial1D* new 1-D polynomial struct
Parameters:
type  Polynomial Type
nX  Number of terms

psF64 psPolynomial1DEval ( const psPolynomial1D poly,
psF64  x 
)

Evaluates a 1-D polynomial at specific coordinates.

Returns:
psF64 result of polynomial at given location
Parameters:
poly  Coefficients for the polynomial
x  location at which to evaluate

psVector* psPolynomial1DEvalVector ( const psPolynomial1D poly,
const psVector x 
)

Evaluates a 1-D polynomial at specific sets of coordinates.

Returns:
psVector* results of polynomials at given locations
Parameters:
poly  Coefficients for the polynomial
x  x locations at which to evaluate

psPolynomial2D* psPolynomial2D_dX ( psPolynomial2D out,
psPolynomial2D poly 
)

psPolynomial2D* psPolynomial2D_dY ( psPolynomial2D out,
psPolynomial2D poly 
)

psPolynomial2D* psPolynomial2DAlloc ( psPolynomialType  type,
unsigned int  nX,
unsigned int  nY 
)

Allocates a 2-D polynomial structure.

Returns:
psPolynomial2D* new 2-D polynomial struct
Parameters:
type  Polynomial Type
nX  Number of terms in x
nY  Number of terms in y

psPolynomial2D* psPolynomial2DCopy ( psPolynomial2D out,
psPolynomial2D poly 
)

psF64 psPolynomial2DEval ( const psPolynomial2D poly,
psF64  x,
psF64  y 
)

Evaluates a 2-D polynomial at specific coordinates.

Returns:
psF64 result of polynomial at given location
Parameters:
poly  Coefficients for the polynomial
x  x location at which to evaluate
y  y location at which to evaluate

psVector* psPolynomial2DEvalVector ( const psPolynomial2D poly,
const psVector x,
const psVector y 
)

Evaluates a 2-D polynomial at specific sets of coordinates.

Returns:
psVector* results of polynomial at given locations
Parameters:
poly  Coefficients for the polynomial
x  x locations at which to evaluate
y  y locations at which to evaluate

bool psPolynomial2DRecycle ( psPolynomial2D poly,
psPolynomialType  type,
unsigned int  nX,
unsigned int  nY 
)

psPolynomial3D* psPolynomial3DAlloc ( psPolynomialType  type,
unsigned int  nX,
unsigned int  nY,
unsigned int  nZ 
)

Allocates a 3-D polynomial structure.

Returns:
psPolynomial3D* new 3-D polynomial struct
Parameters:
type  Polynomial Type
nX  Number of terms in x
nY  Number of terms in y
nZ  Number of terms in z

psF64 psPolynomial3DEval ( const psPolynomial3D poly,
psF64  x,
psF64  y,
psF64  z 
)

Evaluates a 3-D polynomial at specific coordinates.

Returns:
psF64 result of polynomial at given location
Parameters:
poly  Coefficients for the polynomial
x  x location at which to evaluate
y  y location at which to evaluate
z  z location at which to evaluate

psVector* psPolynomial3DEvalVector ( const psPolynomial3D poly,
const psVector x,
const psVector y,
const psVector z 
)

Evaluates a 3-D polynomial at specific sets of coordinates.

Returns:
psVector* results of polynomial at given locations
Parameters:
poly  Coefficients for the polynomial
x  x locations at which to evaluate
y  y locations at which to evaluate
z  z locations at which to evaluate

psPolynomial4D* psPolynomial4DAlloc ( psPolynomialType  type,
unsigned int  nX,
unsigned int  nY,
unsigned int  nZ,
unsigned int  nT 
)

Allocates a 4-D polynomial structure.

Returns:
psPolynomial4D* new 4-D polynomial struct
Parameters:
type  Polynomial Type
nX  Number of terms in x
nY  Number of terms in y
nZ  Number of terms in z
nT  Number of terms in t

psF64 psPolynomial4DEval ( const psPolynomial4D poly,
psF64  x,
psF64  y,
psF64  z,
psF64  t 
)

Evaluates a 4-D polynomial at specific coordinates.

Returns:
psF64 result of polynomial at given location
Parameters:
poly  Coefficients for the polynomial
x  x location at which to evaluate
y  y location at which to evaluate
z  z location at which to evaluate
t  t location at which to evaluate

psVector* psPolynomial4DEvalVector ( const psPolynomial4D poly,
const psVector x,
const psVector y,
const psVector z,
const psVector t 
)

Evaluates a 4-D polynomial at specific sets of coordinates.

Returns:
psVector* results of polynomial at given locations
Parameters:
poly  Coefficients for the polynomial
x  x locations at which to evaluate
y  y locations at which to evaluate
z  z locations at which to evaluate
t  t locations at which to evaluate

psRandom* psRandomAlloc ( psRandomType  type,
unsigned long  seed 
)

Allocates a psRandom struct.

Returns:
psRandom*: A new psRandom structure.
Parameters:
type  The type of RNG
seed  Known value with which to seed the RNG

double psRandomGaussian ( const psRandom r  ) 

Random number generator based on a Gaussian deviate, N(0,1).

Uses gsl_ran_gaussian.

Returns:
double: Random number.
Parameters:
r  psRandom struct for RNG

double psRandomPoisson ( const psRandom r,
double  mean 
)

Random number generator based on a Poisson distribution with the given mean.

Uses gsl_ran_poisson.

Returns:
double: Random number.
Parameters:
r  psRandom struct for RNG
mean  Mean value

void psRandomReset ( psRandom rand,
unsigned long  seed 
)

Resets an existing psRandom struct.

Returns:
void
Parameters:
rand  Existing psRandom struct to reset
seed  Known value with which to seed the RNG

double psRandomUniform ( const psRandom r  ) 

Random number generator based on a uniform distribution on [0,1).

Uses gsl_rng_uniform.

Returns:
double: Random number.
Parameters:
r  psRandom struct for RNG

psRegion* psRegionAlloc ( float  x0,
float  x1,
float  y0,
float  y1 
)

Create a pointer to a psRegion, with associated psMemBlock.

Returns:
psRegion* : a new psRegion.
Parameters:
x0  the first column of the region.
x1  the last column of the region + 1.
y0  the first row of the region.
y1  the last row of the region + 1.

psRegion psRegionForImage ( psImage image,
psRegion  in 
)

Sets an actual region based on image parameters.

An image region defined with negative upper limits may be rationalized for the bounds of a specific image with psRegionForImage. The output of this function is a region with negative upper limits replaced by their corrected value appropriate to the given image. In addition, the lower and upper limits are foced to lie within the bounds of the image. If the lower- limit coordinates are lewss than the lower bound of the image, they are limited to the lower bound of the image. Conversely, if the upper-limit coordinates are greater than the upper bound of the image, they are truncated to define only valid pixels. If the lower-limit coordinates are greater than the upper bounds of the image, or the upper-limit coordinates are less than the lower bounds of the image, the coordinates should saturate on those limits.

Returns:
psRegion: A region with negative upper limits replaced by the corrected
Parameters:
image  the image for which the region is to be set
in  the image region limits

psRegion psRegionForSquare ( double  x,
double  y,
double  radius 
)

Defines a region corresponding to the square with center at coordinate x,y and with coderadius.

The width of the square is 2radius + 1.

Returns:
psRegion: the newly defined psRegion.
Parameters:
x  x coordinate at square-center
y  y coordinate at square-center
radius  radius of square

psRegion psRegionFromString ( const char *  region  ) 

Create a psRegion with the attribute values given as a string.

Create a psRegion with the attribute values given as a string. The format shall be of the standard IRAF form '[x0:x1,y0:y1]'

Returns:
psRegion: A new psRegion struct, or NULL is not successful.
Parameters:
region  image rectangular region in the form '[x0:x1,y0:y1]'

bool psRegionIsNaN ( psRegion  region  ) 

Test if any element of the region is NaN.

Returns:
bool: True if an element is NaN, otherwise false.
Parameters:
region  Region to check

psRegion psRegionSet ( float  x0,
float  x1,
float  y0,
float  y1 
)

Create a psRegion with the specified attributes.

Returns:
psRegion : a corresponding psRegion.
Parameters:
x0  the first column of the region.
x1  the last column of the region + 1.
y0  the first row of the region.
y1  the last row of the region + 1.

psString psRegionToString ( const psRegion  region  ) 

Create a string of the standard IRAF form '[x0:x1,y0:y1]' from a psRegion.

Returns:
psString: A new string representing the psRegion as text, or NULL is not successful.
Parameters:
region  the psRegion to convert to a string

psScalar* psScalarAlloc ( double complex  value,
psElemType  type 
)

Allocate a scalar.

Uses psLib memory allocation functions to create scalar data as defined by the psType type. Accepts a complex 64 bit float for input value, as max size, but resizes according to correct type.

Returns:
psScalar* Pointer to a new psScalar.
Parameters:
value  Data to be put into psScalar.
type  Type of data to be held by psScalar.

psScalar* psScalarCopy ( const psScalar value  ) 

Copy a scalar.

Uses psLib memory allocation functions to copy a scalar.

Returns:
psScalar* A copy of the input scalar
Parameters:
value  Scalar to copy.

psSparse* psSparseAlloc ( int  Nrows,
int  Nelem 
)

psSparseBorder* psSparseBorderAlloc ( psSparse sparse,
int  Nborder 
)

bool psSparseBorderElementB ( psSparseBorder border,
int  i,
int  j,
float  value 
)

bool psSparseBorderElementG ( psSparseBorder border,
int  i,
float  value 
)

bool psSparseBorderElementT ( psSparseBorder border,
int  i,
int  j,
float  value 
)

psVector* psSparseBorderLowerDelta ( psVector Go,
psSparseBorder border,
psVector dG 
)

psVector* psSparseBorderLowerProduct ( psVector dG,
psSparseBorder border,
psVector xVec 
)

bool psSparseBorderMultiply ( psVector **  fIn,
psVector **  gIn,
psSparseBorder border,
psVector xVec,
psVector yVec 
)

bool psSparseBorderSolve ( psVector **  xFit,
psVector **  yFit,
psSparseConstraint  constraint,
psSparseBorder border,
int  Niter 
)

psVector* psSparseBorderSquareProduct ( psVector dG,
psSparseBorder border,
psVector yVec 
)

bool psSparseBorderUpperDelta ( psSparseBorder border,
psVector dF 
)

psVector* psSparseBorderUpperProduct ( psVector dF,
psSparseBorder border,
psVector yVec 
)

bool psSparseMatrixElement ( psSparse sparse,
int  i,
int  j,
float  value 
)

psVector* psSparseMatrixTimesVector ( psVector output,
const psSparse matrix,
const psVector vector 
)

bool psSparseResort ( psSparse sparse  ) 

psVector* psSparseSolve ( psVector output,
psSparseConstraint  constraint,
const psSparse sparse,
int  Niter 
)

void psSparseVectorElement ( psSparse sparse,
int  i,
float  value 
)

psSpline1D* psSpline1DAlloc (  ) 

Allocates a psSpline1D structure.

Allocator for psSpline1D.

Returns:
psSpline1D* new 1-D spline struct

float psSpline1DEval ( const psSpline1D spline,
float  x 
)

Evaluates 1-D spline polynomials at a specific coordinate.

Returns:
float result of spline polynomials evaluated at given location
Parameters:
spline  Coefficients for spline polynomials
x  location at which to evaluate

psVector* psSpline1DEvalVector ( const psSpline1D spline,
const psVector x 
)

Evaluates 1-D spline polynomials at a set of specific coordinates.

Returns:
psVector* results of spline polynomials evaluated at given locations
Parameters:
spline  Coefficients of spline polynomials
x  locations at which to evaluate

psStats* psStatsAlloc ( psStatsOptions  options  ) 

Allocator of the psStats structure.

Returns:
psStats* A new psStats struct with the options member set to the value given.
Parameters:
options  Statistics to calculate

psStats* psStatsFromString ( const char *  string  ) 

double psStatsGetValue ( const psStats stats,
psStatsOptions  option 
)

psStatsOptions psStatsOptionFromString ( const char *  string  ) 

psString psStatsOptionToString ( psStatsOptions  option  ) 

psStatsOptions psStatsSingleOption ( psStatsOptions  option  ) 

psString psStatsToString ( const psStats stats  ) 

psVector* psStringMD5 ( const char *  string  ) 

Return an MD5 hash of the supplied string.

The MD5 hash is returned in a U8 vector of size 16.

Parameters:
string  String to hash

psMathType* psUnaryOp ( psPtr  out,
const psPtr  in,
const char *  op 
)

Perform simple unary arithmetic with images or vectors.

Performs absolute value, exponent, natural log, power of 10, log, sine, cosine, tangent, arcsine, arccosine, or arctan. operations with images and vectors. Uses the form:

out = op(in),

Where op is: "abs", "exp", "ln", "ten", "log", "sin", "cos", "tan" "asin", "acos", "atan", "dsin", "dcos", dtan", "dasin", "dacos", or "datan".

Trigometric Operations with "d" prefix use units of degrees. Those without are in radians.

This function only supports vector-vector or image-image opertions.

Returns:
psType* : Pointer to either psImage or psVector.
Parameters:
out  Output type, either psImage or psVector.
in  Input, either psImage or psVector.
op  Operator.

bool psVectorChiClipFitPolynomial4D ( psPolynomial4D poly,
psStats stats,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y,
const psVector z,
const psVector t 
)

bool psVectorClipFitPolynomial1D ( psPolynomial1D poly,
psStats stats,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x 
)

bool psVectorClipFitPolynomial2D ( psPolynomial2D poly,
psStats stats,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y 
)

bool psVectorClipFitPolynomial3D ( psPolynomial3D poly,
psStats stats,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y,
const psVector z 
)

bool psVectorClipFitPolynomial4D ( psPolynomial4D poly,
psStats stats,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y,
const psVector z,
const psVector t 
)

psVector* psVectorComplex ( psVector out,
const psVector real,
const psVector imag 
)

creates a complex vector from separate real and imaginary vectors

Returns:
psVector* resulting complex vector
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
real  the real vector
imag  the imaginary vector

psVector* psVectorConjugate ( psVector out,
const psVector in 
)

computes the complex conjugate of a vector

Returns:
psVector* the complex conjugate of the 'in' vector
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
in  the psVector to compute conjugate of

psVector* psVectorFFT ( psVector out,
const psVector in,
psFFTFlags  direction 
)

Forward and reverse FFT calculations.

This takes as input the vector of interest (in) and the direction (direction), which is specified by an enumerated type psFftDirection. The input vector may be of type psF32 or psC32, the result is always psC32. If the input vector is psF32, the direction must be forward.

Returns:
psVector* the FFT transformation result
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
in  the vector to apply transform to
direction  the direction of the transform

bool psVectorFitPolynomial1D ( psPolynomial1D poly,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x 
)

Derive a polynomial fit.

psVectorFitPolynomial1d returns the polynomial that best fits the observations. The input parameters are a polynomial that specifies the fit order, myPoly, which will be altered and returned with the best-fit coefficients; and the observations, x, y and yErr. The independent variable list, x may be NULL, in which case the vector index is used. The dependent variable error, yErr may be null, in which case the solution is determined in the assumption that all data errors are equal. This function must be valid only for types psF32, psF64.

Returns:
psPolynomial1D* polynomial fit

bool psVectorFitPolynomial2D ( psPolynomial2D poly,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y 
)

bool psVectorFitPolynomial3D ( psPolynomial3D poly,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y,
const psVector z 
)

bool psVectorFitPolynomial4D ( psPolynomial4D poly,
const psVector mask,
psMaskType  maskValue,
const psVector f,
const psVector fErr,
const psVector x,
const psVector y,
const psVector z,
const psVector t 
)

psSpline1D* psVectorFitSpline1D ( const psVector x,
const psVector y 
)

Derive a one-dimensional spline fit.

Given a psSpline1D data structure and a set of x,y vectors, this routine generates the linear splines which satisfy those data points.

Returns:
psSpline1D*: the calculated one-dimensional splines
Parameters:
x  Ordinates (or NULL to just use the indices)
y  Coordinates

psHistogram* psVectorHistogram ( psHistogram out,
const psVector values,
const psVector errors,
const psVector mask,
psMaskType  maskVal 
)

Calculate a histogram.

The following function populates the histogram bins from the specified vector (in). It alters and returns the histogram out structure. The input vector may be of types psU8, psU16, psF32, psF64.

Returns:
psHistogram* histogram result
Parameters:
out  Histogram data
values  Vector to analyse
errors  Errors
mask  Mask dat for input vector
maskVal  Mask value

psVector* psVectorImaginary ( psVector out,
const psVector in 
)

extract the imaginary portion of a complex vector

Returns:
psVector* imaginary portion of the input vector.
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
in  the psVector to extract imaginary portion from

psVector* psVectorMD5 ( const psVector vector  ) 

Return an MD5 hash of the supplied vector.

The MD5 hash is returned in a U8 vector of size 16.

Parameters:
vector  Vector to hash

psVector* psVectorPowerSpectrum ( psVector out,
const psVector in 
)

computes the power spectrum of a vector

Returns:
psVector* the power spectrum of the 'in' vector
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
in  the psVector to power spectrum of

psVector* psVectorReal ( psVector out,
const psVector in 
)

extract the real portion of a complex vector

Returns:
psVector* real portion of the input vector.
Parameters:
out  a psVector to recycle. If NULL, a new psVector is made.
in  the psVector to extract real portion from

psVector* psVectorSmooth ( psVector output,
const psVector input,
double  sigma,
double  Nsigma 
)

bool psVectorStats ( psStats stats,
const psVector in,
const psVector errors,
const psVector mask,
psMaskType  maskVal 
)

Performs statistical calculations on a vector.

Returns:
psStats* the statistical results as specified by stats->options
Parameters:
stats  stats structure defines stats to be calculated and how
in  Vector to be analysed.
errors  Errors.
mask  Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
maskVal  Only mask elements with one of these bits set in maskVector

psImage* psVectorToMatrix ( psImage outImage,
const psVector inVector 
)

Convert vector to matrix.

Converts a vector into a psImage matrix. If the dimensionality of the vector is PS_DIMEN_VECTOR, then the resulting psImage is a 1d column. If the dimensionality of the vector is PS_DIMEN_TRANSV, then the resulting psImage is a 1d row. If the user specifies NULL as the outImage argument, then it will automatically be created. This function operates only with the psF64 data type.

Returns:
psVector* : Pointer to psIamge.
Parameters:
outImage  Matrix to return, or NULL.
inVector  Vector to convert.


Generated on Fri Feb 2 22:25:49 2007 for pslib by  doxygen 1.5.1