IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26669


Ignore:
Timestamp:
Jan 22, 2010, 11:30:32 AM (16 years ago)
Author:
Paul Price
Message:

Add function to return FWHM from PSF.

Location:
branches/eam_branches/20091201/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/objects/pmPSF.c

    r24206 r26669  
    4242#include "pmErrorCodes.h"
    4343
     44
     45#define MAX_AXIS_RATIO 20.0             // Maximum axis ratio for PSF model
     46
    4447/*****************************************************************************/
    4548/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     
    405408    return psf;
    406409}
     410
     411
     412float pmPSFtoFWHM(const pmPSF *psf, float x, float y)
     413{
     414    PS_ASSERT_PTR_NON_NULL(psf, NAN);
     415
     416    pmModel *model = pmModelFromPSFforXY(psf, x, y, 1.0); // Model of source
     417    psF32 *params = model->params->data.F32; // Model parameters
     418    psEllipseAxes axes = pmPSF_ModelToAxes(params, MAX_AXIS_RATIO); // Ellipse axes
     419
     420    // Curiously, the minor axis can be larger than the major axis, so need to check.
     421    float fwhm = 2.355 * PS_MAX(axes.minor, axes.major); // FWHM, converted from sigma
     422
     423    psFree(model);
     424
     425    return fwhm;
     426}
  • branches/eam_branches/20091201/psModules/src/objects/pmPSF.h

    r25754 r26669  
    111111psEllipseAxes pmPSF_ModelToAxes (psF32 *modelPar, double maxAR);
    112112
     113/// Calculate FWHM value from a PSF
     114float pmPSFtoFWHM(
     115    const pmPSF *psf,                   // PSF of interest
     116    float x, float y                    // Position of interest
     117    );
     118
     119
    113120/// @}
    114121# endif
Note: See TracChangeset for help on using the changeset viewer.