BEAST-Fitting / beast

Bayesian Extinction And Stellar Tool
http://beast.readthedocs.io
23 stars 35 forks source link

Extinction curves that extend below 912 A #767

Closed karllark closed 2 years ago

karllark commented 2 years ago

BEAST runs interested in providing predictions of ionizing photons need dust extinction curves that extend below 912 A. This PR provides two new dust extinction models that merge observation based extinction curves with dust grain models to provide this capability.

This is done using the Generalized_DustExt capabilities and models available in the dust_extinction package. Previously this capability was provide directly inside of the Gordon16_RvFALaw using static data files.

In the beast_settings.txt file, these new extinction models can be used by declaring the extinction mixture model to be:

extlaw = extinction.Generalized_RvFALaw(ALaw=extinction.Generalized_DustExt(curve=’F19_D03_extension’), BLaw=extinction.Generalized_DustExt(curve=’G03_SMCBar_WD01_extension’))

Replaces #749.

karllark commented 2 years ago

Still need to remove the old draine_extend code and add docs. And maybe a quick test.

codecov-commenter commented 2 years ago

Codecov Report

Merging #767 (5add070) into master (bf9ed7a) will increase coverage by 0.29%. The diff coverage is 83.87%.

@@            Coverage Diff             @@
##           master     #767      +/-   ##
==========================================
+ Coverage   42.84%   43.14%   +0.29%     
==========================================
  Files         102      103       +1     
  Lines        9928     9961      +33     
==========================================
+ Hits         4254     4298      +44     
+ Misses       5674     5663      -11     
Impacted Files Coverage Δ
beast/physicsmodel/dust/extinction.py 90.04% <50.00%> (+6.10%) :arrow_up:
beast/physicsmodel/dust/extinction_extension.py 92.00% <92.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bf9ed7a...5add070. Read the comment docs.

karllark commented 2 years ago

Plots showing the extended extinction curves compared to the grain models can be seen in the API docs via the RTD build for this PR.

https://beast--767.org.readthedocs.build/en/767/api/beast.physicsmodel.dust.extinction_extension.F19_D03_extension.html#beast.physicsmodel.dust.extinction_extension.F19_D03_extension

and

https://beast--767.org.readthedocs.build/en/767/api/beast.physicsmodel.dust.extinction_extension.G03_SMCBar_WD01_extension.html#beast.physicsmodel.dust.extinction_extension.G03_SMCBar_WD01_extension

cmurray-astro commented 2 years ago

Gold star indeed! Thanks, Karl! This looks good to me. Reading the new docs I wonder if there is a/what is the drawback to defaulting to the "extension" models in general (i.e., even without sub-912A observations)?

galaxyumi commented 2 years ago

Hooray. Thanks Karl to make this functionality generic and self-contained eventually! So now the default is for users to indicate whether they want to use an extended version or not in their beast_settings.txt file, right?

karllark commented 2 years ago

Gold star indeed! Thanks, Karl! This looks good to me. Reading the new docs I wonder if there is a/what is the drawback to defaulting to the "extension" models in general (i.e., even without sub-912A observations)?

Yes. The grain model is smoothly merged with the observational model starting at 1675 A. So, the extinction curve in the FUV is changed from what the observations are saying.

karllark commented 2 years ago

Hooray. Thanks Karl to make this functionality generic and self-contained eventually! So now the default is for users to indicate whether they want to use an extended version or not in their beast_settings.txt file, right?

Yes.

I am hoping you can try out this new capability and see if it works as you expected.

karllark commented 2 years ago

Gold star indeed! Thanks, Karl! This looks good to me. Reading the new docs I wonder if there is a/what is the drawback to defaulting to the "extension" models in general (i.e., even without sub-912A observations)?

Yes. The grain model is smoothly merged with the observational model starting at 1675 A. So, the extinction curve in the FUV is changed from what the observations are saying.

I've added a bit more documentation to explain this point.

karllark commented 2 years ago

Gold star = code, tests, and docs. Trying to encourage such PRs. ;-)

karllark commented 2 years ago

Still looking for a formal review of this PR when one of you has the time.