raytraverse.lightfield

LightField

class raytraverse.lightfield.LightField(scene, rebuild=False, prefix='sky', srcn=1, rmraw=False)[source]

Bases: object

container for accessing sampled data

Parameters
  • scene (raytraverse.scene.Scene) – scene class containing geometry, location and analysis plane

  • rebuild (bool, optional) – build kd-tree even if one exists

  • prefix (str, optional) – prefix of data files to map

rebuild = None

force rebuild kd-tree

Type

bool

prefix = None

prefix of data files from sampler (stype)

Type

str

raw_files()[source]
property vec

direction vector (3,)

property lum

luminance (srcn,)

property omega

solid angle (1,)

outfile(idx)[source]
items()[source]

LightFieldKD

class raytraverse.lightfield.LightFieldKD(scene, rebuild=False, prefix='sky', srcn=1, rmraw=False)[source]

Bases: raytraverse.lightfield.lightfield.LightField

light field with KDtree structures for spatial query

static mk_vector_ball(v)[source]
property d_kd

list of direction kdtrees

Getter

Returns kd tree structure

Type

list of scipy.spatial.cKDTree

property scene

scene information

Getter

Returns this integrator’s scene

Setter

Set this integrator’s scene

Type

raytraverse.scene.Scene

raw_files()[source]

get list of files used to build field

_to_mem_map(ar, offset=0)[source]
_get_vl(npts, pref='', ltype=<class 'raytraverse.lightfield.memarraydict.MemArrayDict'>, os0=0, fvrays=False)[source]
_mk_tree(pref='', ltype=<class 'raytraverse.lightfield.memarraydict.MemArrayDict'>, os0=0)[source]
apply_coef(pi, coefs)[source]
add_to_img(img, mask, pi, i, d, coefs=1, vm=None, radius=3)[source]
query_ray(pi, vecs, interp=1)[source]
query_all_pts(vecs, interp=1)[source]
query_ball(pi, vecs, viewangle=180)[source]
_dview(idx, pdirs, mask, res=800, showsample=True)[source]
direct_view(res=800, showsample=True, items=None)[source]

create a summary image of lightfield for each vpt

SCBinField

class raytraverse.lightfield.SCBinField(scene, rebuild=False, prefix='sky', **kwargs)[source]

Bases: raytraverse.lightfield.lightfieldkd.LightFieldKD

container for accessing sampled data where every ray has a value for each source

apply_coef(pi, coefs)[source]

SunField

class raytraverse.lightfield.SunField(scene, suns, rebuild=False, rmraw=False)[source]

Bases: raytraverse.lightfield.lightfieldkd.LightFieldKD

container for sun view data

Parameters
  • scene (raytraverse.scene.Scene) – scene class containing geometry, location and analysis plane

  • suns (raytraverse.sunsetter.SunSetter) – sun class containing sun vectors and SunMapper (passed to SunViewField)

  • rebuild (bool, optional) – build kd-tree even if one exists

suns = None

raytraverse.sunsetter.SunSetter

view = None

raytraverse.lightfield.SunViewField

raw_files()[source]

get list of files used to build field

_mk_tree(pref='', ltype=<class 'list'>, os0=0)[source]
items()[source]
keymap()[source]
add_to_img(img, mask, pi, i, d, coefs=1, vm=None, radius=3)[source]
direct_view(res=200, showsample=False, items=None)[source]

create a summary image of lightfield for each vpt

SunViewField

class raytraverse.lightfield.SunViewField(scene, suns, rebuild=False, rmraw=False)[source]

Bases: raytraverse.lightfield.lightfield.LightField

container for sun view data

Parameters
  • scene (raytraverse.scene.Scene) – scene class containing geometry, location and analysis plane

  • suns (raytraverse.sunsetter.SunSetter) – prefix of data files to integrate

  • rebuild (bool, optional) – build kd-tree even if one exists

suns = None

raytraverse.sunsetter.SunSetter

sunmap = None

raytraverse.sunmapper.SunMapper

raw_files()[source]

get list of files used to build field

property raster

individual pixels forming shape of the sun, stored as uv coorinates with basis viewmapper about sun direction and diameter. indexed like vec, lum, and omega

property scene

scene information

Getter

Returns this integrator’s scene

Setter

Set this integrator’s scene

Type

raytraverse.scene.Scene

items()[source]
_grp_by_sun(vecs, lums, shape, pti, suni)[source]
_build_suns(vecs, lums, shape)[source]

loop through points/suns and group adjacent rays

_to_pix(rxyz, atv, vm, res)[source]
_smudge(cnt, omegap, omegasp)[source]

hack to ensure equal energy and max luminance)

add_to_img(img, pi, sun, vm)[source]
Parameters
metric(psi, v, s, metricfuncs, **kwargs)[source]
direct_view(res=2)[source]

create a summary image of all sun discs from each of vpts

MemArrayDict

class raytraverse.lightfield.memarraydict.MemArrayDict[source]

Bases: dict

a dictionary like object that holds arguments for numpy.memmap, the getter returns a view to the array

static _map(i)[source]
values() → an object providing a view on D’s values[source]
constructors()[source]
full_array()[source]
full_constructor()[source]
index_strides()[source]