IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 374


Ignore:
Timestamp:
Apr 1, 2004, 12:09:25 AM (22 years ago)
Author:
Paul Price
Message:

Syched design document with header files for bitmasks through minimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r367 r374  
    1 %%% $Id: psLibSDRS.tex,v 1.28 2004-04-01 09:44:17 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.29 2004-04-01 10:09:25 price Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    12321232/** Set a bit mask */
    12331233psBitMask *
    1234 psBitMaskSet(psBitMask *outMask,        ///< Output bit mask or NULL
    1235              const psBitMask *myMask,   ///< Input bit mask
    1236              int bit                    ///< Bit to set
     1234psBitMaskSet(psBitMask *myMask,         ///< Input bit mask
     1235             int bit                    ///< Bit to set
    12371236    );
    12381237\end{verbatim}
     
    13411340
    13421341\begin{verbatim}
    1343 /** Do Statistics on an array.  Returns a status value. */
     1342/** Do Statistics on an array.  Returns a status value. \ingroup MathGroup */
    13441343psStats *
    13451344psArrayStats(const psFloatArray *restrict myArray, ///< Array to be analysed
    1346              const psIntArray *restrict maskArray, ///< Ignore elements where (maskArray & maskVal) != 0
    1347                                                    ///< May be NULL
    1348              unsigned int maskVal,      ///< Only mask elements with one of these bits set in maskArray
    1349              psStats *stats             ///< stats structure defines stats to be calculated and how
    1350              );
     1345             const psIntArray *restrict maskArray, ///< Ignore elements where (maskArray & maskVal) != 0
     1346                                                   ///< May be NULL
     1347             unsigned int maskVal,      ///< Only mask elements with one of these bits set in maskArray
     1348             psStats *stats             ///< stats structure defines stats to be calculated and how
     1349    );
    13511350\end{verbatim}
    13521351%
     
    15701569psMatrixOp(psMatrix *out,               ///< Matrix to return, or NULL
    15711570           const psMatrix *matrix1,     ///< Matrix 1
    1572            const char *op,              ///< Operation to perform
     1571           const char *op,              ///< Operation to perform: "+", "-", "*"
    15731572           const psMatrix *matrix2      ///< Matrix 2
    15741573           );
     
    15941593/** Convert matrix to vector.  Intended for a 1-d matrix. */
    15951594psVector *
    1596 psMatrixToVector(psMatrix *myMatrix     ///< Matrix to convert
     1595psMatrixToVector(psVector *out,         ///< Vector to return, or NULL
     1596                 psImage *myMatrix      ///< Matrix to convert
    15971597    );
    15981598
     
    16191619/** Fast Fourier Transform */
    16201620typedef struct {
    1621     p_psFFTDetails *details;            //!< Details on FFT implementation (private)
    1622     int nx, ny;                         //!< Size in x and y
    1623     float **real;                       //!< Data in real space
    1624     void *fourier;                      //!< Data in fourier space; implementation dependent
     1621    p_psFFTDetails *details;            ///< Details on FFT implementation (private)
     1622    int nx, ny;                         ///< Size in x and y
     1623    float *real;                        ///< Data in real space: a 2D array using the [nx*y + x] stuff
     1624    void *fourier;                      ///< Data in fourier space; implementation dependent
    16251625} psFFT;
    16261626\end{verbatim}
    16271627
    1628 The \code{*details} entry allows us to wrap the external library in
    1629 the event that it carries information around from one transform to the
     1628The \code{details} entry allows us to wrap the external library in the
     1629event that it carries information around from one transform to the
    16301630next (as is the case for FFTW), and hence it is
    1631 implementation-dependent.  The intent is that every function that
    1632 employs a FFT will act on a \code{psFFT}.  A user will create a
    1633 \code{psFFT} by stuffing it with the real data, perform operations in
    1634 Fourier space using the \code{psFFT}, and then extract the output as
    1635 an image when done.
     1631implementation-dependent.  The size of the data in real space are
     1632stored in \code{nx} and \code{ny}, and the data is stored as a
     1633Fortran-style array, \code{real}.  Since different libraries store the
     1634data in the Fourier space differently, \code{fourier}, we have
     1635specified it as of type \code{void*}.
     1636
     1637The intent is that every function that employs a FFT will act on a
     1638\code{psFFT}.  A user will create a \code{psFFT} by stuffing it with
     1639the real data, perform operations in Fourier space using the
     1640\code{psFFT}, and then extract the output as an image when done.
    16361641
    16371642We specify two constructors --- one for use with images, and the other
     
    16631668/** Forward FFT: from real to fourier space */
    16641669psFFT *
    1665 psFFTForwardTransform(psFFT *fft        //!< FFT to apply
    1666                       );
     1670psFFTForward(psFFT *fft                 ///< FFT to apply (input and output)
     1671             );
    16671672
    16681673/** Reverse FFT: from fourier to real space */
    16691674psFFT *
    1670 psFFTReverseTransform(psFFT *fft        //!< FFT to apply
    1671                       );
     1675psFFTReverse(psFFT *fft                 ///< FFT to apply (input and output)
     1676             );
    16721677\end{verbatim}
    16731678
     
    17011706
    17021707\begin{verbatim}
    1703 /** Calculate cross-correlation function */
     1708/** Calculate FFT of the cross-correlation.  Multiplication of the first FFT with the complex conjugate of
     1709 *  the second.
     1710 */
    17041711psFFT *
    17051712psFFTCrossCorrelate(psFFT *out          //!< Output FFT (or NULL)
     
    17081715\end{verbatim}
    17091716
     1717In convolution, two Fourier transforms are multiplied, and the resultant
     1718\code{psFFT} is returned.
     1719
     1720\begin{verbatim}
     1721/** Calculate FFT of the convolution.  Straight multiplication of the FFTs */
     1722psFFT *
     1723psFFTConvolve(psFFT *out,               ///< Output FFT (or NULL)
     1724              const psFFT *fft1, const psFFT *fft2 ///< FFTs to multiply
     1725              );
     1726\end{verbatim}
     1727
    17101728The power spectrum is calculated from the Fourier transform, returning
    17111729an array of floating-point values containing the power spectrum.
     
    17131731\begin{verbatim}
    17141732/** Calculate power spectrum */
    1715 psFFT *
    1716 psFFTPowerSpec(psFFT *fft               //!< FFT to use (input and output)
    1717                );
    1718 \end{verbatim}
    1719 
    1720 In convolution, two Fourier transforms are multiplied, and the resultant
    1721 \code{psFFT} is returned.
    1722 
    1723 \begin{verbatim}
    1724 /** Multiply two Fourier transforms, as for convolution */
    1725 psFFT *
    1726 psFFTMultiplyFT(psFFT *out,             //!< Output FFT (or NULL)
    1727                 const psFFT *fft1, const psFFT *fft2 //!< FFTs to multiply
    1728                 );
     1733psFloatArray *
     1734psFFTPowerSpec(psFFT *fft               ///< FFT to use (input and output)
     1735               );
    17291736\end{verbatim}
    17301737
     
    17571764
    17581765\begin{verbatim}
    1759 /** evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate.  Note that this
     1766/** Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate.  Note that this
    17601767    is not a Gaussian deviate.  The evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */
    17611768float
     
    18411848\end{verbatim}
    18421849
    1843 \tbd{Generate a Gaussian deviate vector}
     1850\tbd{Generate a vector of random Gaussian deviates}
    18441851
    18451852%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    18531860
    18541861\begin{verbatim}
    1855 /** Minimize a particular function */
     1862/** Minimize a particular non-linear function */
    18561863psFloatArray *
    1857 psMinimize(float (*myFunction)(const psFloatArray *restrict),   ///< Function to minimize
    1858            psFloatArray *restrict initialGuess ///< Initial guess
    1859            );
     1864psMinimize(float (*myFunction)(const psFloatArray *restrict), ///< Function to minimize
     1865           psFloatArray *restrict initialGuess, ///< Initial guess
     1866           psIntArray *restrict paramMask //!< 1 = fit for parameter, 0 = hold parameter constant
     1867           );
    18601868\end{verbatim}
    18611869
     
    18701878psFloatArray *
    18711879psMinimizeChi2(float (*evalModel)(const psFloatArray *restrict,
    1872                                   const psFloatArray *restrict), ///< Model to fit; receives domain and
    1873                                                                  ///< parameters
    1874                const psFloatArray *restrict domain, ///< The domain values for the corresponding measurements
    1875                const psFloatArray *restrict data, ///< Data to fit
    1876                const psFloatArray *restrict errors, ///< Errors in the data
    1877                psFloatArray *restrict initialGuess, ///< Initial guess
    1878                const psIntArray *restrict guessMask ///< 1 = fit for parameter, 0 = hold parameter constant
    1879                );
     1880                                  const psFloatArray *restrict), ///< Model to fit; (domain and params)
     1881               const psFloatArray *restrict domain, ///< The domain values for the corresponding measurements
     1882               const psFloatArray *restrict data, ///< Data to fit
     1883               const psFloatArray *restrict errors, ///< Errors in the data
     1884               psFloatArray *restrict initialGuess, ///< Initial guess
     1885               const psIntArray *restrict paramMask ///< 1 = fit for parameter, 0 = hold parameter constant
     1886    );
    18801887\end{verbatim}
    18811888
     
    18891896
    18901897\begin{verbatim}
    1891 /** Derive a polynomial that goes through the points --- can be done analytically */
    1892 psFloatArray *
    1893 psGetArrayPolynomial(const psFloatArray *restrict ord, ///< Ordinates (or NULL to just use the indices)
    1894                      const psFloatArray *restrict coord ///< Coordinates
     1898/** Derive a polynomial fit by chi^2 minimisation --- can be done analytically */
     1899psPolynomial1D *
     1900psGetArrayPolynomial(psPolynomial1D myPoly, ///< Polynomial to fit
     1901                     const psFloatArray *restrict x, ///< Ordinates (or NULL to just use the indices)
     1902                     const psFloatArray *restrict y, ///< Coordinates
     1903                     const psFloatArray *restrict yErr ///< Errors in coordinates, or NULL
    18951904    );
    18961905\end{verbatim}
Note: See TracChangeset for help on using the changeset viewer.