honeybee-grasshopper-radiance 1.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honeybee_grasshopper_radiance/__init__.py +7 -0
- honeybee_grasshopper_radiance/src/HB Adjust HDR.py +107 -0
- honeybee_grasshopper_radiance/src/HB Ambient Resolution.py +63 -0
- honeybee_grasshopper_radiance/src/HB Annual Average Values.py +205 -0
- honeybee_grasshopper_radiance/src/HB Annual Cumulative Values.py +191 -0
- honeybee_grasshopper_radiance/src/HB Annual Daylight Metrics.py +209 -0
- honeybee_grasshopper_radiance/src/HB Annual Daylight.py +153 -0
- honeybee_grasshopper_radiance/src/HB Annual Glare Metrics.py +137 -0
- honeybee_grasshopper_radiance/src/HB Annual Irradiance.py +112 -0
- honeybee_grasshopper_radiance/src/HB Annual Peak Values.py +224 -0
- honeybee_grasshopper_radiance/src/HB Annual Results to Data.py +246 -0
- honeybee_grasshopper_radiance/src/HB Annual Sunlight Exposure.py +147 -0
- honeybee_grasshopper_radiance/src/HB Aperture Group Schedule.py +69 -0
- honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py +107 -0
- honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py +71 -0
- honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py +110 -0
- honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py +120 -0
- honeybee_grasshopper_radiance/src/HB Assign Grids and Views.py +58 -0
- honeybee_grasshopper_radiance/src/HB Automatic Aperture Group.py +100 -0
- honeybee_grasshopper_radiance/src/HB BSDF Modifier.py +78 -0
- honeybee_grasshopper_radiance/src/HB CIE Standard Sky.py +75 -0
- honeybee_grasshopper_radiance/src/HB Certain Illuminance.py +41 -0
- honeybee_grasshopper_radiance/src/HB Check Scene.py +208 -0
- honeybee_grasshopper_radiance/src/HB Climatebased Sky.py +75 -0
- honeybee_grasshopper_radiance/src/HB Cumulative Radiation.py +98 -0
- honeybee_grasshopper_radiance/src/HB Custom Sky.py +74 -0
- honeybee_grasshopper_radiance/src/HB Daylight Control Schedule.py +211 -0
- honeybee_grasshopper_radiance/src/HB Daylight Factor.py +82 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct Modifier.py +47 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct ModifierSet Interior.py +67 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct ModifierSet.py +80 -0
- honeybee_grasshopper_radiance/src/HB Deconstruct Wea.py +44 -0
- honeybee_grasshopper_radiance/src/HB Direct Sun Hours.py +88 -0
- honeybee_grasshopper_radiance/src/HB Dynamic Aperture Group.py +90 -0
- honeybee_grasshopper_radiance/src/HB Dynamic Shade Group.py +95 -0
- honeybee_grasshopper_radiance/src/HB Dynamic State Geometry.py +68 -0
- honeybee_grasshopper_radiance/src/HB Dynamic State.py +44 -0
- honeybee_grasshopper_radiance/src/HB Exterior Modifier Subset.py +68 -0
- honeybee_grasshopper_radiance/src/HB Extract HDR.py +225 -0
- honeybee_grasshopper_radiance/src/HB False Color.py +246 -0
- honeybee_grasshopper_radiance/src/HB Get Dynamic Groups.py +57 -0
- honeybee_grasshopper_radiance/src/HB Get Grids and Views.py +82 -0
- honeybee_grasshopper_radiance/src/HB Glare Postprocess.py +225 -0
- honeybee_grasshopper_radiance/src/HB Glass Modifier 3.py +62 -0
- honeybee_grasshopper_radiance/src/HB Glass Modifier.py +58 -0
- honeybee_grasshopper_radiance/src/HB HDR to GIF.py +72 -0
- honeybee_grasshopper_radiance/src/HB Imageless Annual Glare.py +108 -0
- honeybee_grasshopper_radiance/src/HB Interior Modifier Subset.py +83 -0
- honeybee_grasshopper_radiance/src/HB Metal Modifier 3.py +70 -0
- honeybee_grasshopper_radiance/src/HB Metal Modifier.py +68 -0
- honeybee_grasshopper_radiance/src/HB Mirror Modifier 3.py +56 -0
- honeybee_grasshopper_radiance/src/HB Mirror Modifier.py +55 -0
- honeybee_grasshopper_radiance/src/HB Model to Rad Folder.py +75 -0
- honeybee_grasshopper_radiance/src/HB ModifierSet.py +127 -0
- honeybee_grasshopper_radiance/src/HB Opaque Modifier 3.py +68 -0
- honeybee_grasshopper_radiance/src/HB Opaque Modifier.py +67 -0
- honeybee_grasshopper_radiance/src/HB Point-In-Time Grid-Based.py +93 -0
- honeybee_grasshopper_radiance/src/HB Point-In-Time View-Based.py +127 -0
- honeybee_grasshopper_radiance/src/HB Radial Grid from Rooms.py +160 -0
- honeybee_grasshopper_radiance/src/HB Radial Sensor Grid.py +99 -0
- honeybee_grasshopper_radiance/src/HB Radiance Parameter.py +163 -0
- honeybee_grasshopper_radiance/src/HB Search Modifier Sets.py +58 -0
- honeybee_grasshopper_radiance/src/HB Search Modifiers.py +58 -0
- honeybee_grasshopper_radiance/src/HB Section Plane View.py +69 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Apertures.py +153 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Faces.py +147 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid from Rooms.py +210 -0
- honeybee_grasshopper_radiance/src/HB Sensor Grid.py +82 -0
- honeybee_grasshopper_radiance/src/HB Shade Modifier Subset.py +62 -0
- honeybee_grasshopper_radiance/src/HB Sky View.py +86 -0
- honeybee_grasshopper_radiance/src/HB Spatial Daylight Autonomy.py +86 -0
- honeybee_grasshopper_radiance/src/HB Subface Modifier Subset.py +90 -0
- honeybee_grasshopper_radiance/src/HB Translucent Modifier 3.py +77 -0
- honeybee_grasshopper_radiance/src/HB Translucent Modifier.py +77 -0
- honeybee_grasshopper_radiance/src/HB View from Viewport.py +85 -0
- honeybee_grasshopper_radiance/src/HB View.py +96 -0
- honeybee_grasshopper_radiance/src/HB Visualize Sky.py +141 -0
- honeybee_grasshopper_radiance/src/HB Wea From Clear Sky.py +61 -0
- honeybee_grasshopper_radiance/src/HB Wea From EPW.py +50 -0
- honeybee_grasshopper_radiance/src/HB Wea From Tau Clear Sky.py +56 -0
- honeybee_grasshopper_radiance/src/HB Wea from Zhang-Huang.py +63 -0
- honeybee_grasshopper_radiance/src/__init__.py +1 -0
- honeybee_grasshopper_radiance/user_objects/HB Adjust HDR.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Ambient Resolution.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Average Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Cumulative Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Daylight Metrics.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Daylight.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Glare Metrics.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Irradiance.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Peak Values.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Results to Data.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Annual Sunlight Exposure.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Aperture Group Schedule.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser +0 -0
- Views.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Automatic Aperture Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB BSDF Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB CIE Standard Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Certain Illuminance.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Check Scene.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Climatebased Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Cumulative Radiation.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Custom Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Daylight Control Schedule.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Daylight Factor.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct ModifierSet Interior.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Deconstruct Wea.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Direct Sun Hours.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic Aperture Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic Shade Group.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic State Geometry.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Dynamic State.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Exterior Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Extract HDR.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Face Radiance Attributes.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB False Color.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Get Dynamic Groups.ghuser +0 -0
- Views.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glare Postprocess.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glass Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Glass Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB HDR to GIF.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Imageless Annual Glare.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Interior Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Metal Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Metal Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Mirror Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Mirror Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Model to Rad Folder.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB ModifierSet.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Opaque Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Opaque Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Point-In-Time Grid-Based.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Point-In-Time View-Based.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radial Grid from Rooms.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radial Sensor Grid.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Radiance Parameter.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Room Radiance Attributes.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Search Modifier Sets.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Search Modifiers.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Section Plane View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Apertures.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Faces.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid from Rooms.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sensor Grid.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Shade Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Sky View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Spatial Daylight Autonomy.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Subface Modifier Subset.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Translucent Modifier 3.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Translucent Modifier.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB View from Viewport.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB View.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Visualize Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From Clear Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From EPW.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea From Tau Clear Sky.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/HB Wea from Zhang-Huang.ghuser +0 -0
- honeybee_grasshopper_radiance/user_objects/__init__.py +1 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/METADATA +64 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/RECORD +170 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/WHEEL +5 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/licenses/LICENSE +661 -0
- honeybee_grasshopper_radiance-1.35.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create a point-in-time standard Radiance CIE sky.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
north_: A number between 0 and 360 that represents the degrees off from
|
|
16
|
+
the y-axis to make North. This can also be a vector to set the North.
|
|
17
|
+
Default is 0. The default North direction is the Y-axis (0 degrees).
|
|
18
|
+
_location: A Ladybug location object.
|
|
19
|
+
_month_: An integer between 1 and 12 for the month of the year (default: 6).
|
|
20
|
+
_day_: An integer between 1 and 31 for the day of the month (default: 21).
|
|
21
|
+
_hour_: A number between 0 and 23.999 for the hour of the day (default: 12).
|
|
22
|
+
_type_: An integer between 0..5 to indicate CIE Sky Type (default: 0).
|
|
23
|
+
* 0 = Sunny with sun
|
|
24
|
+
* 1 = sunny without sun
|
|
25
|
+
* 2 = intermediate with sun
|
|
26
|
+
* 3 = intermediate without sun
|
|
27
|
+
* 4 = cloudy sky
|
|
28
|
+
* 5 = uniform sky
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
sky: A honeybee sky that can be used to create a point-in-time recipe.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
ghenv.Component.Name = 'HB CIE Standard Sky'
|
|
35
|
+
ghenv.Component.NickName = 'CIESky'
|
|
36
|
+
ghenv.Component.Message = '1.9.0'
|
|
37
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
38
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
39
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
40
|
+
|
|
41
|
+
try:
|
|
42
|
+
from ladybug_geometry.geometry2d.pointvector import Vector2D
|
|
43
|
+
except ImportError as e:
|
|
44
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
45
|
+
|
|
46
|
+
try:
|
|
47
|
+
from honeybee_radiance.lightsource.sky import CIE
|
|
48
|
+
except ImportError as e:
|
|
49
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
50
|
+
|
|
51
|
+
try: # import ladybug_rhino dependencies
|
|
52
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
53
|
+
from ladybug_rhino.togeometry import to_vector2d
|
|
54
|
+
except ImportError as e:
|
|
55
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
56
|
+
|
|
57
|
+
import math
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if all_required_inputs(ghenv.Component):
|
|
61
|
+
# process the north input
|
|
62
|
+
north_ = north_ or 0
|
|
63
|
+
try: # it's a vector
|
|
64
|
+
north_ = math.degrees(to_vector2d(north_).angle_clockwise(Vector2D(0, 1)))
|
|
65
|
+
except AttributeError: # north angle instead of vector
|
|
66
|
+
north_ = float(north_)
|
|
67
|
+
|
|
68
|
+
# set default values if they are not set
|
|
69
|
+
_type_ = 0 if _type_ is None else _type_
|
|
70
|
+
_month_ = 6 if _month_ is None else _month_
|
|
71
|
+
_day_ = 21 if _day_ is None else _day_
|
|
72
|
+
_hour_ = 12 if _hour_ is None else _hour_
|
|
73
|
+
|
|
74
|
+
# create the sky object
|
|
75
|
+
sky = CIE.from_location(_location, _month_, _day_, _hour_, _type_, north_)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create a uniform sky that yields a certain illuminance.
|
|
12
|
+
|
|
13
|
+
-
|
|
14
|
+
Args:
|
|
15
|
+
_value_: Desired value for sky horizontal illuminance in lux. (Default: 10000).
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
sky: A honeybee sky that can be used to create a point-in-time recipe.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
ghenv.Component.Name = 'HB Certain Illuminance'
|
|
22
|
+
ghenv.Component.NickName = 'CertainIllum'
|
|
23
|
+
ghenv.Component.Message = '1.9.0'
|
|
24
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
25
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
26
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
from honeybee_radiance.lightsource.sky import CertainIrradiance
|
|
30
|
+
except ImportError as e:
|
|
31
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
from ladybug_rhino.grasshopper import turn_off_old_tag
|
|
35
|
+
except ImportError as e:
|
|
36
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
37
|
+
turn_off_old_tag(ghenv.Component)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
_value_ = 10000 if _value_ is None else _value_
|
|
41
|
+
sky = CertainIrradiance.from_illuminance(_value_)
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Run a quick view-based Radiance simulation to visualize the properties of Honeybee
|
|
12
|
+
objects within Radiance.
|
|
13
|
+
_
|
|
14
|
+
Note that this simulation is always run on a single processor and will only show
|
|
15
|
+
static Radiance properties (no dynamic Aperture or Shade properties). Accordingly, this
|
|
16
|
+
component is only intended for quick checks of properties. For full customization
|
|
17
|
+
of view-based simulations, the "HB Point-in-time View-based" recipe should be used.
|
|
18
|
+
|
|
19
|
+
-
|
|
20
|
+
Args:
|
|
21
|
+
_hb_objs: An array of honeybee Rooms, Faces, Apertures, Doors or Shades to be
|
|
22
|
+
visualized in Radiance. This can also be an entire Model to be
|
|
23
|
+
visualized.
|
|
24
|
+
_view_: An optional Honeybee-Radiance view to specify the view to render. If
|
|
25
|
+
unspecified, the currently active Rhino viewport will be rendered.
|
|
26
|
+
_sky_: An optional Radiance sky from any of the sky components under the "Light
|
|
27
|
+
Sources" tab. If unspecified, a uniform sky with 10000 lux will be used.
|
|
28
|
+
adj_expos_: Boolean to note whether the exposure of the image should be adjusted to
|
|
29
|
+
mimic the human visual response in the output. The goal of this process
|
|
30
|
+
is to output an image that correlates more strongly with a person’s
|
|
31
|
+
subjective impression of a scene rather than the absolute birghtness
|
|
32
|
+
of the scene. (Default: True).
|
|
33
|
+
_metric_: Either an integer or the full name of a point-in-time metric to be
|
|
34
|
+
computed by the recipe. (Default: luminance). Choose from the following:
|
|
35
|
+
* 0 = illuminance
|
|
36
|
+
* 1 = irradiance
|
|
37
|
+
* 2 = luminance
|
|
38
|
+
* 3 = radiance
|
|
39
|
+
_resolution_: An integer for the maximum dimension of each image in pixels
|
|
40
|
+
(either width or height depending on the input view angle and
|
|
41
|
+
type). (Default: 800).
|
|
42
|
+
radiance_par_: Text for the radiance parameters to be used for ray
|
|
43
|
+
tracing. (Default: -ab 2 -aa 0.25 -ad 512 -ar 16).
|
|
44
|
+
_run: Set to "True" to run Radiance and get an image of the scene.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
report: Reports, errors, warnings, etc.
|
|
48
|
+
hdr: A High Dynamic Range (HDR) image of the scene. This can be plugged into
|
|
49
|
+
the Ladybug "Image Viewer" component to preview the image. It
|
|
50
|
+
can also be plugged into the "HB False Color" component to convert
|
|
51
|
+
the image into a false color version. Lastly, it can be connected to
|
|
52
|
+
the "HB HDR to GIF" component to get a GIF image that is more portable
|
|
53
|
+
and easily previewed by different software. Pixel values are in the
|
|
54
|
+
standard SI units of the requested input metric.
|
|
55
|
+
* illuminance = lux (aka. lm/m2)
|
|
56
|
+
* irradiance = W/m2
|
|
57
|
+
* luminance = cd/m2 (aka. lm/m2-sr)
|
|
58
|
+
* radiance = W/m2-sr
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
ghenv.Component.Name = 'HB Check Scene'
|
|
62
|
+
ghenv.Component.NickName = 'CheckScene'
|
|
63
|
+
ghenv.Component.Message = '1.9.0'
|
|
64
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
65
|
+
ghenv.Component.SubCategory = '3 :: Recipes'
|
|
66
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '6'
|
|
67
|
+
|
|
68
|
+
import os
|
|
69
|
+
|
|
70
|
+
try: # import honeybee_radiance dependencies
|
|
71
|
+
from ladybug.futil import write_to_file_by_name
|
|
72
|
+
except ImportError as e:
|
|
73
|
+
raise ImportError('\nFailed to import ladybug:\n\t{}'.format(e))
|
|
74
|
+
|
|
75
|
+
try: # import honeybee dependencies
|
|
76
|
+
from honeybee.config import folders
|
|
77
|
+
from honeybee.model import Model
|
|
78
|
+
except ImportError as e:
|
|
79
|
+
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
|
|
80
|
+
|
|
81
|
+
try: # import honeybee_radiance_command dependencies
|
|
82
|
+
from honeybee_radiance_command.oconv import Oconv
|
|
83
|
+
from honeybee_radiance_command.rpict import Rpict
|
|
84
|
+
from honeybee_radiance_command.rtrace import Rtrace
|
|
85
|
+
from honeybee_radiance_command.rcalc import Rcalc
|
|
86
|
+
from honeybee_radiance_command.pcond import Pcond
|
|
87
|
+
except ImportError as e:
|
|
88
|
+
raise ImportError('\nFailed to import honeybee_radiance_command:\n\t{}'.format(e))
|
|
89
|
+
|
|
90
|
+
try: # import honeybee_radiance dependencies
|
|
91
|
+
from honeybee_radiance.config import folders as rad_folders
|
|
92
|
+
from honeybee_radiance.view import View
|
|
93
|
+
from honeybee_radiance.lightsource.sky.strutil import string_to_sky
|
|
94
|
+
from honeybee_radiance.lightsource.sky import CertainIrradiance, ClimateBased
|
|
95
|
+
except ImportError as e:
|
|
96
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
97
|
+
|
|
98
|
+
try:
|
|
99
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
100
|
+
from ladybug_rhino.viewport import viewport_by_name, viewport_properties
|
|
101
|
+
from ladybug_rhino.config import tolerance, angle_tolerance, units_system
|
|
102
|
+
except ImportError as e:
|
|
103
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
104
|
+
|
|
105
|
+
# check the Radiance date of the installed radiance
|
|
106
|
+
try: # import lbt_recipes dependencies
|
|
107
|
+
from lbt_recipes.version import check_radiance_date
|
|
108
|
+
except ImportError as e:
|
|
109
|
+
raise ImportError('\nFailed to import lbt_recipes:\n\t{}'.format(e))
|
|
110
|
+
check_radiance_date()
|
|
111
|
+
|
|
112
|
+
# dictionary of supported metrics
|
|
113
|
+
metric_dict = {
|
|
114
|
+
'0': 'illuminance',
|
|
115
|
+
'1': 'irradiance',
|
|
116
|
+
'2': 'luminance',
|
|
117
|
+
'3': 'radiance',
|
|
118
|
+
'illuminance': 'illuminance',
|
|
119
|
+
'irradiance': 'irradiance',
|
|
120
|
+
'luminance': 'luminance',
|
|
121
|
+
'radiance': 'radiance'
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
if all_required_inputs(ghenv.Component) and _run:
|
|
126
|
+
# set defaults for resolution, metric and view
|
|
127
|
+
_resolution_ = 800 if _resolution_ is None else _resolution_
|
|
128
|
+
try:
|
|
129
|
+
_metric_ = metric_dict[_metric_.lower()] if _metric_ is not None else 'luminance'
|
|
130
|
+
except KeyError:
|
|
131
|
+
raise ValueError('Metric "{}" is not supported.'.format(_metric_))
|
|
132
|
+
if _view_ is None:
|
|
133
|
+
viewp = viewport_by_name(None)
|
|
134
|
+
v_props = viewport_properties(viewp, 0)
|
|
135
|
+
VIEW_TYPES = ('v', 'h', 'l', 'c', 'a')
|
|
136
|
+
_view_ = View(
|
|
137
|
+
'current_viewport', v_props['position'], v_props['direction'],
|
|
138
|
+
v_props['up_vector'], VIEW_TYPES[v_props['view_type']],
|
|
139
|
+
v_props['h_angle'], v_props['v_angle'])
|
|
140
|
+
else:
|
|
141
|
+
assert isinstance(_view_, View), 'Expected Radiance View. Got {}.'.format(type(_view_))
|
|
142
|
+
|
|
143
|
+
# process the sky input
|
|
144
|
+
if _sky_ is None:
|
|
145
|
+
_sky_ = CertainIrradiance.from_illuminance(10000)
|
|
146
|
+
elif isinstance(_sky_, str): # convert the sky string into a sky object
|
|
147
|
+
_sky_ = string_to_sky(_sky_)
|
|
148
|
+
to_rad_int = 1 if _metric_ in ('irradiance', 'radiance') else 0
|
|
149
|
+
sky_content = _sky_.to_radiance(to_rad_int) if isinstance(_sky_, ClimateBased) \
|
|
150
|
+
else _sky_.to_radiance()
|
|
151
|
+
|
|
152
|
+
# process the _hb_objs into a Model and then a Radiance string
|
|
153
|
+
models = [obj for obj in _hb_objs if isinstance(obj, Model)]
|
|
154
|
+
other_objs = [obj for obj in _hb_objs if not isinstance(obj, Model)]
|
|
155
|
+
model = Model.from_objects('scene', other_objs, units_system(), tolerance, angle_tolerance)
|
|
156
|
+
for m in models:
|
|
157
|
+
model.add_model(m)
|
|
158
|
+
model_content, modifier_content = model.to.rad(model, minimal=True)
|
|
159
|
+
|
|
160
|
+
# set up the paths for the various files used in translation
|
|
161
|
+
scene_dir = os.path.join(folders.default_simulation_folder, 'scene_visualiztion')
|
|
162
|
+
sky_file, scene_file, mat_file = \
|
|
163
|
+
'weather.sky', 'scene.rad', 'scene.mat'
|
|
164
|
+
view_file = 'view_{}.vf'.format(_metric_)
|
|
165
|
+
write_to_file_by_name(scene_dir, sky_file, sky_content, mkdir=True)
|
|
166
|
+
write_to_file_by_name(scene_dir, scene_file, model_content)
|
|
167
|
+
write_to_file_by_name(scene_dir, mat_file, modifier_content)
|
|
168
|
+
_view_.to_file(scene_dir, view_file)
|
|
169
|
+
scene_oct, final_hdr = 'scene_visual.oct', 'scene.HDR'
|
|
170
|
+
hdr = os.path.join(scene_dir, final_hdr)
|
|
171
|
+
if os.path.isfile(hdr):
|
|
172
|
+
os.remove(hdr)
|
|
173
|
+
|
|
174
|
+
# build up the commands to render the image of the sky
|
|
175
|
+
oconv = Oconv(inputs=[sky_file, mat_file, scene_file], output=scene_oct)
|
|
176
|
+
oconv.options.f = True
|
|
177
|
+
|
|
178
|
+
rpict = Rpict(octree=scene_oct, output=final_hdr, view=view_file)
|
|
179
|
+
rpict.options.ab = 2
|
|
180
|
+
rpict.options.aa = 0.25
|
|
181
|
+
rpict.options.ad = 512
|
|
182
|
+
rpict.options.ar = 16
|
|
183
|
+
if radiance_par_:
|
|
184
|
+
rpict.options.update_from_string(radiance_par_.strip())
|
|
185
|
+
if _metric_ in ('illuminance', 'irradiance'):
|
|
186
|
+
rpict.options.i = True
|
|
187
|
+
else:
|
|
188
|
+
rpict.options.i = False
|
|
189
|
+
rpict.options.x = _resolution_
|
|
190
|
+
rpict.options.y = _resolution_
|
|
191
|
+
|
|
192
|
+
commands = [oconv, rpict]
|
|
193
|
+
if adj_expos_ or adj_expos_ is None:
|
|
194
|
+
adj_image = final_hdr.lower().replace('.hdr', '_h.HDR')
|
|
195
|
+
pcond = Pcond(input=final_hdr, output=adj_image)
|
|
196
|
+
pcond.options.h = True
|
|
197
|
+
commands.append(pcond)
|
|
198
|
+
hdr = os.path.join(scene_dir, adj_image)
|
|
199
|
+
if os.path.isfile(hdr):
|
|
200
|
+
os.remove(hdr)
|
|
201
|
+
|
|
202
|
+
# run the commands in series and load the global horizontal irradiance
|
|
203
|
+
env = None
|
|
204
|
+
if rad_folders.env != {}:
|
|
205
|
+
env = rad_folders.env
|
|
206
|
+
env = dict(os.environ, **env) if env else None
|
|
207
|
+
for r_cmd in commands:
|
|
208
|
+
r_cmd.run(env, cwd=scene_dir)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create a point-in-time climate-based sky from a Wea.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
north_: A number between 0 and 360 that represents the degrees off from
|
|
16
|
+
the y-axis to make North. This can also be a vector to set the North.
|
|
17
|
+
Default is 0. The default North direction is the Y-axis (0 degrees).
|
|
18
|
+
_wea: A Ladybug Wea object.
|
|
19
|
+
_month_: An integer between 1 and 12 for the month of the year (default: 6).
|
|
20
|
+
_day_: An integer between 1 and 31 for the day of the month (default: 21).
|
|
21
|
+
_hour_: A number between 0 and 23.999.. for the hour of the day (default: 12).
|
|
22
|
+
colored_: Boolean to note whether the sky will be rendered in full
|
|
23
|
+
color (True) or it will simple be a grey sky with the same average
|
|
24
|
+
value as the colored sky (False). (Default: False).
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
sky: A Honeybee sky that can be used to create a point-in-time recipe.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
ghenv.Component.Name = 'HB Climatebased Sky'
|
|
31
|
+
ghenv.Component.NickName = 'ClimateBased'
|
|
32
|
+
ghenv.Component.Message = '1.9.0'
|
|
33
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
34
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
35
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
from ladybug_geometry.geometry2d.pointvector import Vector2D
|
|
39
|
+
except ImportError as e:
|
|
40
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
from honeybee_radiance.lightsource.sky import ClimateBased
|
|
44
|
+
except ImportError as e:
|
|
45
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
46
|
+
|
|
47
|
+
try: # import ladybug_rhino dependencies
|
|
48
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
49
|
+
from ladybug_rhino.togeometry import to_vector2d
|
|
50
|
+
except ImportError as e:
|
|
51
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
52
|
+
|
|
53
|
+
import math
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if all_required_inputs(ghenv.Component):
|
|
57
|
+
# process the north input
|
|
58
|
+
north_ = north_ or 0
|
|
59
|
+
try: # it's a vector
|
|
60
|
+
north_ = math.degrees(to_vector2d(north_).angle_clockwise(Vector2D(0, 1)))
|
|
61
|
+
except AttributeError: # north angle instead of vector
|
|
62
|
+
north_ = float(north_)
|
|
63
|
+
|
|
64
|
+
# set default values
|
|
65
|
+
_month_ = _month_ or 6
|
|
66
|
+
_day_ = _day_ or 21
|
|
67
|
+
_hour_ = 12 if _hour_ is None else _hour_
|
|
68
|
+
|
|
69
|
+
# ensure the sun position is aligned with the Wea timestep
|
|
70
|
+
if _wea.timestep == 1 and int(_hour_) == _hour_:
|
|
71
|
+
_hour_ += 0.5
|
|
72
|
+
|
|
73
|
+
# create the sky object
|
|
74
|
+
sky = ClimateBased.from_wea(
|
|
75
|
+
_wea, _month_, _day_, _hour_, north_, is_colored=colored_)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Run a cumulative radiation study for a Honeybee model.
|
|
12
|
+
_
|
|
13
|
+
This recipe calculates cumulative radiation (kWh/m2) and average irradiance (W/m2)
|
|
14
|
+
over the time period of a specified Wea.
|
|
15
|
+
_
|
|
16
|
+
The fundamental calculation of this recipe is the same as that of the "LB Incident
|
|
17
|
+
Radiation" component except that this recipe uses Radiance and can therefore
|
|
18
|
+
account for ambient reflections. Like LB Incident Radiation, the direct sun in this
|
|
19
|
+
recipe is diffused between several sky patches and so the precise line between shadow
|
|
20
|
+
and sun for each hour is blurred. This approximation is acceptable for studies
|
|
21
|
+
where one is only concerned about the average/total conditions over time and the
|
|
22
|
+
timestep-by-timestep irradiance values do not need to be exact. For accurate
|
|
23
|
+
modeling of direct irradiance on a timestep-by-timestep basis, see the "HB Annual
|
|
24
|
+
Irradiance" recipe.
|
|
25
|
+
|
|
26
|
+
-
|
|
27
|
+
Args:
|
|
28
|
+
_model: A Honeybee Model for which Cumulative Radiation will be simulated.
|
|
29
|
+
Note that this model should have grids assigned to it.
|
|
30
|
+
_wea: A Wea object produced from the Wea components that are under the Light
|
|
31
|
+
Sources tab. This can also be the path to a .wea or a .epw file.
|
|
32
|
+
_timestep_: An integer for the timestep of the inpput _wea. (Default: 1)
|
|
33
|
+
_sky_density_: An integer for the number of times that that the original Tregenza
|
|
34
|
+
sky patches are subdivided. 1 indicates that 145 patches are used
|
|
35
|
+
to describe the sky hemisphere, 2 indicates that 577 patches describe
|
|
36
|
+
the hemisphere, and each successive value will roughly quadruple the
|
|
37
|
+
number of patches used. Setting this to a high value will result in
|
|
38
|
+
a more accurate analysis but will take longer to run. (Default: 1).
|
|
39
|
+
north_: A number between -360 and 360 for the counterclockwise difference
|
|
40
|
+
between the North and the positive Y-axis in degrees. This can
|
|
41
|
+
also be Vector for the direction to North. (Default: 0).
|
|
42
|
+
grid_filter_: Text for a grid identifer or a pattern to filter the sensor grids of
|
|
43
|
+
the model that are simulated. For instance, first_floor_* will simulate
|
|
44
|
+
only the sensor grids that have an identifier that starts with
|
|
45
|
+
first_floor_. By default, all grids in the model will be simulated.
|
|
46
|
+
radiance_par_: Text for the radiance parameters to be used for ray
|
|
47
|
+
tracing. (Default: -ab 2 -ad 5000 -lw 2e-05).
|
|
48
|
+
run_settings_: Settings from the "HB Recipe Settings" component that specify
|
|
49
|
+
how the recipe should be run. This can also be a text string of
|
|
50
|
+
recipe settings.
|
|
51
|
+
_run: Set to True to run the recipe and get results. This input can also be
|
|
52
|
+
the integer "2" to run the recipe silently.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
report: Reports, errors, warnings, etc.
|
|
56
|
+
avg_irr: The average irradiance in W/m2 for each sensor over the Wea time period.
|
|
57
|
+
radiation: The cumulative radiation in kWh/m2 over the Wea time period.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
ghenv.Component.Name = 'HB Cumulative Radiation'
|
|
61
|
+
ghenv.Component.NickName = 'CumulativeRadiation'
|
|
62
|
+
ghenv.Component.Message = '1.9.0'
|
|
63
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
64
|
+
ghenv.Component.SubCategory = '3 :: Recipes'
|
|
65
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '3'
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
from lbt_recipes.recipe import Recipe
|
|
69
|
+
except ImportError as e:
|
|
70
|
+
raise ImportError('\nFailed to import lbt_recipes:\n\t{}'.format(e))
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
from ladybug_rhino.grasshopper import all_required_inputs, recipe_result
|
|
74
|
+
except ImportError as e:
|
|
75
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if all_required_inputs(ghenv.Component) and _run:
|
|
79
|
+
# create the recipe and set the input arguments
|
|
80
|
+
recipe = Recipe('cumulative-radiation')
|
|
81
|
+
recipe.input_value_by_name('model', _model)
|
|
82
|
+
recipe.input_value_by_name('wea', _wea)
|
|
83
|
+
recipe.input_value_by_name('timestep', _timestep_)
|
|
84
|
+
recipe.input_value_by_name('sky-density', _sky_density_)
|
|
85
|
+
recipe.input_value_by_name('north', north_)
|
|
86
|
+
recipe.input_value_by_name('grid-filter', grid_filter_)
|
|
87
|
+
recipe.input_value_by_name('radiance-parameters', radiance_par_)
|
|
88
|
+
|
|
89
|
+
# run the recipe
|
|
90
|
+
silent = True if _run > 1 else False
|
|
91
|
+
project_folder = recipe.run(run_settings_, radiance_check=True, silent=silent)
|
|
92
|
+
|
|
93
|
+
# load the results
|
|
94
|
+
try:
|
|
95
|
+
avg_irr = recipe_result(recipe.output_value_by_name('average-irradiance', project_folder))
|
|
96
|
+
radiation = recipe_result(recipe.output_value_by_name('cumulative-radiation', project_folder))
|
|
97
|
+
except Exception:
|
|
98
|
+
raise Exception(recipe.failure_message(project_folder))
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Honeybee: A Plugin for Environmental Analysis (GPL)
|
|
2
|
+
# This file is part of Honeybee.
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2025, Ladybug Tools.
|
|
5
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
6
|
+
# along with Honeybee; If not, see <http://www.gnu.org/licenses/>.
|
|
7
|
+
#
|
|
8
|
+
# @license AGPL-3.0-or-later <https://spdx.org/licenses/AGPL-3.0-or-later>
|
|
9
|
+
|
|
10
|
+
"""
|
|
11
|
+
Create a Custom sky from direct and diffuse irradiance.
|
|
12
|
+
-
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
north_: A number between 0 and 360 that represents the degrees off from
|
|
16
|
+
the y-axis to make North. This can also be a vector to set the North.
|
|
17
|
+
Default is 0. The default North direction is the Y-axis (0 degrees).
|
|
18
|
+
_location: A Ladybug location object.
|
|
19
|
+
_dir_rad: Direct normal irradiance (W/m2).
|
|
20
|
+
_diff_rad: Diffuse horizontal irradiance (W/m2).
|
|
21
|
+
_month_: An integer between 1 and 12 for the month of the year (default: 6).
|
|
22
|
+
_day_: An integer between 1 and 31 for the day of the month (default: 21).
|
|
23
|
+
_hour_: A number between 0 and 23.999 for the hour of the day (default: 12).
|
|
24
|
+
colored_: Boolean to note whether the sky will be rendered in full
|
|
25
|
+
color (True) or it will simple be a grey sky with the same average
|
|
26
|
+
value as the colored sky (False). (Default: False).
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
sky: Honeybee sky. You can use this sky to create a daylight recipe.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
ghenv.Component.Name = 'HB Custom Sky'
|
|
33
|
+
ghenv.Component.NickName = 'CustomSky'
|
|
34
|
+
ghenv.Component.Message = '1.9.0'
|
|
35
|
+
ghenv.Component.Category = 'HB-Radiance'
|
|
36
|
+
ghenv.Component.SubCategory = '2 :: Light Sources'
|
|
37
|
+
ghenv.Component.AdditionalHelpFromDocStrings = '1'
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
from ladybug_geometry.geometry2d.pointvector import Vector2D
|
|
41
|
+
except ImportError as e:
|
|
42
|
+
raise ImportError('\nFailed to import ladybug_geometry:\n\t{}'.format(e))
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
from honeybee_radiance.lightsource.sky import ClimateBased
|
|
46
|
+
except ImportError as e:
|
|
47
|
+
raise ImportError('\nFailed to import honeybee_radiance:\n\t{}'.format(e))
|
|
48
|
+
|
|
49
|
+
try: # import ladybug_rhino dependencies
|
|
50
|
+
from ladybug_rhino.grasshopper import all_required_inputs
|
|
51
|
+
from ladybug_rhino.togeometry import to_vector2d
|
|
52
|
+
except ImportError as e:
|
|
53
|
+
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))
|
|
54
|
+
|
|
55
|
+
import math
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if all_required_inputs(ghenv.Component):
|
|
59
|
+
# process the north input
|
|
60
|
+
north_ = north_ or 0
|
|
61
|
+
try: # it's a vector
|
|
62
|
+
north_ = math.degrees(to_vector2d(north_).angle_clockwise(Vector2D(0, 1)))
|
|
63
|
+
except AttributeError: # north angle instead of vector
|
|
64
|
+
north_ = float(north_)
|
|
65
|
+
|
|
66
|
+
# set default values if they are not set
|
|
67
|
+
_month_ = _month_ or 6
|
|
68
|
+
_day_ = _day_ or 21
|
|
69
|
+
_hour_ = 12 if _hour_ is None else _hour_
|
|
70
|
+
|
|
71
|
+
# create the sky object
|
|
72
|
+
sky = ClimateBased.from_location(
|
|
73
|
+
_location, _month_, _day_, _hour_, _dir_rad, _diff_rad, north_,
|
|
74
|
+
is_colored=colored_)
|