Skip to content

Commit

Permalink
Mention polynomial calibration in readme for changes from v1.X.
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-j committed Aug 9, 2024
1 parent 0bb8f43 commit d76f841
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ Work to do includes:
Migration from < v2.0
---------------------

For most users the primary difference from v1.X will be that the data to predict
and fit is now specified as a list of `prospect.observation.Observation()`
instances, instead of a single 'obs' dictionary. There is a new convenience
method to convert from the old 'obs' dictionary format to the new specification.
This can be used with existing scripts as follows:
For many users the primary difference from v1.X will be that the data to predict
and fit a model to is now specified as a list of
`prospect.observation.Observation()` instances, instead of a single 'obs'
dictionary. There is a new convenience method to convert from the old 'obs'
dictionary format to the new specification. This can be used with existing
scripts as follows:

```py
# old build_obs function giving a dictionary
Expand All @@ -64,6 +65,10 @@ from prospect.fitting import fit_model
output = fit_model(observations, model, sps, **config)
```

Another change is that spectral response functions (i.e. calibration vectors) are now handled by specialized sub-classes of these `Observation` classes. See `spectra`_ for details.

.. _spectra: docs/spectra.rst

Finally, the output chain or samples is now stored as a structured array, where
each row corresponds to a sample, and each column is a parameter (possibly
multidimensional). Additional information (such as sample weights, likelihoods,
Expand Down
8 changes: 6 additions & 2 deletions doc/spectra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ over the polynomial coefficients (this allows you to place priors on the
accuracy of the spectrophotometric calibration). Or you can just take the
spectrum as perfectly calibrated.

Particular treatments can be implemented using different mix-in classes, e.g.
Particular treatments can be implemented using different mix-in classes for the
:py:class:`Spectrum` observational data, e.g. for optimization of a 5th order
polynomial calibration vector at each likelihood call, use
:py:class:`PolyOptCal` as follows

.. code-block:: python
from prospect.observation import Spectrum, PolyOptCal
class PolySpectrum(PolyOptCal, Spectrum):
class PolySpectrum(PolyOptCal, Spectrum): # order matters
pass
spec = PolySpectrum(wavelength=np.linspace(3000, 5000, N),
flux=np.zeros(N),
uncertainty=np.ones(N),
Expand Down

0 comments on commit d76f841

Please sign in to comment.