honeybee.radiance.sky package¶
Submodules¶
honeybee.radiance.sky.analemma module¶
Solar analemma.
-
class
honeybee.radiance.sky.analemma.
Analemma
(sun_vectors, sun_up_hours)[source]¶ Bases:
honeybee.radiance.sky._skyBase.RadianceSky
Generate a radiance-based analemma.
- Analemma consists of two files:
-
analemma_file
¶ Analemma file name.
Use this file to create the octree.
-
classmethod
from_epw_file
(epw_file, hoys=None, north=0, is_leap_year=False)[source]¶ Create sun matrix from an epw file.
- NOTE: Only the location from epw file will be used for creating analemma. For
- climate-based sun materix see SunMatrix class.
Parameters: - epw_file – Full path to an epw file.
- hoys – A list of hours of the year (default: range(8760)).
- north – North angle from Y direction (default: 0).
- is_leap_year – A boolean to indicate if hours are for a leap year (default: False).
-
classmethod
from_location
(location, hoys=None, north=0, is_leap_year=False)[source]¶ Generate a radiance-based analemma for a location.
Parameters: - location – A ladybug location.
- hoys – A list of hours of the year (default: range(8760)).
- north – North angle from Y direction (default: 0).
- is_leap_year – A boolean to indicate if hours are for a leap year (default: False).
-
classmethod
from_wea
(wea, hoys=None, north=0, is_leap_year=False)[source]¶ Generate a radiance-based analemma from a ladybug wea.
- NOTE: Only the location from wea will be used for creating analemma. For
- climate-based sun materix see SunMatrix class.
Parameters: - wea – A ladybug Wea.
- hoys – A list of hours of the year (default: range(8760)).
- north – North angle from Y direction (default: 0).
- is_leap_year – A boolean to indicate if hours are for a leap year (default: False).
-
isAnalemma
¶ Return True.
-
is_climate_based
¶ Return True if the sky is generated from values from weather file.
-
sun_up_hours
¶ Return list of hours for sun vectors.
-
sun_vectors
¶ Return list of sun vectors.
-
sunlist_file
¶ Sun list file name.
Use this file as the list of modifiers in rcontrib.
-
class
honeybee.radiance.sky.analemma.
AnalemmaReversed
(sun_vectors, sun_up_hours)[source]¶ Bases:
honeybee.radiance.sky.analemma.Analemma
Generate a radiance-based analemma.
Reversed Analemma reverses direction of input sun vectors. Use reversed Analemma for radiation studies.
- Analemma consists of two files:
- *_reversed.ann file which includes sun geometries and materials.
2. *_reversed.mod file includes list of modifiers that are included in *_reversed.ann file.
-
analemma_file
¶ Analemma file name.
Use this file to create the octree.
honeybee.radiance.sky.certainIlluminance module¶
-
class
honeybee.radiance.sky.certainIlluminance.
CertainIlluminanceLevel
(illuminance_value=10000, sky_type=0, suffix=None)[source]¶ Bases:
honeybee.radiance.sky.cie.CIE
Uniform CIE sky based on illuminance value.
-
illuminance_value
¶ Desired illuminance value in lux
-
sky_type
¶ An integer between 0..1 to indicate CIE Sky Type. [0] cloudy sky, [1] uniform sky (default: 0)
-
suffix
¶ An optional suffix for sky name. The suffix will be added at the end of the standard name. Use this input to customize the new and avoid sky being overwritten by other skymatrix components.
Usage:
sky = CertainIlluminanceLevel(1000) sky.execute(“c:/ladybug/1000luxsky.sky”)-
classmethod
from_json
(rec_json)[source]¶ Create sky from json file {
“sky_type”: int // CIE Sky Type [0] cloudy sky, [1] uniform sky “illuminance_value”: int // Illuminance value of sky}
-
illuminance_value
Desired Illuminace value.
-
is_climate_based
¶ Return True if the sky is generated from values from weather file.
-
name
¶ Sky default name.
-
honeybee.radiance.sky.cie module¶
-
class
honeybee.radiance.sky.cie.
CIE
(location=None, month=9, day=21, hour=12, north=0, sky_type=0, suffix=None)[source]¶ Bases:
honeybee.radiance.sky._pointintimesky.PointInTimeSky
Create Standard CIE sky.
-
location
¶ A ladybug location
-
month
¶ A number to indicate month (1..12)
-
day
¶ A number to indicate day (1..31)
-
hour
¶ A number to indicate hour (0..23)
-
north_
¶ A number between 0 and 360 that represents the degrees off from the y-axis to make North. The default North direction is set to the Y-axis (default: 0 degrees).
-
sky_type
¶ An integer between 0..5 to indicate CIE Sky Type. [0] Sunny with sun, [1] sunny without sun, [2] intermediate with sun [3] intermediate without sun, [4] cloudy sky, [5] uniform sky
-
suffix
¶ An optional suffix for sky name. The suffix will be added at the end of the standard name. Use this input to customize the new and avoid sky being overwritten by other skymatrix components.
-
SKYTYPES
= {0: ('+s', 'sunnyWSun'), 1: ('-s', 'sunnyNoSun'), 2: ('+i', 'intermWSun'), 3: ('-i', 'intermNoSun'), 4: ('-c', 'cloudy_sky'), 5: ('-u', 'uniformSky')}¶
-
classmethod
from_json
(loc_json)[source]¶ Create sky form json. {
“location”: {}, // honeybee (or actually ladybug location schema) “day”: 1, // an integer between 1-31 “month”: 1, // an integer between 1-12 “hour”: 12.0, // a float number between 0-23 “north”: 0, // degree for north if not Y axis “sky_type”: 0 // A number between 0-5 – 0: sunny sky}
location schema {
“city”: “”, “latitude”: 0, “longitude”: 0, “time_zone”: 0, “elevation”: 0}
-
classmethod
from_lat_long
(city, latitude, longitude, timezone, elevation, month=6, day=21, hour=9, north=0, sky_type=0, suffix=None)[source]¶ Create sky from latitude and longitude.
-
name
¶ Sky default name.
-
to_json
()[source]¶ Return sky as a json. {
“location”: {}, // honeybee (or actually ladybug location schema) “day”: 1, // an integer between 1-31 “month”: 1, // an integer between 1-12 “hour”: 12.0, // a float number between 0-23 “north”: 0, // degree for north if not Y axis “sky_type”: 0 // A number between 0-5 – 0: sunny sky}
location schema {
“city”: “”, “latitude”: 0, “longitude”: 0, “time_zone”: 0, “elevation”: 0}
-
honeybee.radiance.sky.climatebased module¶
-
class
honeybee.radiance.sky.climatebased.
ClimateBased
(location, month, day, hour, direct_radiation, diffuse_radiation, north=0, suffix=None)[source]¶ Bases:
honeybee.radiance.sky._pointintimesky.PointInTimeSky
Create Standard CIE sky.
-
location
¶ A ladybug location
-
month
¶ A number to indicate month (1..12)
-
day
¶ A number to indicate day (1..31)
-
hour
¶ A number to indicate hour (0..23)
-
direct_radiation
¶ Direct-normal irradiance in W/m^2.
-
diffuse_radiation
¶ Diffuse-horizontal irradiance in W/m^2.
-
north_
¶ A number between 0 and 360 that represents the degrees off from the y-axis to make North. The default North direction is set to the Y-axis (default: 0 degrees).
-
suffix
¶ An optional suffix for sky name. The suffix will be added at the end of the standard name. Use this input to customize the new and avoid sky being overwritten by other skymatrix components.
-
classmethod
from_lat_long
(city, latitude, longitude, timezone, elevation, month, day, hour, direct_radiation, diffuse_radiation, north=0, suffix=None)[source]¶ Create sky from latitude and longitude.
-
classmethod
from_wea
(wea, month, day, hour, north=0, suffix=None)[source]¶ Create sky from wea file.
-
is_climate_based
¶ Return True if the sky is climated-based.
-
name
¶ Sky default name.
-
sky_type
¶ Specify 0 for visible radiation, 1 for solar radiation and 2 for luminance.
-
sky_type_human_readable
¶ Human readable sky type.
-
honeybee.radiance.sky.gendaylit module¶
Calculte sky values based on Radiance’s gendaylit.
- This code is parts of genddaylit.c whic is copyrighted by:
- Copyright (c) 1994,2006 *Fraunhofer Institut for Solar Energy Systems
- Heidenhofstr. 2, D-79110 Freiburg, Germany Agence de l’Environnement et de la Maitrise de l’Energie Centre de Valbonne, 500 route des Lucioles, 06565 Sophia Antipolis Cedex, France *BOUYGUES 1 Avenue Eugene Freyssinet, Saint-Quentin-Yvelines, France
- You can check the source code at:
-
honeybee.radiance.sky.gendaylit.
air_mass
(sunzenith)[source]¶ Enter sunzenith angle (degrees) return relative air mass (double).
-
honeybee.radiance.sky.gendaylit.
calc_rel_lum_perez
(dzeta, gamma, z, epsilon, delta, coeff_perez)[source]¶ Sky luminance perez model.
-
honeybee.radiance.sky.gendaylit.
check_input_values
(directilluminance, diffuseilluminance, altitude)[source]¶ Validity of the direct and diffuse components.
-
honeybee.radiance.sky.gendaylit.
check_parametrization
(skyclearness, skybrightness)[source]¶ Check the range of epsilon and delta indexes of the perez parametrization.
-
honeybee.radiance.sky.gendaylit.
coeff_lum_perez
(z, epsilon, delta, coeff_perez)[source]¶ Coefficients for the sky luminance perez model.
-
honeybee.radiance.sky.gendaylit.
direct_n_effi_perez
(skyclearness, skybrightness, sunzenith)[source]¶ Direct normal efficacy model, according to PEREZ.
-
honeybee.radiance.sky.gendaylit.
gendaylit
(altitude, month, day, hour, directirradiance, diffuseirradiance, output_type=0)[source]¶ Get solar irradiance.
Parameters: - altitude – Sun altitude in degrees.
- month – A value for month between 1-12.
- day – A value for day between 1-31.
- hour – A value for hour between 0-23.
- directirradiance – Direct irradiance value.
- diffuseirradiance – Diffuse irradiance value.
- 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).
Returns: solar irradiance.
Return type: solarradiance
-
honeybee.radiance.sky.gendaylit.
get_eccentricity
(day_angle)[source]¶ Enter day number, return E0 = square(R0/R): eccentricity correction factor.
-
honeybee.radiance.sky.gendaylit.
glob_h_diffuse_effi_perez
(skyclearness, skybrightness, sunzenith)[source]¶ Global horizontal diffuse efficacy model, according to PEREZ.
honeybee.radiance.sky.skymatrix module¶
-
class
honeybee.radiance.sky.skymatrix.
SkyMatrix
(wea, sky_density=1, north=0, hoys=None, mode=0, suffix=None)[source]¶ Bases:
honeybee.radiance.sky._skyBase.RadianceSky
Radiance sky matrix based on an epw weather file.
-
wea
¶ An instance of ladybug Wea.
-
sky_density
¶ A positive intger for sky density. [1] Tregenza Sky, [2] Reinhart Sky, etc. (Default: 1)
-
north
¶ An angle in degrees between 0-360 to indicate north direction (Default: 0).
-
hoys
¶ The list of hours for generating the sky matrix (Default: 0..8759).
-
mode
¶ Sky mode 0: total, 1: direct-only, 2: diffuse-only (Default: 0).
-
suffix
¶ An optional suffix for sky name. The suffix will be added at the end of the standard name. Use this input to customize the new and avoid sky being overwritten by other skymatrix components.
-
execute
(working_dir, reuse=True)[source]¶ Generate sky matrix.
Parameters: - working_dir – Folder to execute and write the output.
- reuse – Reuse the matrix if already existed in the folder.
-
classmethod
from_epw_file
(epw_file, sky_density=1, north=0, hoys=None, mode=0, suffix=None)[source]¶ Create sky from an epw file.
-
classmethod
from_json
(rec_json)[source]¶ Create sky from json file { “wea”: {}, // ladybug wea schema “sky_density”: int, // [1] Tregenza Sky, [2] Reinhart Sky, etc. (Default: 1) “north”: float, // Angle in degrees between 0-360 to indicate North “hoys”: [], // List of hours for generating the sky “mode”: int, // Sky mode, integer between 0 and 2 “suffix”: string //Suffix for sky matrix }
-
hoys
-
isSkyMatrix
¶ Return True.
-
is_climate_based
¶ Return True if the sky is generated from values from weather file.
-
mode
**Sky mode 0* – total, 1* – direct-only, 2: diffuse-only (Default: 0).
-
name
¶ Sky default name.
-
north
An angle in degrees between 0-360 to indicate north direction (Default – 0).
-
sky_density
A positive intger for sky density. [1] Tregenza Sky, [2] Reinhart Sky, etc.
-
sky_matrix_parameters
¶ Return sky matrix parameters.
-
sky_type
¶ Specify 0 for visible radiation, 1 for total solar radiation.
-
sky_type_human_readable
¶ Human readable sky type.
-
suffix
-
to_json
()[source]¶ Create json file from sky matrix { “wea”: {}, // ladybug wea schema “sky_density”: int, // [1] Tregenza Sky, [2] Reinhart Sky, etc. (Default: 1) “north”: float, // Angle in degrees between 0-360 to indicate North “hoys”: [], // List of hours for generating the sky “mode”: int, // Sky mode, integer between 0 and 2 “suffix”: string //Suffix for sky matrix }
-
wea
An instance of ladybug Wea.
-
honeybee.radiance.sky.skyvector module¶
-
class
honeybee.radiance.sky.skyvector.
SkyVector
(sky, sky_density=1, is_climate_based=False)[source]¶ Bases:
honeybee.radiance.sky._skyBase.RadianceSky
Radiance sky vector.
-
sky
¶ A sky object generated either by gensky or gendaylit. If you’re not sure how to create them use one of the classmethods.
-
sky_density
¶ A positive intger for sky density. [1] Tregenza Sky, [2] Reinhart Sky, etc. (Default: 1)
-
day
¶ Return hour.
-
execute
(working_dir, reuse=True)[source]¶ Generate sky vector.
Parameters: - working_dir – Folder to execute and write the output.
- reuse – Reuse the matrix if already existed in the folder.
-
classmethod
from_cie_sky
(location, month=6, day=21, hour=12, sky_type=0, sky_density=1, north=0)[source]¶ Generate a sky vector from an standard CIE sky.
Parameters: - month – Month [1..12] (default: 6).
- day – Day [1..31] (default: 21).
- hour – Hour [0..23] (default: 12).
- sky_type – An intger between 0-5 for CIE sky type. 0: [+s] Sunny with sun, 1: [-s] Sunny without sun, 2: [+i] Intermediate with sun, 3: [-i] Intermediate with no sun, 4: [-c] Cloudy overcast sky, 5: [-u] Uniform cloudy sky
- sky_density: A positive intger for sky density. [1] Tregenza Sky,
- [2] Reinhart Sky, etc. (Default: 1)
-
classmethod
from_epw_file
(epw_file, month=6, day=21, hour=12, sky_density=1, north=0)[source]¶ Generate a climate-based sky vector.
This methos uses Radiance’s gendaylit.
Parameters: - epw_file – Full path to epw weather file.
- month – Month [1..12] (default: 6).
- day – Day [1..31] (default: 21).
- hour – Hour [0..23] (default: 12).
- sky_type – An intger between 0-5 for CIE sky type. 0: [+s] Sunny with sun, 1: [-s] Sunny without sun, 2: [+i] Intermediate with sun, 3: [-i] Intermediate with no sun, 4: [-c] Cloudy overcast sky, 5: [-u] Uniform cloudy sky
- sky_density – A positive intger for sky density. [1] Tregenza Sky, [2] Reinhart Sky, etc. (Default: 1)
-
classmethod
from_radiation_values
(location, direct_normal_radiation, diffuse_horizontal_radiation, month=6, day=21, hour=12, sky_density=1, north=0)[source]¶ From radiation values.
-
hour
¶ Return hour.
-
isSkyVector
¶ Return True.
-
is_climate_based
¶ Return True if the sky is generated from values from weather file.
-
month
¶ Return hour.
-
name
¶ Sky default name.
-
honeybee.radiance.sky.sunmatrix module¶
-
class
honeybee.radiance.sky.sunmatrix.
SunMatrix
(wea, north=0, hoys=None, output_type=0, suffix=None)[source]¶ Bases:
honeybee.radiance.sky._skyBase.RadianceSky
Radiance direct sun matrix.
This class generates a sky matrix similar to gendaymtx -5 with the difference that unlike gendaymtx that uses the approximate position of the sun it uses the exact sun position for each timestep.
Parameters: - wea – An instance of ladybug Wea.
- north – An angle in degrees between 0-360 to indicate north direction (Default: 0).
- hoys – The list of hours for generating the sky matrix (Default: 0..8759)
- output_type – Specify 0 for visible radiation, 1 for total solar radiation.
- suffix – An optional suffix for sky name. The suffix will be added at the end of the standard name. Use this input to customize the new and avoid sky being overwritten by other skymatrix components.
-
solar_values
¶ A list of radiance values for each sun_up_hour. These values can be visible or total solar radiation based on output_type input.
-
sun_up_hours
¶ List of sun up hours as hours of the year. Values will be between 0..8759.
Usage:
from honeybee.radiance.sky.sunmatrix import SunMatrix epwfile = r”./USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw” sunmtx = sun_matrix.from_epw_file(epwfile, north=20) analemma, sunlist, sunmtxfile = sunmtx.execute(‘c:/ladybug’)-
analemmafile
¶ Analemma file.
-
execute
(working_dir, reuse=True)[source]¶ Generate sun matrix.
Parameters: - working_dir – Folder to execute and write the output.
- reuse – Reuse the matrix if already existed in the folder.
Returns: Full path to analemma, sunlist and sun_matrix.
-
classmethod
from_epw_file
(epw_file, north=0, hoys=None, output_type=0, suffix=None)[source]¶ Create sun matrix from an epw file.
-
isSunMatrix
¶ Return True.
-
is_climate_based
¶ Return True if the sky is generated from values from weather file.
-
name
¶ Sky default name.
-
north
¶ An angle in degrees between 0-360 to indicate north direction (Default – 0).
-
output_header
¶ Sun matrix file header output.
-
output_type
¶ Specify 0 for visible radiation, 1 for solar radiation and 2 for luminance.
-
output_type_human_readable
¶ Human readable output type.
-
solar_values
List of radiance values for each sun_up_hour.
These values can be visible or total solar radiation based on output_type input.
-
sun_up_hours
List of sun up hours as hours of the year.
Values will be between 0..8759.
-
sunlistfile
¶ Sun list file.
-
sunmtxfile
¶ Sun matrix file.
-
wea
¶ An instance of ladybug Wea.
Module contents¶
Honeybee skies.