juliaastro / dustextinction.jl Goto Github PK
View Code? Open in Web Editor NEWModels for interstellar dust extinction
Home Page: https://juliaastro.github.io/DustExtinction.jl/stable
License: Other
Models for interstellar dust extinction
Home Page: https://juliaastro.github.io/DustExtinction.jl/stable
License: Other
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
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
Here's what I think would be easiest to accomplish that interface
bounds
of the law. Add a recipe with bounds f(::ExtinctionLaw, a, b)
and a recipe with an iterable f(::ExtincitonLaw, X)
unit="invum"
. Other string options include unit="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.
Dear friends,
I would just kindly suggest to add explicit models for the SMC and the LMC. More or less as in the analogous python package dust_extinction (https://dust-extinction.readthedocs.io/en/stable/).
Indeed, already now the Gordon et al. (2016) recipe could cover the MW and SMC cases juts playing with Rv and f_A parameters. I guess it could be a simple extension.
Thanks anyway,
Stefano
In the documentation of cal00
the default value for Rv is mentioned as 4.05
DustExtinction.jl/src/color_laws.jl
Line 100 in a39125b
Whereas in the function default value of Rv is taken as 3.1
DustExtinction.jl/src/color_laws.jl
Line 117 in a39125b
I get the following compilation error with Julia 1.4.1.
(@v1.4) pkg> add DustExtinction
Updating registry at ~/.julia/registries/General
Updating git-repo https://github.com/JuliaRegistries/General.git
Resolving package versions...
Updating ~/.julia/environments/v1.4/Project.toml
[no changes]
Updating ~/.julia/environments/v1.4/Manifest.toml
[no changes]
julia> using DustExtinction
[ Info: Precompiling DustExtinction [fb44c06c-c62f-5397-83f5-69249e0a3c8e]
ERROR: LoadError: LoadError: UndefVarError: Poly not defined
Stacktrace:
[1] top-level scope at /home/gulabd/.julia/packages/DustExtinction/HafUQ/src/color_laws.jl:10
[2] include(::Module, ::String) at ./Base.jl:377
[3] include(::String) at /home/gulabd/.julia/packages/DustExtinction/HafUQ/src/DustExtinction.jl:1
[4] top-level scope at /home/gulabd/.julia/packages/DustExtinction/HafUQ/src/DustExtinction.jl:14
[5] include(::Module, ::String) at ./Base.jl:377
[6] top-level scope at none:2
[7] eval at ./boot.jl:331 [inlined]
[8] eval(::Expr) at ./client.jl:449
[9] top-level scope at ./none:3
in expression starting at /home/gulabd/.julia/packages/DustExtinction/HafUQ/src/color_laws.jl:10
in expression starting at /home/gulabd/.julia/packages/DustExtinction/HafUQ/src/DustExtinction.jl:14
ERROR: Failed to precompile DustExtinction [fb44c06c-c62f-5397-83f5-69249e0a3c8e] to /home/gulabd/.julia/compiled/v1.4/DustExtinction/AbarJ_6AjEn.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
[3] _require(::Base.PkgId) at ./loading.jl:1029
[4] require(::Base.PkgId) at ./loading.jl:927
[5] require(::Module, ::Symbol) at ./loading.jl:922
[6] eval(::Module, ::Any) at ./boot.jl:331
[7] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
[8] run_backend(::REPL.REPLBackend) at /home/gulabd/.julia/packages/Revise/AMRie/src/Revise.jl:1023
[9] top-level scope at none:0
[10] eval(::Module, ::Any) at ./boot.jl:331
[11] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
[12] run_backend(::REPL.REPLBackend) at /home/gulabd/.julia/packages/Revise/AMRie/src/Revise.jl:1023
[13] top-level scope at none:0
The general format of a model is of the form: model(λ::Real, Rv = 3.1)
and if λ
is Quantity
, then we have a modified definition to the function call being:
model(λ::Quantity, Rv::Real = 3.1) = model(ustrip(u"angstrom", λ), Rv) * u"mag"
.
Therefore function aa_to_invum
in each of these models will be called with λ::Real
and not as λ::Quantity
. Therefore the utility function mentioned below is redundant.
DustExtinction.jl/src/color_laws.jl
Line 5 in 1766089
There are commits to this repo that allow FITSIO to be 0.16 and Dirckx to be 0.5, but a release has not been tagged and registered from some time.
If we're okay to proceed, I'm happy to bump the version and trigger tag bot.
DustExtinction.jl/src/color_laws.jl
Line 119 in a39125b
Here λ
is already a scalar so I think broadcasting is redundant.
Here are a list of dust extinction models that have been implemented somewhere else (along with their paper) that could be implemented into this repository.
Currently the documentation for some of the color laws (e.g., F99, Cal00, CCM89) says that they return E(B-V).
If I'm not mistaken, these actually give the ratio A_lambda / A_V, where A_lambda is the extinction in magnitudes at the input wavelength and A_V is the extinction in V band. A_V can be computed as R_v * E(B-V), where E(B-V) can be looked up via SFD98Map for Galactic extinction. Could you correct these docstrings?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.