Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #281 from mattjhill/docs
Browse files Browse the repository at this point in the history
more updates to model fitting via Susan
  • Loading branch information
nmearl authored Apr 3, 2017
2 parents bc30345 + 697f286 commit ca095ae
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions docs/source/model_fitting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ Simplex `~astropy.modeling.fitting.SimplexLSQFitter`
SLSQP `~astropy.modeling.fitting.SLSQPLSQFitter`
=================== ============================================

To add a model:
To use a model:

#. Select the desired layer from ``Layers`` (left panel). For example, you can
choose the layer containing your emission or absorption line.
See :ref:`doc_viewer` on how to create a layer for ROI.
#. Select the desired model name from the ``Add Model`` drop-down box and click
#. Select the layer you wish to operate on from the LAYERS window in the upper left.
#. Create and position a region of interest (ROI) as described in the :ref:`doc_viewer` section of
the documentation.”
#. Select the desired model from the ``Add Model`` drop-down box and click
``Select`` to add it to ``Current Models``.
#. If desired, repeat the above step to add additional models.
#. A new model layer will be created under ``Layers`` (left panel) and it is
attached to the selected data layer.

To fine-tune model parameters:
To edit model parameters or enter a better first estimate of the model parameters:

#. Select the model layer under ``Layers`` (left panel) that contains the desired
model.
Expand Down Expand Up @@ -102,9 +102,9 @@ When added to the ``Current Models`` list, a model will receive a default name
that is generated from the model type (as listed in the drop down model selector)
plus a running numerical suffix.

These names can be re-defined by clicking on the default name and typing a new
name. Note that re-defining names will require that any eventual expression in
the ``Arithmetic`` text box should be edited accordingly.
These names can be changed by clicking on the default name and entering a new
name. Note that changing model names will require that any expression in
the ``Arithmetic`` text box be edited accordingly.

For now, we are limited to only alphanumeric characters (and no white spaces) when
re-naming models.
Expand All @@ -116,15 +116,15 @@ Spline model
Note that the Spline model is of an intrinsically different nature than the
other models included in the drop down list of models. The Spline model, when
added to a pre-existing list of models, or when added by itself to an empty
list, will immediately be fitted to the data within the currently defined
Regions Of Interest. That is, being a linear model, there is no need to iterate
list, will immediately be fit to the data within the currently defined
Regions Of Interest (ROIs). That is, being a linear model, there is no need to iterate
in search of a "best fit" spline. It is just computed once and for all, and kept
as part of the compound model that is built from the models in the list and the
arithmetic behavior expression.

This implies that, to change the regions of interest that define the spline,
one has no other way than removing the spline from the list of models. Then,
redefine the regions of interest, and add a new spline to the list. To change
one must remove the spline from the list of models. Then, the user must redefine
the ROIs and add a new spline to the list of models to be fit. To change
a spline parameter, there is no need do discard the spline. Just do it in the
same way as with other models: just type in the new value for the parameter.

Expand All @@ -135,14 +135,14 @@ accessed, and varied, by the fitter. Thus, the spline parameters are not fitted,
they are just a convenient mechanism that enables user access to the parameter's
values.

The documentation for the spline model cane be seen here:
The documentation for the spline model can be seen here:

http://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.interpolate.UnivariateSpline.html

Note that SpecViz provides access, at this point, to just two of the parameters
in the scipy implementation of th spline function. Pay special attention to the
``smooth`` parameter. SpecViz initializes it to a 'best guess' (``len(wavelength)``).
Too small of a value in here may cause the spline to enter an infinite loop.
Too small of a value may cause the spline to enter an infinite loop.
Change the ``smooth`` value with care, trying to stay close to the default
value.

Expand All @@ -153,7 +153,7 @@ value.


Saving and Exporting Models to File
-----------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Selecting a model layer under "Layers" will enable the
:ref:`Save <doc_model_save>` (the "floppy disk" icon) and
Expand Down

0 comments on commit ca095ae

Please sign in to comment.