raytraverse.utility¶
- raytraverse.utility.utility.pool_call(func, args, *fixed_args, cap=None, expandarg=True, desc='processing', workers=True, pbar=True, **kwargs)[source]¶
calls func for a sequence of arguments using a ProcessPool executor and a progress bar. result is equivalent to:
result = [] for arg in args: result.append(func(*args, *fixed_args, **kwargs)) return result
- Parameters
func (callable) – the function to execute in parallel
args (Sequence[Sequence]) – list of arguments (each item is expanded with ‘*’ unless expandarg is false). first N args of func
fixed_args (Sequence) – arguments passed to func that are the same for all calls (next N arguments after args)
cap (int, optional) – execution cap for ProcessPool
expandarg (bool, optional) – expand args with ‘*’ when calling func
desc (str, optional) – label for progress bar
kwargs – additional keyword arguments passed to func
- Return type
sequence of results from func (order preserved)
imagetools¶
functions for translating from mappers to hdr
- raytraverse.utility.imagetools.normalize_peak(v, o, l, scale=179, peaka=6.7967e-05, peakt=100000.0, peakr=4, blursun=False)[source]¶
consolidate the brightest pixels represented by v, o, l up into a single source, correcting the area while maintaining equal energy
- Parameters
v (np.array) – shape (N, 3), direction vectors of pixels (x, y, z) normalized
o (np.array) – shape (N,), solid angles of pixels (steradians)
l (np.array) – shape (N,), luminance of pixels
scale (Union[float, int], optional) – scale factor for l to convert to cd/m^2, default assumes radiance units
peaka (float, optional) – area to aggregate to
peakt (Union[float, int], optional) – lower threshold for possible bright pixels
peakr (Union[float, int], optional) – ratio, from peak pixel value to lowest value to include when aggregating partially visible sun.
blursun (bool, optional) – whether to correct area and luminance according to human PSF
- Returns
v (np.array) – shape (N, 3), direction vectors of pixels (x, y, z) normalized
o (np.array) – shape (N,), solid angles of pixels (steradians)
l (np.array) – shape (N,), luminance of pixels
cli¶
- raytraverse.utility.cli.np_load(ctx, param, s)[source]¶
read np array from command line
trys np.load (numpy binary), then np.loadtxt (space seperated txt file) then split row by spaces and columns by commas.
used by both raytraverse.cli and raytu, add pull_decs and clk.command_decs as clk.shared_decs in main script so click can properly load options