eradiate.scenes.measure.TargetRectangle

class eradiate.scenes.measure.TargetRectangle(**kwargs)[source]

Bases: Target

Rectangle target specification.

This class defines a rectangular zone where ray targets will be sampled or ray origins will be projected. It supports several parametrizations:

  • bounds and altitude (xmin, xmax, ymin, ymax, z): in that case, the rectangle is axis-aligned;

  • centre position, edge lengths, normal vector and orientation (xyz, size_x, size_y, n, up): in that case, the rectangle is scaled and positioned using a look-at transformation;

  • geometric transform (to_world): in that case, a geometric transformation can be passed directly.

Parameters:
  • to_world (mi.ScalarTransform4f) – If this parametrization is used, to_world must be supplied in kernel units.

  • xmin, xmax, ymin, ymax, z, size_x, size_y (float or quantity) – Unit-enabled (default: ucc[‘length’]). z may be omitted (if so, it defaults to 0).

  • xyz (array-like or quantity) – Unit-enabled (default: ucc[‘length’]).

  • n, up (array-like)

static convert(value)

Object converter method.

If value is a dictionary, this method uses new() to instantiate a Target child class based on the "type" entry it contains.

If value is a 3-vector, this method returns a TargetPoint instance.

Otherwise, it returns value.

kernel_item()[source]

Return kernel item.

static new(target_type, *args, **kwargs)

Instantiate one of the supported child classes. This factory requires manual class registration. All position and keyword arguments are forwarded to the constructed type.

Currently supported classes:

Parameters:

target_type ({"point", "rectangle"}) – Identifier of one of the supported child classes.

Returns:

Target

property bbox

Bounding (in configuration units).

property xmax

Deprecated since version 1.0.0.

Alias to self.bbox.max[0] (for compatibility).

property xmin

Deprecated since version 1.0.0.

Alias to self.bbox.min[0] (for compatibility).

property ymax

Deprecated since version 1.0.0.

Alias to self.bbox.max[1] (for compatibility).

property ymin

Deprecated since version 1.0.0.

Alias to self.bbox.min[1] (for compatibility).

property z

Deprecated since version 1.0.0.

Alias to 0.5 * (self.bbox.min[2] + self.bbox.max[2]) (for compatibility).