Description
openedon Aug 9, 2020
We have all of the information required to plot a dust law in the ExtinctionLaw
structs, so we should be able to create a plotting recipe with RecipesBase
to enable usage like
law = CCM89()
plot(law)
creating this plot recipe should be pretty easy and very similar to the recipes used in Polynomials.jl.
In terms of the interface, I think we need three key components
- what law are we plotting
- what wavelengths are we plotting
- Are we plotting wavenumbers (inverse micron, same effective shape as frequency) or wavelengths.
Here's what I think would be easiest to accomplish that interface
- Trivial
- By default, use the
bounds
of the law. Add a recipe with boundsf(::ExtinctionLaw, a, b)
and a recipe with an iterablef(::ExtincitonLaw, X)
- Let's add a keyword argument "unit". Default is
unit="invum"
. Other string options includeunit="angstrom"
,unit="micron"
, etc. Really we should just use Unitful for parsing these, except for the"invum"
case since that won't show up in unitful despite being (AFAIK) a de facto unit.
The onus for these recipes is to stop doing what we're doing with the plot docs, which is writing scripts that must be evaluated locally to generate plots that are checked out into version control and then only used for docs. A much better workflow would be to have the plots made as part of the documentation step, and ideally we can show the plotting code inside the docs for full reproducibility. After making these recipes, the docs should be able to be rewritten without the plots dir, and instead with simple plot(law)
calls using Documenter's @example
blocks.