astro-group-bristol / Gradus.jl

Extensible spacetime agnostic general relativistic ray-tracing (GRRT).
https://astro-group-bristol.github.io/Gradus.jl/dev/
GNU General Public License v3.0
16 stars 2 forks source link

Add extrapolation to orbit-solving interpolation #180

Closed phajy closed 8 months ago

phajy commented 8 months ago

This pull request adds extrapolation to the orbit-solving interpolation. The extrapolate=true argument has been added to the LinearInterpolation function calls in the PlungingInterpolation struct.

fjebaker commented 8 months ago

I've modified your solution: I like that we no longer have silent extrapolations happening, but am wary of allowing extrapolations since these can lead to hard-to-debug numerical problems if the extrapolation regime is poor. The alternative fix I've added is that we clamp the interpolation within the extrema of the domain, and print a warning to the user informing them that the point is outside of the domain and they may require additional geodesics to populate that region.

This is equivalent to constant extrapolation, but tells the user it is happening.

I've also made the interpolation functions use the utility _make_interpolation function, so that if we decide that we want to change the interpolation / extrapolation defaults, this is easier to do!

codecov-commenter commented 8 months ago

Codecov Report

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

Comparison is base (e9e8632) 68.49% compared to head (9cb90e6) 68.75%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #180 +/- ## ========================================== + Coverage 68.49% 68.75% +0.25% ========================================== Files 66 66 Lines 2787 2810 +23 ========================================== + Hits 1909 1932 +23 Misses 878 878 ``` | [Files](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol) | Coverage Δ | | |---|---|---| | [src/corona/profiles/analytic.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL2Nvcm9uYS9wcm9maWxlcy9hbmFseXRpYy5qbA==) | `100.00% <100.00%> (ø)` | | | [src/corona/profiles/radial.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL2Nvcm9uYS9wcm9maWxlcy9yYWRpYWwuamw=) | `87.69% <100.00%> (+1.72%)` | :arrow_up: | | [src/orbits/orbit-solving.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL29yYml0cy9vcmJpdC1zb2x2aW5nLmps) | `91.22% <100.00%> (+0.48%)` | :arrow_up: | | [src/transfer-functions/transfer-functions-2d.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL3RyYW5zZmVyLWZ1bmN0aW9ucy90cmFuc2Zlci1mdW5jdGlvbnMtMmQuamw=) | `80.30% <100.00%> (ø)` | | | [src/utils.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL3V0aWxzLmps) | `44.77% <100.00%> (+3.50%)` | :arrow_up: | | [src/transfer-functions/types.jl](https://app.codecov.io/gh/astro-group-bristol/Gradus.jl/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=astro-group-bristol#diff-c3JjL3RyYW5zZmVyLWZ1bmN0aW9ucy90eXBlcy5qbA==) | `57.14% <0.00%> (ø)` | |

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