IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2006, 4:38:28 PM (21 years ago)
Author:
Paul Price
Message:

Getting a working ppImage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_p0/psModules/src/objects/pmObjects.h

    r5990 r6062  
    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.4.3 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-01-15 18:21:19 $
     12 *  @version $Revision: 1.4.4.4 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-01-20 02:38:28 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727#include <math.h>
    2828#include "pslib.h"
    29 #include "pmAstrometry.h"
     29#include "pmFPA.h"
    3030/**
    3131 * In the object analysis process, we will use specific mask values to mark the
     
    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
     
    130130
    131131/** pmModel data structure
    132  * 
     132 *
    133133 * Every source may have two types of models: a PSF model and a EXT (extended-source)
    134134 * model. The PSF model represents the best fit of the image PSF to the specific
     
    136136 * object by the PSF, not by the fit. The EXT model represents the best fit of
    137137 * the given model to the object, with all shape parameters floating in the fit.
    138  * 
     138 *
    139139 */
    140140typedef struct
     
    152152
    153153/** pmSourceType enumeration
    154  * 
     154 *
    155155 * A given source may be identified as most-likely to be one of several source
    156156 * types. The pmSource entry pmSourceType defines the current best-guess for this
    157157 * source.
    158  * 
     158 *
    159159 * XXX: The values given below are currently illustrative and will require
    160160 * some modification as the source classification code is developed. (TBD)
    161  * 
     161 *
    162162 */
    163163typedef enum {
     
    186186
    187187/** pmSource data structure
    188  * 
     188 *
    189189 *  This source has the capacity for several types of measurements. The
    190190 *  simplest measurement of a source is the location and flux of the peak pixel
    191191 *  associated with the source:
    192  * 
     192 *
    193193 */
    194194typedef struct
     
    224224
    225225/** pmMomentsAlloc()
    226  * 
     226 *
    227227 */
    228228pmMoments *pmMomentsAlloc();
     
    230230
    231231/** pmModelAlloc()
    232  * 
     232 *
    233233 */
    234234pmModel *pmModelAlloc(pmModelType type);
     
    236236
    237237/** pmSourceAlloc()
    238  * 
     238 *
    239239 */
    240240pmSource  *pmSourceAlloc();
     
    242242
    243243/** pmFindVectorPeaks()
    244  * 
     244 *
    245245 * Find all local peaks in the given vector above the given threshold. A peak
    246246 * is defined as any element with a value greater than its two neighbors and with
     
    256256 * a vector containing the coordinates (element number) of the detected peaks
    257257 * (type psU32).
    258  * 
     258 *
    259259 */
    260260psVector *pmFindVectorPeaks(
     
    265265
    266266/** pmFindImagePeaks()
    267  * 
     267 *
    268268 * Find all local peaks in the given image above the given threshold. This
    269269 * function should find all row peaks using pmFindVectorPeaks, then test each row
     
    276276 * peaks at the (+x,+y) corner. When selecting the peaks, their type must also be
    277277 * set. The result of this function is an array of pmPeak entries.
    278  * 
     278 *
    279279 */
    280280psArray *pmFindImagePeaks(
     
    285285
    286286/** pmCullPeaks()
    287  * 
     287 *
    288288 * Eliminate peaks from the psList that have a peak value above the given
    289289 * maximum, or fall outside the valid region.
    290  * 
     290 *
    291291 */
    292292psList *pmCullPeaks(
     
    298298
    299299/** pmPeaksSubset()
    300  * 
     300 *
    301301 * Create a new peaks array, removing certain types of peaks from the input
    302302 * array of peaks based on the given criteria. Peaks should be eliminated if they
     
    304304 * the valid region.  The result of the function is a new array with a reduced
    305305 * number of peaks.
    306  * 
     306 *
    307307 */
    308308psArray *pmPeaksSubset(
     
    314314
    315315/** pmSourceDefinePixels()
    316  * 
     316 *
    317317 * Define psImage subarrays for the source located at coordinates x,y on the
    318318 * image set defined by readout. The pixels defined by this operation consist of
     
    326326 * example). This function should be used to define a region of interest around a
    327327 * source, including both source and sky pixels.
    328  * 
     328 *
    329329 * XXX: must code this.
    330  * 
     330 *
    331331 */
    332332// XXX: Uncommenting the pmReadout causes compile errors.
     
    341341
    342342/** pmSourceLocalSky()
    343  * 
     343 *
    344344 * Measure the local sky in the vicinity of the given source. The Radius
    345345 * defines the square aperture in which the moments will be measured. This
     
    351351 * This function allocates the pmMoments structure. The resulting sky is used to
    352352 * set the value of the pmMoments.sky element of the provided pmSource structure.
    353  * 
     353 *
    354354 */
    355355bool pmSourceLocalSky(
     
    361361
    362362/** pmSourceMoments()
    363  * 
     363 *
    364364 * Measure source moments for the given source, using the value of
    365365 * source.moments.sky provided as the local background value and the peak
     
    368368 * are measured within the given circular radius of the source.peak coordinates.
    369369 * The return value indicates the success (TRUE) of the operation.
    370  * 
     370 *
    371371 */
    372372bool pmSourceMoments(
     
    377377
    378378/** pmSourcePSFClump()
    379  * 
     379 *
    380380 * We use the source moments to make an initial, approximate source
    381381 * classification, and as part of the information needed to build a PSF model for
     
    386386 * similar. The function returns a pmPSFClump structure, representing the
    387387 * centroid and size of the clump in the sigma_x, sigma_y second-moment plane.
    388  * 
     388 *
    389389 * The goal is to identify and characterize the stellar clump within the
    390390 * sigma_x, sigma_y second-moment plane.  To do this, an image is constructed to
     
    397397 *  * used to calculate the median and standard deviation of the sigma_x, sigma_y
    398398 * values. These resulting values are returned via the pmPSFClump structure.
    399  * 
     399 *
    400400 * The return value indicates the success (TRUE) of the operation.
    401  * 
     401 *
    402402 * XXX: Limit the S/N of the candidate sources (part of Metadata)? (TBD).
    403403 * XXX: Save the clump parameters on the Metadata (TBD)
    404  * 
     404 *
    405405 */
    406406pmPSFClump pmSourcePSFClump(
     
    411411
    412412/** pmSourceRoughClass()
    413  * 
     413 *
    414414 * Based on the specified data values, make a guess at the source
    415415 * classification. The sources are provides as a psArray of pmSource entries.
     
    418418 * can be extracted from the metadata using the given keywords. Except as noted,
    419419 * the data type for these parameters are psF32.
    420  * 
     420 *
    421421 */
    422422bool pmSourceRoughClass(
     
    428428
    429429/** pmSourceModelGuess()
    430  * 
     430 *
    431431 * Convert available data to an initial guess for the given model. This
    432432 * function allocates a pmModel entry for the pmSource structure based on the
     
    434434 * are specified for each model below. The guess values are placed in the model
    435435 * parameters. The function returns TRUE on success or FALSE on failure.
    436  * 
     436 *
    437437 */
    438438pmModel *pmSourceModelGuess(
     
    443443
    444444/** pmContourType
    445  * 
     445 *
    446446 * Only one type is defined at present.
    447  * 
     447 *
    448448 */
    449449typedef enum {
     
    455455
    456456/** pmSourceContour()
    457  * 
     457 *
    458458 * Find points in a contour for the given source at the given level. If type
    459459 * is PM_CONTOUR_CRUDE, the contour is found by starting at the source peak,
     
    465465 * This function may be used as part of the model guess inputs.  Other contour
    466466 * types may be specified in the future for more refined contours (TBD)
    467  * 
     467 *
    468468 */
    469469psArray *pmSourceContour(
     
    476476
    477477/** pmSourceFitModel()
    478  * 
     478 *
    479479 * Fit the requested model to the specified source. The starting guess for the
    480480 * model is given by the input source.model parameter values. The pixels of
     
    482482 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    483483 * on success or FALSE on failure.
    484  * 
     484 *
    485485 */
    486486bool pmSourceFitModel(
     
    492492
    493493/** pmModelFitStatus()
    494  * 
     494 *
    495495 * This function wraps the call to the model-specific function returned by
    496496 * pmModelFitStatusFunc_GetFunction.  The model-specific function examines the
    497497 * model parameters, parameter errors, Chisq, S/N, and other parameters available
    498498 * from model to decide if the particular fit was successful or not.
    499  * 
     499 *
    500500 * XXX: Must code this.
    501  * 
     501 *
    502502 */
    503503bool pmModelFitStatus(
     
    507507
    508508/** pmSourceAddModel()
    509  * 
     509 *
    510510 * Add the given source model flux to/from the provided image. The boolean
    511511 * option center selects if the source is re-centered to the image center or if
     
    514514 * is at most the pixel range specified by the source.pixels image. The success
    515515 * status is returned.
    516  * 
     516 *
    517517 */
    518518bool pmSourceAddModel(
     
    526526
    527527/** pmSourceSubModel()
    528  * 
     528 *
    529529 * Subtract the given source model flux to/from the provided image. The
    530530 * boolean option center selects if the source is re-centered to the image center
     
    533533 * image is at most the pixel range specified by the source.pixels image. The
    534534 * success status is returned.
    535  * 
     535 *
    536536 */
    537537bool pmSourceSubModel(
     
    545545
    546546/**
    547  * 
     547 *
    548548 * The function returns both the magnitude of the fit, defined as -2.5log(flux),
    549549 * where the flux is integrated under the model, theoretically from a radius of 0
     
    552552 * not excluded by the aperture mask. The model flux is calculated by calling the
    553553 * model-specific function provided by pmModelFlux_GetFunction.
    554  * 
     554 *
    555555 * XXX: must code this.
    556  * 
     556 *
    557557 */
    558558bool pmSourcePhotometry(
     
    566566
    567567/**
    568  * 
     568 *
    569569 * This function converts the source classification into the closest available
    570570 * approximation to the Dophot classification scheme:
    571571 * XXX EAM : fix this to use current source classification scheme
    572  * 
     572 *
    573573 * PM_SOURCE_DEFECT: 8
    574574 * PM_SOURCE_SATURATED: 8
     
    585585 * PM_SOURCE_POOR_FIT_GAL: 2
    586586 * PM_SOURCE_OTHER: ?
    587  * 
     587 *
    588588 */
    589589int pmSourceDophotType(
     
    593593
    594594/** pmSourceSextractType()
    595  * 
     595 *
    596596 * This function converts the source classification into the closest available
    597597 * approximation to the Sextractor classification scheme. the correspondence is
    598598 * not yet defined (TBD) .
    599  * 
     599 *
    600600 * XXX: Must code this.
    601  * 
     601 *
    602602 */
    603603int pmSourceSextractType(
     
    606606
    607607/** pmSourceFitModel_v5()
    608  * 
     608 *
    609609 * Fit the requested model to the specified source. The starting guess for the
    610610 * model is given by the input source.model parameter values. The pixels of
     
    612612 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    613613 * on success or FALSE on failure.
    614  * 
     614 *
    615615 */
    616616bool pmSourceFitModel_v5(
     
    622622
    623623/** pmSourceFitModel_v7()
    624  * 
     624 *
    625625 * Fit the requested model to the specified source. The starting guess for the
    626626 * model is given by the input source.model parameter values. The pixels of
     
    628628 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE
    629629 * on success or FALSE on failure.
    630  * 
     630 *
    631631 */
    632632bool pmSourceFitModel_v7(
     
    638638
    639639/** pmSourcePhotometry()
    640  * 
     640 *
    641641 * XXX: Need descriptions
    642  * 
     642 *
    643643 */
    644644bool pmSourcePhotometry(
Note: See TracChangeset for help on using the changeset viewer.