Changeset 3155
- Timestamp:
- Feb 7, 2005, 6:56:24 PM (21 years ago)
- Location:
- trunk/doc
- Files:
-
- 4 edited
-
modules/ChangeLogSDRS.tex (modified) (2 diffs)
-
modules/ModulesSDRS.tex (modified) (16 diffs)
-
pslib/ChangeLogSDRS.tex (modified) (2 diffs)
-
pslib/psLibSDRS.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/ChangeLogSDRS.tex
r3074 r3155 1 %%% $Id: ChangeLogSDRS.tex,v 1.1 2 2005-01-24 21:56:28 price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.13 2005-02-08 04:56:24 eugene Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 42 42 43 43 \begin{itemize} 44 \item changed entries of the form psXXX to pmXXX (object section) 45 \item added enum psSourceType 44 46 \item Specified appropriate image types for the phase 2 modules (bug 258). 45 47 \end{itemize} -
trunk/doc/modules/ModulesSDRS.tex
r3074 r3155 1 %%% $Id: ModulesSDRS.tex,v 1. 29 2005-01-24 21:56:33 price Exp $1 %%% $Id: ModulesSDRS.tex,v 1.30 2005-02-08 04:56:24 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1103 1103 \begin{verbatim} 1104 1104 typedef struct { 1105 p sPeak *peak; // description of peak pixel1105 pmPeak *peak; // description of peak pixel 1106 1106 psImage *pixels; // rectangular region including object pixels 1107 1107 psImage *mask; // mask to mark pixels associated with object in region 1108 p sMoments *moments; // basic moments measure for the object1109 p sModel *models; // model parameters and type1110 p sSourceType type; // best identification of object1111 } p sSource;1108 pmMoments *moments; // basic moments measure for the object 1109 pmModel *models; // model parameters and type 1110 pmSourceType type; // best identification of object 1111 } pmSource; 1112 1112 \end{verbatim} 1113 1113 … … 1120 1120 int y; // y-coordinate of peak pixel 1121 1121 float counts; // value of peak pixel (above sky?) 1122 p sPeakType class; // description of peak1123 } p sPeak;1122 pmPeakType class; // description of peak 1123 } pmPeak; 1124 1124 \end{verbatim} 1125 1125 1126 1126 A peak pixel may have several features which may be determined when 1127 1127 the peak is found or measured. These are specified by the 1128 \code{p sPeakType} enum. \code{PS_PEAK_LONE} represents a single pixel1128 \code{pmPeakType} enum. \code{PM_PEAK_LONE} represents a single pixel 1129 1129 which is higher than its 8 immediate neighbors. The 1130 \code{P S_PEAK_EDGE} represents a peak pixel which touching the image1131 edge. The \code{P S_PEAK_FLAT} represents a peak pixel which has more1130 \code{PM_PEAK_EDGE} represents a peak pixel which touching the image 1131 edge. The \code{PM_PEAK_FLAT} represents a peak pixel which has more 1132 1132 than a specific number of neighbors at the same value, within some 1133 1133 tolarence: 1134 1134 \begin{verbatim} 1135 1135 typedef enum { 1136 P S_PEAK_LONE; // isolated peak1137 P S_PEAK_EDGE; // peak on edge1138 P S_PEAK_FLAT; // peak has equal-value neighbors1139 } p sPeakType;1136 PM_PEAK_LONE; // isolated peak 1137 PM_PEAK_EDGE; // peak on edge 1138 PM_PEAK_FLAT; // peak has equal-value neighbors 1139 } pmPeakType; 1140 1140 \end{verbatim} 1141 1141 … … 1162 1162 float Sky; // sky level (background) 1163 1163 int nPixels; // number of pixels used 1164 } p sMoments;1164 } pmMoments; 1165 1165 \end{verbatim} 1166 1166 … … 1168 1168 function. The description of the model includes the model parameters 1169 1169 and their errors, along with the fit $\chi^2$. The model type is 1170 specified by the enum \code{p sObjectModel}, specified below. We1170 specified by the enum \code{pmObjectModel}, specified below. We 1171 1171 discuss the details of these models in section~\ref{ObjectModels}. 1172 1172 1173 1173 \begin{verbatim} 1174 1174 typedef struct { 1175 p sObjectModel type; // model to be used1175 pmObjectModel type; // model to be used 1176 1176 int Nparams; // number of parameters 1177 1177 float *params; // parameter values 1178 1178 float *dparams; // parameter errors 1179 1179 float chisq; // fit chisq 1180 } p sModel;1180 } pmModel; 1181 1181 \end{verbatim} 1182 1182 1183 1183 \begin{verbatim} 1184 1184 typedef enum { 1185 PS_MODEL_GAUSS; 1186 PS_MODEL_PGAUSS; 1187 PS_MODEL_TWIST_GAUSS; 1188 PS_MODEL_WAUSS; 1189 PS_MODEL_SERSIC; 1190 PS_MODEL_SERSIC_CORE; 1191 } psModelType; 1185 PM_MODEL_GAUSS; 1186 PM_MODEL_PGAUSS; 1187 PM_MODEL_TWIST_GAUSS; 1188 PM_MODEL_WAUSS; 1189 PM_MODEL_SERSIC; 1190 PM_MODEL_SERSIC_CORE; 1191 } pmModelType; 1192 \end{verbatim} 1193 1194 A given source may be identified as most-likey to be one of several 1195 source types. The \code{pmSource} entry \code{pmSourceType} defines 1196 the current best-guess for this source. \tbd{The values given below 1197 are currently illustrative and will require some modification as the 1198 source classification code is developed.} 1199 1200 \begin{verbatim} 1201 typedef enum { 1202 PM_SOURCE_PSFSTAR; 1203 PM_SOURCE_GALAXY; 1204 PM_SOURCE_DEFECT; 1205 PM_SOURCE_SATSTAR; 1206 PM_SOURCE_FAINTSTAR; 1207 PM_SOURCE_BRIGHTSTAR; 1208 } pmSourceType; 1192 1209 \end{verbatim} 1193 1210 … … 1233 1250 making flat-topped regions have single peaks at the (+x,+y) corner. 1234 1251 When selecting the peaks, their type must also be set. The result of 1235 this function is a list of \code{p sPeak} entries.1252 this function is a list of \code{pmPeak} entries. 1236 1253 1237 1254 \tbd{do we need a function psVector *psImageRowVector (psImage *image, int row);} … … 1248 1265 1249 1266 \begin{verbatim} 1250 p sSource *pmSourceLocalSky(const psImage *image, const psPeak *peak, float inner_radius, float outer_radius),1267 pmSource *pmSourceLocalSky(const psImage *image, const pmPeak *peak, float inner_radius, float outer_radius), 1251 1268 \end{verbatim} 1252 1269 … … 1255 1272 specified are used to measure the median \tbd{(clipped mean?) 1256 1273 (statistic from psStats?)} in the vicinity of the the specified peak 1257 coordinates. The resulting sky is applied to the \code{p sMoments}1258 element of the allocated \code{p sSource} structure. The input1259 \code{peak} is also added to the \code{p sSource} element, which is1274 coordinates. The resulting sky is applied to the \code{pmMoments} 1275 element of the allocated \code{pmSource} structure. The input 1276 \code{peak} is also added to the \code{pmSource} element, which is 1260 1277 returned. 1261 1278 1262 1279 \begin{verbatim} 1263 p sSource *pmSourceMoments(psSource *source, const psImage *image, float radius),1280 pmSource *pmSourceMoments(pmSource *source, const psImage *image, float radius), 1264 1281 \end{verbatim} 1265 1282 … … 1271 1288 1272 1289 \begin{verbatim} 1273 p sSource *pmSourceRoughClass(psSource *source, float saturate, float SNlim, const psRegion *valid);1290 pmSource *pmSourceRoughClass(pmSource *source, float saturate, float SNlim, const psRegion *valid); 1274 1291 \end{verbatim} 1275 1292 … … 1303 1320 1304 1321 \begin{verbatim} 1305 bool pmSourceSetPixelsCircle(p sSource *source, const psImage *image, float radius);1322 bool pmSourceSetPixelsCircle(pmSource *source, const psImage *image, float radius); 1306 1323 \end{verbatim} 1307 1324 … … 1314 1331 1315 1332 \begin{verbatim} 1316 bool pmSourceModelGuess(p sSource *source, const psImage *image);1333 bool pmSourceModelGuess(pmSource *source, const psImage *image); 1317 1334 \end{verbatim} 1318 1335 … … 1323 1340 1324 1341 \begin{verbatim} 1325 psArray *pmSourceContour(const p sSource *source, const psImage *image, float level, int mode);1342 psArray *pmSourceContour(const pmSource *source, const psImage *image, float level, int mode); 1326 1343 \end{verbatim} 1327 1344 1328 1345 Find points in a contour for the given source at the given level. If 1329 mode is \code{P S_CONTOUR_CRUDE}, the contour is found by starting at1346 mode is \code{PM_CONTOUR_CRUDE}, the contour is found by starting at 1330 1347 the source peak, running along each pixel row until the level is 1331 1348 crossed, then interpolating to the level coordinate for that row. … … 1339 1356 1340 1357 \begin{verbatim} 1341 bool pmSourceFitModel(p sSource *source, psImage *image);1358 bool pmSourceFitModel(pmSource *source, psImage *image); 1342 1359 \end{verbatim} 1343 1360 … … 1350 1367 1351 1368 \begin{verbatim} 1352 bool pmSourceAddModel(psImage *image, p sSource *source, bool center);1369 bool pmSourceAddModel(psImage *image, pmSource *source, bool center); 1353 1370 \end{verbatim} 1354 1371 … … 1360 1377 1361 1378 \begin{verbatim} 1362 bool pmSourceSubModel(p sSource *source);1379 bool pmSourceSubModel(pmSource *source); 1363 1380 \end{verbatim} 1364 1381 … … 1388 1405 1389 1406 \begin{verbatim} 1390 float p sMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x);1407 float pmMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x); 1391 1408 \end{verbatim} 1392 1409 -
trunk/doc/pslib/ChangeLogSDRS.tex
r3093 r3155 1 %%% $Id: ChangeLogSDRS.tex,v 1.6 1 2005-01-26 00:04:52 price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.62 2005-02-08 04:56:24 eugene Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 446 446 \item Added \code{region} and \code{nSamples} to 447 447 \code{psPlaneTransformCombine} and specified the algorithm. 448 \end{itemize} 448 \item re-added psMetadata iterators, modified the APIs somewhat 449 \item added the mode entry to psMetadataAddItem 450 \item clarified the 'format' entry in psMetadataAdd 451 \item added the function psMetadataAddV 452 \item added the option flags \code{psMetadataFlags} 453 \end{itemize} -
trunk/doc/pslib/psLibSDRS.tex
r3106 r3155 1 %%% $Id: psLibSDRS.tex,v 1.17 3 2005-01-28 21:37:57 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.174 2005-02-08 04:56:24 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 3901 3901 \code{psMetadataItem} ready for insertion into the \code{psMetadata}. 3902 3902 The \code{name} entry specifies the name to use for this metadata 3903 item, and may include \code{sprintf}-stype formating codes. The 3904 \code{format} entry, which specifies both the metadata type and the 3905 optional flags, is constructed by bit-wise or'ing the appropriate type 3906 and flag. The \code{comment} entry is a fixed string which is used 3907 for the comment associated with this metadata item. The metadata data 3908 and the arguments to the \code{name} formatting codes are passed, in 3909 that order (metadata pointer first), to \code{psMetadataItemAlloc} as 3903 item, and may include \code{sprintf}-type formating codes. The 3904 \code{comment} entry is a fixed string which is used for the comment 3905 associated with this metadata item. The metadata data and the 3906 arguments to the \code{name} formatting codes are passed, in that 3907 order (metadata pointer first), to \code{psMetadataItemAlloc} as 3910 3908 arguments following the comment string. The data must be a pointer 3911 3909 for any data types which are stored in the element \code{data.void}, … … 3915 3913 \begin{verbatim} 3916 3914 psMetadataItem *psMetadataItemAlloc(const char *name, psMetadataType type, const char *comment, ...); 3917 psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, 3918 const char *comment, va_list list); 3915 psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, const char *comment, va_list list); 3919 3916 \end{verbatim} 3920 3917 … … 3933 3930 (\code{true}) or failure of the operation. The second function, 3934 3931 \code{psMetadataAdd} takes a pointer or value which is interpreted by 3935 the function using variadic argument interpretation. Both functions 3936 take an parameter \code{location} which specifies where in the list to 3937 place the element, following the conventions for the \code{psList}. 3938 Care should be taken not to leak memory when appending an item for 3939 which the key already exists in the metadata (and is not 3940 \code{PS_META_LIST}). 3941 % 3942 \begin{verbatim} 3943 bool psMetadataAddItem(psMetadata *md, psMetadataItem *item, int location); 3932 the function using variadic argument interpretation. The third 3933 version is the \code{va_list} version of the second function. All 3934 three functions take a parameter, \code{location}, which specifies 3935 where in the list to place the element, following the conventions for 3936 the \code{psList}. The entry \code{mode} for \code{psMetadataAddItem} 3937 is a bit mask constructed by OR-ing the allowed option flags (eg, 3938 PS_META_REPLACE) which specifies minor variations on the behavior. 3939 The \code{format} entry, which specifies both the metadata type and 3940 the optional flags, is constructed by bit-wise OR-ing the appropriate 3941 \code{psMetadataType} and allowed option option flags. Care should be 3942 taken not to leak memory when appending an item for which the key 3943 already exists in the metadata (and is not \code{PS_META_LIST}). 3944 % 3945 \begin{verbatim} 3946 bool psMetadataAddItem(psMetadata *md, psMetadataItem *item, int location, int mode); 3944 3947 bool psMetadataAdd(psMetadata *md, int location, const char *name, int format, const char *comment, ...); 3948 bool psMetadataAddV(psMetadata *md, int location, const char *name, int format, const char *comment, ...); 3949 \end{verbatim} 3950 3951 The functions above take option flags which modify the behavior when 3952 metadata items are added to the metadata list. These flags must be 3953 bit-exclusive of those used above for the \code{psMetadataTypes}. The 3954 flags have the following meanings: 3955 3956 \code{PS_META_DEFAULT}: This is the zero bit mask, to allow the 3957 default behavior for \code{psMetadataAddItem} above. If this is OR-ed 3958 with a \code{psMetadataType}, the result is as if no OR-ing took 3959 place. 3960 3961 \code{PS_META_REPLACE}: If the given metadata item exists in the 3962 metadata list, and is not of type \code{PS_META_LIST} or 3963 \code{PS_META_META} (ie, not a container type), then this entry is 3964 allowed to replace the existing entry. If this mode bit is not set, a 3965 duplicate (non-container-type) entry is an error. 3966 3967 \begin{verbatim} 3968 typedef enum { ///< option flags for psMetadata functions 3969 PS_META_DEFAULT, ///< default behavior (0x0000) for use in mode above 3970 PS_META_REPLACE, ///< allow entry to be replaced 3971 } psMetadataFlags; 3972 \end{verbatim} 3973 3974 An example of code to use these metadata APIs to generate the 3975 structure seen in Figure~\ref{fig:metadata} is given below. 3976 3977 \begin{verbatim} 3978 md = psMetadataAlloc(); 3979 3980 psMetadataAdd(md, PS_LIST_TAIL, "SIMPLE", PS_META_BOOL, "basic fits", TRUE); 3981 psMetadataAdd(md, PS_LIST_TAIL, "BLANK", PS_META_S32, "invalid pixel data", -32768); 3982 psMetadataAdd(md, PS_LIST_TAIL, "DATE-OBS", PS_META_STR, "observing date UT", " 2004-6-16"); 3983 psMetadataAdd(md, PS_LIST_TAIL, "COMMENT", PS_META_LIST, "head of comment block", NULL); 3984 psMetadataAdd(md, PS_LIST_TAIL, "COMMENT", PS_META_STR, "", "DATA"); 3985 psMetadataAdd(md, PS_LIST_TAIL, "COMMENT", PS_META_STR, "", "PARAMS"); 3986 psMetadataAdd(md, PS_LIST_TAIL, "EXPTIME", PS_META_F32, "exposure time (sec)", 1.05); 3987 psMetadataAdd(md, PS_LIST_TAIL, "COMMENT", PS_META_STR, "", "FOO"); 3988 3989 cell = psMetadataAlloc(); 3990 psMetadataAdd(cell, PS_LIST_TAIL, "EXTNAME", PS_META_STR, "", "CCD00"); 3991 psMetadataAdd(cell, PS_LIST_TAIL, "BIASNAME", PS_META_STR, "", "BSEC-00"); 3992 psMetadataAdd(cell, PS_LIST_TAIL, "CHIP", PS_META_STR, "", "CHIP.00"); 3993 psMetadataAdd(md, PS_LIST_TAIL, "CELL.00", PS_META_META, "", cell); 3994 3995 cell = psMetadataAlloc(); 3996 psMetadataAdd(cell, PS_LIST_TAIL, "EXTNAME", PS_META_STR, "", "CCD01"); 3997 psMetadataAdd(cell, PS_LIST_TAIL, "BIASNAME", PS_META_STR, "", "BSEC-01"); 3998 psMetadataAdd(cell, PS_LIST_TAIL, "CHIP", PS_META_STR, "", "CHIP.01"); 3999 psMetadataAdd(md, PS_LIST_TAIL, "CELL.01", PS_META_META, "", cell); 4000 \end{verbatim} 4001 4002 The following code shows how to use the APIs to replace one of these values: 4003 \begin{verbatim} 4004 psMetadataAdd(md, PS_LIST_TAIL, "EXPTIME", PS_META_F32 | PS_REPLACE, "new exposure time (sec)", 2.05); 3945 4005 \end{verbatim} 3946 4006 … … 3983 4043 \end{verbatim} 3984 4044 3985 The metadata may be iterated over by (re-)setting a particular 3986 \code{iterator}, to a location in the \code{psMetadata} list, and 3987 getting the previous or next item. \code{psMetadataGetNext} has the 3988 ability to match the beginning of a key, e.g., if the user only wants 3989 to iterate through \code{IPP.machines.sky} and doesn't want to bother 3990 with \code{IPP.machines.detector}. The iterator should iterate over 3991 every item of metadata --- even those that are non-unique. The value 3992 \code{iterator} specifies the iterator to be used. In setting the 3993 iterator, the position of the iterator is defined by \code{location}, 3994 which follows the conventions of the \code{psList} iterators. 3995 \begin{verbatim} 3996 bool psMetadataSetIterator(psMetadata *md, int iterator, int location); 3997 psMetadataItem *psMetadataGetNext(psMetadata *md, const char *match, int iterator); 3998 psMetadataItem *psMetadataGetPrevious(psMetadata *md, const char *match, int iterator); 4045 The metadata list component may be iterated over by using a 4046 \code{psListIterator} in a fashion equivalent to the usage for 4047 \code{psList}. The iterator may be set to a location in the 4048 \code{psMetadata} list, and the user may get the previous or next item 4049 in the list relative to that location. \code{psMetadataGetNext} has 4050 the ability to match the key using a POSIX regex, e.g., if the user 4051 only wants to iterate through \code{IPP.machines.sky} and doesn't want 4052 to bother with \code{IPP.machines.detector}. The iterator should 4053 iterate over every item in the metadata list, even those that are 4054 contained in a \code{PS_META_LIST}. The value \code{iterator} 4055 specifies the iterator to be used. In setting the iterator, the 4056 position of the iterator is defined by \code{location}, which follows 4057 the conventions of the \code{psList} iterators. 4058 \begin{verbatim} 4059 psListIterator *psMetadataIteratorAlloc(psMetadata *md, int location, bool mutable); 4060 bool psMetadataIteratorSet(psListIterator *iterator, int location); 4061 psMetadataItem *psMetadataGetAndIncrement(psListIterator *iterator, const char *regex); 4062 psMetadataItem *psMetadataGetAndDecrement(psListIterator *iterator, const char *regex); 3999 4063 \end{verbatim} 4000 4064
Note:
See TracChangeset
for help on using the changeset viewer.
