IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1092


Ignore:
Timestamp:
Jun 24, 2004, 5:10:26 PM (22 years ago)
Author:
eugene
Message:

resolved conflicts

File:
1 edited

Legend:

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

    r1068 r1092  
    1 %%% $Id: psLibSDRS.tex,v 1.58 2004-06-22 18:48:22 rhl Exp $
     1%%% $Id: psLibSDRS.tex,v 1.59 2004-06-25 03:10:26 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    1010\project{Pan-STARRS Image Processing Pipeline}
    1111\organization{Institute for Astronomy}
    12 \version{01}
     12\version{02}
    1313\docnumber{PSDC-430-007}
    1414% note the use of the docnumber & version number:
     
    313100 & 2004 Apr 1  & First version, sent to MHPCC \\ \hline
    323201 & 2004 May 19 & Extensive modifications, see appendix \\ \hline
     3302 & 2004 Jun 22 & Incorporation of Bugzilla PRs (up to 69) \\ \hline
    3334\RevisionsEnd
    3435
     
    3637
    3738\DocumentsInternal
    38 PSCD-130-001  &   PS-1 Design Reference Mission \\ \hline
    39 PSCD-430-004  &   Pan-STARRS IPP C Code Conventions \\ \hline
    40 PSCD-430-005  &   Pan-STARRS IPP SRS \\ \hline
    41 PSCD-430-006  &   Pan-STARRS IPP ADD \\ \hline
    42 PSCD-430-008  &   Pan-STARRS IPP Architecture SDR \\
     39PSDC-130-001  &   PS-1 Design Reference Mission \\ \hline
     40PSDC-430-004  &   Pan-STARRS IPP C Code Conventions \\ \hline
     41PSDC-430-005  &   Pan-STARRS IPP SRS \\ \hline
     42PSDC-430-006  &   Pan-STARRS IPP ADD \\ \hline
     43PSDC-430-008  &   Pan-STARRS IPP Architecture SDR \\
    4344\DocumentsExternal
    4445Posix Standard & Open Group Based Specifications Issue 6, IEEE Std 1003.1, 2003 \\
     
    335336routine registered by \code{psMemExhaustedSetCallback} (see
    336337\S\ref{secMemAdvanced}), and if still unsuccessful, call
    337 \code{psAbort()}.
     338\code{psAbort()}.  The same behavior is true for constructors of rich
     339structures, with names of the form \code{psFooAlloc}.
    338340
    339341Note that we have not specified an equivalent of the \code{calloc}
     
    951953may be registered with the PSLib error handler using the function:
    952954\begin{verbatim}
    953 void psErrorRegisterSet(const psErrorDescription *errors, int nerror);
     955void psErrorRegister(const psErrorDescription *errors, int nerror);
    954956\end{verbatim}
    955957where the errors are represented internally as follows:
     
    961963\end{verbatim}
    962964PSLib internal errors must be registered with the function
    963 \code{psErrorRegisterSet}, which should be called as part of the
     965\code{psErrorRegister}, which should be called as part of the
    964966program initialization to set up the error codes.  It is left to the
    965967external project to produce their own error registration functions
     
    12901292
    12911293\begin{verbatim}
    1292 psList *psListAdd(psList *list, void *data, int where);
     1294bool psListAdd(psList *list, void *data, int where);
    12931295\end{verbatim}
    12941296Add 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.
     1297the list and returns a boolean giving the success or failure of the
     1298operation. The value of \code{where} specifies if the specified data
     1299item should be placed on the front of the list (\code{PS_LIST_HEAD}),
     1300at 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
     1302element (specified by the iteration cursor), or an index that the new
     1303\code{data} should inhabit.
    13031304
    13041305\begin{verbatim}
     
    13071308A data item may be retrieved from the list with this function.  The
    13081309value 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 are
     1310the special values: \code{PS_LIST_HEAD}, \code{PS_LIST_TAIL},
     1311\code{PS_LIST_PREV}, and \code{PS_LIST_NEXT}, all of which are
    13111312defined as negative integers, allowing \code{where} to also be the
    13121313index of one of the data items.
    13131314
    13141315\begin{verbatim}
    1315 void *psListRemove(psList *list, void *data, int which);
     1316bool psListRemove(psList *list, void *data, int which);
    13161317\end{verbatim}
    13171318A data item may be removed from the list with this function.  The
    13181319value 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}, and
    1321 \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 data
     1320the 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.
     1323If the value of \code{which} is \code{PS_LIST_UNKNOWN}, then the data
    13231324item 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
     1326was successfull, and \code{false} otherwise.
    13251327
    13261328All data items placed onto lists (\code{psListAdd}) must have their
    13271329reference counters (section \ref{secMemRefcounter}) incremented.  When
    13281330elements are removed from a list with \code{psListRemove}, they must
    1329 have their reference counters decremented. The action of retrieving
    1330 data from a list (with \code{psListGet}) must not affect their
    1331 reference counter.
     1331have their reference counters decremented.  The action of retrieving
     1332data from a list (with \code{psListGet}) also increments the reference
     1333counter.
    13321334
    13331335\begin{verbatim}
     
    13401342
    13411343\begin{verbatim}
    1342 psVector *psListToVector(psList *dlist);
    1343 psList *psVectorToDlist(psVector *vector);
     1344psVector *psListToVector(psList *list);
     1345psList *psVectorToList(psVector *vector);
    13441346\end{verbatim}
    13451347These two functions are available to convert between the
     
    13561358\code{iter} is provided by these functions.  The first of these
    13571359functions 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 end
    1359 \code{PS_DLIST_TAIL} for the iterator specified by \code{which}.  The
     1360for 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
    13601362next two functions move the iteration cursor forward or backwards,
    13611363returning the data item from the resulting list entry, or returning
     
    14261428A data item may be added to the hash table with the function:
    14271429\begin{verbatim}
    1428 void *psHashInsert(psHash *table, char *key, void *data, void (*itemFree)(void *item));
     1430bool psHashAdd(psHash *table, char *key, void *data);
    14291431\end{verbatim}
    14301432In this function, the value of the string \code{key} is used to
    14311433construct 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}.
     1434new element \code{data} to the list.  An exiting element with the same
     1435value of \code{key} is destroyed using its registered destructor
     1436(\code{psMemBlock}). The return value of the function is a boolean
     1437defining the success or failure of the operation.
    14401438
    14411439The data associated with a given key may be found with the function:
     
    14491447void *psHashRemove(psHash *table, char *key);
    14501448\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).
     1449The function returns a value of \code{true} if the operation was
     1450successfull, and \code{false} otherwise.
    14531451
    14541452A complete hash table may be freed by calling:
     
    16161614
    16171615\begin{verbatim}
    1618 psStats *psVectorStats(const psVector *restrict in,
     1616psStats *psVectorStats(psStats *stats,
     1617                       const psVector *restrict in,
    16191618                       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}
    16241621%
    16251622This function takes the input data in \code{in} (with optional masking
     
    16301627used to specify a value range for which the statistics are calculated.
    16311628\code{binsize} specifies a choice for the robust statistics histogram
    1632 bin size.  If these are to be used, the user should set the
     1629bin size.  If these are to be used, the user must set the
    16331630corresponding \code{options} bits \code{PS_STAT_USE_RANGE} or
    16341631\code{PS_STAT_USE_BINSIZE}.  \code{clipSigma} specifies the number of
     
    16431640\code{PS_STAT_ROBUST_FOR_SAMPLE} in \code{options} must be set in this
    16441641case.  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}
     1642value in \code{sampleLimit}, which should have a default of $3 \times
     164310^{5}$.  Default input field values must be set by the \code{psStats}
    16471644constructor.  The input vector may be of type \code{psU8},
    16481645\code{psU16}, \code{psF32}, \code{psF64}; the mask must be of type
     
    17651762structure. 
    17661763\begin{verbatim}
    1767 psHistogram *psHistogramVector(psHistogram *restrict out, const psVector *restrict in);
    1768 \end{verbatim}
    1769 \tbd{psHistogram *psHistogramVector (psHistogram *out, psVector *in);}
     1764psHistogram *psVectorHistogram(psHistogram *out,
     1765                               const psVector *restrict in,
     1766                               const psVector *restrict mask,
     1767                               unsigned int maskVal);
     1768\end{verbatim}
    17701769The input vector may be of types \code{psU8, psU16, psF32, psF64}.
    17711770
     
    19871986                       int x, int y, int nx, int ny,
    19881987                       int direction, const psStats *stats);
     1988typedef enum {
     1989    PS_CUT_X_POS;
     1990    PS_CUT_X_NEG;
     1991    PS_CUT_Y_POS;
     1992    PS_CUT_Y_NEG;
     1993} psImageCutDirection;
    19891994\end{verbatim}
    19901995Extract pixels from rectlinear region to a vector (array of floats).
    19911996The output vector contains either \code{nx} or \code{ny} elements,
    19921997based on the value of the direction: e.g., if \code{direction} is
    1993 \tbd{+x}, there are \code{nx} elements.  The input region is collapsed
    1994 in the perpendicular direction, and each element of the output vectors
    1995 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{psF32}, \code{psF64}.
     1998\code{PS_CUT_X_POS}, there are \code{nx} elements.  The input region
     1999is collapsed in the perpendicular direction, and each element of the
     2000output vectors is derived from the statistics of the pixels at that
     2001direction coordinate.  The statistic used to derive the output vector
     2002value is specified by \code{stats}.  Only one of the statistics
     2003choices may be specified, otherwise the function must return an error.
     2004This function must be defined for the following types: \code{psU8},
     2005\code{psU16}, \code{psF32}, \code{psF64}.
    20012006
    20022007\begin{verbatim}
     
    20122017represents pixel-sized boxes, where the value is derived from the
    20132018statistics 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}
     2019direction.  The specific algorithm which must be used is described in
     2020the PSLib ADD (PSDC-430-006).  The statistic used to derive the output
     2021vector value is specified by \code{stats}.  Only one of the statistics
     2022choices may be specified, otherwise the function must return an error.
     2023This function must be defined for the following types: \code{psU8},
     2024\code{psU16}, \code{psF32}, \code{psF64}
    20192025
    20202026\begin{verbatim}
     
    20222028                           const psVector *radii, const psStats *stats);
    20232029\end{verbatim}
    2024 Extract radial annuli data to a vector.  A vector is constructed where
     2030Extract radial region data to a vector.  A vector is constructed where
    20252031each 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}.
     2032which land within one of a sequence of radii.  The radii are centered
     2033on the image pixel coordinate \code{x,y}, and are defined by the
     2034sequence of values in the vector \code{radii}.  The specific algorithm
     2035which must be used is described in the PSLib ADD (PSDC-430-006).  The
     2036statistic used to derive the output vector value is specified by
     2037\code{stats}.  Only one of the statistics choices may be specified,
     2038otherwise the function must return an error.  This function must be
     2039defined for the following types: \code{psU8}, \code{psU16},
     2040\code{psF32}, \code{psF64}.
    20332041
    20342042\subsubsection{Image Geometry Manipulation}
     
    20512059
    20522060\begin{verbatim}
    2053 psImage *psImageRotate(psImage *out, const psImage *input, float angle);
     2061psImage *psImageRotate(psImage *out, const psImage *input, float
     2062angle, float exposed);
    20542063\end{verbatim}
    20552064Rotate the input image by given angle, specified in degrees.  The
    20562065output image must contain all of the pixels from the input image in
    20572066their 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 always
    2059 the center pixel of the image.  The rotation is specified in the sense
    2060 that a positive angle is an anti-clockwise rotation.  This function
    2061 must be defined for the following types: \code{psU8}, \code{psU16},
    2062 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32},
    2063 \code{psC64}.
     2067pixels should be set to \code{exposed}.  The center of rotation is
     2068always the center pixel of the image.  The rotation is specified in
     2069the sense that a positive angle is an anti-clockwise rotation.  This
     2070function 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}.
    20642073
    20652074\begin{verbatim}
     
    20902099
    20912100\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);}
     2101psStats *psImageStats(psStats *stats,
     2102                      const psImage *restrict in,
     2103                      const psImage *restrict mask,
     2104                      unsigned int maskVal);
     2105\end{verbatim}
    20952106Determine 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);}
     2107determined are specified by \code{stats}.  The \code{mask} allows
     2108pixels to be excluded if their corresponding mask pixel value matches
     2109the value of \code{maskVal}.  This function must be defined for the
     2110following types: \code{psU8}, \code{psU16}, \code{psF32},
     2111\code{psF64}.
     2112
     2113\begin{verbatim}
     2114psHistogram *psImageHistogram(psHistogram *out,
     2115                              const psImage *restrict in,
     2116                              const psImage *restrict mask,
     2117                              unsigned int maskVal);
     2118\end{verbatim}
    21042119Construct a histogram from an image (or subimage).  The histogram to
    21052120generate is specified by \code{psHistogram hist} (see
     
    21772192number of clipped pixels.  This function must be defined for the
    21782193following 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
     2196match the image data.  If the input parameters \code{vmin} or
     2197\code{vmax} are out of bounds for the image pixel type, the function
     2198must raise an error.  It is not an error for \code{min} or \code{max}
     2199to be out of range.  In the case of complex numbers, the input
     2200parameters \code{min} and \code{max} must be compared against the
     2201absolute value of the pixel values.  The values to which complex image
     2202data are clipped employ the provided value for the real component and
     22030.0 for the imaginary component.
    21802204
    21812205\begin{verbatim}
     
    21862210Returns the number of clipped pixels.  This function must be defined
    21872211for 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
     2213imaginary part have the value \code{NaN}, then that component will be
     2214set to the specified value.
    21892215
    21902216\begin{verbatim}
     
    22132239images, e.g.\ dividing one image by another, subtracting a vector
    22142240from an image, etc.  Both binary operations and unary operations are
    2215 required.  To avoid the burden of memorizing a ton of APIs, we specify
     2241required.  To avoid the burden of memorizing a plethora of APIs, we specify
    22162242two generic APIs for the binary and unary operations.
    22172243
     
    22272253expected that the implementation of these functions will employ
    22282254pre-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.
     2255loops.  An attempt to perform an arithmetic operation on an object of
     2256dimension \code{PS_DIMEN_OTHER} should produce an error.  Operations
     2257between data structures with different types (e.g., \code{psS32} and
     2258\code{psF32}) are not allowed and must raise an error (it is the
     2259responsibility of calling functions to perform type conversions).
     2260Operations between data structures with incompatible sizes are not
     2261allowed.  However, operations between data elements of different rank
     2262(scalar, vector, image) are allowed, and defined below.
    22322263
    22332264Binary operations between an image and a vector have a potential
     
    22362267(\code{PS_DIMEN_VECTOR}), and a ``transposed vector''
    22372268(\code{PS_DIMEN_TRANSV}).  We specify that a ``vector'', when involved
    2238 in binary operations on an image, acts on the rows, while a
    2239 ``transposed vector'' in the same context acts on the columns.
     2269in binary operations on an image, acts on all rows of the image, while
     2270a ``transposed vector'' in the same context acts on all columns.
    22402271Vectors, when created, will be created as ``vectors'', but may be
    22412272converted to ``transposed vectors'' using the following function:
     
    26882719Certain metadata names (such as the FITS keywords \code{COMMENT} and
    26892720\code{HISTORY} in a FITS header) may be repeated with different
    2690 values.  The \code{psMetadataAppend} routine is required to check that
     2721values.  The \code{psMetadataAdd} routine is required to check that
    26912722all metadata names are unique unless the type is qualified as
    26922723\code{PS_META_NON_UNIQUE}; in this case a unique integer must be added
     
    27382769item may be added by appending a \code{psMetadataItem} which has
    27392770already 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,
     2771be 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
     2774by the \code{va_list} operators in the function.  Both functions take
     2775an parameter \code{where} which specifies where in the list to place
     2776the element, following the conventions for the \code{psList}.  Care
     2777should be taken not to leak memory when appending an item for which
     2778the key already exists in the metadata (and is not
     2779\code{PS_META_NON_UNIQUE}).
     2780%
     2781\begin{verbatim}
     2782bool psMetadataAddItem(psMetadata *restrict md, int where,
    27472783                                     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
     2784bool psMetadataAdd(psMetadata *restrict md, int where,
     2785                                 const char *name, int format, const char *comment, ...);
     2786\end{verbatim}
     2787
     2788Items may be removed from the metadata by specifying a key or a
     2789location in the list.  If the value of \code{name} is \code{NULL}, the
     2790value 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}.
     2792If the key matches a metadata item, the item is removed from the
     2793metadata and \code{true} is returned; otherwise, \code{false} is
     2794returned.  If the key is not unique, then \emph{all} items
     2795corresponding to the key are removed, and \code{true} is returned.
     2796%
     2797\begin{verbatim}
     2798bool psMetadataRemove(psMetadata *restrict md, int where, const char *restrict key);
     2799\end{verbatim}
     2800
     2801Items may be found within the metadata by providing a key.  In the
     2802event that the key is non-unique, the first item is returned.
     2803\begin{verbatim}
     2804psMetadataItem *psMetadataLookup(const psMetadata *restrict md,
     2805                                 const char *restrict key);
     2806\end{verbatim}
     2807
     2808Items may be retrieved from the metadata by their entry position.  The
     2809value of which specifies the desired entry in the fashion of
     2810\code{psList}.
     2811\begin{verbatim}
     2812psMetadataItem *psMetadataGet(const psMetadata *restrict md, int which);
     2813\end{verbatim}
     2814
     2815The metadata may be iterated over by (re-)setting the iterator to a
     2816location in the \code{psMetadata} list, and getting the previous or
     2817next item.  \code{psMetadataGetNext} has the ability to match the
     2818beginning of a key, e.g., if the user only wants to iterate through
    27682819\code{IPP.machines.sky} and doesn't want to bother with
    27692820\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);
     2821item of metadata --- even those that are non-unique.  The value
     2822\code{which} specifies the iterator to be used.  In setting the
     2823iterator, the position of the iterator is defined by \code{where},
     2824which follows the conventions of the \code{psList} iterators.
     2825\begin{verbatim}
     2826void psMetadataSetIterator(psMetadata *md, int where);
     2827psMetadataItem *psMetadataGetNext(psMetadata *restrict md, const char *restrict match, int which);
     2828psMetadataItem *psMetadataGetPrevious(psMetadata *restrict md, const char *restrict match, int which);
    27812829\end{verbatim}
    27822830
     
    29833031The following functions simply return the appropriate
    29843032\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);
     3033coordinate systems (i.e., ICRS, Ecliptic and Galactic).
     3034%
     3035\begin{verbatim}
     3036psSphereTransform *psSphereTransformICRSToEcliptic(void);
     3037psSphereTransform *psSphereTransformEclipticToICRS(void);
     3038psSphereTransform *psSphereTransformICRSToGalactic(void);
     3039psSphereTransform *psSphereTransformGalacticToICRS(void);
    29933040\end{verbatim}
    29943041
     
    34383485
    34393486\begin{verbatim}
    3440 psPlane *psCoordCelltoChip (psPlane *out, const psPlane *in, const psCell *cell);
     3487psPlane *psCoordCellToChip (psPlane *out, const psPlane *in, const psCell *cell);
    34413488\end{verbatim}
    34423489which converts coordindates \code{in} on the specified \code{cell} to
     
    34443491
    34453492\begin{verbatim}
    3446 psPlane *psCoordChiptoFPA (psPlane *out, const psPlane *in, const psChip *chip);
     3493psPlane *psCoordChipToFPA (psPlane *out, const psPlane *in, const psChip *chip);
    34473494\end{verbatim}
    34483495which converts the coordinates \code{in} on the specified \code{chip}
     
    34573504
    34583505\begin{verbatim}
    3459 psSphere *psCoordTPtoSky(psSphere *out, const psPlane *in, const psGrommit *grommit);
     3506psSphere *psCoordTPToSky(psSphere *out, const psPlane *in, const psGrommit *grommit);
    34603507\end{verbatim}
    34613508which converts the tangent plane coordinates \code{in} to (RA,Dec) on
     
    34813528
    34823529\begin{verbatim}
    3483 psSphere *psCoordCellToSkyQD(psSphere *out, const psPlane *in, const psCell *cell);
     3530psSphere *psCoordCellToSkyQuick(psSphere *out, const psPlane *in, const psCell *cell);
    34843531\end{verbatim}
    34853532which uses the 'quick-and-dirty' transformation to convert coordinates
     
    35003547
    35013548\begin{verbatim}
    3502 psPlane *psCoordTPtoFPA(psPlane *out, const psPlane *in, const psFPA *fpa);
     3549psPlane *psCoordTPToFPA(psPlane *out, const psPlane *in, const psFPA *fpa);
    35033550\end{verbatim}
    35043551which converts the tangent plane coordinates \code{in} to focal plane coordinates.
    35053552
    35063553\begin{verbatim}
    3507 psPlane *psCoordFPAtoChip (psPlane *out, const psPlane *in, const psChip *chip);
     3554psPlane *psCoordFPAToChip (psPlane *out, const psPlane *in, const psChip *chip);
    35083555\end{verbatim}
    35093556which converts the specified FPA coordinates \code{in} to the
     
    35143561
    35153562\begin{verbatim}
    3516 psPlane *psCoordChiptoCell (psPlane *out, const psPlane *in, const psCell *cell);
     3563psPlane *psCoordChipToCell (psPlane *out, const psPlane *in, const psCell *cell);
    35173564\end{verbatim}
    35183565which converts the specified Chip coordinate \code{in} to the
     
    35303577
    35313578\begin{verbatim}
    3532 psPlane *psCoordSkyToCellQD(psPlane *out, const psSphere *in, psCell *cell);
     3579psPlane *psCoordSkyToCellQuick(psPlane *out, const psSphere *in, psCell *cell);
    35333580\end{verbatim}
    35343581which directly converts (RA,Dec) \code{in} to coordinates on the
     
    37003747    for (int i = 0; i < 10; i += 5) {
    37013748        float sqrti = sqrt(i);
    3702         psMetadataAppend(ms, psMetadataItemAlloc(PS_META_INT, &i, NULL, "const.%d", i));
    3703         psMetadataAppend(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));
    37043751    }
    3705     psMetadataAppend(ms, psMetadataItemAlloc(PS_META_STR, "Bonjour", "French", "lang.hello"));
     3752    psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR, "Bonjour", "French", "lang.hello"));
    37063753    /*
    37073754     * Remove a key
     
    37403787
    37413788\begin{verbatim}
    3742     psMetadataAppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
     3789    psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
    37433790                                           "Bonjour", "French", "lang.hello"));
    3744     psMetadataAppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
     3791    psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
    37453792                                           "Aloha", "Hawaiian", "lang.hello"));
    3746     psMetadataAppend(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
     3793    psMetadataAdd(ms, psMetadataItemAlloc(PS_META_STR | PS_META_NON_UNIQUE,
    37473794                                           "Good Morning", "English", "lang.hello"));
    37483795    /*
Note: See TracChangeset for help on using the changeset viewer.