Skip to content

Commit 3eb717d

Browse files
authored
Compromise and print out the estimated parameters individually (#1159)
1 parent b59003e commit 3eb717d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

docs/fitting.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,17 @@ For example, based on the spectrum defined above we can first select a region:
145145
>>> sub_region = SpectralRegion(4*u.um, 5*u.um)
146146
>>> sub_spectrum = extract_region(spectrum, sub_region)
147147
148-
Then estimate the line parameters it it for a Gaussian line profile::
149-
150-
>>> print(estimate_line_parameters(sub_spectrum, models.Gaussian1D())) # doctest: +FLOAT_CMP
151-
Model: Gaussian1D
152-
Inputs: ('x',)
153-
Outputs: ('y',)
154-
Model set size: 1
155-
Parameters:
156-
amplitude mean stddev
157-
Jy um um
158-
------------------ ---------------- -------------------
159-
1.1845669151078486 4.57517271067525 0.19373372929165977
148+
Then estimate the line parameters for a Gaussian line profile::
160149

150+
>>> result = estimate_line_parameters(sub_spectrum, models.Gaussian1D())
151+
>>> print(result.amplitude) # doctest: +FLOAT_CMP
152+
Parameter('amplitude', value=1.1845669151078486, unit=Jy)
153+
154+
>>> print(result.mean) # doctest: +FLOAT_CMP
155+
Parameter('mean', value=4.57517271067525, unit=um)
156+
157+
>>> print(result.stddev) # doctest: +FLOAT_CMP
158+
Parameter('stddev', value=0.19373372929165977, unit=um, bounds=(1.1754943508222875e-38, None))
161159

162160
If an `~astropy.modeling.Model` is used that does not have the predefined
163161
parameter estimators, or if one wants to use different parameter estimators then

0 commit comments

Comments
 (0)