xhorizon.diagram_tools.diagram_classes module
- This module defines the classes
diagram region block
which are used to construct and plot diagrams.
- class xhorizon.diagram_tools.diagram_classes.diagram
Bases:
objectA diagram is fundamentally a collection of curves. A diagram object consists of:
a list of curves in UV coordinates, and
a list of sss regions, each of which bring their own curves.
- add_curves_UV(crvlist)
- dplot()
- class xhorizon.diagram_tools.diagram_classes.region(metfunc, rparams={})
Bases:
objectA region object corresponds to a single piece of an sss spacetime with metric function f(r). This will often, but not always, be a single Eddington-Finklestein region of the spacetime. A region object consists of:
a metfunc object which determines the metric function f(r) and its associated transformations
a list of curve objects explicitly belonging to the region
a list of block objects belonging to the region
methods providing transformations from region to diagram coordinates
- UV_of_uvdl(uvdl)
- uvdl_of_UV(UV)
- U_of_udl(udl)
- V_of_vdl(vdl)
- udl_of_U(U)
- vdl_of_V(V)
- add_block(j, bparams)
Add a new block to the region, given index j and parameters bparams.
- add_curves_uvdl(crvlist)
- rplot()
- class xhorizon.diagram_tools.diagram_classes.block(master, j, bparams={})
Bases:
objectA block object corresponds to a single sss block. It is owned by a region, its “master”, which determines its metric function and region params c,s0.
The block object does most of the heavy lifting for creating a diagram.
- update()
Use current block primary attributes to set derived attributes and coordinate transformations. Check for consistency.
- add_curves_uv(crvlist)
Add a curve to the block, using uv coords to fill all other coordinate fields.
- refresh_curves_from_uv()
Recalculate coordinates of all curves based on the current uv coords.
- add_curves_tr(crvlist)
Add a curve to the block, using tr coords to fill all other coordinate fields. Only curves lying entirely within the block can be added. If any points have an invalid radius, whole curve is discarded.
- update_curves_from_tr(crvlist)
Update curves to the block, using tr coords to fill all other coordinate fields. Only curves lying entirely within the block can be added. If any points have an invalid radius, whole curve is discarded.
- fill(sty={})
Fill in the block with a background patch.
- fill_between_r(rvals=array([0., 0.]), sty={}, npoints=1000, inf=100)
Fill block between r values if valid.
- bplot()
Plot all curves belonging to the block.
- update_derived_attributes()
Use the current block primary attributes to set the derived attributes.
- update_coord_transf()
Use the current block attributes to set the coordinate transformations.
- consistency_check()
Check if current block attributes are self-consistent. True if consistent. False if not.
- update_curves_from_uv(crvlist)
Update curves in the block, using uv coords to fill all other coordinate fields.
- apply_masks(crvlist)
Apply all masks to self.curves. Masks are functions of the form
mask(block, crvlist): return new_crvlist