Changeset 703
- Timestamp:
- May 15, 2004, 6:50:56 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (64 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r702 r703 1 %%% $Id: psLibSDRS.tex,v 1.4 4 2004-05-15 02:41:00 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.45 2004-05-16 04:50:56 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 99 99 example, the function which copies an image (of type \code{psImage}) 100 100 is called \code{psImageCopy()}. 101 102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 101 103 102 104 \subsection{External Libraries} … … 129 131 \subsection{Threads} 130 132 131 \tbd{discussion of thread safe?} 133 Pan-STARRS does not have a strong requirement for multithreading 134 capability. The memory management functions, defined below, must be 135 written to be thread-safe. 132 136 133 137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 537 541 /* No operation if object is NULL */ 538 542 if (myType == NULL) { 539 return;543 return; 540 544 } 541 545 /* Only call psFree if reference counter is 1 */ 542 546 if (psMemGetRefCounter(myType) == 1) { 543 psFree(myType);544 return;547 psFree(myType); 548 return; 545 549 } 546 550 /* Otherwise, decrement the reference counter only */ … … 1202 1206 \begin{verbatim} 1203 1207 typedef enum { 1204 PS_TYPE_S8, ///< Character1205 PS_TYPE_S16, ///< Short integer1206 PS_TYPE_S32, ///< Integer1207 PS_TYPE_S64, ///< Long integer1208 PS_TYPE_U8, ///< Unsigned character1209 PS_TYPE_U16, ///< Unsigned short integer1210 PS_TYPE_U32, ///< Unsigned integer1211 PS_TYPE_U64, ///< Unsigned long integer1212 PS_TYPE_F32, ///< Floating point1213 PS_TYPE_F64, ///< Double-precision floating point1214 PS_TYPE_C32, ///< Complex numbers consisting of floating point1215 PS_TYPE_OTHER, ///< Something else that's not supported for arithmetic1208 PS_TYPE_S8, ///< Character 1209 PS_TYPE_S16, ///< Short integer 1210 PS_TYPE_S32, ///< Integer 1211 PS_TYPE_S64, ///< Long integer 1212 PS_TYPE_U8, ///< Unsigned character 1213 PS_TYPE_U16, ///< Unsigned short integer 1214 PS_TYPE_U32, ///< Unsigned integer 1215 PS_TYPE_U64, ///< Unsigned long integer 1216 PS_TYPE_F32, ///< Floating point 1217 PS_TYPE_F64, ///< Double-precision floating point 1218 PS_TYPE_C32, ///< Complex numbers consisting of floating point 1219 PS_TYPE_OTHER, ///< Something else that's not supported for arithmetic 1216 1220 } psElemType; 1217 1221 \end{verbatim} … … 1228 1232 \begin{verbatim} 1229 1233 typedef struct { 1230 psType type; ///< vector data type and dimension1231 const int n; ///< size of vector1232 const int nalloc; ///< data region relative to parent1234 psType type; ///< vector data type and dimension 1235 const int n; ///< size of vector 1236 const int nalloc; ///< data region relative to parent 1233 1237 union { 1234 psF32 *arr;///< Pointers to floating-point data (default)1235 psS8 *arr_S8;///< Pointers to short-integer data1236 psS16 *arr_S16;///< Pointers to short-integer data1237 psS32 *arr_S32;///< Pointers to integer data1238 psS64 *arr_S64;///< Pointers to long-integer data1239 psU8 *arr_U18;///< Pointers to unsigned-short-integer data1240 psU16 *arr_U16;///< Pointers to unsigned-short-integer data1241 psU32 *arr_U32;///< Pointers to unsigned-integer data1242 psU64 *arr_U64;///< Pointers to unsigned-long-integer data1243 psF32 *arr_F32;///< Pointers to floating-point data1244 psF64 *arr_F64;///< Pointers to double-precision data1245 psF32 *arr_C32;///< Pointers to complex floating-point data1246 void **arr_v;1238 psF32 *arr; ///< Pointers to floating-point data (default) 1239 psS8 *arr_S8; ///< Pointers to short-integer data 1240 psS16 *arr_S16; ///< Pointers to short-integer data 1241 psS32 *arr_S32; ///< Pointers to integer data 1242 psS64 *arr_S64; ///< Pointers to long-integer data 1243 psU8 *arr_U18; ///< Pointers to unsigned-short-integer data 1244 psU16 *arr_U16; ///< Pointers to unsigned-short-integer data 1245 psU32 *arr_U32; ///< Pointers to unsigned-integer data 1246 psU64 *arr_U64; ///< Pointers to unsigned-long-integer data 1247 psF32 *arr_F32; ///< Pointers to floating-point data 1248 psF64 *arr_F64; ///< Pointers to double-precision data 1249 psF32 *arr_C32; ///< Pointers to complex floating-point data 1250 void **arr_v; 1247 1251 } arr; 1248 1252 } psVector; … … 1323 1327 \begin{verbatim} 1324 1328 typedef struct psImage { 1325 psType type; ///< image data type and dimension1326 const int ncols, nrows; ///< size of image1327 const int x0, y0; ///< data region relative to parent1329 psType type; ///< image data type and dimension 1330 const int ncols, nrows; ///< size of image 1331 const int x0, y0; ///< data region relative to parent 1328 1332 union { 1329 psF32 **rows;///< Pointers to floating-point data (default)1330 psS8 **rows_S8;///< Pointers to char data1331 psS16 **rows_S16;///< Pointers to short-integer data1332 psS32 **rows_S32;///< Pointers to integer data1333 psS64 **rows_S64;///< Pointers to long-integer data1334 psU8 **rows_U8;///< Pointers to unsigned-char data1335 psU16 **rows_U16;///< Pointers to unsigned-short-integer data1336 psU32 **rows_U32;///< Pointers to unsigned-integer data1337 psU64 **rows_U64;///< Pointers to unsigned-long-integer data1338 psF32 **rows_F32;///< Pointers to floating-point data1339 psF64 **rows_F64;///< Pointers to double-precision data1340 psC32 **rows_C32;///< Pointers to complex floating-point data1333 psF32 **rows; ///< Pointers to floating-point data (default) 1334 psS8 **rows_S8; ///< Pointers to char data 1335 psS16 **rows_S16; ///< Pointers to short-integer data 1336 psS32 **rows_S32; ///< Pointers to integer data 1337 psS64 **rows_S64; ///< Pointers to long-integer data 1338 psU8 **rows_U8; ///< Pointers to unsigned-char data 1339 psU16 **rows_U16; ///< Pointers to unsigned-short-integer data 1340 psU32 **rows_U32; ///< Pointers to unsigned-integer data 1341 psU64 **rows_U64; ///< Pointers to unsigned-long-integer data 1342 psF32 **rows_F32; ///< Pointers to floating-point data 1343 psF64 **rows_F64; ///< Pointers to double-precision data 1344 psC32 **rows_C32; ///< Pointers to complex floating-point data 1341 1345 } rows; 1342 const struct psImage *parent; ///< parent, if a subimage1343 int Nchildren; ///< number of subimages1344 struct psImage **children; ///< children of this region; array of Nchildren pointers1346 const struct psImage *parent; ///< parent, if a subimage 1347 int Nchildren; ///< number of subimages 1348 struct psImage **children; ///< children of this region; array of Nchildren pointers 1345 1349 } psImage; 1346 1350 \end{verbatim} … … 1637 1641 array. Also note that the constructor is passed the number of 1638 1642 required bits, which implies that \code{ceil(n / 8)} bytes must be 1639 allocated. 1640 1641 \begin{verbatim} 1642 /** A bitset of arbitrary length. */ 1643 allocated. The bitset structure is define by: 1644 \begin{verbatim} 1643 1645 typedef struct { 1644 1646 int n; ///< Number of chars that form the bitset … … 1648 1650 1649 1651 We also require the corresponding constructor and destructor: 1650 1651 \begin{verbatim} 1652 /** Constructor */ 1653 psBitset *psBitsetAlloc(int n ///< Number of bits required 1654 ); 1655 1656 /** Destructor */ 1657 void psBitsetFree(psBitset *restrict myBits ///< bitset to destroy 1658 ); 1659 \end{verbatim} 1652 \begin{verbatim} 1653 psBitset *psBitsetAlloc(int n); 1654 void psBitsetFree(psBitset *restrict myBits); 1655 \end{verbatim} 1656 where \code{n} is the requested number of bits. 1660 1657 1661 1658 Four basic operations on bitsets are required: … … 1665 1662 \item \code{OR}, \code{AND} and \code{XOR} two bitsets. 1666 1663 \end{itemize} 1667 The corresponding APIs are defined below. 1668 1669 \begin{verbatim} 1670 /** Set a bitset */ 1671 psBitset * 1672 psBitsetSet(psBitset *restrict myBits, ///< Input bitset 1673 int bit ///< Bit to set 1674 ); 1664 The corresponding APIs are defined below: 1665 1666 \begin{verbatim} 1667 psBitset *psBitsetSet(psBitset *restrict myBits, int bit); 1668 psBitset *psBitsetOp(psBitset *outBits, 1669 const psBitset *restrict inBits1, 1670 char *operator, 1671 const psBitset *restrict inBits2); 1672 psBitset *psBitsetNot(psBitset *out, psBitset *in); 1673 int psBitsetTest(const psBitset *restrict checkBits, int bit); 1675 1674 \end{verbatim} 1676 1675 … … 1679 1678 will be modified. 1680 1679 1681 \begin{verbatim}1682 /** Check a bitset. Returns true or false */1683 int1684 psBitsetTest(const psBitset *restrict checkBits, ///< bitset to check1685 int bit ///< Bit to check1686 );1687 \end{verbatim}1688 1689 \code{psBitsetTest} returns a true value if the specified \code{bit}1690 is set; otherwise, it returns a false value.1691 1692 \begin{verbatim}1693 /** apply the given operator to two bitsets */1694 psBitset *1695 psBitsetOp(psBitset *outBits, ///< Output bitset or NULL1696 const psBitset *restrict inBits1, ///< Input bitset 11697 char *operator, ///< bitset operator (AND, OR, XOR)1698 const psBitset *restrict inBits2 ///< Input bitset 21699 );1700 \end{verbatim}1701 1702 1680 \code{psBitsetOp} returns the \code{psBitset} that is the result of 1703 1681 performing the specified \code{operator} (one of \code{"AND"}, 1704 1682 \code{"OR"}, or \code{"XOR"}) on \code{inBits1} and \code{inBits2}. 1705 1706 Finally, \code{psBitsetNot} applies a unary \code{NOT} to a bitset: 1707 1708 \begin{verbatim} 1709 /** Apply unary NOT to a bitset */ 1710 psBitset * 1711 psBitsetNot(psBitset *out, ///< Output bitset, or NULL 1712 psBitset *in ///< Input bitset to be NOT-ed 1713 ); 1714 \end{verbatim} 1683 If the output bitset \code{outBits} is \code{NULL}, it is created by 1684 the function. 1685 1686 \code{psBitsetNot} applies a unary \code{NOT} to a bitset, placing the 1687 answer in the bitset \code{out}, or creating a new bitset if 1688 \code{out} is \code{NULL}. 1689 1690 Finally, \code{psBitsetTest} returns a true value if the specified 1691 \code{bit} is set; otherwise, it returns a false value. 1715 1692 1716 1693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1721 1698 following function returns the array, sorted from the smallest (i.e.\ 1722 1699 most negative) value in the first element, and the largest (i.e.\ most 1723 positive) value in the last element. The input array, \code{myArray}, 1724 may be sorted in-place if it is also specified as the \code{out} 1725 array. 1726 1727 \begin{verbatim} 1728 /** Sort an array. Inputs not restrict-ed to allow sort in place */ 1729 psFloatArray * 1730 psSort(psFloatArray *out, ///< Sorted array to return. May be NULL 1731 const psFloatArray *restrict myArray ///< Array to sort 1732 ); 1700 positive) value in the last element. The input array, \code{in}, may 1701 be sorted in-place if it is also specified as the \code{out} 1702 array. This function is specified for input types \code{psU8, psU16, 1703 psF32, psF64}. The input and output vectors must have the same type. 1704 1705 \begin{verbatim} 1706 psVector *psSort(psVector *out, const psVector *restrict in); 1733 1707 \end{verbatim} 1734 1708 … … 1737 1711 in \code{x}. In order to facilitate this, we will have a sort 1738 1712 function return an array containing the indices for the unsorted list 1739 in the order appropriate for the sorted array: 1740 1741 \begin{verbatim} 1742 /** Sort an array, along with some other stuff. Returns an index array */ 1743 psIntArray * 1744 psSortIndex(psIntArray *restrict out; ///< Output index array (may be NULL) 1745 const psFloatArray *restrict myArray ///< Array to sort 1746 ); 1747 \end{verbatim} 1748 1749 Then the sorted arrays may be accessed in the following manner: 1750 1713 in the order appropriate for the sorted array. The output vector must 1714 be of type \code{psU32}. This function is specified for input types 1715 \code{psU8, psU16, psF32, psF64}. 1716 1717 \begin{verbatim} 1718 psVector *psSortIndex(psVector *restrict out; const psVector *restrict in); 1719 \end{verbatim} 1720 1721 The sorted arrays may be accessed in the following manner: 1751 1722 \begin{verbatim} 1752 1723 indexArray = psSortIndex(NULL, x); 1753 1724 for (int i = 0; i < indexArray.n; i++) { 1754 doMyFunc(x[indexArray [i]], y[indexArray[i]]);1725 doMyFunc(x[indexArray.arr.arr_U32[i]], y[indexArray[i].arr.arr_U32]); 1755 1726 } 1756 1727 \end{verbatim} … … 1788 1759 1789 1760 \begin{verbatim} 1790 /** Do Statistics on an array. Returns a status value. \ingroup MathGroup */ 1791 psStats * 1792 psArrayStats(const psFloatArray *restrict myArray, ///< Array to be analysed 1793 const psIntArray *restrict maskArray, ///< Ignore elements where (maskArray & maskVal) != 0 1794 ///< May be NULL 1795 unsigned int maskVal, ///< Only mask elements with one of these bits set in maskArray 1796 psStats *stats ///< stats structure defines stats to be calculated and how 1797 ); 1798 \end{verbatim} 1799 % 1800 This function takes the input data in \code{myArray} (with optional 1801 masking in \code{maskArray}, so that the user may explicitly reject 1802 specific entries) and a \code{psStats} structure, which will be 1803 altered and returned. 1761 psStats *psArrayStats(const psVector *restrict in, 1762 const psVector *restrict mask, 1763 unsigned int maskVal, 1764 psStats *stats); 1765 \end{verbatim} 1766 % 1767 This function takes the input data in \code{in} (with optional masking 1768 in \code{mask}, so that the user may explicitly reject specific 1769 entries) and a \code{psStats} structure, which will be altered and 1770 returned. The input vector may be of type \code{psU8}, \code{psU16}, 1771 \code{psF32}, \code{psF64}; the mask must be of type \code{psU8}. 1804 1772 1805 1773 The \code{psStats} structure is defined with entries for each of the … … 1814 1782 double sampleUQ; ///< upper quartile of sample 1815 1783 double sampleLQ; ///< lower quartile of sample 1816 double robustMean; ///< robust mean of array1784 double robustMean; ///< robust mean of data 1817 1785 int robustMeanNvalues; ///< number of measurements used for robust mean 1818 double robustMedian; ///< robust median of array1786 double robustMedian; ///< robust median of data 1819 1787 int robustMedianNvalues; ///< number of measurements used for robust median 1820 double robustMode; ///< Robust mode of array1788 double robustMode; ///< Robust mode of data 1821 1789 int robustModeNvalues; ///< Number of measurements used for robust mode 1822 double robustStdev; ///< robust standard deviation of array1790 double robustStdev; ///< robust standard deviation of data 1823 1791 double robustUQ; ///< robust upper quartile 1824 1792 double robustLQ; ///< robust lower quartile … … 1828 1796 double clipSigma; ///< Nsigma used for clipping; user input 1829 1797 int clipIter; ///< Number of clipping iterations; user input 1830 double min; ///< minimum data value in array1831 double max; ///< maximum data value in array1832 int nValues; ///< number of data values in array1798 double min; ///< minimum data value in data 1799 double max; ///< maximum data value in data 1800 int nValues; ///< number of data values in data 1833 1801 psStatsOptions options; ///< bitmask of calculated values 1834 1802 } psStats; … … 1867 1835 1868 1836 \begin{verbatim} 1869 /** Constructor */ 1870 psStats * 1871 psStatsAlloc(psStatsOptions options ///< Statistics to measure 1872 ); 1873 1874 /** Destructor */ 1875 void 1876 psStatsFree(psStats *restrict stats ///< Stats structure to destroy 1877 ); 1878 \end{verbatim} 1879 1837 psStats *psStatsAlloc(psStatsOptions options); 1838 void psStatsFree(psStats *restrict stats); 1839 \end{verbatim} 1880 1840 1881 1841 \subsubsection{Histograms} … … 1883 1843 1884 1844 We also require to be able to generate histograms, given a list of 1885 upper and lower bounds for each of the bins. 1886 1887 \begin{verbatim} 1888 /** Histograms */ 1845 upper and lower bounds for each of the bins. We define the following 1846 data structure to represent a histogram: 1847 \begin{verbatim} 1889 1848 typedef struct { 1890 const psFloatArray *restrict bounds; ///< Bounds for the bins 1891 psIntArray *nums; ///< Number in each of the bins 1892 const float minVal, maxVal; ///< Minimum and maximum values 1893 int minNum, maxNum; ///< Number below the minimum and above the maximum 1894 int uniform; ///< Is it a uniform distribution? 1849 const psVector *restrict bounds; ///< Bounds for the bins 1850 psVector *nums; ///< Number in each of the bins 1851 int minNum, maxNum; ///< Number below the minimum and above the maximum 1852 int uniform; ///< Is it a uniform distribution? 1895 1853 } psHistogram; 1896 1854 \end{verbatim} 1855 In this structure, the vector \code{bounds} specifies the boundaries 1856 of the histogram bins, and must of type \code{psF32}, while 1857 \code{nums} specifies the number of entries in the bin, and must of 1858 type \code{psU32}. The value of \code{bounds.n} must therefore be 1 1859 greater than than \code{nums.n}. The two values \code{minNum} and 1860 \code{maxNum} are the number of data values which fell below the lower 1861 limit bound or above the upper limit bound, respectively. 1897 1862 1898 1863 The constructors and destructor follow. We specify two constructors, … … 1902 1867 1903 1868 \begin{verbatim} 1904 /** Constructor */ 1905 psHistogram * 1906 psHistogramAlloc(float lower, ///< Lower limit for the bins 1907 float upper, ///< Upper limit for the bins 1908 int n ///< Number of the bins 1909 ); 1910 \end{verbatim} 1911 1912 \begin{verbatim} 1913 /** Generic constructor */ 1914 psHistogram * 1915 psHistogramAllocGeneric(const psFloatArray *restrict bounds, ///< Bounds for the bins 1916 float minVal, ///< Minimum value 1917 float maxVal ///< Maximum value 1918 ); 1919 \end{verbatim} 1920 1921 \begin{verbatim} 1922 /** Destructor */ 1923 void 1924 psHistogramFree(psHistogram *restrict myHist ///< Histogram to destroy 1925 ); 1869 psHistogram *psHistogramAlloc(float lower, float upper, int n); 1870 \end{verbatim} 1871 where \code{lower} specifies the lower bound of the histogram range, 1872 \code{upper} specified the upper bound of the histogram range, and 1873 \code{n} is the number of bins desired across the range. This 1874 constructor sets the value of \code{uniform} to be true. 1875 1876 A histogram with a more flexible bin set may be constructed with the 1877 following constructor: 1878 \begin{verbatim} 1879 psHistogram *psHistogramAllocGeneric(const psVector *restrict bounds); 1880 \end{verbatim} 1881 where the \code{psVector *bounds} (of type \code{psF32}) is defined by 1882 the user to specify the boundaries of the histogram bins. This 1883 constructor sets the value of \code{uniform} to be false. 1884 1885 A histogram is free with the destructor: 1886 \begin{verbatim} 1887 void psHistogramFree(psHistogram *restrict myHist); 1926 1888 \end{verbatim} 1927 1889 1928 1890 The following function populates the histogram bins from the specified 1929 array (\code{myArray}), the number of entries less than \code{minVal} 1930 (\code{minNum}), and the number of entries greater than \code{maxVal} 1931 (\code{maxNum}). It alters and returns the \code{psHistogram} 1932 structure. 1933 1934 \begin{verbatim} 1935 /** Calculate a histogram \ingroup MathGroup **/ 1936 psHistogram * 1937 psGetArrayHistogram(psHistogram *restrict myHist, ///< Histogram data 1938 const psFloatArray *restrict myArray ///< Array to analyse 1939 ); 1940 \end{verbatim} 1891 vector (\code{in}). It alters and returns the histogram \code{out} 1892 structure. 1893 \begin{verbatim} 1894 psHistogram *psHistogramVector(psHistogram *restrict out, const psVector *restrict in); 1895 \end{verbatim} 1896 The input vector may be of types \code{psU8, psU16, psF32, psF64}. 1941 1897 1942 1898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 1947 1903 (\S\ref{sec:arithmetic}), we also require the ability to perform basic 1948 1904 linear algebra on matrices, in order to solve equations. We use 1949 \code{psImage} as a matrix, since it has the correct form; similarly, 1950 we define a vector, \code{psVector} to be an array of floating-point 1951 numbers, \code{psFloatArray}. We define the following basic matrix 1952 operations: 1905 \code{psImage} as a matrix, since it has the correct form. We define 1906 the following basic matrix operations: 1953 1907 \begin{itemize} 1954 1908 \item $LU$ Decompose a matrix, and solve for $x$ in $Ax = b$; … … 1963 1917 1964 1918 \begin{verbatim} 1965 /** LU Decomposition of a matrix */ 1966 psImage * 1967 psMatrixLUD(psImage *out, ///< Matrix to return, or NULL 1968 psImage *myMatrix ///< Matrix to decompose 1969 ); 1970 1971 /** LU Solution. Solves for and returns x in the equation Ax = b */ 1972 psVector * 1973 psMatrixLUSolve(psVector *out, ///< Vector to return, or NULL 1974 const psImage *luMatrix, ///< LU-decomposed matrix 1975 const psVector *rhsVector ///< right-hand-side of the equation 1976 ); 1977 \end{verbatim} 1978 1979 The above functions decompose a matrix, \code{myMatrix}, into its $LU$ 1919 psImage *psMatrixLUD(psImage *out, psImage *in); 1920 psVector *psMatrixLUSolve(psVector *out, const psImage *LU, const psVector *RHS); 1921 \end{verbatim} 1922 The above functions decompose a matrix, \code{in}, into its $LU$ 1980 1923 representation (\code{psMatrixLUD}, which returns the decomposed 1981 1924 matrix), and uses the decomposed matrix to solve for $x$ in the 1982 1925 equation $Ax = b$. In this case, the $LU$ decomposed matrix $A$ is 1983 specified as \code{luMatrix}, and $b$ is \code{rhsVector}; the 1984 solution for $x$ is returned. 1985 1986 \begin{verbatim} 1987 /** Invert matrix. Not using restrict, to allow inversion to be done in-place */ 1988 psImage * 1989 psMatrixInvert(psImage *out, ///< Matrix to return, or NULL 1990 const psImage *myMatrix, ///< Matrix to be inverted 1991 float *restrict determinant ///< Determinant to return, or NULL 1992 ); 1993 \end{verbatim} 1994 1926 specified as \code{LU}, and $b$ is \code{RHS}; the solution vector for 1927 $x$ is returned. These functions are specified for data types 1928 \code{psF32, psF64}. The output and input vectors and images must all 1929 have the same data type. 1930 1931 \begin{verbatim} 1932 psImage *psMatrixInvert(psImage *out, const psImage *in, float *restrict determinant); 1933 \end{verbatim} 1995 1934 \code{psMatrixInvert} returns the inverse of the specified matrix 1996 (\code{myMatrix}), along with the \code{determinant}, if non-NULL. 1935 (\code{in}), along with the \code{determinant}, if the \code{float} 1936 pointer is non-NULL. The input and output images must have the same 1937 type. This function is specified for data types \code{psF32, psF64}. 1997 1938 1998 1939 The matrix determinant may be calculated using 1999 1940 \code{psMatrixDeterminant}, which simply returns the determinant for 2000 the specified matrix, \code{myMatrix}. 2001 2002 \begin{verbatim} 2003 /** Matrix determinant */ 2004 float 2005 psMatrixDeterminant(const psImage *restrict myMatrix //!< Matrix to get determinant for 2006 ); 1941 the specified matrix, \code{in}. This function is specified for data 1942 types \code{psF32, psF64}. 1943 \begin{verbatim} 1944 float psMatrixDeterminant(const psImage *restrict in); 2007 1945 \end{verbatim} 2008 1946 … … 2014 1952 \code{psMatrixOp} are identical to that for \code{psBinaryOp} (since 2015 1953 that is how matrix addition is defined). Matrix division is not 2016 defined. 2017 2018 \begin{verbatim} 2019 /** Matrix operations */ 2020 psImage * 2021 psMatrixOp(psImage *out, ///< Matrix to return, or NULL 2022 const psImage *matrix1, ///< Matrix 1 2023 const char *op, ///< Operation to perform: "+", "-", "*" 2024 const psImage *matrix2 ///< Matrix 2 2025 ); 2026 \end{verbatim} 2027 2028 The transpose of an input matrix, \code{myMatrix}, is returned by 2029 \code{psMatrixTranspose}. 2030 2031 \begin{verbatim} 2032 /** Transpose Matrix */ 2033 psImage * 2034 psMatrixTranspose(psImage *out, ///< Matrix to return, or NULL 2035 const psImage *myMatrix ///< Matrix to transpose 2036 ); 2037 \end{verbatim} 2038 2039 Eigenvectors of a matrix are calculated by \code{psMatrixEigenvectors}: 2040 2041 \begin{verbatim} 2042 /** Eigenvectors of a matrix */ 2043 psVector * 2044 psMatrixEigenvectors(psImage *myMatrix ///< Matrix to get eigenvectors for 2045 ); 1954 defined. \tbd{why specify addition as an operator? why not only 1955 define operators which are different for matrices?}. This function is 1956 specified for data types \code{psF32, psF64}. 1957 1958 \begin{verbatim} 1959 psImage *psMatrixOp(psImage *out, const psImage *in1, const char *op, const psImage *in2); 1960 \end{verbatim} 1961 1962 The transpose of an input matrix, \code{in}, is returned by 1963 \code{psMatrixTranspose}, optionally into the provided matrix 1964 \code{out}. This function is specified for data types \code{psF32,psF64}. 1965 \begin{verbatim} 1966 psImage *psMatrixTranspose(psImage *out, const psImage *in); 1967 \end{verbatim} 1968 1969 Eigenvectors of a matrix are calculated by 1970 \code{psMatrixEigenvectors}. This function is specified for data 1971 types \code{psF32, psF64}. Input and output data types should match. 1972 \begin{verbatim} 1973 psVector *psMatrixEigenvectors(psImage *in); 2046 1974 \end{verbatim} 2047 1975 2048 1976 Finally, we specify two functions to convert between matrices and 2049 vectors. This allows the use of vectors in matrix arithmetic, since 2050 a vector can be converted to a matrix, utilised, and the result can 2051 be converted back to a vector if required. 2052 2053 \begin{verbatim} 2054 /** Convert matrix to vector. Intended for a 1-d matrix. */ 2055 psVector * 2056 psMatrixToVector(psVector *out, ///< Vector to return, or NULL 2057 psImage *myMatrix ///< Matrix to convert 2058 ); 2059 2060 /** Convert vector to matrix. */ 2061 psImage * 2062 psVectorToMatrix(psImage *out, //!< Matrix to return, or NULL 2063 psVector *myVector //!< Vector to convert 2064 ); 2065 \end{verbatim} 2066 1977 vectors. This allows the use of vectors in matrix arithmetic, since a 1978 vector can be converted to a matrix, utilised, and the result can be 1979 converted back to a vector if required. This function is specified 1980 for data types \code{psF32, psF64}. Input and output data types 1981 should match. 1982 \begin{verbatim} 1983 psVector *psMatrixToVector(psVector *out, psImage *in); 1984 psImage *psVectorToMatrix(psImage *out, psVector *in); 1985 \end{verbatim} 2067 1986 2068 1987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 2071 1990 2072 1991 We require the ability to calculate the (fast) fourier transforms of 2073 floating-point two-dimensional images and one-dimensional arrays. We1992 floating-point one-dimensional vectors and two-dimensional images. We 2074 1993 expect that these will be implemented through wrapping an external 2075 library. 2076 2077 The forward and reverse Fourier transforms may be calculated using the 2078 following APIs: 2079 2080 \begin{verbatim} 2081 /** Forward FFT an image. Returns a complex float image. */ 2082 psImage * 2083 psImageFFT(const psImage *image ///< Image to transform 2084 ); 2085 2086 /** Forward FFT an array of floating-point numbers. */ 2087 psFloatArray * 2088 psFloatArrayFFT(const psFloatArray *arr ///< Array to transform 2089 ); 2090 2091 /** Inverse FFT an image. */ 2092 psImage * 2093 psImageInverseFFT(const psImage *fftImage ///< FFT-ed image to inverse-transform 2094 ); 2095 2096 /** Inverse FFT an array of complex floating-point numbers */ 2097 psComplexArray * 2098 psComplexArrayInverseFFT(const psComplexArray *fftArray ///< FFT-ed array to inverse-transform 2099 ); 2100 \end{verbatim} 2101 2102 Neither the forward or inverse transforms shall multiply by $1/N$ (or 2103 $1/N^{1/2}$), and so it falls to the responsibility of the user to 2104 multiply an image that has been forward- and reverse-transformed by 2105 $1/N$. 2106 2107 The \code{psImage}s output by \code{psImageFFT} and 2108 \code{psImageInverseFFT} should be of complex floating-point type. Following 2109 an inverse transform, therefore, the user will likely want to extract the 2110 real parts: 2111 2112 \begin{verbatim} 2113 /** Get the real part of an image */ 2114 psImage * 2115 psImageReal(psImage *out, ///< Image for output (or NULL) 2116 const psImage *in ///< Image to get the real part of 2117 ); 2118 2119 /** Get the real part of an array of complex floating-point numbers */ 2120 psFloatArray * 2121 psComplexArrayReal(psFloatArray *out, ///< Array for output (or NULL) 2122 const psComplexArray *in ///< Array to get the real part of 2123 ); 2124 \end{verbatim} 2125 2126 To aid operations on FFT-ed images or arrays, we also specify 2127 functions to return the complex conjugate of an image or array: 2128 2129 \begin{verbatim} 2130 /** Get the complex conjugate of an image */ 2131 psImage * 2132 psImageConjugate(psImage *out, ///< Image for output (or NULL) 2133 const psImage *in ///< Image to get the complex conjugate of 2134 ); 2135 2136 /** Get the complex conjugate of an array of complex floating-point numbers */ 2137 psComplexArray * 2138 psComplexArrayConjugate(psComplexArray *out, ///< Array for output (or NULL) 2139 const psComplexArray *in ///< Array to get the complex conjugate of 2140 ); 2141 \end{verbatim} 2142 2143 Finally, the power spectrum may be calculated directly from the 2144 original image or array: 2145 2146 \begin{verbatim} 2147 /** Calculate power spectrum of an image */ 2148 psImage * 2149 psImagePowerSpectrum(const psImage *image ///< Image to obtain power spectrum of 2150 ); 2151 2152 /** Calculate power spectrum of an array of floating-point numbers */ 2153 psFloatArray * 2154 psFloatArrayPowerSpectrum(const psFloatArray *arr ///< Array to obtain power spectrum of 2155 ); 1994 library. We define the following APIs to support FFT operations on vectors: 1995 1996 \begin{verbatim} 1997 psVector *psVectorFFT(const psVector *in, int direction); 1998 psVector *psVectorReal(psVector *out, const psVector *in); 1999 psVector *psVectorImaginary(psVector *out, const psVector *in); 2000 psVector *psVectorComplex(psVector *real, psVector *imag); 2001 psVector *psVectorConjugate(psVector *out, const psVector *in); 2002 psVector *psVectorPowerSpectrum(const psVector *in); 2003 \end{verbatim} 2004 2005 The forward and reverse FFT is calculated using \code{psVectorFFT}, 2006 which takes as input the vector of interest (\code{in}) and the 2007 direction (\code{direction}; 1 is forward, -1 is reverse). The input 2008 vector may be of type \code{psF32} or \code{psC32}, the result is 2009 always \code{psC32}. If the input vector is \code{psF32}, the 2010 direction must be forward. Neither the forward or inverse transforms 2011 shall multiply by $1/N$ (or $1/N^{1/2}$), and so it falls to the 2012 responsibility of the user to multiply a vector that has been forward- 2013 and reverse-transformed by $1/N$. 2014 2015 Conversions between complex and real vectors requires the functions 2016 \code{psVectorReal}, which returns the real part (\code{psF32}) of the 2017 complex vector \code{in}, \code{psVectorImaginary}, which returns the 2018 the magnitude of the imaginary part (\code{psF32}) of the complex 2019 vector \code{in}, and \code{psVectorComplex}, which constructs a 2020 complex vector (\code{psC32}) from the real and imaginary components 2021 \code{real} and \code{imag}, both of type \code{psF32}. 2022 2023 We also specify the additional utility functions 2024 \code{psVectorConjuagte} and \code{psVectorPowerSpectrum} which 2025 construct the complex conjugate (\code{psC32}) and the magnitude 2026 (\code{psF32}) vectors of the input complex vector (\code{psC32}). 2027 2028 In analogy with the vector FFT operations, we also define matching 2029 image operations as follows: 2030 \begin{verbatim} 2031 psImage *psImageFFT(const psImage *image, int direction); 2032 psImage *psImagePowerSpectrum(const psImage *image); 2033 psImage *psImageReal(psImage *out, const psImage *in); 2034 psImage *psImageReal(psImage *out, const psImage *in); 2035 psImage *psImageReal(psImage *out, const psImage *in); 2036 psImage *psImageConjugate(psImage *out, const psImage *in); 2156 2037 \end{verbatim} 2157 2038 … … 2161 2042 2162 2043 We require two types of general functions which will be used in fitting: 2163 Gaussians and Polynomials. The Gaussian is easily defined: 2164 2165 \begin{verbatim} 2166 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate. Note that this 2167 * is not a Gaussian deviate. The evaluated Gaussian is: 2168 * \f[ 1/(\sqrt(2\pi)\sigma) exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 2169 */ 2170 float 2171 psGaussian(float x, ///< Value at which to evaluate 2172 float mean, ///< Mean for the Gaussian 2173 float stddev ///< Standard deviation for the Gaussian 2174 ); 2175 \end{verbatim} 2044 Gaussians and Polynomials. The Gaussian is defined as: 2045 \begin{verbatim} 2046 float psGaussian(float x, float mean, float stdev); 2047 \end{verbatim} 2048 2049 which evaluates a non-normalized Gaussian with the given mean and 2050 sigma at the given coordianate. Note that this is not a Gaussian 2051 deviate. The evaluated Gaussian is: 2052 2053 \[ 1/(\sqrt(2\pi)\sigma) exp(-\frac{(x-mean)^2}{2\sigma^2}) \] 2176 2054 2177 2055 For the polynomial, \PS{} astrometry requirements lead us to specify … … 2232 2110 The constructor and destructor are: 2233 2111 \begin{verbatim} 2234 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 2235 ); 2236 void psDPolynomial2DFree(psDPolynomial2D *restrict myPoly ///< Polynomial to destroy 2237 ); 2238 \end{verbatim} 2239 2240 And the polynomials may be evaluated, returning the value of the 2241 polynomial at the specified coordinates: 2242 2243 \begin{verbatim} 2244 /** Evaluate 2D polynomial (double precision) */ 2245 double 2246 psEvalDPolynomial2D(double x, ///< Value x at which to evaluate 2247 double y, ///< Value y at which to evaluate 2248 const psDPolynomial2D *restrict myPoly ///< Coefficients for the polynomial 2249 ); 2112 psDPolynomial2D *psDPolynomial2DAlloc(int nX, int nY); 2113 void psDPolynomial2DFree(psDPolynomial2D *restrict myPoly); 2114 \end{verbatim} 2115 where \code{nX} and \code{nY} are the number of terms in x and y 2116 respectively. 2117 2118 To evaluate the polynomials at specific coordinates, we define: 2119 \begin{verbatim} 2120 double psEvalDPolynomial2D(double x, double y, const psDPolynomial2D *restrict myPoly); 2250 2121 \end{verbatim} 2251 2122 … … 2255 2126 2256 2127 \subsection{Minimization and fitting routines} 2128 2129 \tbd{I am concerned the minimization functions defined here are 2130 missing details - gene} 2257 2131 2258 2132 We require a general minimization routine, a routine that will 2259 2133 specifically minimize $\chi^2$ given a list of data with associated 2260 2134 errors, and a function that will analytically determine the best 2261 polynomial fit by minimizing $\chi^2$. The APIs are: 2262 2263 \begin{verbatim} 2264 /** Find the minimum of a particular non-linear function */ 2265 psFloatArray * 2266 psMinimize(psFloatArray *restrict initialGuess, ///< Initial guess and answer 2267 float (*myFunction)(const psFloatArray *restrict), ///< Function to minimize 2268 float (*myFuncDeriv)(const psFloatArray *restrict), ///< Derivatives of function, or NULL 2269 const psIntArray *restrict paramMask //!< 1 = fit for parameter, 0 = hold parameter constant 2270 ); 2271 \end{verbatim} 2272 2273 \code{psMinimize} determines and returns the parameters that minimizes 2274 the specified function. It takes as input a function, 2275 \code{myFunction}, an initial guess for the parameters that minimize 2276 the function, \code{initialGuess} which is returned with the best-fit 2277 parameters, and an optional mask for the parameters to minimize, 2278 \code{paramMask} (all parameters are fit if \code{NULL}). 2279 2280 \begin{verbatim} 2281 /** Minimize chi^2 for input data */ 2282 psFloatArray * 2283 psMinimizeChi2(psFloatArray *restrict initialGuess, ///< Initial guess and answer 2284 float (*evalModel)(const psFloatArray *restrict, 2285 const psFloatArray *restrict), ///< Model to fit; (domain and params) 2286 const psFloatArray *restrict domain, ///< The domain values for the corresponding measurements 2287 const psFloatArray *restrict data, ///< Data to fit 2288 const psFloatArray *restrict errors, ///< Errors in the data 2289 const psIntArray *restrict paramMask ///< 1 = fit for parameter, 0 = hold parameter constant 2290 ); 2291 \end{verbatim} 2292 2135 polynomial fit by minimizing $\chi^2$. 2136 2137 First, we define \code{psMinimize}, which returns the vector which 2138 minimizes the specified function, which is itself a function of a 2139 single vector. The returned vector must be the same length as the 2140 vector argument to the input function. 2141 \begin{verbatim} 2142 psVector *psMinimize(psVector *restrict initialGuess, 2143 float (*myFunction)(const psVector *restrict), 2144 float (*myFuncDeriv)(const psVector *restrict), 2145 const psVector *restrict paramMask); 2146 \end{verbatim} 2147 2148 \code{psMinimize} determines and returns the vector that minimizes the 2149 specified function. It takes as input a function, \code{myFunction}, 2150 an initial guess for the vector that minimizes the function, 2151 \code{initialGuess}, and an optional mask for the vector elements 2152 (function parameters) to minimize, \code{paramMask} (all parameters 2153 are fit if \code{NULL}). Note that \code{paramMask} must be of type 2154 \code{psU8}, while \tbd{what are valid types for the function 2155 parameter lists?}. The optional function, \code{myFuncDeriv} returns 2156 the derivative of the function. \tbd{is this sufficient? clear?} 2157 2158 \begin{verbatim} 2159 psVector *psMinimizeChi2(psVector *restrict initialGuess, 2160 float (*evalModel)(const psVector *restrict, const psVector *restrict), 2161 const psVector *restrict domain, 2162 const psVector *restrict data, 2163 const psVector *restrict errors, 2164 const psVector *restrict paramMask); 2165 \end{verbatim} 2293 2166 \code{psMinimizeChi2} fits a model to observations by minimizing 2294 2167 $\chi^2$, returing the best-fit parameters. The input parameters are … … 2297 2170 \code{data}, and \code{errors}); an initial guess at the best-fit 2298 2171 parameters, \code{initialGuess} which is returned with the best-fit 2299 parameters, and an optional mask specifying which parameters are to be 2300 fit, \code{paramMask} (all parameters are fit if \code{NULL}). 2301 2302 \begin{verbatim} 2303 /** Derive a polynomial fit by chi^2 minimisation --- can be done analytically */ 2304 psPolynomial1D * 2305 psGetArrayPolynomial(psPolynomial1D myPoly, ///< Polynomial to fit 2306 const psFloatArray *restrict x, ///< Ordinates (or NULL to just use the indices) 2307 const psFloatArray *restrict y, ///< Coordinates 2308 const psFloatArray *restrict yErr ///< Errors in coordinates, or NULL 2309 ); 2310 \end{verbatim} 2311 2312 \code{psGetArrayPolynomial} calculates analytically and returns the 2313 polynomial that best fits the observations. The input parameters are 2314 a polynomial that specifies the fit order, \code{myPoly}, which will 2315 be altered and returned with the best-fit coefficients; and the 2316 observations, \code{x}, \code{y} and \code{yErr}. 2317 2318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2172 parameters \tbd{how? unclear!}, and an optional mask specifying which 2173 parameters are to be fit, \code{paramMask}, which must be of type 2174 \code{psU8}. All parameters are fit if this vector is \code{NULL}. 2175 2176 \begin{verbatim} 2177 psPolynomial1D *psGetArrayPolynomial(psPolynomial1D myPoly, 2178 const psVector *restrict x, 2179 const psVector *restrict y, 2180 const psVector *restrict yErr); 2181 \end{verbatim} 2182 \code{psGetArrayPolynomial} returns the polynomial that best fits the 2183 observations. The input parameters are a polynomial that specifies 2184 the fit order, \code{myPoly}, which will be altered and returned with 2185 the best-fit coefficients; and the observations, \code{x}, \code{y} 2186 and \code{yErr}. The independent variable list, \code{x} may be 2187 \code{NULL}, in which case the vector index is used. The dependent 2188 variable error, \code{yErr} may be null, in which case the solution is 2189 determined in the assumption that all data errors are equal. 2190 \tbd{valid types?} 2191 2320 2192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2321 2193 … … 2339 2211 starting pixel of the subraster. The entire subraster must be 2340 2212 contained within the raster of the parent image. Note that the 2341 \code{refCounter} for the parent should be incremented. 2213 \code{refCounter} for the parent should be incremented. This function 2214 must be defined for the following types: \code{psU8}, \code{psU16}, 2215 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, 2216 \code{psC64}. 2342 2217 2343 2218 Create a copy of the specified image, converting the type in the … … 2345 2220 in the specified structure. The output image data must be allocated 2346 2221 as a single, contiguous block of memory. The output image may not be 2347 the input image. 2222 the input image. This function must be defined for the following 2223 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2224 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2348 2225 \begin{verbatim} 2349 2226 psImage *psImageCopy(psImage *output, const psImage *input, psElemType type); … … 2359 2236 is derived from the statistics of the pixels at that direction 2360 2237 coordinate. The statistic used to derive the output vector value is 2361 specified by \code{stats}. 2362 \begin{verbatim} 2363 psFloatArray *psImageSlice(psFloatArray *out, const psImage *input, int x, int y, int nx, int ny, 2238 specified by \code{stats}. This function must be defined for the 2239 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2240 \begin{verbatim} 2241 psVector *psImageSlice(psVector *out, const psImage *input, int x, int y, int nx, int ny, 2364 2242 int direction, const psStats *stats); 2365 2243 \end{verbatim} … … 2373 2251 statistics of the pixels interpolated along the perpendicular 2374 2252 direction. The statistic used to derive the output vector value is 2375 specified by \code{stats}. 2376 \begin{verbatim} 2377 psFloatArray *psImageCut(psFloatArray *out, const psImage *input, float xs, float ys, float xe, float ye, 2253 specified by \code{stats}. This function must be defined for the 2254 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64} 2255 \begin{verbatim} 2256 psVector *psImageCut(psVector *out, const psImage *input, float xs, float ys, float xe, float ye, 2378 2257 float dw, const psStats *stats); 2379 2258 \end{verbatim} … … 2384 2263 the image pixel coordinate \code{x,y}, and have width \code{dr}. The 2385 2264 number of annuli is $radius / dr$. The statistic used to derive the 2386 output vector value is specified by \code{stats} 2387 \begin{verbatim} 2388 psFloatArray *psImageRadialCut(psFloatArray *out, const psImage *input, float x, float y, 2389 const psFloatArray *radii, const psStats *stats); 2265 output vector value is specified by \code{stats}. This function must be defined for the 2266 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2267 \begin{verbatim} 2268 psVector *psImageRadialCut(psVector *out, const psImage *input, float x, float y, 2269 const psVector *radii, const psStats *stats); 2390 2270 \end{verbatim} 2391 2271 … … 2398 2278 Each pixel in the output image is derived from the statistics of the 2399 2279 corresponding set of input image pixels based on the statistics 2400 specified by \code{stats}. 2280 specified by \code{stats}. This function must be defined for the following 2281 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2282 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2401 2283 \begin{verbatim} 2402 2284 psImage *psImageRebin(psImage *out, const psImage *input, float scale, const psStats *stats); … … 2408 2290 pixels should be set to \tbd{value}. The center of rotation is always 2409 2291 the center pixel of the image. The rotation is specified in the sense 2410 that a positive angle is an anti-clockwise rotation. 2292 that a positive angle is an anti-clockwise rotation. This function must be defined for the following 2293 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2294 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2411 2295 \begin{verbatim} 2412 2296 psImage *psImageRotate(psImage *out, const psImage *input, float angle); … … 2418 2302 image has the same dimensions as the input image. Pixels which fall 2419 2303 off the edge of the output image are lost. Newly exposed pixels are 2420 set to the value given by \code{exposed}. 2304 set to the value given by \code{exposed}. This function must be defined for the following 2305 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2306 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2421 2307 \begin{verbatim} 2422 2308 psImage *psImageShift(psImage *out, const psImage *input, float dx, float dy, float exposed); … … 2425 2311 Roll image by an integer number of pixels (\code{dx,dy}) in either 2426 2312 direction. The output image is the same dimensions as the input 2427 image. Edge pixels wrap to the other side (no values are lost). 2313 image. Edge pixels wrap to the other side (no values are lost). This function must be defined for the following 2314 types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2315 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2428 2316 \begin{verbatim} 2429 2317 psImage *psImageRoll(psImage *out, const psImage *input, int dx, int dy); … … 2433 2321 2434 2322 Determine statistics for image (or subimage). The statistics to be 2435 determined are specified by \code{stats}. 2323 determined are specified by \code{stats}. This function must be defined for the 2324 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2436 2325 \begin{verbatim} 2437 2326 psStats *psImageGetStats(psStats *stats, const psImage *input); … … 2440 2329 Construct a histogram from an image (or subimage). The histogram to 2441 2330 generate is specified by \code{psHistogram hist} (see 2442 section~\ref{sec:histograms}). 2331 section~\ref{sec:histograms}). This function must be defined for the 2332 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2443 2333 \begin{verbatim} 2444 2334 psHistogram *psImageHistogram(psHistogram *hist, const psImage *input); … … 2447 2337 Fit a 2-D Chebychev polynomial surface to an image. The input 2448 2338 structure \code{coeffs} contains the desired order and terms of 2449 interest. 2339 interest. This function must be defined for the 2340 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2450 2341 \begin{verbatim} 2451 2342 psPolynomial2D *psImageFitPolynomial(psPolynomial2D *coeffs, const psImage *input); … … 2454 2345 Evaluate a 2-D polynomial surface for the image pixels. Given the 2455 2346 input polynomial coefficients, set the image pixel values on the basis 2456 of the polynomial function. 2347 of the polynomial function. This function must be defined for the 2348 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2457 2349 \begin{verbatim} 2458 2350 psImage *psImageEvalPolynomial(psImage *input, const psPolynomial2D *coeffs); … … 2516 2408 \end{verbatim} 2517 2409 2518 Read header data from a FITS image file descriptor into a \code{psMetaData}2519 structure. 2410 Read header data from a FITS image file descriptor into a 2411 \code{psMetaData} structure. 2520 2412 \begin{verbatim} 2521 2413 psMetadata *psImageFReadHeader(psMetadata *output, const char *extname, int extnum, FILE *f); … … 2527 2419 values \code{< min} are set to the value \code{vmin}. All pixels with 2528 2420 values \code{> max} are set to the value \code{vmax}. Returns the 2529 number of clipped pixels. 2421 number of clipped pixels. This function must be defined for the 2422 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2423 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2530 2424 \begin{verbatim} 2531 2425 int psImageClip(psImage *input, float min, float vmin, float max, float vmax); … … 2534 2428 Clip \code{NaN} image pixels to given value. Pixels with \code{NaN}, 2535 2429 \code{+Inf} or \code{-Inf} values are set to the specified value. 2536 Returns the number of clipped pixels. 2430 Returns the number of clipped pixels. This function must be defined 2431 for the following types: \code{psU8}, \code{psU16}, \code{psS8}, 2432 \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2537 2433 \begin{verbatim} 2538 2434 int psImageClipNaN(psImage *input, float value); … … 2546 2442 image value), \code{-} (subtract overlay from image), \code{*} 2547 2443 (multiply overlay times image), \code{/} (divide image by overlay). 2444 This function must be defined for the following types: \code{psU8}, 2445 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, 2446 \code{psC32}, \code{psC64}. 2548 2447 \begin{verbatim} 2549 2448 int psImageOverlaySection(psImage *image, const psImage *overlay, int x0, int y0, const char *op); … … 2573 2472 pre-processor macros to perform the onerous task of creating the 2574 2473 loops. Also note that \code{psVector} is equivalent to 2575 \code{ps FloatArray}. An attempt to perform an arithmetic operation on2474 \code{psVector}. An attempt to perform an arithmetic operation on 2576 2475 an object of dimension \code{PS_DIMEN_OTHER} should produce an error. 2577 2476 … … 3036 2935 /// get the next item in the sequence 3037 2936 psMetadataItem *psMetadataGetNext(psMetadata *restrict md, ///< metadata to get from 3038 const char *restrict match, ///< Match this3039 int which ///< Which iterator to use2937 const char *restrict match, ///< Match this 2938 int which ///< Which iterator to use 3040 2939 ); 3041 2940 \end{verbatim} … … 3074 2973 /** A point in 2-D space, with errors. */ 3075 2974 typedef struct { 3076 double x; ///< x position3077 double y; ///< y position3078 double xErr; ///< Error in x position3079 double yErr; ///< Error in y position2975 double x; ///< x position 2976 double y; ///< y position 2977 double xErr; ///< Error in x position 2978 double yErr; ///< Error in y position 3080 2979 } psPlaneCoord; 3081 2980 3082 2981 /** A point on the surface of a sphere, with errors */ 3083 2982 typedef struct { 3084 double r; ///< RA3085 double d; ///< Dec3086 double rErr; ///< Error in RA3087 double dErr; ///< Error in Dec2983 double r; ///< RA 2984 double d; ///< Dec 2985 double rErr; ///< Error in RA 2986 double dErr; ///< Error in Dec 3088 2987 } psSphereCoord; 3089 2988 \end{verbatim} … … 3188 3087 /** apply the coordinate transformation to the given coordinate */ 3189 3088 psPlaneCoord *psPlaneCoordXformApply (psPlaneCoord *out, ///< Output coordinates, or NULL 3190 const psPlaneCoordXform *frame, ///< coordinate transformation3191 const psPlaneCoord *coords ///< input coordiate3089 const psPlaneCoordXform *frame, ///< coordinate transformation 3090 const psPlaneCoord *coords ///< input coordiate 3192 3091 ); 3193 3092 3194 3093 /** apply the optical distortion to the given coordinate, magnitude, color */ 3195 3094 psPlaneCoord *psPlaneDistortionApply (psPlaneCoord *out, ///< Output coordinates, or NULL 3196 const psPlaneDistortion *pattern, ///< optical distortion pattern3197 const psPlaneCoord *coords, ///< input coordinate3198 float mag, ///< magnitude of object3199 float color ///< color of object3095 const psPlaneDistortion *pattern, ///< optical distortion pattern 3096 const psPlaneCoord *coords, ///< input coordinate 3097 float mag, ///< magnitude of object 3098 float color ///< color of object 3200 3099 ); 3201 3100 \end{verbatim} … … 3232 3131 psSphereCoordTransformation * 3233 3132 psSphereCoordTransformationAlloc(double pole1, ///< First location of pole 3234 double pole2, ///< Second location of pole3235 double rotation ///< Rotation between systems3133 double pole2, ///< Second location of pole 3134 double rotation ///< Rotation between systems 3236 3135 ); 3237 3136 … … 3248 3147 psSphereCoord * 3249 3148 psSphereCoordTransform(const psSphereCoord *coord, ///< Coordinates to convert 3250 psSphereCoordSystem *sys///< System to use to convert3149 psSphereCoordSystem *sys ///< System to use to convert 3251 3150 ); 3252 3151 \end{verbatim} … … 3291 3190 psPlaneCoord * 3292 3191 psCoordProject(const psSphereCoord *coord, ///< Spherical coordinates to project 3293 const char *projection///< Projection to use3192 const char *projection ///< Projection to use 3294 3193 ); 3295 3194 … … 3297 3196 psSphereCoord * 3298 3197 psCoordDeproject(const psPlaneCoord *coord, ///< Plane coordinates to deproject 3299 const char *projection///< Projection to use3198 const char *projection ///< Projection to use 3300 3199 ); 3301 3200 \end{verbatim} … … 3310 3209 psSphereCoord * 3311 3210 psSphereCoordGetOffset(const psSphereCoord *restrict position1, ///< Position 1 3312 const psSphereCoord *restrict position2, ///< Position 23313 const char *type///< Type of offset: Linear, Spherical/Arcsec,3314 ///< Spherical/Degreees etc3211 const psSphereCoord *restrict position2, ///< Position 2 3212 const char *type ///< Type of offset: Linear, Spherical/Arcsec, 3213 ///< Spherical/Degreees etc 3315 3214 ); 3316 3215 … … 3318 3217 psSphereCoord * 3319 3218 psSphereCoordApplyOffset(const psSphereCoord *restrict position, ///< Position 3320 const psSphereCoord *restrict offset, ///< Offset3321 const char *type///< Type of offset: Linear, Spherical/Arcsec,3322 ///< Spherical/Degreees etc3219 const psSphereCoord *restrict offset, ///< Offset 3220 const char *type ///< Type of offset: Linear, Spherical/Arcsec, 3221 ///< Spherical/Degreees etc 3323 3222 ); 3324 3223 \end{verbatim} … … 3453 3352 */ 3454 3353 typedef struct { 3455 int nReadouts; ///< number of readouts in this cell realization; each may have its3456 ///< own image, objects and overscan.3457 struct psReadout *readouts; ///< Readouts from the cell3458 psMetadata *md; ///< Cell-level metadata3459 3460 psPlaneCoordXform *cellToChip; ///< Transformations from cell coordinates to chip coordinates3461 psPlaneCoordXform *cellToFPA; ///< Transformations from cell coordinates to FPA coordinates3462 psPlaneCoordXform *cellToSky; ///< Quick and Dirty transformations from cell coordinates to sky3463 3464 struct psChip *parentChip; ///< chip which contains this cell3354 int nReadouts; ///< number of readouts in this cell realization; each may have its 3355 ///< own image, objects and overscan. 3356 struct psReadout *readouts; ///< Readouts from the cell 3357 psMetadata *md; ///< Cell-level metadata 3358 3359 psPlaneCoordXform *cellToChip; ///< Transformations from cell coordinates to chip coordinates 3360 psPlaneCoordXform *cellToFPA; ///< Transformations from cell coordinates to FPA coordinates 3361 psPlaneCoordXform *cellToSky; ///< Quick and Dirty transformations from cell coordinates to sky 3362 3363 struct psChip *parentChip; ///< chip which contains this cell 3465 3364 } psCell; 3466 3365 \end{verbatim} … … 3484 3383 typedef struct { 3485 3384 int nCells; ///< Number of Cells assigned 3486 struct psCell *cells; ///< Cells in the Chip3487 3488 psMetadata *md; ///< Chip-level metadata3489 psPlaneCoordXform *chipToFPA; ///< Transformations from chip coordinates to FPA coordinates3490 psPlaneCoordXform *FPAtoChip; ///< Transformations from FPA coordinates to chip3491 3492 struct psFPA *parentFPA; ///< FPA which contains this chip3385 struct psCell *cells; ///< Cells in the Chip 3386 3387 psMetadata *md; ///< Chip-level metadata 3388 psPlaneCoordXform *chipToFPA; ///< Transformations from chip coordinates to FPA coordinates 3389 psPlaneCoordXform *FPAtoChip; ///< Transformations from FPA coordinates to chip 3390 3391 struct psFPA *parentFPA; ///< FPA which contains this chip 3493 3392 } psChip; 3494 3393 \end{verbatim} … … 3520 3419 int nChips; ///< Number of Cells assigned 3521 3420 int nAlloc; ///< Number of Cells available 3522 struct psChip *chips; ///< Chips in the Focal Plane Array3523 3524 psMetadata *md; ///< FPA-level metadata3525 psPlaneDistortion *TPtoFP; ///< Transformation term from3526 psPlaneDistortion *FPtoTP; ///< Transformation term from3527 psFixedPattern *pattern; ///< Fixed pattern residual offsets3528 const psExposure *exp; ///< information about this exposure3421 struct psChip *chips; ///< Chips in the Focal Plane Array 3422 3423 psMetadata *md; ///< FPA-level metadata 3424 psPlaneDistortion *TPtoFP; ///< Transformation term from 3425 psPlaneDistortion *FPtoTP; ///< Transformation term from 3426 psFixedPattern *pattern; ///< Fixed pattern residual offsets 3427 const psExposure *exp; ///< information about this exposure 3529 3428 psPhotSystem colorPlus, colorMinus; ///< Colour reference 3530 3429 float rmsX, rmsY; ///< Dispersion in astrometric solution … … 3543 3442 typedef struct { 3544 3443 // Telescope longitude, latitude and height are stored separately, since they don't change with pointing 3545 const double ra, dec; ///< Telescope boresight3546 const double ha; ///< Hour angle3547 const double zd; ///< Zenith distance3548 const double az; ///< Azimuth3549 const double lst; ///< Local Sidereal Time3550 const float mjd; ///< MJD of observation3551 const float rotAngle; ///< Rotator position angle3552 const float temp; ///< Air temperature, for estimating refraction3553 const float pressure; ///< Air pressure, for calculating refraction3554 const float humidity; ///< Relative humidity, for calculating refraction3555 const float exptime; ///< Exposure time3444 const double ra, dec; ///< Telescope boresight 3445 const double ha; ///< Hour angle 3446 const double zd; ///< Zenith distance 3447 const double az; ///< Azimuth 3448 const double lst; ///< Local Sidereal Time 3449 const float mjd; ///< MJD of observation 3450 const float rotAngle; ///< Rotator position angle 3451 const float temp; ///< Air temperature, for estimating refraction 3452 const float pressure; ///< Air pressure, for calculating refraction 3453 const float humidity; ///< Relative humidity, for calculating refraction 3454 const float exptime; ///< Exposure time 3556 3455 /* Derived quantities */ 3557 const float posAngle; ///< Position angle3558 const float parallactic; ///< Parallactic angle3559 const float airmass; ///< Airmass, calculated from zenith distance3560 const float pf; ///< Parallactic factor3561 const char *cameraName; ///< name of camera which provided exposure3562 const char *telescopeName; ///< name of telescope which provided exposure3456 const float posAngle; ///< Position angle 3457 const float parallactic; ///< Parallactic angle 3458 const float airmass; ///< Airmass, calculated from zenith distance 3459 const float pf; ///< Parallactic factor 3460 const char *cameraName; ///< name of camera which provided exposure 3461 const char *telescopeName; ///< name of telescope which provided exposure 3563 3462 } psExposure; 3564 3463 \end{verbatim} … … 3646 3545 /** Information needed (by SLALIB) to convert Apparent to Observed Position */ 3647 3546 typedef struct { 3648 const double latitude; ///< geodetic latitude (radians)3649 const double sinLat, cosLat; ///< sine and cosine of geodetic latitude3650 const double abberationMag; ///< magnitude of diurnal aberration vector3651 const double height; ///< height (HM)3652 const double temperature; ///< ambient temperature (TDK)3653 const double pressure; ///< pressure (PMB)3654 const double humidity; ///< relative humidity (RH)3655 const double wavelength; ///< wavelength (WL)3656 const double lapseRate; ///< lapse rate (TLR)3657 const double refractA, refractB; ///< refraction constants A and B (radians)3658 const double longitudeOffset; ///< longitude + eqn of equinoxes + ``sidereal UT'' (radians)3659 const double siderealTime; ///< local apparent sidereal time (radians)3547 const double latitude; ///< geodetic latitude (radians) 3548 const double sinLat, cosLat; ///< sine and cosine of geodetic latitude 3549 const double abberationMag; ///< magnitude of diurnal aberration vector 3550 const double height; ///< height (HM) 3551 const double temperature; ///< ambient temperature (TDK) 3552 const double pressure; ///< pressure (PMB) 3553 const double humidity; ///< relative humidity (RH) 3554 const double wavelength; ///< wavelength (WL) 3555 const double lapseRate; ///< lapse rate (TLR) 3556 const double refractA, refractB; ///< refraction constants A and B (radians) 3557 const double longitudeOffset; ///< longitude + eqn of equinoxes + ``sidereal UT'' (radians) 3558 const double siderealTime; ///< local apparent sidereal time (radians) 3660 3559 } psGrommit; 3661 3560 \end{verbatim} … … 3667 3566 /** Constructor */ 3668 3567 psGrommit * 3669 psGrommitAlloc(const psExposure *exp ///< Relevant exposure3568 psGrommitAlloc(const psExposure *exp ///< Relevant exposure 3670 3569 ); 3671 3570 3672 3571 /** Destructor */ 3673 3572 void 3674 psGrommitFree(psGrommit *grommit ///< Grommit to destroy3573 psGrommitFree(psGrommit *grommit ///< Grommit to destroy 3675 3574 ); 3676 3575 \end{verbatim} … … 3710 3609 /** returns Chip in FPA which contains the given FPA coordinate */ 3711 3610 psChip * 3712 psChipInFPA (psChip *out, ///< Chip to return, or NULL3713 const psPlaneCoord *coord///< coordinate in FPA3714 const psFPA *fpa,///< FPA description3715 );3611 psChipInFPA (psChip *out, ///< Chip to return, or NULL 3612 const psPlaneCoord *coord ///< coordinate in FPA 3613 const psFPA *fpa, ///< FPA description 3614 ); 3716 3615 3717 3616 /** returns Cell in Chip which contains the given chip coordinate */ 3718 3617 psCell * 3719 psCellInChip(psCell *out, ///< Cell to return, or NULL3720 const psPlaneCoord *coord///< coordinate in chip3721 const psChip *chip,///< chip description3722 );3618 psCellInChip(psCell *out, ///< Cell to return, or NULL 3619 const psPlaneCoord *coord ///< coordinate in chip 3620 const psChip *chip, ///< chip description 3621 ); 3723 3622 3724 3623 /** Return the cell in FPA which contains the given FPA coordinates */ 3725 3624 psCell * 3726 psCellInFPA(psCell *out, ///< Cell to return, or NULL3727 const psPlaneCoord *coord///< Coordinate in FPA3728 const psFPA *fpa,///< FPA description3729 );3625 psCellInFPA(psCell *out, ///< Cell to return, or NULL 3626 const psPlaneCoord *coord ///< Coordinate in FPA 3627 const psFPA *fpa, ///< FPA description 3628 ); 3730 3629 \end{verbatim} 3731 3630 … … 3763 3662 /** Convert (RA,Dec) to cell and cell coordinates */ 3764 3663 psPlaneCoord * 3765 psCoordSkyToCell(psPlaneCoord *out, ///< Coordinates to return, or NULL3766 psCell *cell,///< Cell to return3767 const psSphereCoord *in, ///< Input coordinates3768 const psFPA *fpa///< FPA description3769 );3664 psCoordSkyToCell(psPlaneCoord *out, ///< Coordinates to return, or NULL 3665 psCell *cell, ///< Cell to return 3666 const psSphereCoord *in, ///< Input coordinates 3667 const psFPA *fpa ///< FPA description 3668 ); 3770 3669 3771 3670 /** Convert cell and cell coordinate to (RA,Dec) */ 3772 3671 psSphereCoord * 3773 psCoordCellToSky(psSphereCoord *out, ///< Coordinates to return, or NULL3774 const psPlaneCoord *coord ///< cell coordinates to transform3775 const psCell *cell,///< Cell to get coordinates for3776 );3672 psCoordCellToSky(psSphereCoord *out, ///< Coordinates to return, or NULL 3673 const psPlaneCoord *coord ///< cell coordinates to transform 3674 const psCell *cell, ///< Cell to get coordinates for 3675 ); 3777 3676 3778 3677 /** Quick and dirty cell to (RA,Dec) --- employs cellToSky transformation */ 3779 3678 psSphereCoord * 3780 3679 psCoordCellToSkyQuick(psSphereCoord *out, ///< Coordinates to return, or NULL 3781 const psPlaneCoord *coord///< cell coordinates to transform3782 const psCell *cell, ///< Cell description3783 );3680 const psPlaneCoord *coord ///< cell coordinates to transform 3681 const psCell *cell, ///< Cell description 3682 ); 3784 3683 3785 3684 /** Convert (RA,Dec) to tangent plane coords */ 3786 3685 psPlaneCoord * 3787 psCoordSkyToTP(psPlaneCoord *out, ///< Coordinates to return, or NULL3788 const psSphereCoord *coord ///< input Sky coordinate3789 const psGrommit *grommit, ///< Grommit for fast conversion3790 );3686 psCoordSkyToTP(psPlaneCoord *out, ///< Coordinates to return, or NULL 3687 const psSphereCoord *coord ///< input Sky coordinate 3688 const psGrommit *grommit, ///< Grommit for fast conversion 3689 ); 3791 3690 3792 3691 /** Convert tangent plane coords to focal plane coordinates */ 3793 3692 psPlaneCoord * 3794 psCoordTPtoFPA(psPlaneCoord *out, ///< Coordinates to return, or NULL3795 const psPlaneCoord *coord ///< input TP coordinate3796 const psFPA *fpa,///< FPA description3797 );3693 psCoordTPtoFPA(psPlaneCoord *out, ///< Coordinates to return, or NULL 3694 const psPlaneCoord *coord ///< input TP coordinate 3695 const psFPA *fpa, ///< FPA description 3696 ); 3798 3697 3799 3698 /** converts the specified FPA coord to the coord on the given Chip */ 3800 3699 psPlaneCoord * 3801 psCoordFPAtoChip (psPlaneCoord *out, ///< Coordinates to return, or NULL3802 const psPlaneCoord *coord ///< input FPA coordinate3803 const psChip *chip,///< Chip of interest3804 );3700 psCoordFPAtoChip (psPlaneCoord *out, ///< Coordinates to return, or NULL 3701 const psPlaneCoord *coord ///< input FPA coordinate 3702 const psChip *chip, ///< Chip of interest 3703 ); 3805 3704 3806 3705 /** converts the specified Chip coord to the coord on the given Cell */ 3807 3706 psPlaneCoord * 3808 psCoordChiptoCell (psPlaneCoord *out, ///< Coordinates to return, or NULL3809 const psPlaneCoord *coord ///< input Chip coordinate3810 const psCell *cell,///< Cell of interest3811 );3707 psCoordChiptoCell (psPlaneCoord *out, ///< Coordinates to return, or NULL 3708 const psPlaneCoord *coord ///< input Chip coordinate 3709 const psCell *cell, ///< Cell of interest 3710 ); 3812 3711 3813 3712 /** converts the specified Cell coord to the coord on the parent Chip */ 3814 3713 psPlaneCoord * 3815 psCoordCelltoChip (psPlaneCoord *out, ///< Coordinates to return, or NULL3816 const psPlaneCoord *coord ///< input Cell coordinate3817 const psCell *cell,///< Cell description3818 );3714 psCoordCelltoChip (psPlaneCoord *out, ///< Coordinates to return, or NULL 3715 const psPlaneCoord *coord ///< input Cell coordinate 3716 const psCell *cell, ///< Cell description 3717 ); 3819 3718 3820 3719 /** converts the specified Chip coord to the coord on the parent FPA */ 3821 3720 psPlaneCoord * 3822 psCoordChiptoFPA (psPlaneCoord *out, ///< Coordinates to return, or NULL3823 const psPlaneCoord *coord///< input Chip coordinate3824 const psChip *chip,///< Chip description3825 );3721 psCoordChiptoFPA (psPlaneCoord *out, ///< Coordinates to return, or NULL 3722 const psPlaneCoord *coord ///< input Chip coordinate 3723 const psChip *chip, ///< Chip description 3724 ); 3826 3725 3827 3726 /** Convert focal plane coords to tangent plane coordinates */ 3828 3727 psPlaneCoord * 3829 psCoordFPAToTP(psPlaneCoord *out, ///< Coordinates to return, or NULL3830 const psPlaneCoord *coord ///< input FPA coordinate3831 const psFPA *fpa,///< FPA description3832 );3728 psCoordFPAToTP(psPlaneCoord *out, ///< Coordinates to return, or NULL 3729 const psPlaneCoord *coord ///< input FPA coordinate 3730 const psFPA *fpa, ///< FPA description 3731 ); 3833 3732 3834 3733 /** Convert tangent plane coords to (RA,Dec) */ 3835 3734 psSphereCoord * 3836 psCoordTPtoSky(psSphereCoord *out, ///< Coordinates to return, or NULL3837 const psPlaneCoord *coord ///< input TP coordinate3838 const psGrommit *grommit, ///< Grommit for fast conversion3839 );3735 psCoordTPtoSky(psSphereCoord *out, ///< Coordinates to return, or NULL 3736 const psPlaneCoord *coord ///< input TP coordinate 3737 const psGrommit *grommit, ///< Grommit for fast conversion 3738 ); 3840 3739 3841 3740 /** Convert Cell coords to FPA coordinates */ 3842 3741 psPlaneCoord * 3843 psCoordCellToFPA(psPlaneCoord *out, ///< Coordinates to return, or NULL3844 const psPlaneCoord *coord ///< Input cell coordinates3845 const psCell *cell,///< Cell description3846 );3742 psCoordCellToFPA(psPlaneCoord *out, ///< Coordinates to return, or NULL 3743 const psPlaneCoord *coord ///< Input cell coordinates 3744 const psCell *cell, ///< Cell description 3745 ); 3847 3746 \end{verbatim} 3848 3747 … … 3858 3757 float 3859 3758 psGetAirmass(const psSphereCoord *coord, ///< Position on the sky 3860 double siderealTime, ///< Sidereal time3861 float height///< Height above sea level3759 double siderealTime, ///< Sidereal time 3760 float height ///< Height above sea level 3862 3761 ); 3863 3762 \end{verbatim} … … 3973 3872 /** Get Sun Position */ 3974 3873 psSphereCoord * 3975 psGetSunPos(float mjd ///< MJD to get position for3874 psGetSunPos(float mjd ///< MJD to get position for 3976 3875 ); 3977 3876 3978 3877 /** Get Moon position */ 3979 3878 psSphereCoord * 3980 psGetMoonPos(float mjd, ///< MJD to get position for3981 double latitude,///< Latitude for apparent position3982 double longitude///< Longitude for apparent position3879 psGetMoonPos(float mjd, ///< MJD to get position for 3880 double latitude, ///< Latitude for apparent position 3881 double longitude ///< Longitude for apparent position 3983 3882 ); 3984 3883
Note:
See TracChangeset
for help on using the changeset viewer.
