Changeset 6829
- Timestamp:
- Apr 11, 2006, 11:24:07 AM (20 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 2 edited
-
ChangeLogSDRS.tex (modified) (3 diffs)
-
psLibSDRS.tex (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/ChangeLogSDRS.tex
r6760 r6829 1 %%% $Id: ChangeLogSDRS.tex,v 1.20 1 2006-04-04 03:30:29 price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.202 2006-04-11 21:24:07 eugene Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 866 866 \end{itemize} 867 867 868 \subsection{Changes from Revistion 19 (21 Feb 2006) to Revision 20 ( ?? ???2006)}868 \subsection{Changes from Revistion 19 (21 Feb 2006) to Revision 20 (11 Apr 2006)} 869 869 870 870 \begin{itemize} … … 884 884 psFitsWriteTable}. Added \code{psFitsHeaderFromImage, 885 885 psFitsHeaderFromTable}. See bug 733. 886 \end{itemize} 886 887 \item Added \code{psLine} functions 888 \item Added \code{psEllipse} functions 889 \item Added \code{psStringSplit} 890 \item Added \code{psStringStrip} 891 \item Added \code{psMetadataPrint} % added FILE * 892 \item Added \code{psMetadataItemTransfer} 893 \item Added \code{psFitsWriteHeaderNotImage} 894 \item Added \code{psImageFlip} % x and y in same function 895 \item Added \code{psImageJpeg} functions 896 \item Added \code{psMetadataItemParse} functions 897 \item Added \code{psImageBicube} functions 898 \item Added \code{psRegionIsBad} 899 \item Added \code{psRegionIsNaN} 900 \item Added \code{psSparse} functions. 901 902 \end{itemize} -
trunk/doc/pslib/psLibSDRS.tex
r6759 r6829 1 %%% $Id: psLibSDRS.tex,v 1.39 0 2006-04-04 03:29:03 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.391 2006-04-11 21:24:07 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 11 11 \project{Pan-STARRS Image Processing Pipeline} 12 12 \organization{Institute for Astronomy} 13 \version{ 19}13 \version{20} 14 14 \docnumber{PSDC-430-007} 15 15 … … 50 50 17 & 2005 Oct 18 & draft for cycle 9 \\ \hline 51 51 18 & 2005 Dec 06 & draft for cycle 10 \\ \hline 52 19 & 2005 Feb 21 & draft for cycle 11 \\ \hline 53 20 & 2005 Apr 11 & draft for cycle 12 \\ \hline 52 54 \RevisionsEnd 53 55 … … 906 908 similarly, except it shall prepend to the \code{dest} string. 907 909 908 A further useful function is: 910 Other string manipulation functions are listed below. 909 911 910 912 \begin{prototype} … … 916 918 one of the characters in \code{splitters}. Split strings of zero 917 919 length should not be included in the output list. 920 921 String whitespace from head and tail of string: 922 \begin{prototype} 923 int psStringStrip (char *string); 924 \end{prototype} 925 926 \subsubsection{Fixed-Length Lines} 927 928 We define the \code{psLine} structure to carry a pre-allocated block 929 to store a character string. The interfaces are similar to 930 \code{psString}, but allow for the container to be allocated initially 931 upfront with a specified length. They are used to force a 932 fixed-length line. 933 934 \begin{datatype} 935 // structure to carry a dynamic string 936 typedef struct { 937 int NLINE; // allocated length 938 int Nline; // current lenght 939 char *line; // character string data 940 } psLine; 941 \end{datatype} 942 943 The following function allocates a line object of length Nline. 944 \begin{prototype} 945 psLine *psLineAlloc (int Nline); 946 \end{prototype} 947 948 The following function initializes or re-initializes the line, setting 949 the current length to zero and setting the string data values to 0. 950 If the function is passed \code{NULL}, the function returns \code{false}. 951 \begin{prototype} 952 bool psLineInit (psLine *line); 953 \end{prototype} 954 955 The following function appends a line segment to the string, returning 956 \code{false} if the new segment would overflow the allocated string 957 length. 958 \begin{prototype} 959 bool psLineAdd (psLine *line, char *format, ...); 960 \end{prototype} 918 961 919 962 \subsubsection{Type information} … … 2852 2895 \end{prototype} 2853 2896 2897 The following utility functions simplify further the selection of 2898 elements from the metadata. These functions convert the data 2899 associated with the supplied metadata item to the desired type if 2900 possible. Conversions between types are performed as needed, and 2901 default values are returned for the integer and floating point types 2902 if the data is not available (0 for int, \code{NaN} for float). 2903 2904 \begin{prototype} 2905 psF32 psMetadataItemParseF32(psMetadataItem *item); 2906 psF64 psMetadataItemParseF64(psMetadataItem *item); 2907 psS32 psMetadataItemParseS32(psMetadataItem *item); 2908 psString psMetadataItemParseString(psMetadataItem *item); 2909 \end{prototype} 2910 2911 2854 2912 Items may be retrieved from the metadata by their entry position. The 2855 2913 value of which specifies the desired entry in the fashion of … … 2899 2957 \end{prototype} 2900 2958 2959 A complete metadata structure may be printed to the given file 2960 descriptor with the following command, where the level represents the 2961 desired indentation 2962 \begin{prototype} 2963 bool psMetadataPrint(FILE *fd, const psMetadata *md, int level); 2964 \end{prototype} 2965 2901 2966 There will be occasions when we want to perform a deep copy of a 2902 2967 \code{psMetadata}, for example, to generate a new and independent FITS … … 2917 2982 the \code{out} metadata, or a new \code{psMetadata} if \code{out} is 2918 2983 \code{NULL}. 2984 2985 The following functio copies a single metadata item from one 2986 psMetadata to another: 2987 \begin{prototype} 2988 bool psMetadataItemTransfer (psMetadata *out, // Destination: copy is placed here 2989 psMetadata *in, // Source: item comes from here 2990 char *key // key to identify the metadata item 2991 ); 2992 \end{prototype} 2919 2993 2920 2994 \subsubsection{Configuration files} … … 3719 3793 The width of the square is thus \code{2radius + 1}. 3720 3794 3795 The following fucntions provide tests of the validity of 3796 \code{regions} 3797 \begin{prototype} 3798 bool psRegionIsBad(psRegion region); 3799 bool psRegionIsNaN (psRegion region); 3800 \end{prototype} 3801 3721 3802 \pagebreak 3722 3803 … … 4132 4213 Write metadata into the header of a FITS image file. The header is 4133 4214 written at the current HDU. 4215 4216 \begin{prototype} 4217 bool psFitsWriteHeaderNotImage(psFits *fits, const psMetadata *header); 4218 \end{prototype} 4219 This function creates a header for a 0 length image. The resulting 4220 header shall have \code{NAXIS = 0}. Any \code{NAXISi} elements 4221 present in the header shall be maintained as reference data. 4134 4222 4135 4223 \begin{prototype} … … 5200 5288 place. 5201 5289 5290 The following function flips the given image in the x and/or y 5291 direction. Note that a request for both an x and a y flip is 5292 identical to a 180\degree\ rotation. 5293 \begin{prototype} 5294 psImage *psImageFlip(psImage *image, // Image to flip 5295 bool xFlip, 5296 bool yFlip); 5297 \end{prototype} 5298 5202 5299 \subsubsection{Image Pixel Extractions} 5203 5300 … … 5251 5348 subimage, the \code{region} argument refers to parent coordinates. 5252 5349 5253 The input region is collapsed in the direction perpendicular to that 5350 The pixel region defined by the coordinate pair \code{start} \& 5351 \code{stop} is collapsed in the direction perpendicular to that 5254 5352 specified by \code{direction}, and each element of the output vectors 5255 5353 is derived from the statistics of the pixels at that direction … … 5258 5356 for which the corresponding \code{mask} pixel matches \code{maskVal} 5259 5357 are excluded from operations. If \code{coords} is not \code{NULL}, 5260 the calculated coordinates along the slice are returned in this 5261 arrayof pixels. Only one of the statistics choices may be specified,5358 the calculated coordinates along the slice are returned in this array 5359 of pixels. Only one of the statistics choices may be specified, 5262 5360 otherwise the function must return an error. This function must be 5263 5361 defined for the following types: \code{psS8}, \code{psU16}, … … 5271 5369 const psImage *mask, 5272 5370 psMaskType maskVal, 5273 psRegion region, 5371 psPlane *start, 5372 psPlane *stop, 5274 5373 unsigned int nSamples, 5275 5374 psImageInterpolateMode mode); … … 5592 5691 datatype. The return value shall be the number of pixels overlaid. 5593 5692 5693 \subsubsection{Image Local Bicube} 5694 5695 The following functions provide interpolations of image data values 5696 based on bicubic interpolation. 5697 5698 This function fits a 2D 2nd order polynomial to the 9 pixels centered 5699 on the coordinate x,y. 5700 \begin{prototype} 5701 psPolynomial2D *psImageBicubeFit (psImage *image, int x, int y); 5702 \end{prototype} 5703 5704 This function detemines the min (or max) of the special 2D 2nd order 5705 polynomial representing the fit to 9 pixels of an image. 5706 \begin{prototype} 5707 psPlane psImageBicubeMin (psPolynomial2D *poly); 5708 \end{prototype} 5709 5710 \subsubsection{JPEG operations} 5711 5712 The following functions and structures are used to convert an image in 5713 memory to a output JPEG file. These functions allow the user to 5714 define a color map (from a list of predefined color maps) and to 5715 define the dynamic range of the translation from data values to JPEG 5716 color values. 5717 5718 The representation of a JPEG colormap is given by the following structure: 5719 \begin{datatype} 5720 typedef struct { 5721 psString name; 5722 psVector *red; 5723 psVector *green; 5724 psVector *blue; 5725 } psImageJpegColormap; 5726 \end{datatype} 5727 The colormap is just a translation from a \code{psImage} data value to 5728 a JPEG image data value. The colormap may be used to construct either 5729 single channel or multichannel images. 5730 5731 The following function allocates, but does not specify, a JPEG colormap: 5732 \begin{prototype} 5733 psImageJpegColormap *psImageJpegColormapAlloc (); 5734 \end{prototype} 5735 5736 The following function sets the colormap values based on the named 5737 colormap. Currently defined colormaps have the names \code{greyscale} 5738 (or \code{grayscale}), \code{-grayscale} (or \code{-greyscale}), 5739 \code{rainbow}, \code{heat}. 5740 \begin{prototype} 5741 psImageJpegColormap *psImageJpegColormapSet (psImageJpegColormap *map, char *name); 5742 \end{prototype} 5743 5744 The following function writes out the specified image as a JPEG file 5745 using the supplied colormap. The output goes to the specified 5746 filename. This function performs a single-channel JPEG conversion 5747 (the values of the single image determine the colors). 5748 \begin{prototype} 5749 bool psImageJpeg (psImageJpegColormap *map, psImage *image, char *filename, float min, float max); 5750 \end{prototype} 5751 5594 5752 \subsubsection{Mask operations} 5595 5753 … … 5852 6010 \end{prototype} 5853 6011 6012 \subsubsection{Sparse Matrices} 6013 6014 Very large matrices (N elements $> 1000$) can be very time consuming 6015 to manipulate. A certain class of matrices, sparse matrices, are 6016 amenable to iterative solutions even when extremely large (100,000s of 6017 elements). The following functions define structures to efficiently 6018 represent sparse matricies, to add elements to those matrices, and to 6019 perform linear algebra with them. 6020 6021 \begin{datatype} 6022 typedef struct { 6023 psVector *Aij; 6024 psVector *Bfj; 6025 psVector *Qii; 6026 psVector *Si; 6027 psVector *Sj; 6028 int Nelem; 6029 int Nrows; 6030 } psSparse; 6031 \end{datatype} 6032 6033 The above structure contains the following elements, describing a 6034 sparse matrix equation of the form $A \bar{x} = \bar{Bf}$: 6035 \begin{itemize} 6036 \item the vector \code{Aij} contains the populated elements of the matrix 6037 \item the vector \code{Bfj} contains the elements of the vector Bf 6038 \item the vector \code{Qii} contains the diagonal elements of Aij 6039 \item the vector \code{Si} contains the i-index values of Aij 6040 \item the vector \code{Sj} contains the j-index values of Aij 6041 \item the element \code{Nelem} defines the total number of elements in 6042 matrix \code{Aij} 6043 \item the element \code{Nrows} defines the size of the matrix \code{Aij} 6044 \end{itemize} 6045 6046 The following structure defines constraints to limit the range of the 6047 value matrix equation solution: 6048 \begin{datatype} 6049 typedef struct { 6050 double paramDelta; 6051 double paramMin; 6052 double paramMax; 6053 } psSparseConstraint; 6054 \end{datatype} 6055 6056 The following function allocates a sparse matrix structure: 6057 \begin{prototype} 6058 psSparse *psSparseAlloc (int Nrows, int Nelem); 6059 \end{prototype} 6060 6061 The following function adds a new matrix element. The user should 6062 only add elements above the diagonal. 6063 \begin{prototype} 6064 void psSparseMatrixElement (psSparse *sparse, int i, int j, float value); 6065 \end{prototype} 6066 6067 The following function define a new sparse matrix equation vector element: 6068 \begin{prototype} 6069 void psSparseVectorElement (psSparse *sparse, int i, float value); 6070 \end{prototype} 6071 6072 The following function performs the operation ``matrix times vector'' 6073 on a sparse matrix and a vector: 6074 \begin{prototype} 6075 psVector *psSparseMatrixTimesVector (psVector *output, psSparse *matrix, psVector *vector); 6076 \end{prototype} 6077 6078 The following function re-sorts a sparse matrix to have all elements 6079 in index order rather than insertion order. The user must call this 6080 function before attempting to solve, but after populating, the matrix and vector: 6081 \begin{prototype} 6082 void psSparseResort (psSparse *sparse); 6083 \end{prototype} 6084 6085 The following function iteratively solves the equation $A \bar{x} = 6086 \bar{Bf}$. For the value of $\bar{x}$, a good starting guess is the vector $\bar{Bf}$ 6087 \begin{prototype} 6088 psVector *psSparseSolve (psVector *guess, psSparseConstraint constraint, psSparse *sparse, int Niter); 6089 \end{prototype} 6090 5854 6091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5855 6092 … … 6109 6346 Poisson distribution with the given \code{mean} using 6110 6347 \code{gsl_ran_poisson}. 6348 6349 \subsection{Ellipse Shape Functions} 6350 6351 Astronomical objects are frequently decomposed into components 6352 represented by a radial function modified by an elliptical contour. 6353 There are a few ways in which the elliptical shape information can be 6354 represented depending on the circumstance in which it is used. The 6355 structures and functions in the section provide tools for converting 6356 between the elliptical representations. We provide three structures 6357 representing three ways in which the elliptical shape is represented. 6358 Like the \code{psRegion}, these datatypes and their supporting 6359 functions do not use allocators. 6360 6361 This structure represents an ellipse by its major and minor axis 6362 lengths and the orientation angle. 6363 \begin{datatype} 6364 typedef struct { 6365 double major; 6366 double minor; 6367 double theta; 6368 } psEllipseAxes; 6369 \end{datatype} 6370 6371 This structure represents an elliptical Gaussian by the second moments 6372 measured for that Gaussian. 6373 \begin{datatype} 6374 typedef struct { 6375 double x2; 6376 double y2; 6377 double xy; 6378 } psEllipseMoments; 6379 \end{datatype} 6380 6381 This structure represents an ellipse by the components of the 6382 cartesian coordiante equation: $(s_x x)^2 + (s_y y)^2 + s_{x,y} x y = 6383 R$ 6384 \begin{datatype} 6385 typedef struct { 6386 double sx; 6387 double sy; 6388 double sxy; 6389 } psEllipseShape; 6390 \end{datatype} 6391 6392 The following functions provide conversions between the elliptical 6393 shape representations: 6394 6395 \begin{prototype} 6396 psEllipseAxes psEllipseMomentsToAxes (psEllipseMoments moments); 6397 psEllipseShape psEllipseAxesToShape (psEllipseAxes axes); 6398 psEllipseAxes psEllipseShapeToAxes (psEllipseShape shape); 6399 \end{prototype} 6111 6400 6112 6401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
