honeybee_radiance.lightsource.sunpath module

A Radiance-based sunpath.

A Radiance-based sunpath is a list of light sources with radius of 0.533

A sunpath can be climate-based or non-climate-based. In non climate-based sunpath irradiance values are set to 1e6 for red, green and blue channels.

Use the climate-based sunpath for direct solar radiation studies and use the non climate-based sunpath for solar access studies.

class honeybee_radiance.lightsource.sunpath.Sunpath(location, north=0)[source]

Bases: object

A Radiance-based sun-path.

Parameters
  • location – A Ladybug location.

  • north – Sunpath north angle.

Properties:
  • location

  • north

ToString()[source]

Overwrite .NET ToString method.

classmethod from_dict(data)[source]

Create a sunpath from a dictionary.

Dictionary keys are type, location and north.

to_dict()[source]

Convert this sunpath to a dictionary.

Parameters

input_dict – A python dictionary in the following format

{
'type': 'Sunpath',
'location': {}  # Location dictionary,
'north': 0,
}
to_file(folder='.', file_name='sunpath', hoys=None, wea=None, output_type=0, leap_year=False, reverse_vectors=False, split_mod_files=True)[source]

Write sunpath to file.

This method will generate a sunpath file and one or several files for sun modifiers.

In sunpath file each sun is defined as a radiance source in a separate line. The naming is based on the minute of the year.

void light {sol_moy} 0 0 3 {irr} {irr} {irr} {sol_moy} source {sun_moy} 0 0 4 x y z 0.533

This method also generate a mod file which includes all the modifiers in sunpath. mod file is usually used with rcontrib command to indicate the list of modifiers. Since rcontrib command has a hard limit of 10,000 modifiers in a single run you can use split_mod_files to split the modifier files not to exceed 10,000 modifiers.

Parameters
  • folder – Target folder to write the sunpath files (default: ‘.’)

  • file_name – Optional file name for generated files. By default files will be named as sunpath.rad and sunpath.mod.

  • hoys – An optional list of hoys to be included in sunpath. By default sunpath includes all the sun up hours during the year.

  • wea – A Ladybug wea. If wea is provided a climate-based sunpath will be generated otherwise all suns will be assigned the same value of 1e6.

  • output_type – An integer between 0-2. 0=output in W/m^2/sr visible, 1=output in W/m^2/sr solar, 2=output in candela/m^2 (default: 0).

  • leap_year – Set to True if hoys are for a leap year (default: False).

  • reverse_vector – Set to True to reverse the vector direction of suns. By default sun vectors are coming from sun towards the ground. This option will reverse the direction of the vectors. Reversed sunpath is mainly useful for radiation studies (default: False).

  • split_mod_files – A boolean to split the modifier file into multiple files to ensure none of them includes more than 10,000 modifiers.

Returns

dict – A dictionary with with two keys for sunpath and suns. sunpath returns the path to the sunpath file and suns returns a list of path to modifier files.

property location

Sunpath location.

property north

Sunpath north angle.