Skip to content

Commit

Permalink
Clean up some more docstrings in ap_components
Browse files Browse the repository at this point in the history
  • Loading branch information
drvdputt committed Aug 13, 2024
1 parent 936a2fa commit a643417
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions pahfit/fitters/ap_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def evaluate(x, tau, x_0, fwhm):


class PowerDrude1D(Fittable1DModel):
"""Drude profile with amplitude determined by power.
"""
Drude profile with amplitude determined by power.
Special attention is needed for the units. An implementation for
this is 'unitful' because 'power' is defined as integral over
Expand Down Expand Up @@ -178,11 +179,11 @@ class PowerDrude1D(Fittable1DModel):
)

def evaluate(self, x, power, x_0, fwhm):
"""Smith, et al. (2007) dust features model. Calculation is for
a Drude profile (equation in section 4.1.4).
"""
Smith, et al. (2007) dust features model. Calculation is for a
Drude profile (equation in section 4.1.4).
The intensity profile as a function of
wavelength is
The intensity profile as a function of wavelength is
Inu(lambda) = (b * g**2) / ((lambda / x0 - x0 / lambda)**2 + g**2)
Expand All @@ -201,9 +202,9 @@ def evaluate(self, x, power, x_0, fwhm):
According to the above equations, without additional
conversions, the resulting amplitude unit will be unit(P) *
Hz-1. The factor x0 / c = 1 / nu0 (Hz-1) will result in very small
values for for Inu(lambda), or very large values for P. To avoid
numerical problems, we apply a conversion that ensures
Hz-1. The factor x0 / c = 1 / nu0 (Hz-1) will result in very
small values for for Inu(lambda), or very large values for P. To
avoid numerical problems, we apply a conversion that ensures
Inu(lambda) and P are in internal units.
Parameters
Expand All @@ -225,7 +226,8 @@ def evaluate(self, x, power, x_0, fwhm):


class PowerGaussian1D(Fittable1DModel):
"""Gaussian profile with amplitude derived from power.
"""
Gaussian profile with amplitude derived from power.
Implementation analogous to PowerDrude1D.
Expand All @@ -236,7 +238,7 @@ class PowerGaussian1D(Fittable1DModel):
Flambda(lambda) = Alambda * G(lambda; mean, stddev)
where G is a gaussian profile with amplitude 1.Converting this to
where G is a gaussian profile with amplitude 1. Converting this to
Fnu units yields
Fnu(lambda) = lambda**2 / c * Flambda(lambda)
Expand Down Expand Up @@ -271,7 +273,8 @@ class PowerGaussian1D(Fittable1DModel):
)

def evaluate(self, x, power, mean, stddev):
"""Evaluate F_nu(lambda) given the power.
"""
Evaluate F_nu(lambda) given the power.
See class description for equations and unit notes."""

Expand Down

0 comments on commit a643417

Please sign in to comment.