Changeset 922
- Timestamp:
- Jun 8, 2004, 9:38:45 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r842 r922 1 %%% $Id: psLibSDRS.tex,v 1.5 0 2004-06-03 03:14:54eugene Exp $1 %%% $Id: psLibSDRS.tex,v 1.51 2004-06-08 19:38:45 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 362 362 The callback functions are defined in terms of specific callback 363 363 types, specified below. The callbacks are set using functions with 364 names of the form \code{psCallbackSet}. In all cases, the 365 `\code{Set}' routine takes a pointer to the desired callback function 366 and returns a pointer to the one that was previously installed. The 367 defaults for each of these callbacks is \code{NULL}, in which case the 368 corresponding callback is skipped. If the function pointer passed to 369 the functions above is \code{NULL}, the default behavior is set. We 370 discuss the use of each of the four callbacks below. 364 names of the form \code{psCallbackSet}. In all cases, the \code{Set} 365 routine takes a pointer to the desired callback function and returns a 366 pointer to the one that was previously installed. The default 367 functions for each of these callbacks is listed below: 368 % 369 \begin{itemize} 370 \item \code{psMemExhaustedCallbackDefault} 371 \item \code{psMemProblemCallbackDefault} 372 \item \code{psMemAllocateCallbackDefault} 373 \item \code{psMemFreeCallbackDefault} 374 \end{itemize} 375 % 376 and have the behavior of immediately returning \code{NULL}, as if the 377 callback had been skipped. If the function pointer passed to the 378 functions above is \code{NULL}, the callback must be reset to the 379 default callback function. The named default callbacks may be used in 380 within a debugger to catch these conditions by breaking when the 381 functions are called. We discuss the use of each of the four 382 callbacks below. 371 383 372 384 \subsubsubsection{\tt psMemExhaustedCallback} … … 1014 1026 \subsection{Abort} 1015 1027 1016 \code{psAbort}, must call \code{ps MsgLog} with a1017 level of\code{PS_LOG_ABORT}, and then call \code{abort}.1028 \code{psAbort}, must call \code{psLogMsgV} with a level of 1029 \code{PS_LOG_ABORT}, and then call \code{abort}. 1018 1030 1019 1031 \begin{verbatim} … … 1232 1244 1233 1245 \subsection{Doubly-linked lists} 1234 \label{sec:ps Dlist}1235 1236 \PS{} supports doubly linked lists through a type \code{ps Dlist}:1246 \label{sec:psList} 1247 1248 \PS{} supports doubly linked lists through a type \code{psList}: 1237 1249 % 1238 1250 \begin{verbatim} 1239 1251 typedef struct { 1240 1252 int n; ///< number of elements on list 1241 ps DlistElem *head; ///< first element on list (may be NULL)1242 ps DlistElem *tail; ///< last element on list (may be NULL)1243 ps DlistElem *iter; ///< iteration cursor1244 } ps Dlist;1245 \end{verbatim} 1246 % 1247 The type \code{ps Dlist} represents the container of the list. It has1253 psListElem *head; ///< first element on list (may be NULL) 1254 psListElem *tail; ///< last element on list (may be NULL) 1255 psListElem *iter; ///< iteration cursor 1256 } psList; 1257 \end{verbatim} 1258 % 1259 The type \code{psList} represents the container of the list. It has 1248 1260 a pointer to the first element in the linked list (\code{head}), a 1249 1261 pointer to the last element in the list (\code{tail}), an entry for … … 1251 1263 number of elements in the list (\code{n}). 1252 1264 1253 The elements of the list are defined by the type \code{ps DlistElem}:1254 % 1255 \begin{verbatim} 1256 typedef struct ps DlistElem {1257 struct ps DlistElem *prev; ///< previous link in list1258 struct ps DlistElem *next; ///< next link in list1265 The elements of the list are defined by the type \code{psListElem}: 1266 % 1267 \begin{verbatim} 1268 typedef struct psListElem { 1269 struct psListElem *prev; ///< previous link in list 1270 struct psListElem *next; ///< next link in list 1259 1271 void *data; ///< real data item 1260 } ps DlistElem;1272 } psListElem; 1261 1273 \end{verbatim} 1262 1274 % … … 1267 1279 1268 1280 \begin{verbatim} 1269 ps Dlist *psDlistAlloc(void *data);1281 psList *psListAlloc(void *data); 1270 1282 \end{verbatim} 1271 1283 Create a list. This function may take a pointer to a data item, or it 1272 may take \code{NULL}. The allocator creates both the \code{ps Dlist}1284 may take \code{NULL}. The allocator creates both the \code{psList} 1273 1285 and the first element in the list, pointed to by both 1274 \code{ps Dlist.head} and \code{psDlist.tail}. If the data entry is1286 \code{psList.head} and \code{psList.tail}. If the data entry is 1275 1287 \code{NULL}, then an empty list, with both pointers are set to 1276 1288 \code{NULL} should be created. 1277 1289 1278 1290 \begin{verbatim} 1279 ps Dlist *psDlistAdd(psDlist *list, void *data, int where);1291 psList *psListAdd(psList *list, void *data, int where); 1280 1292 \end{verbatim} 1281 1293 Add an entry to the list with this function, which takes a pointer to 1282 1294 the list and also returns a pointer to the list. The returned pointer 1283 must be used as the value of \code{ps Dlist} may have changed. The1295 must be used as the value of \code{psList} may have changed. The 1284 1296 value of \code{where} specifies if the specified data item should be 1285 1297 placed on the front of the list (\code{PS_DLIST_HEAD}), at the end of … … 1290 1302 1291 1303 \begin{verbatim} 1292 void *ps DlistGet(psDlist *list, int which);1304 void *psListGet(psList *list, int which); 1293 1305 \end{verbatim} 1294 1306 A data item may be retrieved from the list with this function. The … … 1300 1312 1301 1313 \begin{verbatim} 1302 void *ps DlistRemove(psDlist *list, void *data, int which);1314 void *psListRemove(psList *list, void *data, int which); 1303 1315 \end{verbatim} 1304 1316 A data item may be removed from the list with this function. The … … 1311 1323 *data}. 1312 1324 1313 All data items placed onto lists (\code{ps DlistAdd}) must have their1325 All data items placed onto lists (\code{psListAdd}) must have their 1314 1326 reference counters (section \ref{secMemRefcounter}) incremented. When 1315 elements are removed from a list with \code{ps DlistRemove}, they must1327 elements are removed from a list with \code{psListRemove}, they must 1316 1328 have their reference counters decremented. The action of retrieving 1317 data from a list (with \code{ps DlistGet}) must not affect their1329 data from a list (with \code{psListGet}) must not affect their 1318 1330 reference counter. 1319 1331 1320 1332 \begin{verbatim} 1321 void ps DlistFree(psDlist *list, void (*elemFree)(void *));1333 void psListFree(psList *list, void (*elemFree)(void *)); 1322 1334 \end{verbatim} 1323 1335 A complete list may be freed with this destructor. If the element … … 1327 1339 1328 1340 \begin{verbatim} 1329 psVector *ps DlistToVector(psDlist *dlist);1330 ps Dlist *psVectorToDlist(psVector *vector);1341 psVector *psListToVector(psList *dlist); 1342 psList *psVectorToDlist(psVector *vector); 1331 1343 \end{verbatim} 1332 1344 These two functions are available to convert between the 1333 \code{ps Dlist} and \code{psVector} containers. These functions do not1345 \code{psList} and \code{psVector} containers. These functions do not 1334 1346 free the elements or destroy the input collection. Rather, they 1335 1347 increment the reference counter for each of the elements. 1336 1348 1337 1349 \begin{verbatim} 1338 void ps DlistSetIterator(psDlist *list, int where, int which);1339 void *ps DlistGetNext(psDlist *list, int which);1340 void *ps DlistGetPrev(psDlist *list, int which);1350 void psListSetIterator(psList *list, int where, int which); 1351 void *psListGetNext(psList *list, int which); 1352 void *psListGetPrev(psList *list, int which); 1341 1353 \end{verbatim} 1342 1354 Iteration over all elements of the list using the iteration cursor … … 1348 1360 returning the data item from the resulting list entry, or returning 1349 1361 \code{NULL} at the end of the list. Explicit traversal of the list 1350 using the \code{ps DlistElem}s \code{prev} and \code{next} pointers is1362 using the \code{psListElem}s \code{prev} and \code{next} pointers is 1351 1363 also supported. 1352 1364 1353 1365 \begin{verbatim} 1354 ps Dlist *psDlistSort(psDlist *list, int (*compare)(const void *a, const void *b) );1355 \end{verbatim} 1356 A list may be sorted using \code{ps DlistSort}, which requires the1366 psList *psListSort(psList *list, int (*compare)(const void *a, const void *b) ); 1367 \end{verbatim} 1368 A list may be sorted using \code{psListSort}, which requires the 1357 1369 specification of a comparison function to specify how the objects on 1358 1370 the list should be sorted. The motivation is primarily to be able to … … 1449 1461 The function 1450 1462 \begin{verbatim} 1451 ps Dlist *psHashKeylist(psHast *table);1463 psList *psHashKeylist(psHast *table); 1452 1464 \end{verbatim} 1453 1465 returns the complete list of defined keys associated with the … … 1980 1992 is derived from the statistics of the pixels at that direction 1981 1993 coordinate. The statistic used to derive the output vector value is 1982 specified by \code{stats}. This function must be defined for the 1983 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 1994 specified by \code{stats}. Only one of the statistics choices may be 1995 specified, otherwise the function must return an error. This function 1996 must be defined for the following types: \code{psU8}, \code{psU16}, 1997 \code{psF32}, \code{psF64}. 1984 1998 1985 1999 \begin{verbatim} … … 1989 2003 \end{verbatim} 1990 2004 Extract pixels from an image along a line to a vector (array of 1991 floats). The vector \code{(xs,ys)} - \code{(xe,ye)} forms the basis of1992 the output vector. Pixels are considered in a rectangular region of 1993 width \code{dw} about this vector. The input region is collapsed in 1994 the perpendicular direction, and each element of the output vector2005 floats). The vector \code{(xs,ys)} - \code{(xe,ye)} forms the basis 2006 of the output vector. Pixels are considered in a rectangular region 2007 of width \code{dw} about this vector. The input region is collapsed 2008 in the perpendicular direction, and each element of the output vector 1995 2009 represents pixel-sized boxes, where the value is derived from the 1996 2010 statistics of the pixels interpolated along the perpendicular 1997 2011 direction. The statistic used to derive the output vector value is 1998 specified by \code{stats}. This function must be defined for the 1999 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64} 2012 specified by \code{stats}. Only one of the statistics choices may be 2013 specified, otherwise the function must return an error. This function 2014 must be defined for the following types: \code{psU8}, \code{psU16}, 2015 \code{psF32}, \code{psF64} 2000 2016 2001 2017 \begin{verbatim} … … 2008 2024 the image pixel coordinate \code{x,y}, and have width \code{dr}. The 2009 2025 number of annuli is $radius / dr$. The statistic used to derive the 2010 output vector value is specified by \code{stats}. This function must be defined for the 2011 following types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2026 output vector value is specified by \code{stats}. Only one of the 2027 statistics choices may be specified, otherwise the function must 2028 return an error. This function must be defined for the following 2029 types: \code{psU8}, \code{psU16}, \code{psF32}, \code{psF64}. 2012 2030 2013 2031 \subsubsection{Image Geometry Manipulation} … … 2023 2041 Each pixel in the output image is derived from the statistics of the 2024 2042 corresponding set of input image pixels based on the statistics 2025 specified by \code{stats}. This function must be defined for the 2026 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, 2027 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}. 2043 specified by \code{stats}. Only one of the statistics choices may be 2044 specified, otherwise the function must return an error. This function 2045 must be defined for the following types: \code{psU8}, \code{psU16}, 2046 \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, \code{psC32}, 2047 \code{psC64}. 2028 2048 2029 2049 \begin{verbatim} … … 2162 2182 \code{+Inf} or \code{-Inf} values are set to the specified value. 2163 2183 Returns the number of clipped pixels. This function must be defined 2164 for the following types: \code{ps U8}, \code{psU16}, \code{psS8},2165 \code{ps S16}, \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.2184 for the following types: \code{psF32}, \code{psF64}, \code{psC32}, 2185 \code{psC64}. 2166 2186 2167 2187 \begin{verbatim} … … 2178 2198 This function must be defined for the following types: \code{psU8}, 2179 2199 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, 2180 \code{psC32}, \code{psC64}. 2200 \code{psC32}, \code{psC64}. The two input images must have the same 2201 datatype and the output image must be constructed with that same 2202 datatype. 2181 2203 2182 2204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 2394 2416 \end{verbatim} 2395 2417 2396 The output from a FFT and power spectrum shallbe of the same size as2418 The output from a FFT and power spectrum must be of the same size as 2397 2419 the input. In the future, if this adversely affects performance, this 2398 2420 will be revised so that the redundant information will be neglected. … … 2600 2622 } data; ///< value of metadata 2601 2623 char *comment; ///< optional comment ("", not NULL) 2602 ps Dlist *restrict items; ///< list of psMetadataItems with the same name2624 psList *restrict items; ///< list of psMetadataItems with the same name 2603 2625 } psMetadataItem; 2604 2626 \end{verbatim} … … 2643 2665 \begin{verbatim} 2644 2666 typedef struct { 2645 ps Dlist *restrict list; ///< list of psMetadataItem2667 psList *restrict list; ///< list of psMetadataItem 2646 2668 psHash *restrict table; ///< hash table of the same metadata 2647 2669 } psMetadata; … … 3119 3141 const int nx, ny; ///< Image binning 3120 3142 psImage *image; ///< imaging area of cell 3121 ps Dlist *objects; ///< objects derived from cell3143 psList *objects; ///< objects derived from cell 3122 3144 psMetadata *md; ///< Readout-level metadata 3123 3145 } psReadout;
Note:
See TracChangeset
for help on using the changeset viewer.
