Changeset 5844 for trunk/psModules/src/objects/pmObjects.h
- Timestamp:
- Dec 23, 2005, 3:24:38 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmObjects.h (modified) (56 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmObjects.h
r5765 r5844 4 4 * images is one of the critical tasks of the IPP or any astronomical software 5 5 * 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 7 7 * are generally low-level components which can be connected together to 8 8 * construct a complete object measurement suite. … … 10 10 * @author GLG, MHPCC 11 11 * 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 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 45 45 46 46 /** pmPeakType 47 * 47 * 48 48 * A peak pixel may have several features which may be determined when the 49 49 * peak is found or measured. These are specified by the pmPeakType enum. … … 52 52 * edge. The PM_PEAK_FLAT represents a peak pixel which has more than a specific 53 53 * number of neighbors at the same value, within some tolarence: 54 * 54 * 55 55 */ 56 56 typedef enum { … … 63 63 64 64 /** pmPeak data structure 65 * 65 * 66 66 * A source has the capacity for several types of measurements. The 67 67 * simplest measurement of a source is the location and flux of the peak pixel 68 68 * associated with the source: 69 * 69 * 70 70 */ 71 71 typedef struct … … 80 80 81 81 /** pmMoments data structure 82 * 82 * 83 83 * One of the simplest measurements which can be made quickly for an object 84 84 * are the object moments. We specify a structure to carry the moment information 85 85 * for a specific source: 86 * 86 * 87 87 */ 88 88 typedef struct … … 103 103 104 104 /** pmPSFClump data structure 105 * 105 * 106 106 * A collection of object moment measurements can be used to determine 107 107 * approximate object classes. The key to this analysis is the location and 108 108 * statistics (in the second-moment plane, 109 * 109 * 110 110 */ 111 111 typedef struct … … 118 118 pmPSFClump; 119 119 120 // type of model carried by the pmModel structure 120 121 typedef 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 123 typedef 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; 126 130 127 131 /** pmModel data structure 128 * 132 * 129 133 * Every source may have two types of models: a PSF model and a FLT (floating) 130 134 * model. The PSF model represents the best fit of the image PSF to the specific … … 132 136 * object by the PSF, not by the fit. The FLT model represents the best fit of 133 137 * the given model to the object, with all parameters floating in the fit. 134 * 138 * 135 139 */ 136 140 typedef struct … … 142 146 int nDOF; ///< number of degrees of freedom 143 147 int nIter; ///< number of iterations to reach min 148 int status; ///< fit status 144 149 float radius; ///< fit radius actually used 145 150 } … … 147 152 148 153 /** pmSourceType enumeration 149 * 154 * 150 155 * A given source may be identified as most-likely to be one of several source 151 156 * types. The pmSource entry pmSourceType defines the current best-guess for this 152 157 * source. 153 * 158 * 154 159 * XXX: The values given below are currently illustrative and will require 155 160 * some modification as the source classification code is developed. (TBD) 156 * 161 * 157 162 */ 158 163 typedef enum { … … 178 183 179 184 /** pmSource data structure 180 * 185 * 181 186 * This source has the capacity for several types of measurements. The 182 187 * simplest measurement of a source is the location and flux of the peak pixel 183 188 * associated with the source: 184 * 189 * 185 190 */ 186 191 typedef struct … … 194 199 pmModel *modelFLT; ///< FLT (floating) Model fit (parameters and type). 195 200 pmSourceType type; ///< Best identification of object. 201 float apMag; 202 float fitMag; 196 203 } 197 204 pmSource; … … 211 218 212 219 /** pmMomentsAlloc() 213 * 220 * 214 221 */ 215 222 pmMoments *pmMomentsAlloc(); … … 217 224 218 225 /** pmModelAlloc() 219 * 226 * 220 227 */ 221 228 pmModel *pmModelAlloc(pmModelType type); … … 223 230 224 231 /** pmSourceAlloc() 225 * 232 * 226 233 */ 227 234 pmSource *pmSourceAlloc(); … … 229 236 230 237 /** pmFindVectorPeaks() 231 * 238 * 232 239 * Find all local peaks in the given vector above the given threshold. A peak 233 240 * is defined as any element with a value greater than its two neighbors and with … … 243 250 * a vector containing the coordinates (element number) of the detected peaks 244 251 * (type psU32). 245 * 252 * 246 253 */ 247 254 psVector *pmFindVectorPeaks( … … 252 259 253 260 /** pmFindImagePeaks() 254 * 261 * 255 262 * Find all local peaks in the given image above the given threshold. This 256 263 * function should find all row peaks using pmFindVectorPeaks, then test each row … … 263 270 * peaks at the (+x,+y) corner. When selecting the peaks, their type must also be 264 271 * set. The result of this function is an array of pmPeak entries. 265 * 272 * 266 273 */ 267 274 psArray *pmFindImagePeaks( … … 272 279 273 280 /** pmCullPeaks() 274 * 281 * 275 282 * Eliminate peaks from the psList that have a peak value above the given 276 283 * maximum, or fall outside the valid region. 277 * 284 * 278 285 */ 279 286 psList *pmCullPeaks( … … 285 292 286 293 /** pmPeaksSubset() 287 * 294 * 288 295 * Create a new peaks array, removing certain types of peaks from the input 289 296 * array of peaks based on the given criteria. Peaks should be eliminated if they … … 291 298 * the valid region. The result of the function is a new array with a reduced 292 299 * number of peaks. 293 * 300 * 294 301 */ 295 302 psArray *pmPeaksSubset( … … 301 308 302 309 /** pmSourceDefinePixels() 303 * 310 * 304 311 * Define psImage subarrays for the source located at coordinates x,y on the 305 312 * image set defined by readout. The pixels defined by this operation consist of … … 313 320 * example). This function should be used to define a region of interest around a 314 321 * source, including both source and sky pixels. 315 * 322 * 316 323 * XXX: must code this. 317 * 324 * 318 325 */ 319 326 // XXX: Uncommenting the pmReadout causes compile errors. … … 328 335 329 336 /** pmSourceLocalSky() 330 * 337 * 331 338 * Measure the local sky in the vicinity of the given source. The Radius 332 339 * defines the square aperture in which the moments will be measured. This … … 338 345 * This function allocates the pmMoments structure. The resulting sky is used to 339 346 * set the value of the pmMoments.sky element of the provided pmSource structure. 340 * 347 * 341 348 */ 342 349 bool pmSourceLocalSky( … … 348 355 349 356 /** pmSourceMoments() 350 * 357 * 351 358 * Measure source moments for the given source, using the value of 352 359 * source.moments.sky provided as the local background value and the peak … … 355 362 * are measured within the given circular radius of the source.peak coordinates. 356 363 * The return value indicates the success (TRUE) of the operation. 357 * 364 * 358 365 */ 359 366 bool pmSourceMoments( … … 364 371 365 372 /** pmSourcePSFClump() 366 * 373 * 367 374 * We use the source moments to make an initial, approximate source 368 375 * classification, and as part of the information needed to build a PSF model for … … 373 380 * similar. The function returns a pmPSFClump structure, representing the 374 381 * centroid and size of the clump in the sigma_x, sigma_y second-moment plane. 375 * 382 * 376 383 * The goal is to identify and characterize the stellar clump within the 377 384 * sigma_x, sigma_y second-moment plane. To do this, an image is constructed to … … 384 391 * * used to calculate the median and standard deviation of the sigma_x, sigma_y 385 392 * values. These resulting values are returned via the pmPSFClump structure. 386 * 393 * 387 394 * The return value indicates the success (TRUE) of the operation. 388 * 395 * 389 396 * XXX: Limit the S/N of the candidate sources (part of Metadata)? (TBD). 390 397 * XXX: Save the clump parameters on the Metadata (TBD) 391 * 398 * 392 399 */ 393 400 pmPSFClump pmSourcePSFClump( … … 398 405 399 406 /** pmSourceRoughClass() 400 * 407 * 401 408 * Based on the specified data values, make a guess at the source 402 409 * classification. The sources are provides as a psArray of pmSource entries. … … 405 412 * can be extracted from the metadata using the given keywords. Except as noted, 406 413 * the data type for these parameters are psF32. 407 * 414 * 408 415 */ 409 416 bool pmSourceRoughClass( … … 415 422 416 423 /** pmSourceModelGuess() 417 * 424 * 418 425 * Convert available data to an initial guess for the given model. This 419 426 * function allocates a pmModel entry for the pmSource structure based on the … … 421 428 * are specified for each model below. The guess values are placed in the model 422 429 * parameters. The function returns TRUE on success or FALSE on failure. 423 * 430 * 424 431 */ 425 432 pmModel *pmSourceModelGuess( … … 430 437 431 438 /** pmContourType 432 * 439 * 433 440 * Only one type is defined at present. 434 * 441 * 435 442 */ 436 443 typedef enum { … … 442 449 443 450 /** pmSourceContour() 444 * 451 * 445 452 * Find points in a contour for the given source at the given level. If type 446 453 * is PM_CONTOUR_CRUDE, the contour is found by starting at the source peak, … … 452 459 * This function may be used as part of the model guess inputs. Other contour 453 460 * types may be specified in the future for more refined contours (TBD) 454 * 461 * 455 462 */ 456 463 psArray *pmSourceContour( … … 463 470 464 471 /** pmSourceFitModel() 465 * 472 * 466 473 * Fit the requested model to the specified source. The starting guess for the 467 474 * model is given by the input source.model parameter values. The pixels of … … 469 476 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE 470 477 * on success or FALSE on failure. 471 * 478 * 472 479 */ 473 480 bool pmSourceFitModel( … … 479 486 480 487 /** pmModelFitStatus() 481 * 488 * 482 489 * This function wraps the call to the model-specific function returned by 483 490 * pmModelFitStatusFunc_GetFunction. The model-specific function examines the 484 491 * model parameters, parameter errors, Chisq, S/N, and other parameters available 485 492 * from model to decide if the particular fit was successful or not. 486 * 493 * 487 494 * XXX: Must code this. 488 * 495 * 489 496 */ 490 497 bool pmModelFitStatus( … … 494 501 495 502 /** pmSourceAddModel() 496 * 503 * 497 504 * Add the given source model flux to/from the provided image. The boolean 498 505 * option center selects if the source is re-centered to the image center or if … … 501 508 * is at most the pixel range specified by the source.pixels image. The success 502 509 * status is returned. 503 * 510 * 504 511 */ 505 512 bool pmSourceAddModel( … … 507 514 psImage *mask, ///< The image pixel mask (valid == 0) 508 515 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 510 518 ); 511 519 512 520 513 521 /** pmSourceSubModel() 514 * 522 * 515 523 * Subtract the given source model flux to/from the provided image. The 516 524 * boolean option center selects if the source is re-centered to the image center … … 519 527 * image is at most the pixel range specified by the source.pixels image. The 520 528 * success status is returned. 521 * 529 * 522 530 */ 523 531 bool pmSourceSubModel( … … 525 533 psImage *mask, ///< The image pixel mask (valid == 0) 526 534 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 528 537 ); 529 538 530 539 531 540 /** 532 * 541 * 533 542 * The function returns both the magnitude of the fit, defined as -2.5log(flux), 534 543 * where the flux is integrated under the model, theoretically from a radius of 0 … … 537 546 * not excluded by the aperture mask. The model flux is calculated by calling the 538 547 * model-specific function provided by pmModelFlux_GetFunction. 539 * 548 * 540 549 * XXX: must code this. 541 * 550 * 542 551 */ 543 552 bool pmSourcePhotometry( … … 551 560 552 561 /** 553 * 562 * 554 563 * This function converts the source classification into the closest available 555 564 * approximation to the Dophot classification scheme: 556 * 565 * 557 566 * PM_SOURCE_DEFECT: 8 558 567 * PM_SOURCE_SATURATED: 8 … … 569 578 * PM_SOURCE_POOR_FIT_GAL: 2 570 579 * PM_SOURCE_OTHER: ? 571 * 580 * 572 581 */ 573 582 int pmSourceDophotType( … … 577 586 578 587 /** pmSourceSextractType() 579 * 588 * 580 589 * This function converts the source classification into the closest available 581 590 * approximation to the Sextractor classification scheme. the correspondence is 582 591 * not yet defined (TBD) . 583 * 592 * 584 593 * XXX: Must code this. 585 * 594 * 586 595 */ 587 596 int pmSourceSextractType( … … 590 599 591 600 /** pmSourceFitModel_v5() 592 * 601 * 593 602 * Fit the requested model to the specified source. The starting guess for the 594 603 * model is given by the input source.model parameter values. The pixels of … … 596 605 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE 597 606 * on success or FALSE on failure. 598 * 607 * 599 608 */ 600 609 bool pmSourceFitModel_v5( … … 606 615 607 616 /** pmSourceFitModel_v7() 608 * 617 * 609 618 * Fit the requested model to the specified source. The starting guess for the 610 619 * model is given by the input source.model parameter values. The pixels of … … 612 621 * function calls psMinimizeLMChi2() on the image data. The function returns TRUE 613 622 * on success or FALSE on failure. 614 * 623 * 615 624 */ 616 625 bool pmSourceFitModel_v7( … … 622 631 623 632 /** pmSourcePhotometry() 624 * 633 * 625 634 * XXX: Need descriptions 626 * 635 * 627 636 */ 628 637 bool pmSourcePhotometry(
Note:
See TracChangeset
for help on using the changeset viewer.
