honeybee-radiance-postprocess 0.4.555__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_radiance_postprocess/__init__.py +1 -0
- honeybee_radiance_postprocess/__main__.py +4 -0
- honeybee_radiance_postprocess/annual.py +73 -0
- honeybee_radiance_postprocess/annualdaylight.py +289 -0
- honeybee_radiance_postprocess/annualirradiance.py +35 -0
- honeybee_radiance_postprocess/breeam/__init__.py +1 -0
- honeybee_radiance_postprocess/breeam/breeam.py +552 -0
- honeybee_radiance_postprocess/cli/__init__.py +33 -0
- honeybee_radiance_postprocess/cli/abnt.py +392 -0
- honeybee_radiance_postprocess/cli/breeam.py +96 -0
- honeybee_radiance_postprocess/cli/datacollection.py +133 -0
- honeybee_radiance_postprocess/cli/grid.py +295 -0
- honeybee_radiance_postprocess/cli/leed.py +143 -0
- honeybee_radiance_postprocess/cli/merge.py +161 -0
- honeybee_radiance_postprocess/cli/mtxop.py +161 -0
- honeybee_radiance_postprocess/cli/postprocess.py +1092 -0
- honeybee_radiance_postprocess/cli/schedule.py +103 -0
- honeybee_radiance_postprocess/cli/translate.py +216 -0
- honeybee_radiance_postprocess/cli/two_phase.py +252 -0
- honeybee_radiance_postprocess/cli/util.py +121 -0
- honeybee_radiance_postprocess/cli/viewfactor.py +157 -0
- honeybee_radiance_postprocess/cli/well.py +110 -0
- honeybee_radiance_postprocess/data_type.py +102 -0
- honeybee_radiance_postprocess/dynamic.py +273 -0
- honeybee_radiance_postprocess/electriclight.py +24 -0
- honeybee_radiance_postprocess/en17037.py +304 -0
- honeybee_radiance_postprocess/helper.py +266 -0
- honeybee_radiance_postprocess/ies/__init__.py +1 -0
- honeybee_radiance_postprocess/ies/lm.py +224 -0
- honeybee_radiance_postprocess/ies/lm_schedule.py +248 -0
- honeybee_radiance_postprocess/leed/__init__.py +1 -0
- honeybee_radiance_postprocess/leed/leed.py +801 -0
- honeybee_radiance_postprocess/leed/leed_schedule.py +256 -0
- honeybee_radiance_postprocess/metrics.py +439 -0
- honeybee_radiance_postprocess/reader.py +80 -0
- honeybee_radiance_postprocess/results/__init__.py +4 -0
- honeybee_radiance_postprocess/results/annual_daylight.py +752 -0
- honeybee_radiance_postprocess/results/annual_irradiance.py +196 -0
- honeybee_radiance_postprocess/results/results.py +1416 -0
- honeybee_radiance_postprocess/type_hints.py +38 -0
- honeybee_radiance_postprocess/util.py +211 -0
- honeybee_radiance_postprocess/vis_metadata.py +49 -0
- honeybee_radiance_postprocess/well/__init__.py +1 -0
- honeybee_radiance_postprocess/well/well.py +509 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/METADATA +79 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/RECORD +50 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/WHEEL +5 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/entry_points.txt +2 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/licenses/LICENSE +661 -0
- honeybee_radiance_postprocess-0.4.555.dist-info/top_level.txt +1 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
"""Post-processing reader functions."""
|
2
|
+
try:
|
3
|
+
import cupy as np
|
4
|
+
is_gpu = True
|
5
|
+
except ImportError:
|
6
|
+
is_gpu = False
|
7
|
+
import numpy as np
|
8
|
+
|
9
|
+
from .util import binary_mtx_dimension
|
10
|
+
|
11
|
+
|
12
|
+
def binary_to_array(
|
13
|
+
binary_file: str, nrows: int = None, ncols: int = None,
|
14
|
+
ncomp: int = None, fmt=None, line_count: int = 0) -> np.ndarray:
|
15
|
+
"""Read a Radiance binary file as a NumPy array.
|
16
|
+
|
17
|
+
Args:
|
18
|
+
binary_file: Path to binary Radiance file.
|
19
|
+
nrows: Number of rows in the Radiance file.
|
20
|
+
ncols: Number of columns in the Radiance file.
|
21
|
+
ncomp: Number of components of each element in the Radiance file.
|
22
|
+
fmt: Format of the Radiance file. Can be either "ascii", "float", or "double.
|
23
|
+
line_count: Number of lines to skip in the input file. Usually used to
|
24
|
+
skip the header.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
A NumPy array.
|
28
|
+
"""
|
29
|
+
if (nrows or ncols or ncomp or fmt) is None:
|
30
|
+
# get nrows, ncols and header line count
|
31
|
+
nrows, ncols, ncomp, line_count, fmt = binary_mtx_dimension(binary_file)
|
32
|
+
with open(binary_file, 'rb') as reader:
|
33
|
+
# skip first n lines from reader
|
34
|
+
for i in range(line_count):
|
35
|
+
reader.readline()
|
36
|
+
|
37
|
+
if fmt == 'ascii':
|
38
|
+
array = np.loadtxt(reader, dtype=np.float32)
|
39
|
+
elif fmt == 'float':
|
40
|
+
array = np.fromfile(reader, dtype=np.float32)
|
41
|
+
elif fmt == 'double':
|
42
|
+
array = np.fromfile(reader, dtype=np.float64)
|
43
|
+
|
44
|
+
if ncomp != 1:
|
45
|
+
array = array.reshape(nrows, ncols, ncomp)
|
46
|
+
else:
|
47
|
+
array = array.reshape(nrows, ncols)
|
48
|
+
|
49
|
+
return array
|
50
|
+
|
51
|
+
|
52
|
+
def ascii_to_array(
|
53
|
+
ascii_file: str, nrows: int = None, ncols: int = None,
|
54
|
+
ncomp: int = None, line_count: int = 0) -> np.ndarray:
|
55
|
+
"""Read a Radiance ascii file as a NumPy array.
|
56
|
+
|
57
|
+
Args:
|
58
|
+
ascii_file: Path to ascii Radiance file.
|
59
|
+
nrows: Number of rows in the Radiance file.
|
60
|
+
ncols: Number of columns in the Radiance file.
|
61
|
+
ncomp: Number of components of each element in the Radiance file.
|
62
|
+
line_count: Number of lines to skip in the input file. Usually used to
|
63
|
+
skip the header.
|
64
|
+
|
65
|
+
Returns:
|
66
|
+
A NumPy array.
|
67
|
+
"""
|
68
|
+
with open(ascii_file, 'r') as reader:
|
69
|
+
if (nrows or ncols or ncomp) is None:
|
70
|
+
# get nrows, ncols and header line count
|
71
|
+
# we can reuse binary_mtx_dimension though the input file is ascii
|
72
|
+
nrows, ncols, ncomp, line_count, fmt = binary_mtx_dimension(ascii_file)
|
73
|
+
|
74
|
+
array = np.loadtxt(reader, dtype=np.float32, skiprows=line_count)
|
75
|
+
if ncomp != 1:
|
76
|
+
array = array.reshape(nrows, ncols, ncomp)
|
77
|
+
else:
|
78
|
+
array = array.reshape(nrows, ncols)
|
79
|
+
|
80
|
+
return array
|