raytraverse.lightpoint

LightPointKD

class raytraverse.lightpoint.LightPointKD(scene, vec=None, lum=None, vm=None, pt=0, 0, 0, posidx=0, src='sky', srcn=1, calcomega=True, write=True)[source]

Bases: object

light field with KDtree structures for spatial query

vm = None

raytraverse.mapper.ViewMapper

scene = None

raytraverse.scene.Scene

posidx = None

index for point

Type

int

pt = None

point location

Type

np.array

src = None

source key

Type

str

file = None

relative path to disk storage

Type

str

dump()[source]
property vec

direction vector (N,3)

property lum

luminance (N,srcn)

property d_kd

kd tree for spatial query

Getter

Returns kd tree structure

Type

scipy.spatial.cKDTree

property omega

solid angle (N)

Getter

Returns array of solid angles

Setter

sets soolid angles with viewmapper

Type

np.array

calc_omega(write=True)[source]

calculate solid angle

Parameters

write (bool, optional) – update/write kdtree data to file

apply_coef(coefs)[source]
add_to_img(img, vecs, mask=None, coefs=1, interp=False, omega=False, vm=None)[source]

add luminance contributions to image array (updates in place)

Parameters
  • img (np.array) – 2D image array to add to (either zeros or with other source)

  • vecs (np.array) – vectors corresponding to img pixels shape (N, 3)

  • mask (np.array) – indices to img that correspond to vec (in case where whole image is not being updated, such as corners of fisheye)

  • coefs (int, float, np.array) – source coefficients, shape is (1,) or (srcn,)

  • interp (bool, optional) – for linear interpolation (falls back to nearest outside of convexhull

  • omega (bool) – if true, add value of ray solid angle instead of luminance

  • vm (raytraverse.mapper.ViewMapper, optional) –

Returns

Return type

None

get_applied_rays(skyvec, vm=None)[source]

the analog to add_to_img for metric calculations

query_ray(vecs, interp=1)[source]
query_ball(vecs, viewangle=180)[source]
direct_view(res=512, showsample=False, showweight=True, srcidx=None, interp=False, omega=False, scalefactor=1)[source]

create a summary image of lightfield for each vpt

static _build(vec, lum, srcn)[source]

load samples and build data structure

SunPointKD

class raytraverse.lightpoint.SunPointKD(scene, vec=None, lum=None, sun=0, 0, 0, **kwargs)[source]

Bases: raytraverse.lightpoint.lightpointkd.LightPointKD

removes stray rays from accidental direct sun hits and incorporates sunviewsampler results

_build(vec, lum, srcn)[source]

load samples and build data structure

SunViewPoint

class raytraverse.lightpoint.SunViewPoint(scene, vecs, lum, pt=0, 0, 0, posidx=0, src='sunview', res=64, blursun=1.0)[source]

Bases: object

interface for sun view data

solar_omega = 6.796702357283834e-05
static offset(points, target)[source]
scene = None

raytraverse.scene.Scene

posidx = None

index for point

Type

int

pt = None

point location

Type

np.array

src = None

source key

Type

str

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

hack to ensure equal energy and max luminance)

add_to_img(img, vecs, mask=None, coefs=1, vm=None)[source]
get_applied_rays(vm, sunval)[source]
direct_view(res=80)[source]