honeybee_radiance_postprocess.metrics module

Functions to calculate various metrics for 1D and 2D NumPy arrays.

honeybee_radiance_postprocess.metrics.ase_array2d(array: ndarray, occ_hours: int = 250, direct_threshold: float = 1000) Tuple[ndarray, ndarray][source]

Calculate annual sunlight exposure for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • occ_hours – The number of occupied hours that cannot receive more than the direct_threshold. Defaults to 250.

  • direct_threshold – The threshold that determines if a sensor is overlit. Defaults to 1000.

Returns:

A NumPy float of the ASE as a percentage (decimal).

honeybee_radiance_postprocess.metrics.average_values_array1d(array: ndarray, full_length: int = 8760) float64[source]

Calculate average value for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • full_length – Integer to use as divisor.

Returns:

A NumPy float of the average value.

honeybee_radiance_postprocess.metrics.average_values_array2d(array: ndarray, full_length: int = 8760) ndarray[source]

Calculate average values for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • full_length – Integer to use as divisor.

Returns:

A 1-dimensional NumPy array with the average value for each row in the input array.

honeybee_radiance_postprocess.metrics.cda_array1d(array: ndarray, total_occ: int = None, threshold: float = 300) float64[source]

Calculate continuos daylight autonomy for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • threshold – Threshold value for continuos daylight autonomy. Default: 300.

Returns:

A NumPy float of the continuos daylight autonomy.

honeybee_radiance_postprocess.metrics.cda_array2d(array: ndarray, total_occ: int = None, threshold: float = 300) ndarray[source]

Calculate continuos daylight autonomy for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • threshold – Threshold value for continuos daylight autonomy. Default: 300.

Returns:

A 1-dimensional NumPy array with the continuos daylight autonomy for each row in the input array.

honeybee_radiance_postprocess.metrics.cumulative_values_array1d(array: ndarray, timestep: int = 1, t_step_multiplier: float = 1) float64[source]

Calculate daylight autonomy for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • timestep – Integer for the timestep of the analysis.

  • t_step_multiplier – A value that will be multiplied with the timestep.

Returns:

A NumPy float of the cumulative value.

honeybee_radiance_postprocess.metrics.cumulative_values_array2d(array: ndarray, timestep: int = 1, t_step_multiplier: float = 1) ndarray[source]

Calculate cumulative values for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • timestep – Integer for the timestep of the analysis.

  • t_step_multiplier – A value that will be multiplied with the timestep.

Returns:

A 1-dimensional NumPy array with the cumulative value for each row in the input array.

honeybee_radiance_postprocess.metrics.da_array1d(array: ndarray, total_occ: int = None, threshold: float = 300) float64[source]

Calculate daylight autonomy for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • threshold – Threshold value for daylight autonomy. Default: 300.

Returns:

A NumPy float of the daylight autonomy.

honeybee_radiance_postprocess.metrics.da_array2d(array: ndarray, total_occ: int = None, threshold: float = 300) ndarray[source]

Calculate daylight autonomy for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape, i.e., it is assumed that the array is filtered by occupied hours.

  • threshold – Threshold value for daylight autonomy. Default: 300.

Returns:

A 1-dimensional NumPy array with the daylight autonomy for each row in the input array.

honeybee_radiance_postprocess.metrics.peak_values_array2d(array: ndarray, coincident: bool = False) Tuple[ndarray, int | None][source]

Calculate peak values for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • coincident – Boolean to indicate whether output values represent the peak value for each sensor throughout the entire analysis (False) or they represent the highest overall value across each sensor grid at a particular timestep (True).

Returns:

A 1-dimensional NumPy array with the peak value for each row in the input array, and the index of the maximum value representing the timestep in the array with the largest value.

honeybee_radiance_postprocess.metrics.sda_array2d(array: ndarray, target_time: float = 50, threshold: float = 300, total_occ: int = None) ndarray[source]

Calculate spatial daylight autonomy for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • target_time – A minimum threshold of occupied time (eg. 50% of the time), above which a given sensor passes and contributes to the spatial daylight autonomy. Defaults to 50.

  • threshold – Threshold value for daylight autonomy. Default: 300.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape, i.e., it is assumed that the array is filtered by occupied hours.

Returns:

A NumPy float of the sDA as a percentage (decimal)

honeybee_radiance_postprocess.metrics.udi_array1d(array: ndarray, total_occ: int = None, min_t: float = 100, max_t: float = 3000) float64[source]

Calculate useful daylight illuminance for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • min_t – Minimum threshold for useful daylight illuminance. Default: 100.

  • max_t – Maximum threshold for useful daylight illuminance. Default: 3000.

Returns:

A NumPy float of the useful daylight illuminance.

honeybee_radiance_postprocess.metrics.udi_array2d(array: ndarray, total_occ: int = None, min_t: float = 100, max_t: float = 3000) ndarray[source]

Calculate useful daylight illuminance for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • min_t – Minimum threshold for useful daylight illuminance. Default: 100.

  • max_t – Maximum threshold for useful daylight illuminance. Default: 3000.

Returns:

A 1-dimensional NumPy array with the useful daylight illuminance for each row in the input array.

honeybee_radiance_postprocess.metrics.udi_lower_array1d(array: ndarray, total_occ: int = None, min_t: float = 100, sun_down_occ_hours: int = 0) float64[source]

Calculate lower than useful daylight illuminance for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • min_t – Minimum threshold for useful daylight illuminance. Default: 100.

  • sun_down_occ_hours – Number of occupied hours where the sun is down.

Returns:

A NumPy float of the lower than useful daylight illuminance.

honeybee_radiance_postprocess.metrics.udi_lower_array2d(array: ndarray, total_occ: int = None, min_t: float = 100, sun_down_occ_hours: int = 0) ndarray[source]

Calculate lower than useful daylight illuminance for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • min_t – Minimum threshold for useful daylight illuminance. Default: 100.

  • sun_down_occ_hours – Number of occupied hours where the sun is down.

Returns:

A 1-dimensional NumPy array with the lower than useful daylight illuminance for each row in the input array.

honeybee_radiance_postprocess.metrics.udi_upper_array1d(array: ndarray, total_occ: int = None, max_t: float = 3000) float64[source]

Calculate higher than useful daylight illuminance for a 1D NumPy array.

Parameters:
  • array – A 1D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • max_t – Maximum threshold for higher than useful daylight illuminance. Default: 3000.

Returns:

A NumPy float of the higher than useful daylight illuminance.

honeybee_radiance_postprocess.metrics.udi_upper_array2d(array: ndarray, total_occ: int = None, max_t: float = 3000) ndarray[source]

Calculate higher than useful daylight illuminance for a 2D NumPy array.

Parameters:
  • array – A 2D NumPy array.

  • total_occ – Integer indicating the number of occupied hours. If not given any input the number of occupied hours will be found by the array shape.

  • max_t – Maximum threshold for useful daylight illuminance. Default: 3000.

Returns:

A 1-dimensional NumPy array with the higher than useful daylight illuminance for each row in the input array.