On Wed, 25 Jul 2007, Tim Jenness wrote:
> There is a perl module written by Andy (Starlink::PSF) that takes the PSF
> output from the KAPPA PSF command and calculates the integral for it. It
> occurs to me that we may as well do that in PSF and store the answer in a
> parameter (it's being used by ORAC-DR).
>
> After the next release (or at least after Brad branches for the release) can
> anyone see an argument for not adding this? The perl code is below.
>
> --
> Tim Jenness
> JAC software
> http://www.jach.hawaii.edu/~timj
>
> my $PI = 3.1415926535;
> use Math::Gsl::Sf qw(:Gamma);
>
> my ($amp, $width, $axisr, $gamma) = @_;
>
> my $order = 1.0; #Exponent of r in eqn above
> my $k = ($order + 1.0) / $gamma;
>
> # Use geometric mean FWHM
> my $widthsq = $width * $axisr * $width;
>
> my $const = 2.0 * log(2.0)**$k ;
>
> my $integral = $PI * $amp * $widthsq * Math::Gsl::Sf::sf_gamma($k)
> / ( $gamma * $const );
If anyone is interested I seem to have some RFWS code around from
EDRS/DIPS that also does this job.
Peter.
|