Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer functions: fail for warped disc #209

Open
fjebaker opened this issue Aug 28, 2024 · 0 comments
Open

Transfer functions: fail for warped disc #209

fjebaker opened this issue Aug 28, 2024 · 0 comments
Labels
bug Something isn't working integrator Issue or pull request related to integration methods

Comments

@fjebaker
Copy link
Member

using Gradus

function NoZDisc(m::AbstractMetric{T}; outer_radius = T(50)) where {T}
    isco = Gradus.isco(m)

    rs = collect(range(isco, outer_radius, 200))
    hs = rs .* cos.(Gradus._solve_orbit_θ.(m, rs))

    interp = Gradus._make_interpolation(rs, hs)
    WarpedThinDisc(interp, isco, outer_radius)
end

m = NoZMetric= 2.0, a = 0.9)
x = SVector(0.0, 10000.0, deg2rad(85), 0.0)
d = NoZDisc(m, outer_radius = 1000.0)

model = LampPostModel(h = 5.0)
radii = Gradus.Grids._inverse_grid(Gradus.isco(m) + 0.5, 300.0, 100)
itb = @time Gradus.interpolated_transfer_branches(m, x, d, radii; verbose = true)

# dispatches special methods for calculating the emissivity profile if available
prof = emissivity_profile(m, d, model; n_samples = 2000)

gbins = collect(range(0.0, 1.2, 800))
tbins = collect(range(0, 125.0, 500))

t0 = Gradus.continuum_time(m, x, model)

flux = Gradus.integrate_lagtransfer(
    prof,
    itb,
    gbins,
    tbins;
    t0 = t0,
    n_radii = 6000,
    rmin = minimum(radii),
    rmax = maximum(radii),
)

In the main branch this will fail because there is no appropriate dispatch. I made some changes that use a datum plane, but I think there's a constrain_upper_hemisphere lurking somewhere that's preventing it from working. Pending investigation.

@fjebaker fjebaker added bug Something isn't working integrator Issue or pull request related to integration methods labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integrator Issue or pull request related to integration methods
Projects
None yet
Development

No branches or pull requests

1 participant