honeybee_radiance_postprocess.util module

Post-processing utility functions.

honeybee_radiance_postprocess.util.array_memory_size(sensors: int, sun_up_hours: int, ncomp: int = None, dtype: ~numpy.dtype = <class 'numpy.float32'>, gigabyte: bool = True) float[source]

Calculate the memory size of an array before creating or loading an array.

Parameters:
  • sensors – Number of sensors in the array.

  • sun_up_hours – Number of sun up hours in the array.

  • ncomp – Optional number of components for each element in the array, e.g., if the data is in RGB format then this value must be set to 3. Defaults to None.

  • dtype – The data type of the array. Defaults to np.float32.

  • gigabyte – Boolean toggle to output the memory size in gigabytes. Defaults to True.

Returns:

The memory size of an array.

Return type:

float

honeybee_radiance_postprocess.util.binary_mtx_dimension(filepath: str) Tuple[int, int, int, int, str][source]

Return binary Radiance matrix dimensions if exist.

This function returns NROWS, NCOLS, NCOMP and number of header lines including the white line after last header line.

Parameters:

filepath – Full path to Radiance file.

Returns:

nrows, ncols, ncomp, line_count, fmt

honeybee_radiance_postprocess.util.check_array_dim(array: ndarray, dim: int)[source]

Check NumPy array dimension.

Parameters:
  • array – A NumPy array.

  • dim – The dimension to check against.

honeybee_radiance_postprocess.util.filter_array(array: ndarray, mask: ndarray) ndarray[source]

Filter a NumPy array by a masking array. The array will be passed as is if the mask is None.

Parameters:
  • array – A NumPy array to filter.

  • mask – A NumPy array of ones/zeros or True/False.

Returns:

A filtered NumPy array.

honeybee_radiance_postprocess.util.get_delimiter(delimiter_input)[source]
honeybee_radiance_postprocess.util.hoys_mask(sun_up_hours: list, hoys: list) ndarray[source]

Create a NumPy masking array from a list of hoys.

Parameters:
  • sun_up_hours – A list of sun up hours.

  • hoys – A list hoys to select.

Returns:

A NumPy array of booleans.

honeybee_radiance_postprocess.util.recursive_dict_merge(dict_1: dict, dict_2: dict)[source]

Recursive merging of two dictionaries.

Parameters:
  • dict_1 – Original dictionary.

  • dict_2 – Dictionary to merge with dict_1.