Giter Site home page Giter Site logo

juliaastro / dustextinction.jl Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 9.0 2.23 MB

Models for interstellar dust extinction

Home Page: https://juliaastro.github.io/DustExtinction.jl/stable

License: Other

Julia 100.00%
julia astronomy dust-extinction astrophysics

dustextinction.jl's People

Contributors

giordano avatar github-actions[bot] avatar icweaver avatar juliatagbot avatar kbarbary avatar mileslucas avatar sefffal avatar siddharthlal25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dustextinction.jl's Issues

TagBot trigger issue

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!

Plotting recipes (in order to clean up doc plots)

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

  1. what law are we plotting
  2. what wavelengths are we plotting
  3. 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

  1. Trivial
  2. By default, use the bounds of the law. Add a recipe with bounds f(::ExtinctionLaw, a, b) and a recipe with an iterable f(::ExtincitonLaw, X)
  3. Let's add a keyword argument "unit". Default is 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.

SMC and LMC curves

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

Build error with Julia 1.4.1

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

Redundant utility function

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.

aa_to_invum(wave::Quantity) = aa_to_invum(ustrip(u"angstrom", wave))

Tagging a new release

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.

Documentation for color laws

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.