fitLP(filename=None,
lprof=None,
theory=0,
show=0,
cfg='
' ,
convert_ms_kms=0,
vary_pars=[ ' vexp ' ] ,
i_vexp=15.0,
i_gamma=1.0,
do_gauss=0)
| source code
|
Fit a line profile with a soft parabola, and a Gaussian component if
required.
The method automatically checks if a second component is needed (eg an
extra absorption component). An estimate of the expansion velocity (width
of the profile) and an improved guess of the vlsr are given.
A guess for the gas terminal velocity is returned, as well as its
error and the fitted profile (sp/gaussian, and if applicable extra
gaussian and the full fit).
- Parameters:
filename (string) - The filename to the data file of the line profile. If None a line
profile object is expected.
(default: None)
lprof (LPDataReader()) - A line profile object (LPDataReader or inheriting classes) If
None, a filename is expected! If not None, the results are saved
in this object as well as returned upon method call
(default: None)
convert_ms_kms (bool) - Convert velocity grid from m/s to km/s.
(default: 0)
theory (bool) - If theoretical profile, and filename is given, set vlsr to 0 and
read two columns. lprof not relevant if True.
(default: 0)
vary_pars (list[string]) - The soft parabola parameters varied (can only be vexp or gamma
for now). The initial values for parameters listed here are not
used. If 'gamma' is requested, a reasonable guess for i_vexp when
calling the method will improve the fitting results. This is done
for the first guess only! If a Gaussian absorption is present
improving these first guesses won't make much of a difference.
However, the first guess value for gamma is still used. Vexp is
always varied if absorption is present.
(default: ['vexp'])
i_vexp (float) - The initial guess for the expansion velocity. Not relevant if
vexp is included in vary_pars.
(default: 15.0)
i_gamma (float) - The initial guess for the gamma parameter of soft parab. Not
relevant if gamma is included in vary_pars.
(default: 1.0)
do_gauss (bool) - Force a Gaussian fit regardless of soft parabola fit results.
Still does the soft parabola fit first to allow for comparison of
parameters.
(default: 0)
show (bool) - Show the results of the fit
(default: 0)
- Returns: dict[float,float,float,float,funclib.Function(),
funclib.Function(),funclib.Function()]
- dictionary including [vexp,evexp,gamma,egamma,fitprof,gaussian,
fullfit,dintint,fgintint]
|