honeybee_radiance.lightsource.sky.cie module

Generate CIE standard sky.

class honeybee_radiance.lightsource.sky.cie.CIE(altitude, azimuth, sky_type=0, ground_reflectance=0.2)[source]

Bases: _PointInTime

CIE sky.

The output of CIE sky is similar to using Radiance’s gensky command. For more information see gensky documentation.

Parameters:
  • altitude – Solar altitude. The altitude is measured in degrees above the horizon.

  • azimuth – Solar azimuth. The azimuth is measured in degrees east of North. East is 90, South is 180 and West is 270. Note that this input is different from Radiance convention. In Radiance the azimuth degrees are measured in west of South.

  • sky_type

    An integer between 0..5 to indicate CIE Sky Type.

    • 0 = Sunny with sun. Sunny sky with sun. In addition to the sky distribution function, a source description of the sun is generated.

    • 1 = Sunny without sun. Sunny sky without sun. The sky distribution will correspond to a standard CIE clear day.

    • 2 = Intermediate with sun. In addition to the sky distribution, a (somewhat subdued) sun is generated.

    • 3 = Intermediate without sun. The sky will correspond to a standard CIE intermediate day.

    • 4 = Cloudy sky. The sky distribution will correspond to a standard CIE overcast day.

    • 5 = Uniform cloudy sky. The sky distribution will be completely uniform.

  • ground_reflectance – Average ground reflectance (Default: 0.2).

Properties:
  • altitude

  • azimuth

  • sky_type

  • sky_type_radiance

  • sky_type_human_readable

  • ground_hemisphere

  • sky_hemisphere

  • ground_reflectance

  • is_point_in_time

  • is_climate_based

ToString()

Overwrite .NET ToString.

classmethod from_dict(data)[source]

Create the sky from a dictionary.

Parameters:

data – A python dictionary in the following format

{
    'type': 'CIE',
    'altitude': 0.0,
    'azimuth': 0.0,
    'sky_type': 0,  # optional integer for sky type
    'ground_reflectance': 0.2  # optional fraction for ground reflectance
}
classmethod from_lat_long(latitude, longitude, time_zone, month, day, hour, sky_type=0, north_angle=0, ground_reflectance=0.2)[source]

Create sky with certain illuminance.

Parameters:
  • latitude – Location latitude between -90 (south) and 90 (north).

  • longitude – Location longitude between -180 (west) and 180 (east).

  • time_zone – Time zone between -12 hours (west) and +14 hours (east). If None, the time will be interpreted as solar time at the given longitude.

  • month – An integer between 1-12 for month.

  • day – An integer between 1 to 28-31 depending on the input month.

  • hour – A float number larger or equal to 0 and smaller than 24.

  • sky_type

    An integer between 0..5 to indicate CIE Sky Type.

    • 0 = Sunny with sun. Sunny sky with sun. In addition to the sky distribution function, a source description of the sun is generated.

    • 1 = Sunny without sun. Sunny sky without sun. The sky distribution will correspond to a standard CIE clear day.

    • 2 = Intermediate with sun. In addition to the sky distribution, a (somewhat subdued) sun is generated.

    • 3 = Intermediate without sun. The sky will correspond to a standard CIE intermediate day.

    • 4 = Cloudy sky. The sky distribution will correspond to a standard CIE overcast day.

    • 5 = Uniform cloudy sky. The sky distribution will be completely uniform.

  • north_angle – North angle in degrees. 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).

  • ground_reflectance – Average ground reflectance (Default: 0.2).

classmethod from_location(location, month, day, hour, sky_type=0, north_angle=0, ground_reflectance=0.2)[source]

Create a standard CIE sky for a location.

Parameters:
  • location – A Ladybug location.

  • month – An integer between 1-12 for month.

  • day – An integer between 1 to 28-31 depending on the input month.

  • hour – A float number larger or equal to 0 and smaller than 24.

  • sky_type

    An integer between 0..5 to indicate CIE Sky Type.

    • 0 = Sunny with sun. Sunny sky with sun. In addition to the sky distribution function, a source description of the sun is generated.

    • 1 = Sunny without sun. Sunny sky without sun. The sky distribution will correspond to a standard CIE clear day.

    • 2 = Intermediate with sun. In addition to the sky distribution, a (somewhat subdued) sun is generated.

    • 3 = Intermediate without sun. The sky will correspond to a standard CIE intermediate day.

    • 4 = Cloudy sky. The sky distribution will correspond to a standard CIE overcast day.

    • 5 = Uniform cloudy sky. The sky distribution will be completely uniform.

  • north_angle – North angle in degrees. 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).

  • ground_reflectance – Average ground reflectance (Default: 0.2).

classmethod from_string(sky_string)[source]

Create a CIE sky from a string.

Parameters:

sky_string – A text string representing a CIE sky. This can be a minimal representation of the sky (eg. “cie -alt 71.6 -az 185.2 -type 0”). Or it can be a detailed specification of time and location (eg. “cie 21 Jun 12:00 -lat 41.78 -lon -87.75 -type 0”). The “-type” property of CIE skies is optional and, if unspecified, it defaults to 0 (Sunny with Sun). Any sky string can optionally have a “-g” property of a fractional number, which sets the reflectance of the ground. If unspecified, the ground will have a reflectance of 0.2. The detailed string can optionally have a “-tz” property with an integer between -12 and +14 to denote the time zone. If unspecified, the time will be interpreted as solar time at the given longitude. The detailed string can also have a “-n” property between 0 and 360 to set the counterclockwise difference between the North and the positive Y-axis in degrees. All other properties specified in the string are required.

Usage:

# minimal string representation of the sky
sky_string = "cie -alt 71.6 -az 185.2 -type 2"
sky = CIE.from_string(sky_string)

# detailed location-specific representation of the sky
sky_string = "cie 21 Jun 12:00 -lat 41.78 -lon -87.75 -tz -6"
sky = CIE.from_string(sky_string)
to_dict()[source]

Translate sky to a dictionary.

to_file(folder, name=None, mkdir=False)[source]

Write sky hemisphere to a sky_hemisphere.rad Radiance file.

Parameters:
  • folder – Target folder.

  • name – File name.

  • 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()[source]

Return radiance definition as a string.

SKYTYPES = {0: ('+s', 'Sunny sky with sun'), 1: ('-s', 'Sunny sky without sun'), 2: ('+i', 'intermediate sky with sun'), 3: ('-i', 'intermediate sky without sun'), 4: ('-c', 'Cloudy sky'), 5: ('-u', 'Uniform cloudy sky')}
property altitude

Get or set a number between -90 and 90 for the solar altitude.

The altitude is measured in degrees above the horizon.

property azimuth

Get or set a number between 0 and 360 for the solar azimuth.

The azimuth is measured in degrees east of North. East is 90, South is 180 and West is 270. Note that this input is different from Radiance convention. In Radiance the azimuth degrees are measured in west of South.

property ground_hemisphere

Sky ground glow source.

property ground_reflectance

Get or set a value between 0 and 1 for the ground reflectance.

If not specified, a default of 0.2 will be used.

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 sky_hemisphere

Sky hemisphere glow source.

property sky_type

Get and set sky type.

An integer between 0 and 5 to indicate CIE Sky Type.

  • 0 = Sunny with sun. Sunny sky with sun. In addition to the sky distribution function, a source description of the sun is generated.

  • 1 = Sunny without sun. Sunny sky without sun. The sky distribution will correspond to a standard CIE clear day.

  • 2 = Intermediate with sun. In addition to the sky distribution, a (somewhat subdued) sun is generated.

  • 3 = Intermediate without sun. The sky will correspond to a standard CIE intermediate day.

  • 4 = Cloudy sky. The sky distribution will correspond to a standard CIE overcast day.

  • 5 = Uniform cloudy sky. The sky distribution will be completely uniform.

property sky_type_human_readable

A human readable description of sky type.

property sky_type_radiance

Sky type in Radiance format.

  • +s = Sunny with sun. Sunny sky with sun. In addition to the sky distribution function, a source description of the sun is generated.

  • -s = Sunny without sun. Sunny sky without sun. The sky distribution will correspond to a standard CIE clear day.

  • +i = Intermediate with sun. In addition to the sky distribution, a (somewhat subdued) sun is generated.

  • -i = Intermediate without sun. The sky will correspond to a standard CIE intermediate day.

  • -c = Cloudy sky. The sky distribution will correspond to a standard CIE overcast day.

  • -u = Uniform cloudy sky. The sky distribution will be completely uniform.