tardis-sn / stardis

TARDIS stellar radiative transfer
https://tardis-sn.github.io/stardis/
11 stars 15 forks source link

Additional continuum opacitiy sources #177

Closed jvshields closed 9 months ago

jvshields commented 9 months ago

This PR does a couple things (probably too many), all related to fixing the stardis continuum difference to the solar spectrum. Specifically, it adds Hydrogen anion free free opacity and molecular Hydrogen bound free opacity. They can be turned on by pointing to the appropriate tables in the file_opacity section of the config, specified by the responsible species source of opacity. These sources pretty dramatically correct our continuum flux (see plot).

Screenshot 2024-02-19 at 2 36 09 PM

There's also a lot of spring cleaning, fixing up functions I've used, and generally simplifying/optimizing code in the files that I touch.

The UV continuum still has generally poor agreement, but that needs to be fixed by appropriate handling of metals and their large numbers of overlapping lines, which is beyond the scope of this PR.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (e0cbae4) 67.71% compared to head (de0178e) 68.70%.

Files Patch % Lines
stardis/tests/test_stardis_full.py 0.00% 2 Missing :warning:
...adiation_field/opacities/opacities_solvers/util.py 97.43% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #177 +/- ## ========================================== + Coverage 67.71% 68.70% +0.98% ========================================== Files 31 31 Lines 1109 1131 +22 ========================================== + Hits 751 777 +26 + Misses 358 354 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tardis-bot commented 9 months ago

*beep* *bop* Hi human, I ran benchmarks as you asked comparing main (e0cbae49c3bbe35384aa824e5fb38193969352c0) and the latest commit (de0178ec30130172e857efa8e411d80b2d4424b4). Here are the logs produced by ASV. Results can also be downloaded as artifacts here. Significantly changed benchmarks:

```diff ```

All benchmarks:

```diff All benchmarks: before after ratio [e0cbae49] [de0178ec] failed 1.12±0.01ms n/a run_stardis.BenchmarkStardis.time_calc_alpha_file 1.60±0s 1.60±0.01s 1.00 run_stardis.BenchmarkStardis.time_calc_alpha_line_at_nu 651±7ms 655±4ms 1.01 run_stardis.BenchmarkStardis.time_create_plasma 118±0.3ms 118±0.07ms 1.00 run_stardis.BenchmarkStardis.time_raytrace 3.66±0.01s 3.66±0s 1.00 run_stardis.BenchmarkStardis.time_run_stardis ```
jvshields commented 9 months ago

The calc_alpha_file() benchmark will break on before because this code changes the inputs to the function.