refraction_render.renderers.Renderer_Composite

class refraction_render.renderers.Renderer_Composite(calc, h_obs, lat_obs, lon_obs, max_distance, distance_res=10, vert_obs_angle=0.0, vert_res=1000, focal_length=2000, atol=1.1e-07, rtol=1.1e-07, ellps='sphere')[source]

Bases: object

Object used to set a camera angle and position to render a scene for a user specified horizontal field of view.

__init__(calc, h_obs, lat_obs, lon_obs, max_distance, distance_res=10, vert_obs_angle=0.0, vert_res=1000, focal_length=2000, atol=1.1e-07, rtol=1.1e-07, 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

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

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_names, …[, …])

Renders a composites over a very wide horizontal field.

set_location(lat_obs, lon_obs)

This function can be used to change the position of the renderer.

Attributes

calc

Calc object used to calculate verticle rays.

ds

distance points.

geod

geod object used to distances between latitude and longitude coordinates.

v_angles

Vertical angular scale of the image frame.

vfov

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.

ray_diagram(ax, heading, 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

the heading to take slice of tarrain for ray paths.

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_names, heading_mins, heading_maxs, 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]

Renders a composites over a very wide horizontal field.

Parameters
scene: Scene object

object which contains data which the renderer can extract and render

image_names: array_like (n,) or ‘str’

name(s) for the image(s) being rendered.

heading_mins: array_like (n,) or float

minimum starting point(s) for composite.

heading_maxs: array_like (n,) or float

maximum starting point(s) for composite, pair with ‘heading_mins’.

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)[source]

This function can be used to change the position of the renderer.

Parameters
lat_obs: float

new latitude of observer

lon_obs: float

new longitude of observer

property v_angles

Vertical angular scale of the image frame.

property vfov

Vertial field of view for this particular renderer