refraction_render.renderers.Renderer_35mm¶
-
class
refraction_render.renderers.
Renderer_35mm
(calc, h_obs, lat_obs, lon_obs, direction, max_distance, distance_res=10, vert_obs_angle=0.0, vert_res=1000, focal_length=2000, atol=1.1e-07, rtol=1.1e-07, aspect_ratio=None, ellps='sphere')[source]¶ Bases:
object
Object used to set a camera angle and position to render a scene.
-
__init__
(calc, h_obs, lat_obs, lon_obs, direction, max_distance, distance_res=10, vert_obs_angle=0.0, vert_res=1000, focal_length=2000, atol=1.1e-07, rtol=1.1e-07, aspect_ratio=None, ellps='sphere')[source]¶ - Parameters
- calc: calcs object
object which can be used to calculate the trajectory of light rays
- h_obs: float
height of renderer in meters
- lat_obs: float
latitude of renderer in degrees between -90 and 90
- lon_obs: float
longitude of renderer in degrees between -180 adn 180
- direction: tuple or float
tuple: tuple containing a latitude and longitude point to point renderer towards. float: heading to point the renderer in.
- max_distance: float
maximum distance away from the renderer to calculate the light ray path
- distance_res: float
distance between points where the light ray path is checked for intersection point.
- vert_obs_angle: float
vertical tilt of the renderer.
- vert_res: int
resolution of pixels on the verticle
- focal_length: float
focal length in milimeters to calculate the field of view of the camera. This, along with the vertial resolution, sets the resolution on the horizontal.
- atol: float
absolute tolerance of ode solver
- rtol: float
relative tolerance of the ode solver
- aspect_ratio: tuple
aspect ratio for image
- ellps: str,
type of geoid to use for calculating gps, default is “sphere”
Methods
__init__
(calc, h_obs, lat_obs, lon_obs, …)- Parameters
ray_diagram
(ax[, heading, heights, style, …])Side profile view showing the rays trajectories.
render_scene
(scene, image_name[, …])Render a scene object for the renderer’s given field of view and direction.
set_location
(lat_obs, lon_obs, direction)This function can be used to change the location and heading of the renderer.
Attributes
Calc object used to calculate verticle rays.
distance points.
geod object used to distances between latitude and longitude coordinates.
Horizontal angular scale of the image frame.
Vertical angular scale of the image frame.
Vertial field of view for this particular renderer
-
property
calc
¶ Calc object used to calculate verticle rays.
-
property
ds
¶ distance points.
-
property
geod
¶ geod object used to distances between latitude and longitude coordinates.
-
property
h_angles
¶ Horizontal angular scale of the image frame.
-
ray_diagram
(ax, heading=None, heights=None, style='sphere_top', eye_level=True, linewidth_rays=0.2, linewidth_earth=0.2, R0=6371008, h_min=0.01)[source]¶ Side profile view showing the rays trajectories.
- Parameters
- ax: matplotlib Axes object
this function plots lines on a graph, you can specify which graph to plot to by passing in the axes object for the graph you want to plot to.
- heading: scalar, optional
the heading to take slice of tarrain for ray paths. default is the center of the frame for renderer
- heights: array_like, (N,), optional
list of values which represent the elevation profile along ray trajectory (in addition to elevation)
- style: str, optional
style to plot the graph. “flat”: plot rays on flat plane, “sphere_top”: plot rays as if the earth is filling away from the observer, “sphere_side”: plot rays with the ‘bulge’ in the middle.
- eye_level: bool, optional
color the ray which is closest to eye level (0 degrees initial angle) orange.
- linewidth_rays: float, optional
linewidth used for plotting rays in diagram
- linewidth_earth: float, optional
linewidth used for plotting surface of the earth, both water and land.
- h_min: float, optional
minimum values which should count as water when calculating hit locations.
-
render_scene
(scene, image_name, surface_color=None, background_color=None, cfunc=None, cfunc_args=None, disp=False, eye_level=False, postprocess=None, h_min=0.01, gpu=False)[source]¶ Render a scene object for the renderer’s given field of view and direction.
- Parameters
- scene: Scene object
object which contains data which the renderer can extract and render
- image_name: str
name for the image
- background_color: array_like, optional
3 element array containing an color via RGB color code (numbered 0 to 255) default value: [135,206,250]
- surface_color: array_like, optional
3 element array containing an color via RGB color code (numbered 0 to 255) default value: [0,80,120]
- cfunc: callable, optional
Callable function which is used to color the elevation data. The function takes in two arrays, the first is distances from the observer the second is the elevation above the surface of the earth.
- cfunc_args: array_like, optional
extra arguments to pass into cfunc
- disp: bool, optional
when rendering topographical data this will print out the heading slice which has been rendered.
- eye_level: bool, optional
when rendering the image, an orange line is placed at eye level in the image.
- post_process: callable, optional
function which processes the final image before saving it.
- h_min: float, optional
minimum value for ray to count as crossing water.
- gpu: bool, optional
utilize GPU to calculate 3D land model rendering.
-
set_location
(lat_obs, lon_obs, direction)[source]¶ This function can be used to change the location and heading of the renderer.
- Parameters
- lat_obs: float
new latitude of observer
- lon_obs: float
new longitude of observer
- direction: tuple or float
tuple: tuple containing a latitude and longitude point to point renderer towards. float: heading to point the renderer in.
-
property
v_angles
¶ Vertical angular scale of the image frame.
-
property
vfov
¶ Vertial field of view for this particular renderer
-