tardis-sn / stardis

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

Make hydrogen ignore broadening mask #173

Closed jvshields closed 9 months ago

jvshields commented 9 months ago

Hydrogen lines are much broader than virtually all other lines in a stellar spectrum. If you let hydrogen ignore the broadening range that restricts the calculations of other lines, then you get to use a much stricter broadening range for all the rest of the lines. This allows for some pretty powerful speedups reducing the number of line calculations by a factor of 3 to 10 while still getting accurate spectra.

The PR also includes a small line opacity calculation restructure by moving an if statement checking for a broadening mask outside of the frequency for loop.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (a1c7f38) 68.34% compared to head (f05812e) 68.39%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #173 +/- ## ========================================== + Coverage 68.34% 68.39% +0.05% ========================================== Files 31 31 Lines 1153 1155 +2 ========================================== + Hits 788 790 +2 Misses 365 365 ```

: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 (a1c7f386a192fa50abe3b4a37828705c21797f2e) and the latest commit (f05812ec800a276638329b22581dbe0c5837a95f). 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 [a1c7f386] [f05812ec] 1.49±0.02ms 1.45±0.02ms 0.97 run_stardis.BenchmarkStardis.time_calc_alpha_file 1.65±0.01s 1.65±0s 1.00 run_stardis.BenchmarkStardis.time_calc_alpha_line_at_nu 672±10ms 677±10ms 1.01 run_stardis.BenchmarkStardis.time_create_plasma 101±1ms 99.8±0.7ms 0.99 run_stardis.BenchmarkStardis.time_raytrace 3.82±0.01s 3.81±0.02s 1.00 run_stardis.BenchmarkStardis.time_run_stardis ```