Skip to content

Commit

Permalink
Use builtin Astropy model unit and bounding box support
Browse files Browse the repository at this point in the history
Define the `input_units`, `return_units`, `input_units_equivalencies`,
and `bounding_box` properties for all models. Use Astropy models' built-in
unit conversion support.

All models now require inputs with valid units (wavelength, wavenumber, or
frequency). Dimensionless inputs are no longer automatically converted to
wavenumber.

Fixes #237.
  • Loading branch information
lpsinger committed Sep 5, 2024
1 parent 8871ed6 commit acf4246
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 370 deletions.
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
1.6.dev (unreleased)
================

- none yet
- Define the ``input_units``, ``return_units``, ``input_units_equivalencies``,
and ``bounding_box`` properties for all models. Use Astropy models' built-in
unit conversion support.

- All models now require inputs with valid units (wavelength, wavenumber, or
frequency). Dimensionless inputs are no longer automatically converted to
wavenumber.

1.5 (2024-08-16)
================
Expand Down
2 changes: 1 addition & 1 deletion docs/dust_extinction/dev_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All
All dust extinction models have at least the following:

* A member variable `x_range` that that define the valid range of wavelengths. These are defined in inverse microns as is common for extinction curve research.
* A member function `evaluate` that computes the extinction at a given `x` and any model parameter values. The `x` values are checked to be within the valid `x_range`. The `x` values should have astropy.units. If they do not, then they are assumed to be in inverse microns and a warning is issued stating such.
* A member function `evaluate` that computes the extinction at a given `x` and any model parameter values. The `x` values are checked to be within the valid `x_range`. The `x` values should have astropy.units.

All of these classes used in ``dust_extinction`` are based on the
`Model <https://docs.astropy.org/en/stable/modeling/>`_ astropy.modeling class.
Expand Down
Loading

0 comments on commit acf4246

Please sign in to comment.