honeybee_plus.radiance.recipe.solaraccess.gridbased module

Radiance Solar Access Grid-based Analysis Recipe.

class honeybee_plus.radiance.recipe.solaraccess.gridbased.SolarAccessGridBased(sun_vectors, hoys, analysis_grids, timestep=1, hb_objects=None, sub_folder='solaraccess')[source]

Bases: honeybee_plus.radiance.recipe._gridbasedbase.GenericGridBased

Solar access recipe.

This class calculates number of sunlight hours for a group of test points.

sun_vectors

A list of ladybug sun vectors as (x, y, z) values. Z value for sun vectors should be negative (coming from sun toward earth)

hoys

A list of hours of the year for each sun vector.

analysis_grids

List of analysis grids.

timestep

The number of timesteps per hour for sun vectors. This number should be smaller than 60 and divisible by 60. The default is set to 1 such that one sun vector is generated for each hour (Default: 1).

hb_objects

An optional list of Honeybee surfaces or zones (Default: None).

sub_folder

Analysis subfolder for this recipe. (Default: “solaraccess”)

Usage:

# initiate analysis_recipe analysis_recipe = SolarAccess(sun_vectors, analysis_grids)

# add honeybee object analysis_recipe.hb_objects = HBObjs

# write analysis files to local drive analysis_recipe.write_to_file(_folder_, _name_)

# run the analysis analysis_recipe.run(debug=False)

# get the results print(analysis_recipe.results())

classmethod from_json(rec_json)[source]

Create the solar access recipe from json. {

“id”: “solar_access”, “type”: “gridbased”, “location”: null, // a honeybee location - see below “hoys”: [], // list of hours of the year “surfaces”: [], // list of honeybee surfaces “analysis_grids”: [] // list of analysis grids “sun_vectors”: [] // list of sun vectors if location is not provided

}

classmethod from_location_and_analysis_period(location, analysis_period, point_groups, vector_groups=None, hb_objects=None, sub_folder='sunlighthour')[source]

Create sunlighthours recipe from Location and analysis period.

classmethod from_location_and_hoys(location, hoys, point_groups, vector_groups=[], timestep=1, hb_objects=None, sub_folder='sunlighthour')[source]

Create sunlighthours recipe from Location and hours of year.

classmethod from_points_and_vectors(sun_vectors, hoys, point_groups, vector_groups=[], timestep=1, hb_objects=None, sub_folder='sunlighthour')[source]

Create sunlighthours recipe from points and vectors.

Parameters
  • sun_vectors – A list of ladybug sun vectors as (x, y, z) values. Z value for sun vectors should be negative (coming from sun toward earth)

  • hoys – A list of hours of the year for each sun vector.

  • point_groups – A list of (x, y, z) test points or lists of (x, y, z) test points. Each list of test points will be converted to a TestPointGroup. If testPts is a single flattened list only one TestPointGroup will be created.

  • vector_groups – An optional list of (x, y, z) vectors. Each vector represents direction of corresponding point in testPts. If the vector is not provided (0, 0, 1) will be assigned.

  • timestep – The number of timesteps per hour for sun vectors. This number should be smaller than 60 and divisible by 60. The default is set to 1 such that one sun vector is generated for each hour (Default: 1).

  • hb_objects – An optional list of Honeybee surfaces or zones (Default: None).

  • sub_folder – Analysis subfolder for this recipe. (Default: “sunlighthours”)

classmethod from_suns(suns, point_groups, vector_groups=[], timestep=1, hb_objects=None, sub_folder='sunlighthour')[source]

Create sunlighthours recipe from LB sun objects.

suns

A list of ladybug suns.

point_groups

A list of (x, y, z) test points or lists of (x, y, z) test points. Each list of test points will be converted to a TestPointGroup. If testPts is a single flattened list only one TestPointGroup will be created.

vector_groups

An optional list of (x, y, z) vectors. Each vector represents direction of corresponding point in testPts. If the vector is not provided (0, 0, 1) will be assigned.

timestep

The number of timesteps per hour for sun vectors. This number should be smaller than 60 and divisible by 60. The default is set to 1 such that one sun vector is generated for each hour (Default: 1).

hb_objects

An optional list of Honeybee surfaces or zones (Default: None).

sub_folder

Analysis subfolder for this recipe. (Default: “sunlighthours”)

property hoys

Return list of hours of the year.

property legend_parameters

Legend parameters for solar access analysis.

results()[source]

Return results for this analysis.

property sun_vectors

A list of ladybug sun vectors as (x, y, z) values.

property timestep

An intger for the number of timesteps per hour for sun vectors.

This number should be smaller than 60 and divisible by 60.

to_json()[source]

Create the solar access recipe from json. {

“id”: “solar_access”, “type”: “gridbased”, “location”: null, // a honeybee location - see below “hoys”: [], // list of hours of the year “surfaces”: [], // list of honeybee surfaces “analysis_grids”: [], // list of analysis grids “sun_vectors”: []

}

write(target_folder, project_name='untitled', header=True, transpose=False)[source]

Write analysis files to target folder.

Files for sunlight hours analysis are:

test points <project_name.pts>: List of analysis points. suns file <.sun>: list of sun sources . suns material file <*_suns.mat>: Radiance materials for sun sources. suns geometry file <*_suns.rad>: Radiance geometries for sun sources. material file <.mat>: Radiance materials. Will be empty if hb_objects is

None.

geometry file <*.rad>: Radiance geometries. Will be empty if hb_objects is

None.

batch file <*.bat>: An executable batch file which has the list of commands.
oconv [material file] [geometry file] [sun materials file] [sun

geometries file] > [octree file]

rcontrib -ab 0 -ad 10000 -I -M [sunlist.txt] -dc 1 [octree file]< [pts

file] > [rcontrib results file]

Parameters
  • target_folder – Path to parent folder. Files will be created under target_folder/gridbased. use self.sub_folder to change subfolder name.

  • project_name – Name of this project as a string.

Returns

True in case of success.