Changeset 1092
- Timestamp:
- Jun 24, 2004, 5:10:26 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (39 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r1068 r1092 1 %%% $Id: psLibSDRS.tex,v 1.5 8 2004-06-22 18:48:22 rhlExp $1 %%% $Id: psLibSDRS.tex,v 1.59 2004-06-25 03:10:26 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 10 10 \project{Pan-STARRS Image Processing Pipeline} 11 11 \organization{Institute for Astronomy} 12 \version{0 1}12 \version{02} 13 13 \docnumber{PSDC-430-007} 14 14 % note the use of the docnumber & version number: … … 31 31 00 & 2004 Apr 1 & First version, sent to MHPCC \\ \hline 32 32 01 & 2004 May 19 & Extensive modifications, see appendix \\ \hline 33 02 & 2004 Jun 22 & Incorporation of Bugzilla PRs (up to 69) \\ \hline 33 34 \RevisionsEnd 34 35 … … 36 37 37 38 \DocumentsInternal 38 PS CD-130-001 & PS-1 Design Reference Mission \\ \hline39 PS CD-430-004 & Pan-STARRS IPP C Code Conventions \\ \hline40 PS CD-430-005 & Pan-STARRS IPP SRS \\ \hline41 PS CD-430-006 & Pan-STARRS IPP ADD \\ \hline42 PS CD-430-008 & Pan-STARRS IPP Architecture SDR \\39 PSDC-130-001 & PS-1 Design Reference Mission \\ \hline 40 PSDC-430-004 & Pan-STARRS IPP C Code Conventions \\ \hline 41 PSDC-430-005 & Pan-STARRS IPP SRS \\ \hline 42 PSDC-430-006 & Pan-STARRS IPP ADD \\ \hline 43 PSDC-430-008 & Pan-STARRS IPP Architecture SDR \\ 43 44 \DocumentsExternal 44 45 Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\ … … 335 336 routine registered by \code{psMemExhaustedSetCallback} (see 336 337 \S\ref{secMemAdvanced}), and if still unsuccessful, call 337 \code{psAbort()}. 338 \code{psAbort()}. The same behavior is true for constructors of rich 339 structures, with names of the form \code{psFooAlloc}. 338 340 339 341 Note that we have not specified an equivalent of the \code{calloc} … … 951 953 may be registered with the PSLib error handler using the function: 952 954 \begin{verbatim} 953 void psErrorRegister Set(const psErrorDescription *errors, int nerror);955 void psErrorRegister(const psErrorDescription *errors, int nerror); 954 956 \end{verbatim} 955 957 where the errors are represented internally as follows: … … 961 963 \end{verbatim} 962 964 PSLib internal errors must be registered with the function 963 \code{psErrorRegister Set}, which should be called as part of the965 \code{psErrorRegister}, which should be called as part of the 964 966 program initialization to set up the error codes. It is left to the 965 967 external project to produce their own error registration functions … … 1290 1292 1291 1293 \begin{verbatim} 1292 psList *psListAdd(psList *list, void *data, int where);1294 bool psListAdd(psList *list, void *data, int where); 1293 1295 \end{verbatim} 1294 1296 Add an entry to the list with this function, which takes a pointer to 1295 the list and also returns a pointer to the list. The returned pointer 1296 must be used as the value of \code{psList} may have changed. The 1297 value of \code{where} specifies if the specified data item should be 1298 placed on the front of the list (\code{PS_DLIST_HEAD}), at the end of 1299 the list (\code{PS_DLIST_TAIL}), to add after (\code{PS_DLIST_NEXT}) 1300 or before (\code{PS_DLIST_PREV}) the current element (specified by the 1301 iteration cursor), or an index that the new \code{data} should 1302 inhabit. 1297 the list and returns a boolean giving the success or failure of the 1298 operation. The value of \code{where} specifies if the specified data 1299 item should be placed on the front of the list (\code{PS_LIST_HEAD}), 1300 at the end of the list (\code{PS_LIST_TAIL}), to add after 1301 (\code{PS_LIST_NEXT}) or before (\code{PS_LIST_PREV}) the current 1302 element (specified by the iteration cursor), or an index that the new 1303 \code{data} should inhabit. 1303 1304 1304 1305 \begin{verbatim} … … 1307 1308 A data item may be retrieved from the list with this function. The 1308 1309 value of \code{which} may be the numerical index or it may be one of 1309 the special values: \code{PS_ DLIST_HEAD}, \code{PS_DLIST_TAIL},1310 \code{PS_ DLIST_PREV}, and \code{PS_DLIST_NEXT}, all of which are1310 the special values: \code{PS_LIST_HEAD}, \code{PS_LIST_TAIL}, 1311 \code{PS_LIST_PREV}, and \code{PS_LIST_NEXT}, all of which are 1311 1312 defined as negative integers, allowing \code{where} to also be the 1312 1313 index of one of the data items. 1313 1314 1314 1315 \begin{verbatim} 1315 void *psListRemove(psList *list, void *data, int which);1316 bool psListRemove(psList *list, void *data, int which); 1316 1317 \end{verbatim} 1317 1318 A data item may be removed from the list with this function. The 1318 1319 value of \code{which} may be the numerical index or it may be one of 1319 the special values: \code{PS_ DLIST_HEAD}, \code{PS_DLIST_TAIL},1320 \code{PS_ DLIST_PREV}, \code{PS_DLIST_UNKNOWN}, and1321 \code{PS_ DLIST_NEXT}, all of which are defined as negative integers.1322 If the value of \code{which} is \code{PS_ DLIST_UNKNOWN}, then the data1320 the special values: \code{PS_LIST_HEAD}, \code{PS_LIST_TAIL}, 1321 \code{PS_LIST_PREV}, \code{PS_LIST_UNKNOWN}, and 1322 \code{PS_LIST_NEXT}, all of which are defined as negative integers. 1323 If the value of \code{which} is \code{PS_LIST_UNKNOWN}, then the data 1323 1324 item is identified by matching the pointer value with \code{void 1324 *data}. 1325 *data}. The function returns a value of \code{true} if the operation 1326 was successfull, and \code{false} otherwise. 1325 1327 1326 1328 All data items placed onto lists (\code{psListAdd}) must have their 1327 1329 reference counters (section \ref{secMemRefcounter}) incremented. When 1328 1330 elements are removed from a list with \code{psListRemove}, they must 1329 have their reference counters decremented. The action of retrieving1330 data from a list (with \code{psListGet}) must not affect their1331 referencecounter.1331 have their reference counters decremented. The action of retrieving 1332 data from a list (with \code{psListGet}) also increments the reference 1333 counter. 1332 1334 1333 1335 \begin{verbatim} … … 1340 1342 1341 1343 \begin{verbatim} 1342 psVector *psListToVector(psList * dlist);1343 psList *psVectorTo Dlist(psVector *vector);1344 psVector *psListToVector(psList *list); 1345 psList *psVectorToList(psVector *vector); 1344 1346 \end{verbatim} 1345 1347 These two functions are available to convert between the … … 1356 1358 \code{iter} is provided by these functions. The first of these 1357 1359 functions uses the value of \code{where} to set the iteration cursor 1358 for the given list to the beginning \code{PS_ DLIST_HEAD} or the end1359 \code{PS_ DLIST_TAIL} for the iterator specified by \code{which}. The1360 for the given list to the beginning \code{PS_LIST_HEAD} or the end 1361 \code{PS_LIST_TAIL} for the iterator specified by \code{which}. The 1360 1362 next two functions move the iteration cursor forward or backwards, 1361 1363 returning the data item from the resulting list entry, or returning … … 1426 1428 A data item may be added to the hash table with the function: 1427 1429 \begin{verbatim} 1428 void *psHashInsert(psHash *table, char *key, void *data, void (*itemFree)(void *item));1430 bool psHashAdd(psHash *table, char *key, void *data); 1429 1431 \end{verbatim} 1430 1432 In this function, the value of the string \code{key} is used to 1431 1433 construct the hash value, find the appropriate bucket set, and add the 1432 new element \code{data} to the list. The element destructor, 1433 \code{itemFree}, is provided to destroy an existing element with the 1434 same value of \code{key}. The routine \code{psHashInsert} must 1435 provide a non-NULL \code{itemFree} argument if it wishes to change the 1436 value for previously inserted keys; if \code{itemFree} is NULL, 1437 attempting to insert a pre-existing key is an error, and the routine 1438 will return NULL. If \code{psHashInsert} succeeds it returns 1439 \code{data}. 1434 new element \code{data} to the list. An exiting element with the same 1435 value of \code{key} is destroyed using its registered destructor 1436 (\code{psMemBlock}). The return value of the function is a boolean 1437 defining the success or failure of the operation. 1440 1438 1441 1439 The data associated with a given key may be found with the function: … … 1449 1447 void *psHashRemove(psHash *table, char *key); 1450 1448 \end{verbatim} 1451 the return value of which is the value at the key that is removed (or 1452 NULL if no match is found).1449 The function returns a value of \code{true} if the operation was 1450 successfull, and \code{false} otherwise. 1453 1451 1454 1452 A complete hash table may be freed by calling: … … 1616 1614 1617 1615 \begin{verbatim} 1618 psStats *psVectorStats(const psVector *restrict in, 1616 psStats *psVectorStats(psStats *stats, 1617 const psVector *restrict in, 1619 1618 const psVector *restrict mask, 1620 unsigned int maskVal, 1621 psStats *stats); 1622 \end{verbatim} 1623 \tbd{psStats *psVectorStats (psStats *stats, psVector *in, psVector *mask, int maskVal);} 1619 unsigned int maskVal); 1620 \end{verbatim} 1624 1621 % 1625 1622 This function takes the input data in \code{in} (with optional masking … … 1630 1627 used to specify a value range for which the statistics are calculated. 1631 1628 \code{binsize} specifies a choice for the robust statistics histogram 1632 bin size. If these are to be used, the user shouldset the1629 bin size. If these are to be used, the user must set the 1633 1630 corresponding \code{options} bits \code{PS_STAT_USE_RANGE} or 1634 1631 \code{PS_STAT_USE_BINSIZE}. \code{clipSigma} specifies the number of … … 1643 1640 \code{PS_STAT_ROBUST_FOR_SAMPLE} in \code{options} must be set in this 1644 1641 case. The cutoff for this decision must be made on the basis of the 1645 value in \code{sampleLimit}, which should have a default of \tbd{3e5}.1646 Default input field values must be set by the \code{psStats}1642 value in \code{sampleLimit}, which should have a default of $3 \times 1643 10^{5}$. Default input field values must be set by the \code{psStats} 1647 1644 constructor. The input vector may be of type \code{psU8}, 1648 1645 \code{psU16}, \code{psF32}, \code{psF64}; the mask must be of type … … 1765 1762 structure. 1766 1763 \begin{verbatim} 1767 psHistogram *psHistogramVector(psHistogram *restrict out, const psVector *restrict in); 1768 \end{verbatim} 1769 \tbd{psHistogram *psHistogramVector (psHistogram *out, psVector *in);} 1764 psHistogram *psVectorHistogram(psHistogram *out, 1765 const psVector *restrict in, 1766 const psVector *restrict mask, 1767 unsigned int maskVal); 1768 \end{verbatim} 1770 1769 The input vector may be of types \code{psU8, psU16, psF32, psF64}. 1771 1770 … … 1987 1986 int x, int y, int nx, int ny, 1988 1987 int direction, const psStats *stats); 1988 typedef enum { 1989 PS_CUT_X_POS; 1990 PS_CUT_X_NEG; 1991 PS_CUT_Y_POS; 1992 PS_CUT_Y_NEG; 1993 } psImageCutDirection; 1989 1994 \end{verbatim} 1990 1995 Extract pixels from rectlinear region to a vector (array of floats). 1991 1996 The output vector contains either \code{nx} or \code{ny} elements, 1992 1997 based on the value of the direction: e.g., if \code{direction} is 1993 \ tbd{+x}, there are \code{nx} elements. The input region is collapsed1994 i n the perpendicular direction, and each element of the output vectors1995 is derived from the statistics of the pixels at that direction 1996 coordinate. The statistic used to derive the output vector value is 1997 specified by \code{stats}. Only one of the statistics choices may be 1998 specified, otherwise the function must return an error. This function 1999 must be defined for the following types: \code{psU8}, \code{psU16},2000 \code{ps F32}, \code{psF64}.1998 \code{PS_CUT_X_POS}, there are \code{nx} elements. The input region 1999 is collapsed in the perpendicular direction, and each element of the 2000 output vectors is derived from the statistics of the pixels at that 2001 direction coordinate. The statistic used to derive the output vector 2002 value is specified by \code{stats}. Only one of the statistics 2003 choices may be specified, otherwise the function must return an error. 2004 This function must be defined for the following types: \code{psU8}, 2005 \code{psU16}, \code{psF32}, \code{psF64}. 2001 2006 2002 2007 \begin{verbatim} … … 2012 2017 represents pixel-sized boxes, where the value is derived from the 2013 2018 statistics of the pixels interpolated along the perpendicular 2014 direction. The statistic used to derive the output vector value is 2015 specified by \code{stats}. Only one of the statistics choices may be 2016 specified, otherwise the function must return an error. This function 2017 must be defined for the following types: \code{psU8}, \code{psU16}, 2018 \code{psF32}, \code{psF64} 2019 direction. The specific algorithm which must be used is described in 2020 the PSLib ADD (PSDC-430-006). The statistic used to derive the output 2021 vector value is specified by \code{stats}. Only one of the statistics 2022 choices may be specified, otherwise the function must return an error. 2023 This function must be defined for the following types: \code{psU8}, 2024 \code{psU16}, \code{psF32}, \code{psF64} 2019 2025 2020 2026 \begin{verbatim} … … 2022 2028 const psVector *radii, const psStats *stats); 2023 2029 \end{verbatim} 2024 Extract radial annulidata to a vector. A vector is constructed where2030 Extract radial region data to a vector. A vector is constructed where 2025 2031 each vector elements is derived from the statistics of the pixels 2026 which land in one of a sequence of annuli. The annuli are centered on 2027 the image pixel coordinate \code{x,y}, and have width \code{dr}. The 2028 number of annuli is $radius / dr$. The statistic used to derive the 2029 output vector value is specified by \code{stats}. Only one of the 2030 statistics choices may be specified, otherwise the function must 2031 return an error. This function must be defined for the following 2032 types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2032 which land within one of a sequence of radii. The radii are centered 2033 on the image pixel coordinate \code{x,y}, and are defined by the 2034 sequence of values in the vector \code{radii}. The specific algorithm 2035 which must be used is described in the PSLib ADD (PSDC-430-006). The 2036 statistic used to derive the output vector value is specified by 2037 \code{stats}. Only one of the statistics choices may be specified, 2038 otherwise the function must return an error. This function must be 2039 defined for the following types: \code{psU8}, \code{psU16}, 2040 \code{psF32}, \code{psF64}. 2033 2041 2034 2042 \subsubsection{Image Geometry Manipulation} … … 2051 2059 2052 2060 \begin{verbatim} 2053 psImage *psImageRotate(psImage *out, const psImage *input, float angle); 2061 psImage *psImageRotate(psImage *out, const psImage *input, float 2062 angle, float exposed); 2054 2063 \end{verbatim} 2055 2064 Rotate the input image by given angle, specified in degrees. The 2056 2065 output image must contain all of the pixels from the input image in 2057 2066 their new frame. Pixels in the output image which do not map to input 2058 pixels should be set to \ tbd{value}. The center of rotation is always2059 the center pixel of the image. The rotation is specified in the sense 2060 th at a positive angle is an anti-clockwise rotation. This function2061 must be defined for the following types: \code{psU8}, \code{psU16},2062 \code{ps S8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},2063 \code{psC 64}.2067 pixels should be set to \code{exposed}. The center of rotation is 2068 always the center pixel of the image. The rotation is specified in 2069 the sense that a positive angle is an anti-clockwise rotation. This 2070 function must be defined for the following types: \code{psU8}, 2071 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, 2072 \code{psC32}, \code{psC64}. 2064 2073 2065 2074 \begin{verbatim} … … 2090 2099 2091 2100 \begin{verbatim} 2092 psStats *psImageGetStats(psStats *stats, const psImage *input); 2093 \end{verbatim} 2094 \tbd{psStats *psImageStats(psStats *stats, psImage *in, psImage *mask, int maskVal);} 2101 psStats *psImageStats(psStats *stats, 2102 const psImage *restrict in, 2103 const psImage *restrict mask, 2104 unsigned int maskVal); 2105 \end{verbatim} 2095 2106 Determine statistics for image (or subimage). The statistics to be 2096 determined are specified by \code{stats}. This function must be 2097 defined for the following types: \code{psU8}, \code{psU16}, 2098 \code{psF32}, \code{psF64}. 2099 2100 \begin{verbatim} 2101 psHistogram *psImageHistogram(psHistogram *hist, const psImage *input); 2102 \end{verbatim} 2103 \tbd{psHistogram *psImageHistogram(psHistogram *out, psImage *in, psImage *mask, int maskVal);} 2107 determined are specified by \code{stats}. The \code{mask} allows 2108 pixels to be excluded if their corresponding mask pixel value matches 2109 the value of \code{maskVal}. This function must be defined for the 2110 following types: \code{psU8}, \code{psU16}, \code{psF32}, 2111 \code{psF64}. 2112 2113 \begin{verbatim} 2114 psHistogram *psImageHistogram(psHistogram *out, 2115 const psImage *restrict in, 2116 const psImage *restrict mask, 2117 unsigned int maskVal); 2118 \end{verbatim} 2104 2119 Construct a histogram from an image (or subimage). The histogram to 2105 2120 generate is specified by \code{psHistogram hist} (see … … 2177 2192 number of clipped pixels. This function must be defined for the 2178 2193 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2179 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2194 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. The arguments 2195 (\code{min}, \code{max}, etc) must be cast to the appropriate types to 2196 match the image data. If the input parameters \code{vmin} or 2197 \code{vmax} are out of bounds for the image pixel type, the function 2198 must raise an error. It is not an error for \code{min} or \code{max} 2199 to be out of range. In the case of complex numbers, the input 2200 parameters \code{min} and \code{max} must be compared against the 2201 absolute value of the pixel values. The values to which complex image 2202 data are clipped employ the provided value for the real component and 2203 0.0 for the imaginary component. 2180 2204 2181 2205 \begin{verbatim} … … 2186 2210 Returns the number of clipped pixels. This function must be defined 2187 2211 for the following types: \code{psF32}, \code{psF64}, \code{psC32}, 2188 \code{psC64}. 2212 \code{psC64}. In the case of complex values, if either the real or 2213 imaginary part have the value \code{NaN}, then that component will be 2214 set to the specified value. 2189 2215 2190 2216 \begin{verbatim} … … 2213 2239 images, e.g.\ dividing one image by another, subtracting a vector 2214 2240 from an image, etc. Both binary operations and unary operations are 2215 required. To avoid the burden of memorizing a tonof APIs, we specify2241 required. To avoid the burden of memorizing a plethora of APIs, we specify 2216 2242 two generic APIs for the binary and unary operations. 2217 2243 … … 2227 2253 expected that the implementation of these functions will employ 2228 2254 pre-processor macros to perform the onerous task of creating the 2229 loops. Also note that \code{psVector} is equivalent to 2230 \code{psVector}. An attempt to perform an arithmetic operation on 2231 an object of dimension \code{PS_DIMEN_OTHER} should produce an error. 2255 loops. An attempt to perform an arithmetic operation on an object of 2256 dimension \code{PS_DIMEN_OTHER} should produce an error. Operations 2257 between data structures with different types (e.g., \code{psS32} and 2258 \code{psF32}) are not allowed and must raise an error (it is the 2259 responsibility of calling functions to perform type conversions). 2260 Operations between data structures with incompatible sizes are not 2261 allowed. However, operations between data elements of different rank 2262 (scalar, vector, image) are allowed, and defined below. 2232 2263 2233 2264 Binary operations between an image and a vector have a potential … … 2236 2267 (\code{PS_DIMEN_VECTOR}), and a ``transposed vector'' 2237 2268 (\code{PS_DIMEN_TRANSV}). We specify that a ``vector'', when involved 2238 in binary operations on an image, acts on the rows, while a2239 ``transposed vector'' in the same context acts on thecolumns.2269 in binary operations on an image, acts on all rows of the image, while 2270 a ``transposed vector'' in the same context acts on all columns. 2240 2271 Vectors, when created, will be created as ``vectors'', but may be 2241 2272 converted to ``transposed vectors'' using the following function: … … 2688 2719 Certain metadata names (such as the FITS keywords \code{COMMENT} and 2689 2720 \code{HISTORY} in a FITS header) may be repeated with different 2690 values. The \code{psMetadataA ppend} routine is required to check that2721 values. The \code{psMetadataAdd} routine is required to check that 2691 2722 all metadata names are unique unless the type is qualified as 2692 2723 \code{PS_META_NON_UNIQUE}; in this case a unique integer must be added … … 2738 2769 item may be added by appending a \code{psMetadataItem} which has 2739 2770 already been created; and secondly by directly providing the data to 2740 be appended. In both cases, the \code{psMetadataItem} that is 2741 appended to the metadata is returned. The second function, 2742 \code{psMetadataAppend} takes a pointer or value which is interpretted 2743 by the \code{va_list} operators in the function. 2744 % 2745 \begin{verbatim} 2746 psMetadataItem *psMetadataAppendItem(psMetadata *restrict md, 2771 be appended. In both cases, the return value defines the success 2772 (\code{true}) or failure of the operation. The second function, 2773 \code{psMetadataAdd} takes a pointer or value which is interpretted 2774 by the \code{va_list} operators in the function. Both functions take 2775 an parameter \code{where} which specifies where in the list to place 2776 the element, following the conventions for the \code{psList}. Care 2777 should be taken not to leak memory when appending an item for which 2778 the key already exists in the metadata (and is not 2779 \code{PS_META_NON_UNIQUE}). 2780 % 2781 \begin{verbatim} 2782 bool psMetadataAddItem(psMetadata *restrict md, int where, 2747 2783 psMetadataItem *restrict item); 2748 psMetadataItem *psMetadataAppend(psMetadata *restrict md, const char *name, 2749 int format, const char *comment, ...); 2750 \end{verbatim} 2751 2752 Items may be removed from the metadata by specifying a key. If the 2753 key matches a metadata item, the item is removed from the metadata and 2754 returned; otherwise, \code{NULL} is returned. If the key is not 2755 unique, then \emph{all} items corresponding to the key are removed, 2756 and the first item is returned. Care should be taken not to leak 2757 memory when appending an item for which the key already exists in the 2758 metadata (and is not \code{PS_META_NON_UNIQUE}). 2759 % 2760 \begin{verbatim} 2761 psMetadataItem *psMetadataRemove(psMetadata *restrict md, const char *restrict key); 2762 \end{verbatim} 2763 2764 The metadata may be iterated over by (re-)setting the iterator for the 2765 appropriate \code{psMetadata}, and getting the next item. 2766 \code{psMetadataGetNext} has the ability to match the beginning of a 2767 key, e.g., if the user only wants to iterate through 2784 bool psMetadataAdd(psMetadata *restrict md, int where, 2785 const char *name, int format, const char *comment, ...); 2786 \end{verbatim} 2787 2788 Items may be removed from the metadata by specifying a key or a 2789 location in the list. If the value of \code{name} is \code{NULL}, the 2790 value of \code{where} is used. If the value of \code{name} is not 2791 \code{NULL}, then \code{where} must be set to \code{PS_LIST_UNKNOWN}. 2792 If the key matches a metadata item, the item is removed from the 2793 metadata and \code{true} is returned; otherwise, \code{false} is 2794 returned. If the key is not unique, then \emph{all} items 2795 corresponding to the key are removed, and \code{true} is returned. 2796 % 2797 \begin{verbatim} 2798 bool psMetadataRemove(psMetadata *restrict md, int where, const char *restrict key); 2799 \end{verbatim} 2800 2801 Items may be found within the metadata by providing a key. In the 2802 event that the key is non-unique, the first item is returned. 2803 \begin{verbatim} 2804 psMetadataItem *psMetadataLookup(const psMetadata *restrict md, 2805 const char *restrict key); 2806 \end{verbatim} 2807 2808 Items may be retrieved from the metadata by their entry position. The 2809 value of which specifies the desired entry in the fashion of 2810 \code{psList}. 2811 \begin{verbatim} 2812 psMetadataItem *psMetadataGet(const psMetadata *restrict md, int which); 2813 \end{verbatim} 2814 2815 The metadata may be iterated over by (re-)setting the iterator to a 2816 location in the \code{psMetadata} list, and getting the previous or 2817 next item. \code{psMetadataGetNext} has the ability to match the 2818 beginning of a key, e.g., if the user only wants to iterate through 2768 2819 \code{IPP.machines.sky} and doesn't want to bother with 2769 2820 \code{IPP.machines.detector}. The iterator should iterate over every 2770 item of metadata --- even those that are non-unique. 2771 \begin{verbatim} 2772 void psMetadataSetIterator(psMetadata *md); 2773 psMetadataItem *psMetadataGetNext(psMetadata *restrict md, const char *restrict match); 2774 \end{verbatim} 2775 2776 Items may be found within the metadata by providing a key. In the 2777 event that the key is non-unique, the first item is returned. 2778 \begin{verbatim} 2779 psMetadataItem *psMetadataLookup(const psMetadata *restrict md, 2780 const char *restrict key); 2821 item of metadata --- even those that are non-unique. The value 2822 \code{which} specifies the iterator to be used. In setting the 2823 iterator, the position of the iterator is defined by \code{where}, 2824 which follows the conventions of the \code{psList} iterators. 2825 \begin{verbatim} 2826 void psMetadataSetIterator(psMetadata *md, int where); 2827 psMetadataItem *psMetadataGetNext(psMetadata *restrict md, const char *restrict match, int which); 2828 psMetadataItem *psMetadataGetPrevious(psMetadata *restrict md, const char *restrict match, int which); 2781 2829 \end{verbatim} 2782 2830 … … 2983 3031 The following functions simply return the appropriate 2984 3032 \code{psSphereTransform} to convert between predefined spherical 2985 coordinate systems (i.e., {\bf I}CRS, {\bf E}cliptic and {\bf 2986 G}alactic). 2987 % 2988 \begin{verbatim} 2989 psSphereTransform *psSphereTransformItoE(void); 2990 psSphereTransform *psSphereTransformEtoI(void); 2991 psSphereTransform *psSphereTransformItoG(void); 2992 psSphereTransform *psSphereTransformGtoI(void); 3033 coordinate systems (i.e., ICRS, Ecliptic and Galactic). 3034 % 3035 \begin{verbatim} 3036 psSphereTransform *psSphereTransformICRSToEcliptic(void); 3037 psSphereTransform *psSphereTransformEclipticToICRS(void); 3038 psSphereTransform *psSphereTransformICRSToGalactic(void); 3039 psSphereTransform *psSphereTransformGalacticToICRS(void); 2993 3040 \end{verbatim} 2994 3041 … … 3438 3485 3439 3486 \begin{verbatim} 3440 psPlane *psCoordCell toChip (psPlane *out, const psPlane *in, const psCell *cell);3487 psPlane *psCoordCellToChip (psPlane *out, const psPlane *in, const psCell *cell); 3441 3488 \end{verbatim} 3442 3489 which converts coordindates \code{in} on the specified \code{cell} to … … 3444 3491 3445 3492 \begin{verbatim} 3446 psPlane *psCoordChip toFPA (psPlane *out, const psPlane *in, const psChip *chip);3493 psPlane *psCoordChipToFPA (psPlane *out, const psPlane *in, const psChip *chip); 3447 3494 \end{verbatim} 3448 3495 which converts the coordinates \code{in} on the specified \code{chip} … … 3457 3504 3458 3505 \begin{verbatim} 3459 psSphere *psCoordTP toSky(psSphere *out, const psPlane *in, const psGrommit *grommit);3506 psSphere *psCoordTPToSky(psSphere *out, const psPlane *in, const psGrommit *grommit); 3460 3507 \end{verbatim} 3461 3508 which converts the tangent plane coordinates \code{in} to (RA,Dec) on … … 3481 3528 3482 3529 \begin{verbatim} 3483 psSphere *psCoordCellToSkyQ D(psSphere *out, const psPlane *in, const psCell *cell);3530 psSphere *psCoordCellToSkyQuick(psSphere *out, const psPlane *in, const psCell *cell); 3484 3531 \end{verbatim} 3485 3532 which uses the 'quick-and-dirty' transformation to convert coordinates … … 3500 3547 3501 3548 \begin{verbatim} 3502 psPlane *psCoordTP toFPA(psPlane *out, const psPlane *in, const psFPA *fpa);3549 psPlane *psCoordTPToFPA(psPlane *out, const psPlane *in, const psFPA *fpa); 3503 3550 \end{verbatim} 3504 3551 which converts the tangent plane coordinates \code{in} to focal plane coordinates. 3505 3552 3506 3553 \begin{verbatim} 3507 psPlane *psCoordFPA toChip (psPlane *out, const psPlane *in, const psChip *chip);3554 psPlane *psCoordFPAToChip (psPlane *out, const psPlane *in, const psChip *chip); 3508 3555 \end{verbatim} 3509 3556 which converts the specified FPA coordinates \code{in} to the … … 3514 3561 3515 3562 \begin{verbatim} 3516 psPlane *psCoordChip toCell (psPlane *out, const psPlane *in, const psCell *cell);3563 psPlane *psCoordChipToCell (psPlane *out, const psPlane *in, const psCell *cell); 3517 3564 \end{verbatim} 3518 3565 which converts the specified Chip coordinate \code{in} to the … … 3530 3577 3531 3578 \begin{verbatim} 3532 psPlane *psCoordSkyToCellQ D(psPlane *out, const psSphere *in, psCell *cell);3579 psPlane *psCoordSkyToCellQuick(psPlane *out, const psSphere *in, psCell *cell); 3533 3580 \end{verbatim} 3534 3581 which directly converts (RA,Dec) \code{in} to coordinates on the … … 3700 3747 for (int i = 0; i < 10; i += 5) { 3701 3748 float sqrti = sqrt(i); 3702 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_INT, &i, NULL, "const.%d", i));3703 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_FLOAT, &sqrti, "square root", "const.sqrt%d", i));3749 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_INT, &i, NULL, "const.%d", i)); 3750 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_FLOAT, &sqrti, "square root", "const.sqrt%d", i)); 3704 3751 } 3705 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_STR, "Bonjour", "French", "lang.hello"));3752 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR, "Bonjour", "French", "lang.hello")); 3706 3753 /* 3707 3754 * Remove a key … … 3740 3787 3741 3788 \begin{verbatim} 3742 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,3789 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE, 3743 3790 "Bonjour", "French", "lang.hello")); 3744 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,3791 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE, 3745 3792 "Aloha", "Hawaiian", "lang.hello")); 3746 psMetadataA ppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,3793 psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE, 3747 3794 "Good Morning", "English", "lang.hello")); 3748 3795 /*
Note:
See TracChangeset
for help on using the changeset viewer.
