Import the components of the volume rendering extension
yt.visualization.volume_rendering.old_camera.
Camera
(center, normal_vector, width, resolution, transfer_function=None, north_vector=None, steady_north=False, volume=None, fields=None, log_fields=None, sub_samples=5, ds=None, min_level=None, max_level=None, no_ghost=True, data_source=None, use_light=False)[source]¶Bases: yt.utilities.parallel_tools.parallel_analysis_interface.ParallelAnalysisInterface
A viewpoint into a volume, for volume rendering.
The camera represents the eye of an observer, which will be used to generate raycast volume renderings of the domain.
Parameters: 


Examples
>>> from yt.mods import *
>>> import yt.visualization.volume_rendering.api as vr
>>> ds = load('DD1701') # Load a dataset
>>> c = [0.5]*3 # Center
>>> L = [1.0,1.0,1.0] # Viewpoint
>>> W = np.sqrt(3) # Width
>>> N = 1024 # Pixels (1024^2)
# Get density min, max >>> mi, ma = ds.all_data().quantities[‘Extrema’](‘Density’)[0] >>> mi, ma = np.log10(mi), np.log10(ma)
# Construct transfer function >>> tf = vr.ColorTransferFunction((mi2, ma+2)) # Sample transfer function with 5 gaussians. Use new col_bounds keyword. >>> tf.add_layers(5,w=0.05, col_bounds = (mi+1,ma), colormap=’spectral’)
# Create the camera object >>> cam = vr.Camera(c, L, W, (N,N), transfer_function=tf, ds=ds)
# Ray cast, and save the image. >>> image = cam.snapshot(fn=’my_rendering.png’)
comm
= None¶draw_box
(im, le, re, color=None)[source]¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)[source]¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)[source]¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)[source]¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)[source]¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶look_at
(new_center, north_vector=None)[source]¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)[source]¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
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.
pitch
(theta)[source]¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
roll
(theta)[source]¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)[source]¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)[source]¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)[source]¶Save an image with the transfer function represented as a colorbar.
Parameters: 


show
(clip_ratio=None)[source]¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, transparent=False)[source]¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)[source]¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)[source]¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


yaw
(theta)[source]¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)[source]¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)[source]¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
FisheyeCamera
(center, radius, fov, resolution, transfer_function=None, fields=None, sub_samples=5, log_fields=None, volume=None, ds=None, no_ghost=False, rotation=None, use_light=False)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶get_sampler
(args, kwargs)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, transparent=False)¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
HEALpixCamera
(center, radius, nside, transfer_function=None, fields=None, sub_samples=5, log_fields=None, volume=None, ds=None, use_kd=True, no_ghost=False, use_light=False, inner_radius=10)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶get_sampler
(args, kwargs)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, clim=None, label=None)[source]¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters:  

Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
InteractiveCamera
(center, normal_vector, width, resolution, transfer_function=None, north_vector=None, steady_north=False, volume=None, fields=None, log_fields=None, sub_samples=5, ds=None, min_level=None, max_level=None, no_ghost=True, data_source=None, use_light=False)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
finalize_image
(image)¶frames
= []¶get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶get_sampler_args
(image)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
yt.visualization.volume_rendering.old_camera.
MosaicCamera
(center, normal_vector, width, resolution, transfer_function=None, north_vector=None, steady_north=False, volume=None, fields=None, log_fields=None, sub_samples=5, ds=None, use_kd=True, l_max=None, no_ghost=True, tree_type='domain', expand_factor=1.0, le=None, re=None, nimx=1, nimy=1, procs_per_wg=None, preload=True, use_light=False)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
finalize_image
(image)¶get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶get_sampler_args
(image)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
PerspectiveCamera
(*args, **kwargs)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
A viewpoint into a volume, for perspective volume rendering.
The camera represents the eye of an observer, which will be used to generate raycast volume renderings of the domain. The rays start from the camera and end on the image plane, which generates a perspective view.
Note: at the moment, this results in a lefthanded coordinate system view
Parameters: 


annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, transparent=False)¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta, rot_center)[source]¶Rotate by a given angle about the vertical axis through the point center. This is accomplished by rotating the focal point and then setting the looking vector to point to the center.
Yaw the view.
Parameters: 


Examples
>>> cam.yaw(np.pi/4, (0., 0., 0.))
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
ProjectionCamera
(center, normal_vector, width, resolution, field, weight=None, volume=None, no_ghost=False, north_vector=None, ds=None, interpolated=False, method='integrate')[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶get_information
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0)[source]¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
SphericalCamera
(*args, **kwargs)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, transparent=False)¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
StereoPairCamera
(original_camera, relative_separation=0.005)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
finalize_image
(image)¶get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶get_sampler_args
(image)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶snapshot
(fn=None, clip_ratio=None, double_check=False, num_threads=0, transparent=False)¶Raycast the camera.
This method instructs the camera to take a snapshot – i.e., call the ray caster – based on its current settings.
Parameters: 


Returns:  image – An (N,M,3) array of the final returned values, in float64 form. 
Return type: 
switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
StereoSphericalCamera
(*args, **kwargs)[source]¶Bases: yt.visualization.volume_rendering.old_camera.Camera
annotate
(ax, enhance=True, label_fmt=None)¶comm
= None¶draw
()¶draw_box
(im, le, re, color=None)¶Draws a box on an existing volume rendering.
Draws a box defined by a left and right edge by modifying an existing volume rendering
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_box(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_box.png')
draw_coordinate_vectors
(im, length=0.05, thickness=1)¶Draws three coordinate vectors in the corner of a rendering.
Modifies an existing image to have three lines corresponding to the coordinate directions colored by {x,y,z} = {r,g,b}. Currently only functional for planeparallel volume rendering.
Parameters:  

Returns: 

Examples
>>> im = cam.snapshot()
>>> cam.draw_coordinate_vectors(im)
>>> im.write_png('render_with_grids.png')
draw_domain
(im, alpha=0.3)¶Draws domain edges on an existing volume rendering.
Draws a white wireframe on the domain edges.
Parameters: 


Returns:  nim – A new image with the domain lines drawn 
Return type:  Numpy ndarray 
Examples
>>> im = cam.snapshot()
>>> nim = cam.draw_domain(im)
>>> write_bitmap(nim, 'render_with_domain_boundary.png')
draw_grids
(im, alpha=0.3, cmap=None, min_level=None, max_level=None)¶Draws Grids on an existing volume rendering.
By mapping grid level to a color, draws edges of grids on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.add_grids(im)
>>> write_bitmap(im, 'render_with_grids.png')
draw_line
(im, x0, x1, color=None)¶Draws a line on an existing volume rendering. Given starting and ending positions x0 and x1, draws a line on a volume rendering using the camera orientation.
Parameters: 


Returns:  
Return type: 
Examples
>>> im = cam.snapshot()
>>> cam.draw_line(im, np.array([0.1,0.2,0.3], np.array([0.5,0.6,0.7)))
>>> write_bitmap(im, 'render_with_line.png')
finalize_image
(image)¶get_dependencies
(fields)¶get_information
()¶get_sampler
(args, kwargs)¶initialize_source
()¶look_at
(new_center, north_vector=None)¶Change the view direction based on a new focal point.
This will recalculate all the necessary vectors and vector planes to orient the image plane so that it points at a new location.
Parameters: 


move_to
(final, n_steps, final_width=None, exponential=False, clip_ratio=None)¶Loop over a look_at
This will yield n_steps snapshots until the current view has been moved to a final center of final with a final width of final_width.
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.move_to([0.2,0.3,0.6], 10)):
... iw.write_bitmap(snapshot, "move_%04i.png" % i)
new_image
()¶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.
pitch
(theta)¶Rotate by a given angle about the horizontal axis
Pitch the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to pitch the view. 

Examples
>>> cam.pitch(np.pi/4)
project_to_plane
(pos, res=None)¶roll
(theta)¶Rotate by a given angle about the view normal axis
Roll the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to roll the view. 

Examples
>>> cam.roll(np.pi/4)
rotate
(theta, rot_vector=None)¶Rotate by a given angle
Rotate the view. If rot_vector is None, rotation will occur around the north_vector.
Parameters: 


Examples
>>> cam.rotate(np.pi/4)
rotation
(theta, n_steps, rot_vector=None, clip_ratio=None)¶Loop over rotate, creating a rotation
This will yield n_steps snapshots until the current view has been rotated by an angle theta
Parameters: 


Examples
>>> for i, snapshot in enumerate(cam.rotation(np.pi, 10)):
... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
save_annotated
(fn, image, enhance=True, dpi=100, clear_fig=True, label_fmt=None)¶Save an image with the transfer function represented as a colorbar.
Parameters: 


save_image
(image, fn=None, clip_ratio=None, transparent=False)¶set_default_light_dir
()¶set_default_light_rgba
()¶show
(clip_ratio=None)¶This will take a snapshot and display the resultant image in the IPython notebook.
If yt is being run from within an IPython session, and it is able to determine this, this function will snapshot and send the resultant image to the IPython notebook for display.
If yt can’t determine if it’s inside an IPython session, it will raise YTNotInsideNotebook.
Parameters:  clip_ratio (float, optional) – If supplied, the ‘max_val’ argument to write_bitmap will be handed clip_ratio * image.std() 

Examples
>>> cam.show()
show_mpl
(im, enhance=True, clear_fig=True)¶show_tf
()¶switch_orientation
(normal_vector=None, north_vector=None)¶Change the view direction based on any of the orientation parameters.
This will recalculate all the necessary vectors and vector planes related to an orientable object.
Parameters: 


switch_view
(normal_vector=None, width=None, center=None, north_vector=None)¶Change the view based on any of the view parameters.
This will recalculate the orientation and width based on any of normal_vector, width, center, and north_vector.
Parameters: 


update_view_from_matrix
(mat)¶yaw
(theta)¶Rotate by a given angle about the vertical axis
Yaw the view.
Parameters:  theta (float, in radians) – Angle (in radians) by which to yaw the view. 

Examples
>>> cam.yaw(np.pi/4)
zoom
(factor)¶Change the distance to the focal point.
This will zoom the camera in by some factor toward the focal point, along the current view direction, modifying the left/right and up/down extents as well.
Parameters:  factor (float) – The factor by which to reduce the distance to the focal point. 

Notes
You will need to call snapshot() again to get a new image.
zoomin
(final, n_steps, clip_ratio=None)¶Loop over a zoomin and return snapshots along the way.
This will yield n_steps snapshots until the current view has been zooming in to a final factor of final.
Parameters: 

Examples
>>> for i, snapshot in enumerate(cam.zoomin(100.0, 10)):
... iw.write_bitmap(snapshot, "zoom_%04i.png" % i)
yt.visualization.volume_rendering.old_camera.
off_axis_projection
(ds, center, normal_vector, width, resolution, field, weight=None, volume=None, no_ghost=False, interpolated=False, north_vector=None, method='integrate')[source]¶Project through a dataset, offaxis, and return the image plane.
This function will accept the necessary items to integrate through a volume at an arbitrary angle and return the integrated field of view to the user. Note that if a weight is supplied, it will multiply the preinterpolated values together, then create cellcentered values, then interpolate within the cell to conduct the integration.
Parameters: 


Returns:  image – An (N,N) array of the final integrated values, in float64 form. 
Return type: 
Examples
>>> image = off_axis_projection(ds, [0.5, 0.5, 0.5], [0.2,0.3,0.4],
0.2, N, "temperature", "density")
>>> write_image(np.log10(image), "offaxis.png")