reVX.turbine_flicker.turbine_flicker.compute_flicker_exclusions

compute_flicker_exclusions(hub_height, rotor_diameter, points, res_fpath, flicker_threshold, max_flicker_exclusion_range, grid_cell_size, steps_per_hour, building_layer, resolution=640, max_workers=None)[source]

Compute turbine flicker exclusions.

Exclude all pixels that will cause flicker exceeding the “flicker_threshold” on any building in “building_layer”. Buildings are defined as any pixels in the array that are “truthy”. In other words, the locations of the buildings are found using np.where(building_layer). Shadow flicker is computed at the supply curve point resolution based on a turbine with “hub_height” (m) and applied to all buildings within that supply curve point sub-array.

Parameters:
  • hub_height (int | float) – Hub height in meters.

  • rotor_diameter (int | float) – Rotor diameter in meters.

  • points (iterable of pd.Series) – Supply curve points to calculate shadow flicker exclusions for. The series for each point should include, at the minimum, “res_gid”, “latitude” and “longitude”.

  • res_fpath (str) – Filepath to wind resource .h5 file containing hourly wind direction data.

  • flicker_threshold (int) – Maximum number of allowable flicker hours.

  • max_flicker_exclusion_range (float | int | str) – Max distance (m) that flicker exclusions will extend in any of the cardinal directions.

  • grid_cell_size (int) – Length (m) of a side of each grid cell in excl_fpath.

  • steps_per_hour (int) – Number of time steps to take per hour when computing flicker.

  • building_layer (np.ndarray) – Array containing building data. Any “truthy” values in this array are assumed to be buildings, so be sure to apply any appropriate threshold/mask before passing in the array.

  • resolution (int, optional) – SC resolution, by default 640.

  • max_workers (int, optional) – Number of workers to use. If 1 run, in serial. If None, use all available cores. By default, None.

Returns:

flicker_arr (ndarray) – 2D inclusion array. Pixels to exclude (0) to prevent shadow flicker on buildings in “building_layer