IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3155


Ignore:
Timestamp:
Feb 7, 2005, 6:56:24 PM (21 years ago)
Author:
eugene
Message:

bugzilla changes (psMetadata iterators, pmObject stuff)

Location:
trunk/doc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/modules/ChangeLogSDRS.tex

    r3074 r3155  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.12 2005-01-24 21:56:28 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.13 2005-02-08 04:56:24 eugene Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    4242
    4343\begin{itemize}
     44\item changed entries of the form psXXX to pmXXX (object section)
     45\item added enum psSourceType
    4446\item Specified appropriate image types for the phase 2 modules (bug 258).
    4547\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 $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    11031103\begin{verbatim}
    11041104typedef struct {
    1105   psPeak *peak;            // description of peak pixel
     1105  pmPeak *peak;            // description of peak pixel
    11061106  psImage *pixels;         // rectangular region including object pixels
    11071107  psImage *mask;           // mask to mark pixels associated with object in region
    1108   psMoments *moments;      // basic moments measure for the object
    1109   psModel *models;         // model parameters and type
    1110   psSourceType type;       // best identification of object
    1111 } psSource;
     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;
    11121112\end{verbatim}
    11131113
     
    11201120  int y;                   // y-coordinate of peak pixel
    11211121  float counts;            // value of peak pixel (above sky?)
    1122   psPeakType class;        // description of peak
    1123 } psPeak;
     1122  pmPeakType class;        // description of peak
     1123} pmPeak;
    11241124\end{verbatim}
    11251125
    11261126A peak pixel may have several features which may be determined when
    11271127the peak is found or measured.  These are specified by the
    1128 \code{psPeakType} enum.  \code{PS_PEAK_LONE} represents a single pixel
     1128\code{pmPeakType} enum.  \code{PM_PEAK_LONE} represents a single pixel
    11291129which is higher than its 8 immediate neighbors.  The
    1130 \code{PS_PEAK_EDGE} represents a peak pixel which touching the image
    1131 edge.  The \code{PS_PEAK_FLAT} represents a peak pixel which has more
     1130\code{PM_PEAK_EDGE} represents a peak pixel which touching the image
     1131edge.  The \code{PM_PEAK_FLAT} represents a peak pixel which has more
    11321132than a specific number of neighbors at the same value, within some
    11331133tolarence:
    11341134\begin{verbatim}
    11351135typedef enum {
    1136   PS_PEAK_LONE;             // isolated peak
    1137   PS_PEAK_EDGE;             // peak on edge
    1138   PS_PEAK_FLAT;             // peak has equal-value neighbors
    1139 } psPeakType;
     1136  PM_PEAK_LONE;             // isolated peak
     1137  PM_PEAK_EDGE;             // peak on edge
     1138  PM_PEAK_FLAT;             // peak has equal-value neighbors
     1139} pmPeakType;
    11401140\end{verbatim}
    11411141
     
    11621162  float Sky;                // sky level (background)
    11631163  int   nPixels;            // number of pixels used
    1164 } psMoments;
     1164} pmMoments;
    11651165\end{verbatim}
    11661166
     
    11681168function.  The description of the model includes the model parameters
    11691169and their errors, along with the fit $\chi^2$.  The model type is
    1170 specified by the enum \code{psObjectModel}, specified below.  We
     1170specified by the enum \code{pmObjectModel}, specified below.  We
    11711171discuss the details of these models in section~\ref{ObjectModels}.
    11721172
    11731173\begin{verbatim}
    11741174typedef struct {
    1175   psObjectModel type;       // model to be used
     1175  pmObjectModel type;       // model to be used
    11761176  int Nparams;              // number of parameters
    11771177  float *params;            // parameter values
    11781178  float *dparams;           // parameter errors
    11791179  float chisq;              // fit chisq
    1180 } psModel;
     1180} pmModel;
    11811181\end{verbatim}
    11821182
    11831183\begin{verbatim}
    11841184typedef 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
     1194A given source may be identified as most-likey to be one of several
     1195source types.  The \code{pmSource} entry \code{pmSourceType} defines
     1196the current best-guess for this source.  \tbd{The values given below
     1197are currently illustrative and will require some modification as the
     1198source classification code is developed.}
     1199
     1200\begin{verbatim}
     1201typedef 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;
    11921209\end{verbatim}
    11931210
     
    12331250making flat-topped regions have single peaks at the (+x,+y) corner.
    12341251When selecting the peaks, their type must also be set.  The result of
    1235 this function is a list of \code{psPeak} entries.
     1252this function is a list of \code{pmPeak} entries.
    12361253
    12371254\tbd{do we need a function psVector *psImageRowVector (psImage *image, int row);}
     
    12481265
    12491266\begin{verbatim}
    1250 psSource *pmSourceLocalSky(const psImage *image, const psPeak *peak, float inner_radius, float outer_radius),
     1267pmSource *pmSourceLocalSky(const psImage *image, const pmPeak *peak, float inner_radius, float outer_radius),
    12511268\end{verbatim}
    12521269
     
    12551272specified are used to measure the median \tbd{(clipped mean?)
    12561273(statistic from psStats?)} in the vicinity of the the specified peak
    1257 coordinates.  The resulting sky is applied to the \code{psMoments}
    1258 element of the allocated \code{psSource} structure.  The input
    1259 \code{peak} is also added to the \code{psSource} element, which is
     1274coordinates.  The resulting sky is applied to the \code{pmMoments}
     1275element of the allocated \code{pmSource} structure.  The input
     1276\code{peak} is also added to the \code{pmSource} element, which is
    12601277returned.
    12611278
    12621279\begin{verbatim}
    1263 psSource *pmSourceMoments(psSource *source, const psImage *image, float radius),
     1280pmSource *pmSourceMoments(pmSource *source, const psImage *image, float radius),
    12641281\end{verbatim}
    12651282
     
    12711288
    12721289\begin{verbatim}
    1273 psSource *pmSourceRoughClass(psSource *source, float saturate, float SNlim, const psRegion *valid);
     1290pmSource *pmSourceRoughClass(pmSource *source, float saturate, float SNlim, const psRegion *valid);
    12741291\end{verbatim}
    12751292
     
    13031320
    13041321\begin{verbatim}
    1305 bool pmSourceSetPixelsCircle(psSource *source, const psImage *image, float radius);
     1322bool pmSourceSetPixelsCircle(pmSource *source, const psImage *image, float radius);
    13061323\end{verbatim}
    13071324
     
    13141331
    13151332\begin{verbatim}
    1316 bool pmSourceModelGuess(psSource *source, const psImage *image);
     1333bool pmSourceModelGuess(pmSource *source, const psImage *image);
    13171334\end{verbatim}
    13181335
     
    13231340
    13241341\begin{verbatim}
    1325 psArray *pmSourceContour(const psSource *source, const psImage *image, float level, int mode);
     1342psArray *pmSourceContour(const pmSource *source, const psImage *image, float level, int mode);
    13261343\end{verbatim}
    13271344
    13281345Find points in a contour for the given source at the given level.  If
    1329 mode is \code{PS_CONTOUR_CRUDE}, the contour is found by starting at
     1346mode is \code{PM_CONTOUR_CRUDE}, the contour is found by starting at
    13301347the source peak, running along each pixel row until the level is
    13311348crossed, then interpolating to the level coordinate for that row.
     
    13391356
    13401357\begin{verbatim}
    1341 bool pmSourceFitModel(psSource *source, psImage *image);
     1358bool pmSourceFitModel(pmSource *source, psImage *image);
    13421359\end{verbatim}
    13431360
     
    13501367
    13511368\begin{verbatim}
    1352 bool pmSourceAddModel(psImage *image, psSource *source, bool center);
     1369bool pmSourceAddModel(psImage *image, pmSource *source, bool center);
    13531370\end{verbatim}
    13541371
     
    13601377
    13611378\begin{verbatim}
    1362 bool pmSourceSubModel(psSource *source);
     1379bool pmSourceSubModel(pmSource *source);
    13631380\end{verbatim}
    13641381
     
    13881405
    13891406\begin{verbatim}
    1390 float psMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x);
     1407float pmMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x);
    13911408\end{verbatim}
    13921409
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r3093 r3155  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.61 2005-01-26 00:04:52 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.62 2005-02-08 04:56:24 eugene Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    446446\item Added \code{region} and \code{nSamples} to
    447447  \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.173 2005-01-28 21:37:57 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.174 2005-02-08 04:56:24 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    39013901\code{psMetadataItem} ready for insertion into the \code{psMetadata}.
    39023902The \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
     3903item, and may include \code{sprintf}-type formating codes.  The
     3904\code{comment} entry is a fixed string which is used for the comment
     3905associated with this metadata item.  The metadata data and the
     3906arguments to the \code{name} formatting codes are passed, in that
     3907order (metadata pointer first), to \code{psMetadataItemAlloc} as
    39103908arguments following the comment string.  The data must be a pointer
    39113909for any data types which are stored in the element \code{data.void},
     
    39153913\begin{verbatim}
    39163914psMetadataItem *psMetadataItemAlloc(const char *name, psMetadataType type, const char *comment, ...);
    3917 psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type,
    3918                                      const char *comment, va_list list);
     3915psMetadataItem *psMetadataItemAllocV(const char *name, psMetadataType type, const char *comment, va_list list);
    39193916\end{verbatim}
    39203917
     
    39333930(\code{true}) or failure of the operation.  The second function,
    39343931\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);
     3932the function using variadic argument interpretation.  The third
     3933version is the \code{va_list} version of the second function.  All
     3934three functions take a parameter, \code{location}, which specifies
     3935where in the list to place the element, following the conventions for
     3936the \code{psList}.  The entry \code{mode} for \code{psMetadataAddItem}
     3937is a bit mask constructed by OR-ing the allowed option flags (eg,
     3938PS_META_REPLACE) which specifies minor variations on the behavior.
     3939The \code{format} entry, which specifies both the metadata type and
     3940the optional flags, is constructed by bit-wise OR-ing the appropriate
     3941\code{psMetadataType} and allowed option option flags.  Care should be
     3942taken not to leak memory when appending an item for which the key
     3943already exists in the metadata (and is not \code{PS_META_LIST}).
     3944%
     3945\begin{verbatim}
     3946bool psMetadataAddItem(psMetadata *md, psMetadataItem *item, int location, int mode);
    39443947bool psMetadataAdd(psMetadata *md, int location, const char *name, int format, const char *comment, ...);
     3948bool psMetadataAddV(psMetadata *md, int location, const char *name, int format, const char *comment, ...);
     3949\end{verbatim}
     3950
     3951The functions above take option flags which modify the behavior when
     3952metadata items are added to the metadata list.  These flags must be
     3953bit-exclusive of those used above for the \code{psMetadataTypes}.  The
     3954flags have the following meanings:
     3955
     3956\code{PS_META_DEFAULT}: This is the zero bit mask, to allow the
     3957default behavior for \code{psMetadataAddItem} above.  If this is OR-ed
     3958with a \code{psMetadataType}, the result is as if no OR-ing took
     3959place.
     3960
     3961\code{PS_META_REPLACE}: If the given metadata item exists in the
     3962metadata 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
     3964allowed to replace the existing entry.  If this mode bit is not set, a
     3965duplicate (non-container-type) entry is an error.
     3966
     3967\begin{verbatim}
     3968typedef 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
     3974An example of code to use these metadata APIs to generate the
     3975structure seen in Figure~\ref{fig:metadata} is given below.
     3976
     3977\begin{verbatim}
     3978md = psMetadataAlloc();
     3979
     3980psMetadataAdd(md, PS_LIST_TAIL, "SIMPLE",   PS_META_BOOL, "basic fits",            TRUE);
     3981psMetadataAdd(md, PS_LIST_TAIL, "BLANK",    PS_META_S32,  "invalid pixel data",    -32768);
     3982psMetadataAdd(md, PS_LIST_TAIL, "DATE-OBS", PS_META_STR,  "observing date UT", "   2004-6-16");
     3983psMetadataAdd(md, PS_LIST_TAIL, "COMMENT",  PS_META_LIST, "head of comment block", NULL);
     3984psMetadataAdd(md, PS_LIST_TAIL, "COMMENT",  PS_META_STR,  "",                      "DATA");
     3985psMetadataAdd(md, PS_LIST_TAIL, "COMMENT",  PS_META_STR,  "",                      "PARAMS");
     3986psMetadataAdd(md, PS_LIST_TAIL, "EXPTIME",  PS_META_F32,  "exposure time (sec)",   1.05);
     3987psMetadataAdd(md, PS_LIST_TAIL, "COMMENT",  PS_META_STR,  "",                      "FOO");
     3988
     3989cell = psMetadataAlloc();
     3990psMetadataAdd(cell, PS_LIST_TAIL, "EXTNAME",  PS_META_STR,  "",                    "CCD00");
     3991psMetadataAdd(cell, PS_LIST_TAIL, "BIASNAME", PS_META_STR,  "",                    "BSEC-00");
     3992psMetadataAdd(cell, PS_LIST_TAIL, "CHIP",     PS_META_STR,  "",                    "CHIP.00");
     3993psMetadataAdd(md,   PS_LIST_TAIL, "CELL.00",  PS_META_META, "",                    cell);
     3994
     3995cell = psMetadataAlloc();
     3996psMetadataAdd(cell, PS_LIST_TAIL, "EXTNAME",  PS_META_STR,  "",                    "CCD01");
     3997psMetadataAdd(cell, PS_LIST_TAIL, "BIASNAME", PS_META_STR,  "",                    "BSEC-01");
     3998psMetadataAdd(cell, PS_LIST_TAIL, "CHIP",     PS_META_STR,  "",                    "CHIP.01");
     3999psMetadataAdd(md,   PS_LIST_TAIL, "CELL.01",  PS_META_META, "",                    cell);
     4000\end{verbatim}
     4001
     4002The following code shows how to use the APIs to replace one of these values:
     4003\begin{verbatim}
     4004psMetadataAdd(md, PS_LIST_TAIL, "EXPTIME",  PS_META_F32 | PS_REPLACE,  "new exposure time (sec)",   2.05);
    39454005\end{verbatim}
    39464006
     
    39834043\end{verbatim}
    39844044
    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);
     4045The 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
     4049in the list relative to that location.  \code{psMetadataGetNext} has
     4050the ability to match the key using a POSIX regex, e.g., if the user
     4051only wants to iterate through \code{IPP.machines.sky} and doesn't want
     4052to bother with \code{IPP.machines.detector}.  The iterator should
     4053iterate over every item in the metadata list, even those that are
     4054contained in a \code{PS_META_LIST}.  The value \code{iterator}
     4055specifies the iterator to be used.  In setting the iterator, the
     4056position of the iterator is defined by \code{location}, which follows
     4057the conventions of the \code{psList} iterators.
     4058\begin{verbatim}
     4059psListIterator *psMetadataIteratorAlloc(psMetadata *md, int location, bool mutable);
     4060bool psMetadataIteratorSet(psListIterator *iterator, int location);
     4061psMetadataItem *psMetadataGetAndIncrement(psListIterator *iterator, const char *regex);
     4062psMetadataItem *psMetadataGetAndDecrement(psListIterator *iterator, const char *regex);
    39994063\end{verbatim}
    40004064
Note: See TracChangeset for help on using the changeset viewer.