# yt.visualization.volume_rendering.lens module¶

Lens Classes

class yt.visualization.volume_rendering.lens.FisheyeLens[source]

A lens for dome-based renderings

This lens type accepts a field-of-view property, fov, that describes how wide an angle the fisheye can see. Fisheye images are typically used for dome-based presentations; the Hayden planetarium for instance has a field of view of 194.6. The images returned by this camera will be flat pixel images that can and should be reshaped to the resolution.

comm = None
get_dependencies(fields)
new_image(camera)[source]

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

project_to_plane(camera, pos, res=None)[source]
set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

For a FisheyeLens, the viewpoint is the camera’s position

setup_box_properties(camera)[source]

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.Lens[source]

A Lens is used to define the set of rays for rendering.

comm = None
get_dependencies(fields)
new_image(camera)[source]

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

set_camera(camera)[source]

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

Set the viewpoint used for AMRKDTree traversal such that you yield bricks from back to front or front to back from with respect to this point. Must be implemented for each Lens type.

setup_box_properties(camera)[source]

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.PerspectiveLens[source]

A lens for viewing a scene with a set of rays within an opening angle.

The scene will have an element of perspective to it since the rays are not parallel.

comm = None
get_dependencies(fields)
new_image(camera)[source]
partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

project_to_plane(camera, pos, res=None)[source]
set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

For a PerspectiveLens, the viewpoint is the front center.

setup_box_properties(camera)

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.PlaneParallelLens[source]

The lens for orthographic projections.

All rays emerge parallel to each other, arranged along a plane.

The initializer takes no parameters.

comm = None
get_dependencies(fields)
new_image(camera)

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

project_to_plane(camera, pos, res=None)[source]
set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

Set the viewpoint based on the camera

setup_box_properties(camera)

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.SphericalLens[source]

A lens for cylindrical-spherical projection.

Movies rendered in this way can be displayed in head-tracking devices or in YouTube 360 view.

comm = None
get_dependencies(fields)
new_image(camera)

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

project_to_plane(camera, pos, res=None)[source]
set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

For a SphericalLens, the viewpoint is the camera’s position

setup_box_properties(camera)[source]

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.StereoPerspectiveLens[source]

A lens that includes two sources for perspective rays, for 3D viewing

The degree of differences between the left and right images is controlled by the disparity (the maximum distance between corresponding points in the left and right images). By default, the disparity is set to be 3 pixels.

comm = None
get_dependencies(fields)
new_image(camera)[source]

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

project_to_plane(camera, pos, res=None)[source]
set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

For a PerspectiveLens, the viewpoint is the front center.

setup_box_properties(camera)

Set up the view and stage based on the properties of the camera.

class yt.visualization.volume_rendering.lens.StereoSphericalLens[source]

A lens for a stereo cylindrical-spherical projection.

Movies rendered in this way can be displayed in VR devices or stereo youtube 360 degree movies.

comm = None
get_dependencies(fields)
new_image(camera)

Initialize a new ImageArray to be used with this lens.

partition_index_2d(axis)
partition_index_3d(ds, padding=0.0, rank_ratio=1)
partition_index_3d_bisection_list()

Returns an array that is used to drive _partition_index_3d_bisection, below.

partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)

Given a region, it subdivides it into smaller regions for parallel analysis.

set_camera(camera)

Set the properties of the lens based on the camera.

This is a proxy for setup_box_properties

set_viewpoint(camera)[source]

For a PerspectiveLens, the viewpoint is the front center.

setup_box_properties(camera)[source]