xhorizon.shell_junction.helpers module

Helpers for evaluating coordinate transformations at null shell junctions.

xhorizon.shell_junction.helpers.set_ruv0(reg, r0=nan, u0=nan, v0=nan)

Self-consistently fill all three values based on input. For a shell junction, r0 should be nan and (u0 xor v0) should be finite. For a corner junction, r0 should be finite and (u0 xor v0) should be finite. Region arg is needed to provide c and F(r). If invalid, warn and return all nan values.

xhorizon.shell_junction.helpers.uvdl_of_r_at_uv0(r, reg, ublocks=[], vblocks=[], u0=nan, v0=nan)
Calculate uvdl of r at fixed u0 and v0 at block points. Slices in both directions are calculated.

r = An array of r values at which to evaluate. Non block points return nan. reg = A region in which to evaluate. ublocks = A list of integer indices for blocks in reg.blocks. The u0 slice is evaluated at block points in these blocks only. vblocks = A list of integer indices for blocks in reg.blocks. The v0 slice is evaluated at block points in these blocks only.

Alternately, block args can be provided directly as a list of blocks (bcon converter handles this). Block args necessary bc radius alone can be ambiguous in extended regions.

u0 = Fixed value of u0 at which the slice is evaluated. v0 = Fixed value of v0 at which the slice is evaluated.

Returns (r, uvdl_u0, uvdl_v0).

xhorizon.shell_junction.helpers.U_of_udl_at_v0(r, udl, U0)

Implements the function U(udl) = U0( r(udl,vdl0) ) at v=v0, where U0(r) is a function of radius. If U0==None, shell mode is activated, and the function reduces to U(udl) = udl. Inputs:

r = An array of radius values at points along v=v0. udl = An array of udl values corresponding to the points in r. U0 = For corner mode, a monotonic function U0(r). If U0==None, shell mode activates.

Returns:

U_v0 = An array of U values corresponding the points in r at v=v0.

xhorizon.shell_junction.helpers.V_of_vdl_at_u0(r, vdl, V0)

Implements the function V(vdl) = V0( r(udl0,vdl) ) at u=u0, where V0(r) is a function of radius. If V0==None, shell mode is activated, and the function reduces to V(vdl) = vdl. Inputs:

r = An array of radius values at points along u=u0. vdl = An array of vdl values corresponding to the points in r. V0 = For corner mode, a monotonic function V0(r). If V0==None, shell mode activates.

Returns:

V_u0 = An array of V values corresponding the points in r at u=u0.

This function is identical to U_of_udl_at_v0. To avoid redundancy, this one just calls the other. They are kept separate only to make the code where these are called more readable.

xhorizon.shell_junction.helpers.bcon(reg, blocks)

Block list converter. If blocks is a list of integers, convert to a list of blocks using reg.blocks. Else, do nothing. Return list of blocks.

xhorizon.shell_junction.helpers.dtr_calc(f0)

Given the values f(r0) in three of the regions, return the last one. The one to be calculated is specified by nan. Order is [A,B,C,D].

xhorizon.shell_junction.helpers.schwarz_dtr_masses(m, r0=1.0)

Given three of four masses, return dtr compatible remaining mass.

xhorizon.shell_junction.helpers.slicecheck(sl, reg)
xhorizon.shell_junction.helpers.get_r_ref(reg, r_refs, r0)