IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 23, 2005, 3:24:38 PM (20 years ago)
Author:
desonia
Message:

changes from eam_rel9_b1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmObjects.h

    r5765 r5844  
    44 * images is one of the critical tasks of the IPP or any astronomical software
    55 * system. This file will define structures and functions related to the task
    6  * of source detection and measurement. The elements defined in this section 
     6 * of source detection and measurement. The elements defined in this section
    77 * are generally low-level components which can be connected together to
    88 * construct a complete object measurement suite.
     
    1010 *  @author GLG, MHPCC
    1111 *
    12  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-12-12 21:14:38 $
     12 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-12-24 01:24:32 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4545
    4646/** pmPeakType
    47  * 
     47 *
    4848 *  A peak pixel may have several features which may be determined when the
    4949 *  peak is found or measured. These are specified by the pmPeakType enum.
     
    5252 *  edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific
    5353 *  number of neighbors at the same value, within some tolarence:
    54  * 
     54 *
    5555 */
    5656typedef enum {
     
    6363
    6464/** pmPeak data structure
    65  * 
     65 *
    6666 *  A source has the capacity for several types of measurements. The
    6767 *  simplest measurement of a source is the location and flux of the peak pixel
    6868 *  associated with the source:
    69  * 
     69 *
    7070 */
    7171typedef struct
     
    8080
    8181/** pmMoments data structure
    82  * 
     82 *
    8383 * One of the simplest measurements which can be made quickly for an object
    8484 * are the object moments. We specify a structure to carry the moment information
    8585 * for a specific source:
    86  * 
     86 *
    8787 */
    8888typedef struct
     
    103103
    104104/** pmPSFClump data structure
    105  * 
     105 *
    106106 * A collection of object moment measurements can be used to determine
    107107 * approximate object classes. The key to this analysis is the location and
    108108 * statistics (in the second-moment plane,
    109  * 
     109 *
    110110 */
    111111typedef struct
     
    118118pmPSFClump;
    119119
     120// type of model carried by the pmModel structure
    120121typedef int pmModelType;
    121 #define PS_MODEL_GAUSS 0
    122 #define PS_MODEL_PGAUSS 1
    123 #define PS_MODEL_QGAUSS 2
    124 #define PS_MODEL_SGAUSS 3
    125 
     122
     123typedef enum {
     124    PM_MODEL_UNTRIED,               ///< model fit not yet attempted
     125    PM_MODEL_SUCCESS,               ///< model fit succeeded
     126    PM_MODEL_NONCONVERGE,           ///< model fit did not converge
     127    PM_MODEL_OFFIMAGE,              ///< model fit drove out of range
     128    PM_MODEL_BADARGS                ///< model fit called with invalid args
     129} pmModelStatus;
    126130
    127131/** pmModel data structure
    128  * 
     132 *
    129133 * Every source may have two types of models: a PSF model and a FLT (floating)
    130134 * model. The PSF model represents the best fit of the image PSF to the specific
     
    132136 * object by the PSF, not by the fit. The FLT model represents the best fit of
    133137 * the given model to the object, with all parameters floating in the fit.
    134  * 
     138 *
    135139 */
    136140typedef struct
     
    142146    int nDOF;    ///< number of degrees of freedom
    143147    int nIter;    ///< number of iterations to reach min
     148    int status;         ///< fit status
    144149    float radius;   ///< fit radius actually used
    145150}
     
    147152
    148153/** pmSourceType enumeration
    149  * 
     154 *
    150155 * A given source may be identified as most-likely to be one of several source
    151156 * types. The pmSource entry pmSourceType defines the current best-guess for this
    152157 * source.
    153  * 
     158 *
    154159 * XXX: The values given below are currently illustrative and will require
    155160 * some modification as the source classification code is developed. (TBD)
    156  * 
     161 *
    157162 */
    158163typedef enum {
     
    178183
    179184/** pmSource data structure
    180  * 
     185 *
    181186 *  This source has the capacity for several types of measurements. The
    182187 *  simplest measurement of a source is the location and flux of the peak pixel
    183188 *  associated with the source:
    184  * 
     189 *
    185190 */
    186191typedef struct
     
    194199    pmModel *modelFLT;   ///< FLT (floating) Model fit (parameters and type).
    195200    pmSourceType type;   ///< Best identification of object.
     201    float apMag;
     202    float fitMag;
    196203}
    197204pmSource;
     
    211218
    212219/** pmMomentsAlloc()
    213  * 
     220 *
    214221 */
    215222pmMoments *pmMomentsAlloc();
     
    217224
    218225/** pmModelAlloc()
    219  * 
     226 *
    220227 */
    221228pmModel *pmModelAlloc(pmModelType type);
     
    223230
    224231/** pmSourceAlloc()
    225  * 
     232 *
    226233 */
    227234pmSource  *pmSourceAlloc();
     
    229236
    230237/** pmFindVectorPeaks()
    231  * 
     238 *
    232239 * Find all local peaks in the given vector above the given threshold. A peak
    233240 * is defined as any element with a value greater than its two neighbors and with
     
    243250 * a vector containing the coordinates (element number) of the detected peaks
    244251 * (type psU32).
    245  * 
     252 *
    246253 */
    247254psVector *pmFindVectorPeaks(
     
    252259
    253260/** pmFindImagePeaks()
    254  * 
     261 *
    255262 * Find all local peaks in the given image above the given threshold. This
    256263 * function should find all row peaks using pmFindVectorPeaks, then test each row
     
    263270 * peaks at the (+x,+y) corner. When selecting the peaks, their type must also be
    264271 * set. The result of this function is an array of pmPeak entries.
    265  * 
     272 *
    266273 */
    267274psArray *pmFindImagePeaks(
     
    272279
    273280/** pmCullPeaks()
    274  * 
     281 *
    275282 * Eliminate peaks from the psList that have a peak value above the given
    276283 * maximum, or fall outside the valid region.
    277  * 
     284 *
    278285 */
    279286psList *pmCullPeaks(
     
    285292
    286293/** pmPeaksSubset()
    287  * 
     294 *
    288295 * Create a new peaks array, removing certain types of peaks from the input
    289296 * array of peaks based on the given criteria. Peaks should be eliminated if they
     
    291298 * the valid region.  The result of the function is a new array with a reduced
    292299 * number of peaks.
    293  * 
     300 *
    294301 */
    295302psArray *pmPeaksSubset(
     
    301308
    302309/** pmSourceDefinePixels()
    303  * 
     310 *
    304311 * Define psImage subarrays for the source located at coordinates x,y on the
    305312 * image set defined by readout. The pixels defined by this operation consist of
     
    313320 * example). This function should be used to define a region of interest around a
    314321 * source, including both source and sky pixels.
    315  * 
     322 *
    316323 * XXX: must code this.
    317  * 
     324 *
    318325 */
    319326// XXX: Uncommenting the pmReadout causes compile errors.
     
    328335
    329336/** pmSourceLocalSky()
    330  * 
     337 *
    331338 * Measure the local sky in the vicinity of the given source. The Radius
    332339 * defines the square aperture in which the moments will be measured. This
     
    338345 * This function allocates the pmMoments structure. The resulting sky is used to
    339346 * set the value of the pmMoments.sky element of the provided pmSource structure.
    340  * 
     347 *
    341348 */
    342349bool pmSourceLocalSky(
     
    348355
    349356/** pmSourceMoments()
    350  * 
     357 *
    351358 * Measure source moments for the given source, using the value of
    352359 * source.moments.sky provided as the local background value and the peak
     
    355362 * are measured within the given circular radius of the source.peak coordinates.
    356363 * The return value indicates the success (TRUE) of the operation.
    357  * 
     364 *
    358365 */
    359366bool pmSourceMoments(
     
    364371
    365372/** pmSourcePSFClump()
    366  * 
     373 *
    367374 * We use the source moments to make an initial, approximate source
    368375 * classification, and as part of the information needed to build a PSF model for
     
    373380 * similar. The function returns a pmPSFClump structure, representing the
    374381 * centroid and size of the clump in the sigma_x, sigma_y second-moment plane.
    375  * 
     382 *
    376383 * The goal is to identify and characterize the stellar clump within the
    377384 * sigma_x, sigma_y second-moment plane.  To do this, an image is constructed to
     
    384391 *  * used to calculate the median and standard deviation of the sigma_x, sigma_y
    385392 * values. These resulting values are returned via the pmPSFClump structure.
    386  * 
     393 *
    387394 * The return value indicates the success (TRUE) of the operation.
    388  * 
     395 *
    389396 * XXX: Limit the S/N of the candidate sources (part of Metadata)? (TBD).
    390397 * XXX: Save the clump parameters on the Metadata (TBD)
    391  * 
     398 *
    392399 */
    393400pmPSFClump pmSourcePSFClump(
     
    398405
    399406/** pmSourceRoughClass()
    400  * 
     407 *
    401408 * Based on the specified data values, make a guess at the source
    402409 * classification. The sources are provides as a psArray of pmSource entries.
     
    405412 * can be extracted from the metadata using the given keywords. Except as noted,
    406413 * the data type for these parameters are psF32.
    407  * 
     414 *
    408415 */
    409416bool pmSourceRoughClass(
     
    415422
    416423/** pmSourceModelGuess()
    417  * 
     424 *
    418425 * Convert available data to an initial guess for the given model. This
    419426 * function allocates a pmModel entry for the pmSource structure based on the
     
    421428 * are specified for each model below. The guess values are placed in the model
    422429 * parameters. The function returns TRUE on success or FALSE on failure.
    423  * 
     430 *
    424431 */
    425432pmModel *pmSourceModelGuess(
     
    430437
    431438/** pmContourType
    432  * 
     439 *
    433440 * Only one type is defined at present.
    434  * 
     441 *
    435442 */
    436443typedef enum {
     
    442449
    443450/** pmSourceContour()
    444  * 
     451 *
    445452 * Find points in a contour for the given source at the given level. If type
    446453 * is PM_CONTOUR_CRUDE, the contour is found by starting at the source peak,
     
    452459 * This function may be used as part of the model guess inputs.  Other contour
    453460 * types may be specified in the future for more refined contours (TBD)
    454  * 
     461 *
    455462 */
    456463psArray *pmSourceContour(
     
    463470
    464471/** pmSourceFitModel()
    465  * 
     472 *
    466473 * Fit the requested model to the specified source. The starting guess for the
    467474 * model is given by the input source.model parameter values. The pixels of
     
    469476 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    470477 * on success or FALSE on failure.
    471  * 
     478 *
    472479 */
    473480bool pmSourceFitModel(
     
    479486
    480487/** pmModelFitStatus()
    481  * 
     488 *
    482489 * This function wraps the call to the model-specific function returned by
    483490 * pmModelFitStatusFunc_GetFunction.  The model-specific function examines the
    484491 * model parameters, parameter errors, Chisq, S/N, and other parameters available
    485492 * from model to decide if the particular fit was successful or not.
    486  * 
     493 *
    487494 * XXX: Must code this.
    488  * 
     495 *
    489496 */
    490497bool pmModelFitStatus(
     
    494501
    495502/** pmSourceAddModel()
    496  * 
     503 *
    497504 * Add the given source model flux to/from the provided image. The boolean
    498505 * option center selects if the source is re-centered to the image center or if
     
    501508 * is at most the pixel range specified by the source.pixels image. The success
    502509 * status is returned.
    503  * 
     510 *
    504511 */
    505512bool pmSourceAddModel(
     
    507514    psImage *mask,   ///< The image pixel mask (valid == 0)
    508515    pmModel *model,   ///< The input pmModel
    509     bool center    ///< A boolean flag that determines whether pixels are centered
     516    bool center,    ///< A boolean flag that determines whether pixels are centered
     517    bool sky        ///< A boolean flag that determines if the sky is subtracted
    510518);
    511519
    512520
    513521/** pmSourceSubModel()
    514  * 
     522 *
    515523 * Subtract the given source model flux to/from the provided image. The
    516524 * boolean option center selects if the source is re-centered to the image center
     
    519527 * image is at most the pixel range specified by the source.pixels image. The
    520528 * success status is returned.
    521  * 
     529 *
    522530 */
    523531bool pmSourceSubModel(
     
    525533    psImage *mask,   ///< The image pixel mask (valid == 0)
    526534    pmModel *model,   ///< The input pmModel
    527     bool center    ///< A boolean flag that determines whether pixels are centered
     535    bool center,    ///< A boolean flag that determines whether pixels are centered
     536    bool sky        ///< A boolean flag that determines if the sky is subtracted
    528537);
    529538
    530539
    531540/**
    532  * 
     541 *
    533542 * The function returns both the magnitude of the fit, defined as -2.5log(flux),
    534543 * where the flux is integrated under the model, theoretically from a radius of 0
     
    537546 * not excluded by the aperture mask. The model flux is calculated by calling the
    538547 * model-specific function provided by pmModelFlux_GetFunction.
    539  * 
     548 *
    540549 * XXX: must code this.
    541  * 
     550 *
    542551 */
    543552bool pmSourcePhotometry(
     
    551560
    552561/**
    553  * 
     562 *
    554563 * This function converts the source classification into the closest available
    555564 * approximation to the Dophot classification scheme:
    556  * 
     565 *
    557566 * PM_SOURCE_DEFECT: 8
    558567 * PM_SOURCE_SATURATED: 8
     
    569578 * PM_SOURCE_POOR_FIT_GAL: 2
    570579 * PM_SOURCE_OTHER: ?
    571  * 
     580 *
    572581 */
    573582int pmSourceDophotType(
     
    577586
    578587/** pmSourceSextractType()
    579  * 
     588 *
    580589 * This function converts the source classification into the closest available
    581590 * approximation to the Sextractor classification scheme. the correspondence is
    582591 * not yet defined (TBD) .
    583  * 
     592 *
    584593 * XXX: Must code this.
    585  * 
     594 *
    586595 */
    587596int pmSourceSextractType(
     
    590599
    591600/** pmSourceFitModel_v5()
    592  * 
     601 *
    593602 * Fit the requested model to the specified source. The starting guess for the
    594603 * model is given by the input source.model parameter values. The pixels of
     
    596605 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    597606 * on success or FALSE on failure.
    598  * 
     607 *
    599608 */
    600609bool pmSourceFitModel_v5(
     
    606615
    607616/** pmSourceFitModel_v7()
    608  * 
     617 *
    609618 * Fit the requested model to the specified source. The starting guess for the
    610619 * model is given by the input source.model parameter values. The pixels of
     
    612621 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    613622 * on success or FALSE on failure.
    614  * 
     623 *
    615624 */
    616625bool pmSourceFitModel_v7(
     
    622631
    623632/** pmSourcePhotometry()
    624  * 
     633 *
    625634 * XXX: Need descriptions
    626  * 
     635 *
    627636 */
    628637bool pmSourcePhotometry(
Note: See TracChangeset for help on using the changeset viewer.