%%% $Id: ChangeLogSDRS.tex,v 1.183.2.6 2006-02-08 02:25:03 jhoblitt Exp $

\subsection{Changes from version 00 to version 01}

\begin{itemize}
\item cosmetic re-organizations
\item specified data types valid for psVector and psImage functions
\item discussion of external libraries
\item minor discussion of threads
\item memory callback routine names changed from ...CB to ...Callback
\item added discussion of freeing/dereferencing components of structures
\item renamed psPrintTraceLevels -> psTracePrintLevels, added prototype
\item added psTraceSetDestination
\item changed psVLogMsg to psLogMsgV
\item changed psSetLogDestination to psLogSetDestination
\item changed psLogSetDestination destination argument to type char *
  extended output target concept
\item changed psSetLogFormat to psLogSetFormat
\item extended the concept of psError to define an error stack
\item added psErrorGet, psErrorLast, psErrorClear
\item defined psErr structure
\item added psErrorStackPrint \& psErrorStackPrintV
\item added psErrorCodeString
\item added psErrorRegister
\item defined psErrorDescription
\item dropped psStringCopy \& psStringNCopy
\item changed naming scheme for psElemType to PS\_TYPE\_F32 format
\item dropped psFLoatArray, psIntArray, psDoubleArray, psComplexArray, 
  psVoidPtrArray, and associated functions
\item defined psVector, psVectorAlloc, psVectorRealloc, psVectorFree
\item changed naming scheme for psImage union (rows.rows\_f32 -> data.F32)
\item added psElemType entry to psImageAlloc and psVectorAlloc
\item added 'which' argument to psDlistSetIterator, psDlistGetNext, psDlistGetPrev
\item added psDlistSort function
\item changed 'bitmask' to 'bitset' 
\item added psBitsetNot function
\item changed output of psSort to psVector
\item changed psArrayStats to psVectorStats
\item dropped robustMeanNvalues, etc from psStats
\item added robustN50, robustNfit, binsize to psStats
\item reduced available options values (psStatsOptions)
\item simplified psHistogram, psHistogramAllocGeneric
\item changed psGetArrayHistogram to psHistogramVector
\item moved Matrix section after Images
\item moved FFT section after Images
\item replaced psMatrixOp with psMatrixMultiply
\item changed FFT function names to have the forms psVectorFFT and psImageFFT
\item replaced the forward and reverse version with an argument to ps...FFT
\item added ps...Real, ps...Imaginary, ps...Complex, ps...Conjugate
\item changed psEvalPolynomial1D to psPolynomial1DEval, (and equivalents)
\item added 'normal' argument to psGaussian
\item added psGaussianDev
\item modified argument lists of psMinimize and psMinimizeChi2
\item changed psGetVectorPolynomial to psVectorFitPolynomial1D
\item dropped psImageFreeChildren
\item modified union naming scheme in p\_psScalar to data.S32 format
\item added Dates and Times functions:
\item modified union naming scheme in psMetadataType to data.S32 format
\item modified psMetadataType to use S32, etc types
\item changed arguments of psMetadataItemAlloc to use stdargs to get data value
\item added psMetadataItemAllocV
\item modified psMetadataAppend arglist to match psMetadataItemAlloc
\item changed psImageReadHeader to psMetadataReadHeader (\& Fread)
\item moved psMetadataReadHeader to metadata section
\item split psCoord into psPlane and psSphere
\item renamed psCoordXform to psPlaneTransform
\item renamed psDistortion to psPlaneDistortion 
\item defined psSphereTransform, ..Alloc, ..Free
\item changed psCoordTransform to psSphereTransformApply
\item delete psCoordinatesItoE \& equivalents
\item added psShereTransformItoE \& equivalents
\item defined psProjection, psProjectionType
\item modifed args to psProject, psDeproject
\item changed psGetOffset, psApplyOffset to psSphereGetOffset, psSphereSetOffset
\item dropped overscan entry from psReadout
\item dropped grommit from psExposure
\item added psGrommitAlloc, psGrommitFree
\item changed args to psCoordsSkyToCell \& psCoordsSkyToCellQD
\item modified argument lists for most psCoord conversion functions
\item renamed psGetSun, psGetMoon functions to psSunGet, psMoonGet
\item added ps...GetRise, ps...GetSet, psNightLength
\item added psTimeToLunation, psLunationToTime
\item moved some naming issues out of this document, to IPP SRS
\item cleaned metadata discussion
\item change psLog date format to use hyphens
\item change Configuration File Grammar to allow periods in names and strings that begin with non-word characters
\end{itemize}

\subsection{Changes from Revision 01 (19 May 2004) to 02 (22 June 2004)}

Changes consisted of incorporating feedback from Bugzilla problem
reports (up to bug number 64).

\subsection{Changes from Revision 02 (22 June 2004) to 06 (19 August 2004)}

\begin{itemize}
\item \code{libTAI} no longer used, since it does not perform as desired.
\item Addition of \code{previousBlock}, \code{nextBlock},
  \code{freeFcn}, \code{userMemorySize}, \code{refCounterMutex} to
  \code{psMemBlock}.
\item Added behavior of memory management when \code{PS_MEM_DEBUG} is
  defined at compile time.
\item \code{psMemExhaustedSetCallback} $\rightarrow$
  \code{psMemExhaustedCallbackSet}.
\item Added \code{p_psSetFreeFcn} and \code{p_psGetFreeFcn}.
\item \code{psMemFreeIDSet}, \code{psMemAllocateIDSet} $\rightarrow$
  \code{psMemFreeCallbackIDSet}, \code{psMemAllocateCallbackIDSet}.
\item \code{psMemCheckCorruption} now takes a \code{bool} instead of
  \code{int}.
\item Specification that destructors are private functions which are
  called by \code{psFree}.
\item \code{psErrorRegisterSet} $rightarrow$ \code{psErrorRegister}.
\item Added a type, \code{PS_TYPE_C64}.
\item Added section on ``Simple Scalars'' for math operations,
  including functions \code{psScalarAlloc} and \code{psScalarCopy}.
\item \code{psVector} no longer carries a \code{void *} type, but now
  has a \code{psC64} type.  The \code{void *} carrier type is
  \code{psArray}.
\item \code{psImage} supporting functions are valid for types
  \code{psS8, psS16, psU8, psU16, psF32, psF64, psC32, psC64}.
\item Section on ``Simple Arrays'' added --- an ordered collection of
  unspecified data elements.
\item \code{psDList} renamed \code{psList}.
\item In \code{psList}, \code{n} changed to \code{size}.
\item \code{psListAdd} and \code{psListRemove} now return a
  \code{bool}.
\item Retrieving data from the list means that the reference counter
  is incremented.
\item \code{psListFree} frees the list and calls \code{psFree} on all
  the data on the list.
\item \code{psListSort} prototype updated.
\item \code{psHashInsert} renamed \code{psHashAdd}, now returns a
  \code{bool} and frees existing data for the given key.
\item \code{psHashRemove} now returns a \code{bool}.
\item \code{psSort} renamed \code{psVectorSort}, and specified for
  type \code{psS8}, instead of \code{psU8}.
\item \code{psSortIndex} renamed \code{psVectorSortIndex}.
\item \code{psVectorStats} parameters reordered.
\item \code{psStats} does not revert to robust statistics for large
  vectors; \code{PS_STAT_ROBUST_FOR_SAMPLE} dropped.
\item \code{psHistogram.uniform} changed to type \code{bool}.
\item \code{psHistogramVector} renamed \code{psVectorHistogram}, and
  takes a \code{mask} and \code{maskVal}.
\item \code{psPolynomial} now incorporates both general polynomials
  and Chebyshev polynomials, with the option being specified by an
  enumerated type in the structure, which is also passed to the
  constructor, \code{psPolynomialAlloc}.  This will necessitate
  changes to the evaluators as well.
\item Vector versions of polynomial evaluators, e.g.\
  \code{psDPolynomial2DEvalVector} defined.
\item Splines added (\code{psSpline1D}), with corresponding
  allocators, single and vector evaluators, and fit to a vector.
\item \code{psGaussian} takes \code{bool normal}, instead of \code{int normal}.
\item Specified minimization routines in much more detail.  Now have
  both LM and Powell minimizers specified, with a $\chi^2$ minimizer
  using the Powell minimizer, and a couple of functions to use to
  minimize $\chi^2$ with the LM minimizer.
\item Function \code{psImageSubsection} added.
\item Behavior of \code{psImageCopy} specified in the event \code{out == NULL}.
\item Function \code{psImageTrim} added.
\item Defined \code{psImageCutDirection}, and added one to
  \code{psImageSlice}.
\item \code{mask} and \code{maskVal} added to \code{psImageCut}, along
  with pointer to the algorithm in the ADD.
\item \code{mask} and \code{maskVal} added to \code{psImageRadialCut},
  along with pointer to the algorithm in the ADD..
\item \code{mask} and \code{maskVal} added to \code{psImageRebin}, and
  specified in more detail.
\item Added function \code{psImageResample}, along with
  \code{psImageResampleMode}.
\item \code{psImageRotate} has new \code{float exposed} parameter.
\item \code{psImageGetStats} renamed \code{psImageStats}, and must be
  defined for \code{psS8} (not \code{psU8}).
\item \code{psImageHistogram} now takes a \code{mask} and
  \code{maskVal}.
\item \code{psImageHistogram}, \code{psImageFitPolynomial},
  \code{psImageEvalPolynomial} must be defined for \code{psS8} (not
  \code{psU8}).
\item Added function \code{psImagePixelInterpolate}.
\item Behavior of \code{psImageReadSection, psImageWriteSection}
specified in more detail.
\item \code{psImageClip} parameters now specified to be \code{double},
  and behavior specified in more detail.
\item Function \code{psImageClipComplexRegion} added.
\item \code{psImageClipNaN} behavior specified for complex images.
\item \code{psBinaryOp} and \code{psUnaryOp} described in more detail.
\item \code{psVectorTranspose} removed.
\item Added section on convolution, including defining \code{psKernel},
  with corresponding constructor and generation function.
\item Section on times (\code{psTime} completely reworked.  In
  particular, \code{libTAI} is no longer used.
\item \code{psMetadataAppend} and \code{psMetadataAppendItem} are now
  \code{psMetadataAdd} and \code{psMetadataAddItem}, returning
  \code{bool}s.  Each is specified in a bit more detail.
\item \code{psMetadataRemove} takes a \code{where} parameter, and
  is specified in a bit more detail.
\item Added function \code{psMetadataGet}.
\item Iterating on the metadata described in more detail.
\item \code{psMetadataItemPrint} changed.
\item In distortions, the third and fourth parameters consistently
  referred to now in the order color and then magnitude.
\item Pre-defined spherical transforms renamed to longer, but more
  meaningful names.
\item GLS projection dropped.
\item Offsets specified in more detail, with different modes
  (\code{psSphereOffsetMode}) and units (\code{psSphereOffsetUnit})
  instead of a single \code{type}.
\item \code{out} parameter in \code{psCellInFPA, psChipInFPA,
  psCellInChip} removed.
\item \code{color, mag} parameters added to functions that transform
  between FPA and tangent plane (\code{psCoordFPAToTP, psCoordCellToSky, psCoordTPToFPA, psCoordSkyToCell}).
\item Specified constructors for the astronomy images and astrometry
  structures.
\item \code{psExposure} contains a \code{psTime *time} instead of
  \code{mjd}.
\item \code{psFPA} contains a \code{psGrommit} composed from the
  relevant \code{psExposure} for assistance in astrometric transforms.
\item Added structure \code{psObservatory}, which contains observatory
  information.  \code{psExposure} contains a \code{psObservatory}.
\item \code{wavelength} added to \code{psExposure}.
\item \code{psCell.cellToSky} renamed to \code{psCell.toTP} and now
  only goes to the tangent plane, from which the \code{psGrommit} is
  used to get the coordinates to the sky.
\item Added description of \code{psMemory} functions
  \code{p_psSetFreeFcn}, \code{p_psGetFreeFcn}
\item Modified definition of \code{psImagePixelInterpolate}.
\item Renamed \code{psImageResampleMode} mode to
  \code{psImageInterpolateMode}.
\item Added \code{psImageInterpolateMode} mode to
  \code{psImageRotate}, \code{psImageShift}.
\item Changed input type of \code{exposed} pixels to \code{psC64}.
\item Dropped maintaince of original type for \code{psImageCopy}.
\item Added output \code{psVector *coords} to \code{psImageSlice}.
\item Dropped \code{psMetadataFlags} from \code{psMetadataItem}.
\item Cleaned \code{psMetadata} discussion to reflect new handling of
  non-unique keys.
\item Clarified sequence of entries in \code{psMetadataItemAlloc}.
\item Dropped metadata naming convention reference (should be part of
  IPP docs, not PSLib)
\item \code{Nchildren} $\rightarrow$ \code{nChildren} in
  \code{psImage}.
\item Changed names of \code{p_psSetFreeFcn}, \code{p_psGetFreeFcn} to
  \code{p_psMemSetDeallocator}, \code{p_psMemGetDeallocator}.
\item Added \code{psFreeFnc} parameter to
  \code{p_psMemSetDeallocator}.
\item \code{long psMemGetId(void)} to \code{psMemoryId
  psMemGetId(void)}.
\end{itemize}

\subsection{Changes from Revision 06 (19 August 2004) to Revision 07 (7 September 2004)}

\begin{itemize}
\item Removed \code{psTimeFromLST}, changed parameters and output for
  \code{psTimeToLST}.
\item Added function \code{psTimeLeapSeconds} to calculate number of
  leap seconds between two dates, required for time arithmetic.
\item Changed \code{psImageCut} to do a slice through the data in an
  arbitrary direction, instead of merging the data along a particular
  dimension.
\item added \code{psVector *coords} to the API for \code{psImageCut}.
\item Added \code{psLibVersion} (bug 156).
\item Added specification of iterator to \code{psMetadataSetIterator}.
\item Replaced \code{which} and \code{where} in \code{psMetadata} and
  \code{psList} functions with \code{iterator} and \code{location},
  respectively, in order to reduce confusion.
\item Changed the order of some \code{psList} function arguments to
  match that of \code{psMetadata}.
\item \code{psLogSetDestination} return type changed to \code{bool}.
\item \code{psImage.nChildren} and \code{.children} changed to
  \code{psArray *children}.
\item Added extra input parameters to \code{psKernelGenerate}:
  \code{psVector *tShifts} and \code{bool relative}.
\item Synched \code{psImageSubset}, \code{psImageTrim},
  \code{psImageReadSection} and \code{psImageSlice} to use a
  consistent region specification: \code{x0,y0,x1,y1}, where \code{x1}
  and \code{y1} are exclusive, and may be negative.
\item Added \code{psTime} arguments to
  \code{psSphereTransformICRSToEcliptic} and
  \code{psSphereTransformEclipticToICRS}.
\item Added \code{bool} type to \code{psMetadata}.
\item TBD-ed the Astronomical Objects section and the photometry
  section.
\item Added \code{psLibInit}.
\item Updated \code{psReadout,Cell,Chip,FPA} to synchronise with
  MHPCC, in particular use of \code{psArray}.
\item \code{psImageTrim} is to free children.
\item Specified the operators for \code{psBinaryOp} and
  \code{psUnaryOp}.
\item Updated types for \code{psVectorStats},
  \code{psImageReadSection} and \code{psImageWriteSection}.
\item Added constructors for \code{psPlaneTransform} and
  \code{psPlaneDistort}.
\item Updated description of behavior of \code{psFree} (doesn't barf
  if \code{refCounter} is not 1.
\item Clarified behavior of \code{psLogSetDestination} (no need to
  specify a protocol for \code{stderr,stdout,none}).
\item Leading dot in facility name for \code{psTrace} is optional.
\item Specification of configuration file format and parse function,
  \code{psMetadataParseConfig}.
\item Added new function \code{psSpherePrecess}.
\end{itemize}

\subsection{Changes from Revision 07 (7 September 2004) to Revision 08 (12 October 2004)}

\begin{itemize}
\item Changed format of \code{psLogMsg}, following bug 189: format now has multiple lines.
\item Added configuration file grammar.
\item Added explanation of \code{psArray *coords} in \code{psMinimizeLMFunc}, and changed \code{psMatrix} to
  \code{psImage} in response to bug 191.
\item Added \code{psTimeTable}.
\item \code{psLibInit} altered to load \code{psTime} configuration
  file.
\item Reworked \code{psList} (including addition of new functions) to
  support multiple iterators.
\item Specified return value for \code{psImageOverlaySection} is the
  number of pixels overlaid.
\item Added \code{persistent} to \code{psMemBlock}, along with
  additional specification of behaviour of \code{psMemCheckLeaks}.
\item Removed \code{psListRemoveNext} and \code{psListRemoveAfter}.
  Removing an item pointed to by an iterator doesn't cause an error.
\item Added \code{psRectangle}
\item Added \code{PS_TYPE_BOOL} to \code{psElemType}.
\item Dropped \code{PS_TYPE_OTHER}
\item Replaced \code{PS_META_IMG} with \code{PS_META_MATH}
\item Replaced \code{PS_META_ITEM_SET} with \code{PS_META_LIST}
\item Added \code{psElemType} to \code{psMetadataItem} to specify primitive data types.
\item Cleaned up the entries in \code{psMetadataType}.
\item Moved the \code{psList} entry (item set, now list) to the union.
\item Added a \code{psMetadata} entry to the union.
\item Added typing contruct and hierarchy to \code{psMetadataParseConfig}
\item Added FITS I/O section 
\item Moved \code{psImageReadSection} and \code{psImageWriteSection} to FITS I/O Functions section and modified names.
\item Moved \code{psMetadataReadHeader} and \code{psMetadataFReadHeader} to FITS I/O Functions section and modified names.
\item Fixed typo: \code{p_psScalar} to \code{psScalar}
\item Renamed \code{psMetadata.data.void} to \code{psMetadata.data.data} to be consistent with \code{psList}, \code{psHash} 
\item Require comment mark in 'multiple' metadata config entry for comments
\item Changed return values for \code{psMetadataParseConfig}
\item Added \code{psTimeAlloc}.
\item Adding \code{errors} to \code{psVectorStats}.
\item Adding \code{psRandom}, with three distributions (uniform,
  Gaussian, Poisson).  This obsoletes \code{psGaussianDev}, and
  impacts \code{psLibInit} (no longer needs to seed the RNG).
\item Changed \code{psImageRotate} to use radians instead of degrees.
\end{itemize}

\subsection{Changes from Revision 08 (12 October 2004) to Revision 09 (15 November 2004)}

\begin{itemize}
\item Updated \code{psSphereTransform}, according to bug 116.
\item Removed mention of \code{libTAI} in the introduction.
\item Fixed \code{psVectorHistogram} prototype to include \code{errors}.
\item In \code{psVectorStats} and \code{psVectorHistogram}, the \code{errors}
vector must be of the same type as the input values vector.
\item Added \code{psLookupTable} section, and removed
  \code{psTimeTableInterpolate} (now redundant).
\item \code{psTimeAdd} and \code{psTimeSubtract} merged to
  \code{psTimeMath}.  Specified that time differences are expressed in
  SI seconds (i.e., not including leap seconds).  Inputs to
  \code{psTimeMath} and \code{psTimeDelta} no longer need to be TAI
  --- the functions will convert from and to UTC as required.
\item modified the document name and PSDC number (and refs).
\item cleaned up the FITS I/O functions: defined Alloc and Move functions, only use psFits for I/O.
\item dropped deprecated psMetadataReadFits
\item replaced \code{PS_META_ITEM_SET} with \code{PS_META_LIST}
\item clarified use of x in psVectorFitSpline
\item unified the form of evaluation functions for polynomials and splines
\item clarified use of errors in stats function
\item Changed return type of \code{psTraceReset}, \code{psLogSetFormat}, \code{psMetadataSetIterator}, \code{psMetadataItemPrint} to return type \code{bool}, so that errors won't be lost (bug 161).
\item \code{psImageRebin} input types restricted; bug 198.
\item Fixed up the LM minimization specification; bug 203.
\item Removed errors from \code{psVectorFitSpline1D}.
\item \code{psTraceReset} is to free memory used by \code{psTrace}.
\item Added requirement on use of persistent memory --- any use of
  persistent memory shall provide a function that frees the persistent
  memory.
\item Added statement on use of \code{restrict}.
\item In \code{psSpline1D}, renamed \code{domains} to \code{knots}.
\end{itemize}

\subsection{Changes from Revision 09 (15 November 2004) to Revision 10 (30 November 2004)}

\begin{itemize}
\item changed psFitsReadHeaderSet to return a psMetadata rather than just a psHash
\item added METADATA ... END construction in psMetadataParseConfig
\item added psArrayAdd function to Simple Arrays
\item added utility functions \code{psMetadataLookupPtr}, \code{psMetadataLookupS32}, \code{psMetadataLookupF64}
\item added \code{psHashToArray}
\item re-organization of the astronomical images section: placed constructors with structures.
\item added \code{XML functions}
\end{itemize}

\subsection{Changes from Revision 10 (30 November 2004) to Revision 11 (21 January 2005)}

\begin{itemize}
\item Changed names of \code{psSphereTransform} structure members to conform with ADD.
\item Altered \code{psList} and \code{psListIterator} to match that in bug 249.
\item added status element to psMetadataLookupTYPE utilities
\item dropped psFitsCreateExt per discussion with rdd
\item fixed error of psHash to psMetadata in psFitsReadHeaderSet
\item added psFitsWriteImage
\item changed psFitsWriteImageSection to psFitsUpdateImage
\item added header entry to psFitsWriteTable
\item added psFitsUpdateTable 
\item Updated \code{psSpline1D} to use a vector for the \code{knots}, and specified types.
\item \code{psHistogram.nums} changed to type F32 to accomodate errors in the values.
\item Synchronized use of \code{mask} throughout.  A non-zero mask value means that the
corresponding value shall not be used.  Affected: polynomials (including plane transformations),
minimization.
\item Added \code{psPlaneAlloc, psSphereAlloc, psProjectionAlloc}.
\item \code{psList}:
  \begin{itemize}
  \item Adopted new names: \code{psListGetAndIncrement,
    psListGetAndDecrement} instead of \code{psListGetNext,
    psListGetPrev} --- clearer description of functionality.
  \item Changed \code{PS_LIST_HEAD = 0} and \code{PS_LIST_TAIL = -1};
    negative indices specify an item relative to the end of the list.
  \item The action of retrieving data from a list (with one of the
    three \code{psListGet} functions) is considered ``borrowing'' the
    reference, so no action is performed on the reference counter.
    Removed other mentions of reference counters, since these were not
    necessary.
  \item \code{mutable} boolean in \code{psListIterator} specifies
    whether \code{psListAddAfter} or \code{psListAddBefore} may be
    used to modify the list through the iterator.  This allows the use
    of \code{const psList} in \code{psListIteratorAlloc}.
  \end{itemize}
\item Added \code{psPlaneTransformInvert},
  \code{psPlaneTransformCombine} and \code{psPlaneTransformFit}.
\item Added \code{psAstrometryReadWCS}, \code{psAstrometryWriteWCS},
  and \code{psAstrometrySimplify}.
\item Added additional modes to \code{psImageInterpolateMode} to deal
  with variances: \code{PS_INTERPOLATE_BILINEAR_VARIANCE,
  PS_INTERPOLATE_BICUBIC_VARIANCE, PS_INTERPOLATE_SINC_VARIANCE}.
\item Added \code{psImageTransform}.
\item Added section of Database Functions
\end{itemize}

\subsection{Changes from Revision 11 (21 January 2005) to Revision 12 (9 February 2005)}

\begin{itemize}
\item In \code{psMatrixLUD}, changed \code{psVector *perm} to
  \code{psVector **perm} to allow the function to allocate the vector
  (bug 269).
\item Removed in \code{psListAlloc}, ``The number of iterators in the
  list is initially set to zero.'' (bug 271).
\item Added \code{region} and \code{nSamples} to
  \code{psPlaneTransformCombine} and specified the algorithm.
\item re-added psMetadata iterators, modified the APIs somewhat
\item added the mode entry to psMetadataAddItem 
\item clarified the 'format' entry in psMetadataAdd
\item added the function psMetadataAddV
\item added the option flags \code{psMetadataFlags}
\item changed psDBDumpCols() to return a psMetadata (bug 285)
\item changed psDB to hold a MYSQL *
\item changed psDBSelectColumnNum() to accept a psElemType parameter
\item changed psDBSelectColumn() to return an psArray of strings
\item renamed psDBUpdateRow() to psDBUpdateRows()
\item renamed psDBDeleteRow() to psDBDeleteRows()
\item renamed psDBInsertRow() to psDBInsertOneRow()
\item add psDBInsertRows()
\item Replaced \code{PS_INTERPOLATE_SINC} with \code{PS_INTERPOLATE_LANCZOS[234]}.
\item noted that SLAlib wrapping will be replaced with our own functions
\item dropped the Image I/O Functions section (functions moved to psFits)
\end{itemize}

\subsection{Changes from Revision 12 (9 February 2005) to Revision 13 (30 March 2005)}

\begin{itemize}
\item Added \code{color}, \code{magnitude} to
  \code{psAstrometryWriteWCS}, in order to convert a
  \code{psPlaneDistort} into a straight spatial polynomial.
\item fix typo in psVector typedef
\item add limit param to psDBSelectRows()
\item change psDBUpdateRows() and psDBDeleteRows() to return signed values
\item Made \code{psMemSetDeallocator} and \code{psMemGetDeallocator}
  public functions, and cleaned up description.
\item Reworked \code{psLookupTable} functions so that the number of
  columns and their types are defined by a \code{scanf}-like format
  string.  Added \code{psVectorsReadFromFile} and
  \code{psLookupTableImport} to generalise the reading of tabular data
  from a file.
\item \code{psMetadataAddV} changed to use \code{va_list} parameter (bug 312).
  
\item Modified \code{psImageTransform} in preparation for image combination.
  
\item Added \code{psPixels} structure and related functions
\item Added \code{psPlaneTransformDeriv}.
\item Added \code{psImageGrowMask}.
\item Added Earth Orientation Calculations Section
  
\item Changes to the Time section:
  \begin{itemize}
  \item Add \code{psTimeBulliten} enum
  \item Add \code{leapsecond} member to \code{psTimeType}
  \item Change \code{psTime.usec} $\rightarrow$ \code{psTime.nsec} (nanoseconds)
  \item Minor reorganization and additional comments
  \item Rename \code{psTimeGetTime()} $\rightarrow$ \code{psTimeGetNow()}
  \item New rules for time system converstion
  \item Rename \code{psTimeToLST()} $\rightarrow$ \code{psTimeToLMST()}
  \item Rename \code{psTimeLeapSeconds()} $\rightarrow$ \code{psTimeLeapSecondDelta()}
  \item Add \code{psTimeIsLeapSecond()}
  \item ISO8601 format clarifications
  \item Rename \code{psTimeToISOTime()} $\rightarrow$ \code{psTimeToISO()}
  \item Add \code{psTimeFromUTC()}
  \item Add \code{psTimeFromTT()}
  \item Change \code{psTime} math rules
  \item Change ``Time Tables'' to have IERS Bulliten A \& B
  \item Add Dates \& Times Test Inputs appendix
  \end{itemize}
  
\item Adding logical operations (and, or) to \code{psBinaryOp}.
  
\item Substantial reorganization:
  \begin{itemize}
  \item Moved Metadata, Database, and XML sections to new section
  \item Re-named Detector \& Sky Coordinates to Linear \& Spherical Coordinates
  \item Moved Exposure and Observatory information out of 'Astronomical Images'
  \item Moved Celestial Coordinate Systems out of 'Detector \& Sky Coordinates'
  \item Added Atmospheric Effects section, incorporating psGrommit and airmass functions from other sections)
  \item Moved Fixed Pattern out of Astronomical Images 
  \end{itemize}
  \end{itemize}

\subsection{Changes from Revision 13 (30 March 2005) to Revision 14 (27 April 2005)}

\begin{itemize}
\item Restrictions on the use of \code{malloc}, \code{calloc}, \code{realloc}, and \code{free} should not be unintentionaly imposed on 3rd party code.
\item Add database support for ``auto-incrementing''
  
\item Changes to Configuration Files:
  \begin{itemize}
  \item Add \code{UTC,UT1,TAI,TT} types
  \item Change ``multiple symbol'' declaration format to \code{[keyword] MULTI}
  \item Add Scoping Rules
  \item Remove Configuration File Grammar appendix
  \item Add Configuration File Test Inputs appendix
  \item Rename \code{psMetadataParseConfig()} $\rightarrow$ \code{psMetadataConfigParse()}
  \item Add \code{psMetadataConfigFormat()}
  \item Add \code{psMetadataConfigWrite()}
  \end{itemize}
  
\item Add \code{PS_META_TIME} to \code{psMetadataType}
\item Changed \code{psPixels} to vector-like array of \code{psPixelCoord} (bug 371).
\item Added \code{psPixelsAlloc}, \code{psPixelsRealloc} and \code{psPixelsCopy} (bug 371).
\item After conversation with GG:
  \begin{itemize}
  \item Mention that Chebyshev domain should only be from -1 to +1, but won't restrict.
  \item Type for \code{psSpline1D} is F32 only.
  \item Matrix functions return \code{NULL} in the event of an error.
  \item Changed API for \code{psVectorFitSpline1D}.
  \item Removed pre-defined LM minimization functions; these will be defined in the Modules SDRS.
  \end{itemize}

\item defined \code{psEarthPole}, re-cast Earth Orientation
  Calculations to use it for inputs and outputs.
\item minor name changes in Earth Orientation to match ADD changes.
\item dropped TBD for \code{psFitsUpdateImage}
\item \code{psAberration} return value defined.
\item added \code{psArrayRemove} function (already exists in psArray.c)
\item added \code{psVectorExtend} function
\item changed inputs to \code{psImageSlice} to use \code{psRegion}

\item changes involving \code{psRegion}
\begin{itemize}
  \item moved Image Regions section to beginning of Image Operations
  \item dropped psImageSubsection (redundant now)

  \item changed the following functions to use psRegion:
  psImageSubset, psImageTrim, psImageSlice, psImageCut

  \item added clarification to meaning of psRegion x0,x1,y0,y1 values.
\end{itemize}

\item removed psMetadata.ptype as per bug 313, dropped reference in psDB section.
\item clarified the discussion of duplicate keys and the option flags in \code{psMetadata}
\item Added \code{psLibFinalize} (bug 388).
\end{itemize}

\subsection{Changes from Revision 14 (27 April 2005) to Revision 15 (15 June 2005)}

\begin{itemize}
\item Bug 393:
  \begin{itemize}
  \item add \code{PS_META_TIME} to \code{psMetadataType}
  \item change \code{psTimeFromISO()} to accept a \code{psTimeType} to specifiy
    what time system the generated psTime object should be set to
  \end{itemize}
\item changes to ``Database Functions''
  \begin{itemize}
  \item change \code{psDBCreateTable()}'s definition to be clear about how to combine indexes and auto-increment
  \item add \code{p_psDBRunQuery()}
  \end{itemize}
\item \code{psLibInit} does not seed the RNG (done in \code{psRandom}).
\item Updated metadata iteration to use \code{psMetadataIterator}.
\item Restoring \code{nbuckets} to \code{psHashAlloc}, since it appears to be required by the code.
\item Adding \code{psArrayGet} and \code{psArraySet} since these are in the code.
\item \code{psMatrixEigenvectors} returns type \code{psImage} (not a single vector).
\item Specify that \code{col0,row0} shall be preserved with \code{psImageCopy}.
\item Added functions \code{psErrorGetStackSize},
  \code{psVectorRecycle}, \code{psVectorCopy},
  \code{psMetadataItemAllocStr}, \code{psMetadataItemAllocF32},
  \code{psMetadataItemAllocF64}, \code{psMetadataItemAllocS32},
  \code{psMetadataItemAllocBool}, \code{psMetadataAddS32},
  \code{psMetadataAddF32}, \code{psMetadataAddF64},
  \code{psMetadataAddList}, \code{psMetadataAddStr},
  \code{psMetadataAddVector}, \code{psMetadataAddImage},
  \code{psMetadataAddHash}, \code{psMetadataAddLookupTable},
  \code{psMetadataAddUnknown}, \code{psMetadataLookupF32},
  \code{psBitSetClear}, \code{psRegionToString} (modified),
  \code{psImageRecycle}, \code{psImageFreeChildren}
  \code{psFitsGetExtName}, \code{psFitsSetExtName} already
  implemented.
\item Renamed \code{psMaskToPixels} to \code{psPixelsFromMask} (bug 414).
\item \code{psRegionFromString} returns \code{NaN} for any element that doesn't parse correctly (bug 416).

\item unified the single and double precision polynomials
\item re-ordered the psPolynomial*Alloc arguments
\item changed the psPolynomials to be defined in terms of Norder not Nterms
\item re-ordered the psVectorFitPoly* arguments
\item added mask \& maskValue ot psVectorFitPoly*
\item changed the requirements on the input data vectors to psPolynomialFit and Eval
\item added the psVectorClipFitPoly* functions

\item SDRS API clean up and implementation re-synchronization
  \begin{itemize}
  \item rename psFinalize() $\rightarrow$ psLibCleanup()
  \item change parameters expecting \code{__LINE__} to type \code{unsigned int}
  \item change parameters expecting \code{__LINE__} to be named \code{lineno}
  \item change \code{int} $\rightarrow$ \code{size_t} where appropriate
  \item change \code{psBool} $\rightarrow$ \code{bool}
  \item change \code{psU64} $\rightarrow$ \code{unsigned long long} where appropriate
  \item add \code{const} to parameters where appropriate
  \item remove \code{const} from parameters passed by value
  \item remove \code{const} from parameters that are actually being modified
  \item change \code{void *} $\rightarrow$ \code{psPtr} where appropriate
  \item change parameter names to be consistent with the current implementation
  \item change parameter names to be more consistent between related functions
  \item change parameter types to be more consistent with related data structures 
  \item change \code{psF64} $\rightarrow$ \code{double} where appropriate
  \item change \code{psC64} $\rightarrow$ \code{complex double}
  \item rename functions/datatypes to abv. ``allocate'' as ``alloc''
  \item rename functions/datatypes to abv. ``memory'' as ``mem''
  \item rename functions/datatypes to abv. ``function'' as ``func'' (not ``fcn'')
  \item no longer abv. ``format'' as ``fmt''
  \item remove ``my'' from function parameters names
  \item add \code{psComparePtrFunc} function pointer
  \item change parameters expecting filenames to be named \code{filename}
  \item change parameters specifying the number of something to allocated to be named \code{nalloc}
  \item change parameters specifying the number of bytes to be allocated to be named \code{size}
  \item change parameters specifying the type of something to be named \code{type} where appropriate
  \item change \code{psImage} to use \code{psU32} rows \& columns
  \item change parameter names to not use the words ``width'' or ``height''
  \item rename \code{psHash.nbuckets} to \code{psHash.n}
  \item rename \code{psList.size} to \code{psList.n}
  \item rename \code{psFitsAlloc()} $\rightarrow$ \code{psFitsOpen()}
  \item add \code{psFitsClose()}
  \item change blurb about ``Threads'' to clarify requirements
  \item remove \code{lock} from \code{psList}
  \item change \code{psVector} to store it's number of elements as an \code{long}
  \item change \code{psArray} to store it's number of elements as an \code{long}
  \item change \code{psList} to store it's number of elements as an \code{long}
  \item change \code{psListIterator} to store the number of elements on the list as an \code{long}
  \item change \code{psListIterator} to store it's index as an \code{long}
  \item change \code{psHash} to store it's number of elements as an \code{long}
  \item change \code{psLookupTable} to store it's index as an \code{long}
  \item change \code{psBitSet} to store it's size as an \code{long}
  \item remove \code{psXMLDocFree()}
  \item add \code{psXMLDocAlloc()}
\end{itemize}
\item add \code{PS_META_NULL}
\item add \code{NULL} keyword to ``Configuration files''
\item Added \code{psMemCheckTYPE} functions, for many values of \code{TYPE}.
\item add \code{psMetadataItemAllocPtr()}
\item add \code{psMetadataAddBool()}
\item condense \code{psMetadataAddVector()}, \code{psMetadataAddImage()},
\code{psMetadataAddHash()}, \code{psMetadataAddLookupTable()},
\code{psMetadataAddUnknown()}, \& \code{psMetadataAddMetadata()} into
\code{psMetadataAddPtr()}
\item add \code{psMetadataLookupStr()}
\item add \code{psMetadataLookupBool()}
\item add \code{psFitsType}
\item add missing \code{psImageRecycle()} prototype (was already defined)
\item add \code{psLookupStatusType}

\item re-organized sections to place all data container before the operations.  
\item moved psRegion to subsubsection under psImage, out of image operations
\item added psMinimizeGaussNewtonDelta
\item defined gain ratio test in psMinimizeLMChi2 
\item added psRegionForImage
\item added psImageSmooth
\item added psVectorInit
\item added psImageInit
\item added fmt to psTrace
\item added psTraceV
\item unification of psTrace and psLogMsg syntax 
\item moved image hierarchy section to ModulesSDRS
\item moved photometry section to ModulesSDRS
\item Updating section on thread safety with new policy.
\item add \code{psFitsOpenFD()}
\item Removed example destructor function, since the current
  implementation does not follow it, but achieves the same result.
\item Reorganised document: collections and mathematical structures
  are now separate sections; metadata, pixels lists and bit sets are
  collections; type information goes into system utilities.
\item \code{psMetadataType} changed to \code{psDataType} (and so
  \code{PS_META_*} changed to \code{PS_DATA_*}), and expanded to
  include most psLib structures.  \code{PS_META_MULTI} changed to
  \code{PS_DATA_METADATA_MULTI}.
\item Added policy on \code{psPtr, psString}, Changed some \code{void
  *} to \code{psPtr} and some \code{char *} to \code{psString}, as
  appropriate.  Noted that metadata functions must copy strings in to
  a \code{psMetadataItem}.
\item Added \code{psMask} instead of \code{unsigned int} for mask values.
\item Added \code{psStringCopy, psStringNCopy, psStringAppend, psStringPrepend}
  to match implementation.
\item added psRegionForSquare
\item added psImageMaskRegion, psImageKeepRegion
\item added psImageMaskCircle, psImageKeepCircle
\item Updated \code{psFits} functions following bug 412: added
  \code{psFitsHeaderFromImage}, \code{psFitsHeaderFromTable},
  \code{psFitsMoveEnd}, \code{psFitsDeleteExtName},
  \code{psFitsDeleteExtNum}, \code{psFitsTruncate},
  \code{psFitsHeaderValidate}.  Changed \code{psFitsWriteImage} and
  \code{psFitsWriteTable} to update the \code{extname}.  Added mode
  options for \code{psFitsOpen}.
\item add \code{limit} param to \code{psDBDeleteRows()}
\item change \code{p_psDBRunQuery()} to accept a \code{printf()} style format 
\item added F (file:line) to psLogMsg and psTrace
\item added psLogGetLevel
\end{itemize}

\subsection{Changes from Revision 15 (15 June 2005) to Revision 16 (13 Sept 2005)}

\begin{itemize}
\item Removed \code{psLookupTableStatusType} (see bugs 304, 454).
\item Added \code{psArrayElementsFree} (already implemented).
\item \code{psMask} changed to \code{psMaskType} (more clear).
\item Use the \code{region} in \code{psImageTransform} to set the size
  of the output image (bug 453).
\item \code{list} in \code{psListIteratorAlloc} is not const (bug
  455).
\item Clarified policy on signed/unsigned for memory allocation;
  \code{psAlloc} checks the allocation size against
  \code{PS_MEM_LIMIT}.
\item \code{psVector} and \code{psImage} functions \code{-Alloc},
  \code{-Realloc} and \code{-Recycle} changed to signed \code{int}.
\item \code{nFail} in \code{psMetadataConfigParse} is \code{unsigned}.
\item \code{timeval} changed to \code{struct timeval} throughout.
\item Making various integers \code{unsigned} in the various
  \code{psPolynomial} types and \code{psSpline1D} (bug 460).
\item Adjusted \code{psStats} to reflect robust / fitted statistics as defined in the ADD.
\item Changed definition of \code{psDB} to abstract database type.
\item clarified psTimeToLMST 
\item added cutCols, cutRows to psImageCut
\item added remaining integer primatives to psMetadata
\item added C++ compatibility specification 
\item Added S32, S64, U32, U64 to \code{psScalar} (bug 491).
\item Added the \code{psCompare} functions.
\item Removed F32 from polynomials --- only use double precision.
\item \code{psPixelCoord} now contains floats.
\item \code{psImageSlice} uses \code{psPixels} to output coordinates.
\item Added \code{psTimer} functions (prototypes by EAM).
\item \code{psLibInit} and \code{psLibCleanup} changed to
  \code{psTimeInitialize} and \code{psTimeFinalize}.  Calls to
  functions that require the time tables before calling
  \code{psTimeInitialize} shall produce an error.
\item Added \code{psArgument} functions to provide simple argument
  handling.
\item Changed return types of \code{psXMLDocToFile, psXMLDocToMem,
  psXMLDocToFD} to bool (bug 499).
\item Clarified behaviour of \code{psLogSetDestination} and \code{psTraceSetDestination}.
\item Split \code{psMetadataRemove} into \code{psMetadataRemoveKey} and \code{psMetadataRemoveIndex}.
\item Added explanatory note about \code{psRegionFromString} and the FITS standard.
\item add \code{psFitsOpenStream()}
\item Removed \code{psFixedPattern}.
\item Changed \code{format} option for
  \code{psMetadataAddS32,psMetadataAddF32,psMetadataAddF64,psMetadataAddBool,psMetadataAddStr}.
\item \code{psVectorFitSpline1D} now takes an input \code{psSpline1D},
  and an optional error vector.
\item Changed \code{complex double} to \code{complex} throughout.
\item Added \code{psImageCountPixelMask}
\item Added \code{psVectorCountPixelMask}
\item Added \code{psVectorCreate}
\item Added \code{psImageRow}
\item Added \code{psImageColumn}
\item moved \code{paramMask} to \code{psMinimization}
\item added \code{paramMin} to \code{psMinimization}
\item added \code{paramMax} to \code{psMinimization}
\item added \code{paramDelta} to \code{psMinimization}
\item adjusted \code{psMinimizeLMChi2} to drop \code{paramMask}
\end{itemize}

\subsection{Changes from Revision 16 (13 Sept 2005) to Revision 17 (18 Oct 2005)}

\begin{itemize}
\item moved param constraints to \code{psMinConstrain}
\item changed type requirement on psMinimize functions to just F64
\item changed psMinimize input arguments to accept weight not sigma
\item changed psPolynomial masks from char to psU8.
\item changed \code{psImage.col0,row0} changed from const.
\item Removed \code{psMath}
\item set \code{psPolynomial} order elements (nX, nY, etc)
\end{itemize}

\subsection{Changes from Revision 17 (18 Oct 2005) to Revision 18 (06 Dec 2005)}

\begin{itemize}
\item TBD-ed \code{psEOC_ParallaxFactor} --- do not code yet.
\item Removed \code{psFitsOpenFD} and \code{psFitsOpenStream} --- not
  possible to implement these with \code{cfitsio}.
\item \code{psFitsMoveEnd} changed to \code{psFitsMoveLast}, and moves
  to the last extension.
\item \code{psFitsWriteImage} and \code{psFitsWriteTable} write to the
  end of the file.
\item Added \code{psFitsInsertImage} and \code{psFitsInsertTable} to
  insert extensions; note that these are expensive.
\item Changed \code{psFitsUpdateImage} to use \code{x0,y0} instead of
  a \code{psRegion}, which would make for an overconstrained system;
  specified origins.
\item Removed \code{psFitsHeaderFromImage, psFitsHeaderFromTable}.
  The functionality will be handled by \code{psFitsWriteImage,
  psFitsWriteTable}.
\item Added \code{psMetadataCopy}.
\item Clarified \code{psPlaneTransformAlloc} and
  \code{psPlaneDistortAlloc}: arguments are polynomial order, not
  number of terms.
\item Updated \code{psImageTransform} to use \code{psPixels} for
  \code{blankPixels} instead of a \code{psArray}.
\item Added requirement on dynamic setting of mutex locks:
  \code{psMemThreadSafety} (see bug 586).
\item Added return type for \code{psImageSmooth} (bug 588).
\item clarified psRegion for subimages
\item clarified units for \code{psProjectionAlloc}
\end{itemize}

\subsection{Changes from Revistion 18 (06 Dec 2005) to Revision 19 ()}
\begin{itemize}
\item change \code{psPolynomial?DAlloc()} to have \code{type} as the last
  parameter.
\item minor \code{typedef} fixes
\item convert \code{complex} declarations to be explicitly \code{double complex}
\item sync \code{psImage}'s definition with the implementation in psLib
\item add \code{*out} param to \code{psFitsReadHeaderSet()}
\item sync \code{psElemType}, \code{psDataType}, & \code{psFitsType} with the implementation in pslib
\end{itemize}
