raytraverse.integrator

Integrator

class raytraverse.integrator.Integrator(*lightplanes, includesky=True, includesun=True, sunviewengine=None)[source]

Bases: object

collection of lightplanes with KDtree structure for sun position query

Parameters

lightplanes (Sequence[raytraverse.lightfield.LightPlaneKD]) –

evaluate_pt(skyvecs, suns, vm=None, vms=None, metricclass=None, metrics=None, srconly=False, sumsafe=False, suntol=10.0, svengine=None, blursun=False, **kwargs)

point by point evaluation suitable for submitting to ProcessPool

img_pt(skyvecs, suns, vms=None, combos=None, qpts=None, skinfo=None, res=512, interp=False, prefix='img', suntol=10.0, svengine=None, **kwargs)

point by point evaluation suitable for submitting to ProcessPool

make_images(skydata, points, vm, viewangle=180.0, res=512, interp=False, prefix='img', namebyindex=False, suntol=10.0, blursun=False)[source]

see namebyindex for file naming conventions

Parameters
  • skydata (raytraverse.sky.Skydata) –

  • points (np.array) – shape (N, 3)

  • vm (Union[raytraverse.mapper.ViewMapper, np.array]) – either a predefined ViewMapper (used for all points) or an array of view directions (will use a 180 degree view angle when initializing ViewMapper)

  • viewangle (float, optional) – view opening for sensor (0-180,360) when vm is given as an array of view directions.

  • res (int, optional) – image resolution

  • interp (bool, optional) – interpolate image

  • prefix (str, optional) – prefix for output file naming

  • namebyindex (bool, optional) – if False (default), names images by: <prefix>_sky-<row>_pt-<x>_<y>_<z>_vd-<dx>_<dy>_<dz>.hdr if True, names images by: <prefix>_sky-<row>_pt-<pidx>_vd-<vidx>.hdr, where pidx, vidx are refer to the order of points, and vm.

Returns

Return type

np.array of out_files shape (skies, points, views)

evaluate(skydata, points, vm, viewangle=180.0, metricclass=<class 'raytraverse.evaluate.metricset.MetricSet'>, metrics=None, datainfo=False, srconly=False, suntol=10.0, blursun=False, **kwargs)[source]

apply sky data and view queries to daylightplane to return metrics parallelizes and optimizes run order.

Parameters
  • skydata (raytraverse.sky.Skydata) –

  • points (np.array) – shape (N, 3)

  • vm (Union[raytraverse.mapper.ViewMapper, np.array]) – either a predefined ViewMapper (used for all points) or an array of view directions (will use ‘viewangle’ when initializing ViewMapper)

  • viewangle (float, optional) – view opening for sensor (0-180,360) when vm is given as an array of view directions, note that for illuminance based metrics, a value of 360 may not make sense as values behind will be negative.

  • metricclass (raytraverse.evaluate.BaseMetricSet, optional) –

  • metrics (Sized, optional) –

  • srconly (bool, optional) – sun only calculations

  • suntol (float, optional) – if Integrator has an engine, resample sun views when actual sun position error is greater than this many degrees.

  • datainfo (Union[Sized[str], bool], optional) – include information about source data as additional metrics. Valid values include: [“pt_err”, “pt_idx”, “src_err”, “src_idx”]. If True, includes all.

Returns

Return type

raytraverse.lightfield.LightResult

IntegratorDS

class raytraverse.integrator.IntegratorDS(skplane, dskplane, snplane, sunviewengine=None)[source]

Bases: raytraverse.integrator.integrator.Integrator

specialized integrator for 2-phase DDS style calculation. assumes first lightplane is sky contrribution, second, direct sky contribution (with identical sampling to sky) and third direct sun contribution. Uses special point functions that combine two sky functions on a per patch basis.

Parameters
evaluate_pt(skyvecs, suns, **kwargs)
img_pt(skyvecs, suns, **kwargs)

ZonalIntegrator

class raytraverse.integrator.ZonalIntegrator(*lightplanes, includesky=True, includesun=True, sunviewengine=None)[source]

Bases: raytraverse.integrator.integrator.Integrator

evaluate(skydata, pm, vm, viewangle=180.0, metricclass=<class 'raytraverse.evaluate.metricset.MetricSet'>, metrics=None, srconly=False, ptfilter=0.25, stol=10, minsun=1, datainfo=False, **kwargs)[source]

apply sky data and view queries to daylightplane to return metrics parallelizes and optimizes run order.

Parameters
  • skydata (raytraverse.sky.Skydata) –

  • pm (raytraverse.mapper.PlanMapper) –

  • vm (Union[raytraverse.mapper.ViewMapper, np.array]) – either a predefined ViewMapper (used for all points) or an array of view directions (will use ‘viewangle’ when initializing ViewMapper)

  • viewangle (float, optional) – view opening for sensor (0-180,360) when vm is given as an array of view directions, note that for illuminance based metrics, a value of 360 may not make sense as values behind will be negative.

  • metricclass (raytraverse.evaluate.BaseMetricSet, optional) –

  • metrics (Sized, optional) –

  • srconly (bool, optional) – sun only calculations

  • ptfilter (Union[float, int], optional) – minimum seperation for returned points

  • stol (Union[float, int], optional) – maximum angle (in degrees) for matching sun vectors

  • minsun (int, optional) – if atleast these many suns are not returned based on stol, directly query for this number of results (regardless of sun error)

  • datainfo (Union[Sized[str], bool], optional) – include information about source data as additional metrics. Valid values include: [“src_err”, “src_idx”]. If True, includes both.

Returns

Return type

raytraverse.lightfield.LightResultKD

ZonalIntegratorDS

class raytraverse.integrator.ZonalIntegratorDS(skplane, dskplane, snplane, sunviewengine=None)[source]

Bases: raytraverse.integrator.integratords.IntegratorDS, raytraverse.integrator.zonalintegrator.ZonalIntegrator

specialized integrator for 2-phase DDS style calculation. assumes first lightplane is sky contribution, second, direct sky contribution (with identical sampling to sky) and third direct sun contribution. Uses special point functions that combine two sky functions on a per patch basis.