honeybee_radiance.lightsource.sky.skymatrix module

Generate a point-in-time climate-based sky.

class honeybee_radiance.lightsource.sky.skymatrix.SkyMatrix(wea, north=0, density=1)[source]

Bases: honeybee_radiance.lightsource.sky.sunmatrix.SunMatrix

Annual Climate-based Sky matrix.

The output of SkyMatrix is similar to using command Radiance’s gendaymtx command with default options. For more information see gendaymtx documentation.

https://www.radiance-online.org/learning/documentation/manual-pages/pdfs/gendaymtx.pdf

Parameters
  • wea – A Ladybug wea object.

  • north – A number between -360 and 360 for the counterclockwise difference between the North and the positive Y-axis in degrees. 90 is West and 270 is East (Default: 0)

  • density

    Sky patch subdivision density. This values is similar to -m option in gendaymtx command. Default is 1 which means 145 sky patches and 1 patch for the ground.

    One can add to the resolution typically by factors of two (2, 4, 8, …) which yields a higher resolution sky using the Reinhart patch subdivision For example, setting density to 4 yields a sky with 2305 patches plus one patch for the ground.

Properties:
  • wea

  • location

  • north

  • is_point_in_time

  • is_climate_based

classmethod from_dict(input_dict)[source]

Create the sky from a dictionary.

Parameters

input_dict – A python dictionary in the following format

{
'type': 'SkyMatrix',
'wea': {},
'north': 0.0  # optional
'density': 1  # optional
}
north_from_vector(north_vector)

Automatically set the north property using a Vector2D.

Parameters

north_vector – A ladybug_geometry Vector2D for the north direction

to_dict()[source]

Translate this matrix to a dictionary.

to_file(folder, name=None, hoys=None, mkdir=False)

Write matrix to a Radiance file.

This method also writes the wea information to a .wea file.

Parameters
  • folder – Target folder.

  • name – File name.

  • hoys – Optional list of hoys to filter the hours of the wea. If None, this object’s wea will be used as-is. Note that you may not want to use this input if this object’s wea is not annual since an exception will be raised if a given hoy is not found in the wea. (Default: None).

  • mkdir – A boolean to note if the directory should be created if doesn’t exist (default: False).

Returns

Full path to the newly created file.

to_radiance(output_type=0, wea_file=None, output_name=None, cumulative=False, components=0)[source]

Return Radiance command to generate the sky.

Note that you need to write the wea to a file (in.wea) before running this command.

Alternatively you can use write method which will write the wea data to a file.

Parameters
  • output_type – An integer between 0 to 1 for output type. * 0 = output in W/m2/sr visible (default) * 1 = output in W/m2/sr solar

  • wea_file – Path to wea file (default: in.wea).

  • output_name – A name for output files (default: sky_mtx).

  • cumulative – A boolean to generate cumulative sky. This option is only available in Radiance 5.3 and higher versions (default: False).

  • components – An integer between 0-2 to note the distribution of which components should be included. 0 might be used to include both sun and sky contribution. 1 may be used to produce a sun-only matrix, with no sky contributions. Alternatively, 2 may be used to exclude any sun component from the output. If there is a sun in the description, gendaymtx will include its contribution in the four nearest sky patches, distributing energy according to centroid proximity (default: 0).

write_wea(folder='.', name=None, hoys=None)

Write wea to a file.

Parameters
  • folder – Path to target folder (Default: ‘.’).

  • name – Optional name for the wea file (Default: in.wea)

  • hoys – Optional list of hoys to filter the hours of the wea. If None, this object’s wea will be used as-is. Note that you may not want to use this input if this object’s wea is not annual since an exception will be raised if a given hoy is not found in the wea. (Default: None).

Returns

Path to wea file.

property density

Set and get sky patch subdivision density.

This values is similar to -m option in gendaymtx command. Default is 1 which means 145 sky patches and 1 patch for the ground.

One can add to the resolution typically by factors of two (2, 4, 8, …) which yields a higher resolution sky using the Reinhart patch subdivision. For example, setting density to 4 yields a sky with 2305 patches plus one patch for the ground.

property is_climate_based

Return True if the sky is created based on values from weather data.

property is_point_in_time

Return True if the sky is generated for a single point in time.

property location

Location information for sky matrix.

property north

Get and set north direction.

A number between -360 and 360 for the counterclockwise difference between the North and the positive Y-axis in degrees. 90 is West and 270 is East.

property wea

Get and set wea.