astropy/astropy — pull request #2932 by embray (2014-10-13 20:40:58+00:00)
Title: Define more parameter defaults for models

Since at least 0.4 (and I think earlier) it has been possible to define defaults for the parameter values on any model. But only a tiny handful of the built-in models currently take advantage of this (the polynomial models in particular set all coefficients to 0 by default, so that only the required coefficients need to be provided on instantiation).

However, I think that many if not most of the built-in models could have sensible defaults for at least some of their parameters (for example most of the models with an "amplitude" parameter could have it default to 1).

Having more parameter defaults could also be very helpful for compound models, where it becomes necessary to provide a large number of parameter values on instantiation. If more of those parameters had defaults it would make instantiating those models simpler (it is still always possible to update a model's parameters after it has been instantiated, which may be clearer in some cases anyways).

Models that could use defaults for some or all of their parameters include:

* [ ] [`Gaussian1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L31)
* [ ] [`GaussianAbsorption1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L121)
* [ ] [`Gaussian2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L171)
* [ ] [`Shift`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L349) (offsets=0?)
* [ ] [`Scale`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L379) (factors=1?)
* [ ] [`Redshift`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L405) (z=0?)
* [ ] [`Sine1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L446)
* [ ] [`Linear1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L492)
* [ ] [`Lorentz1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L538)
* [ ] [`Const1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L590)
* [ ] [`Const2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L630)
* [ ] [`Disk2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L663)
* [ ] [`Ring2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L713)
* [ ] [`Delta1D/2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L779) (these need to be implemented, period--though how would these be useful outside integration?)
* [ ] [`Box1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L793)
* [ ] [`Box2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L850)
* [ ] [`Trapezoid1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L909)
* [ ] [`Trapezoid2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L959)
* [ ] [`MexicanHat1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L1004)
* [ ] [`MexicanHat2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L1048)
* [ ] [`AiryDisk2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L1096)
* [ ] [`Beta1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L1185)
* [ ] [`Beta2D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/functional_models.py#L1241)
* [ ] [`PowerLaw1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/powerlaws.py#L20)
* [ ] [`BrokenPowerLaw1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/powerlaws.py#L73)
* [ ] [`ExponentialCutoffPowerLaw1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/powerlaws.py#L141)
* [ ] [`LogParabola1D`](https://github.com/astropy/astropy/blob/master/astropy/modeling/powerlaws.py#L200)
* [ ] [`Pix2Sky_CYP`](https://github.com/astropy/astropy/blob/master/astropy/modeling/projections.py#L341)
* [ ] [`Sky2Pix_CYP`](https://github.com/astropy/astropy/blob/master/astropy/modeling/projections.py#L381)
* [ ] [`EulerAngleRotation`](https://github.com/astropy/astropy/blob/master/astropy/modeling/rotations.py#L33)

Above I've listed all models that have parameters without defaults. I don't have experience with how all of these are used in practice so I don't know whether or not it makes sense to set defaults for all of them, or what those defaults would be. There are others that I think are pretty obvious.

If you think it makes sense to, please add some defaults to the list either by editing this list or commenting below.