-
Notifications
You must be signed in to change notification settings - Fork 0
/
directions.py
49 lines (39 loc) · 1.81 KB
/
directions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import numpy as np
CWD = os.getcwd()
class Direction:
def __init__(self, rays, geometry):
self.rays = rays
self.geometry = geometry
self.geometry_name = geometry.split(".")[0]
self.receiver = os.path.join(CWD, "geometries", "receiver.yaml")
self.geometry_path = os.path.join(CWD, "geometries", self.geometry)
self.plots_dir = os.path.join(CWD, 'export', self.geometry_name,
"plots", self.__class__.__name__)
self.shape_dir = os.path.join(CWD, 'export', self.geometry_name,
"shapes")
self.csv_path = os.path.join(CWD, 'export', self.geometry_name, 'raw',
self.__class__.__name__ + ".csv")
class Transversal(Direction):
def __init__(self, min_angle, max_angle, step, rays, geometry):
super().__init__(rays, geometry)
self.min_angle = min_angle
self.max_angle = max_angle
self.step = step
self.angles = np.arange(min_angle, max_angle + 1, step).tolist()
self.angle_pairs = [f"{a:.1f},0" for a in self.angles]
self.sun_col = 3 # sun direction column in txt output file
class Longitudinal(Direction):
def __init__(self, min_angle, max_angle, step, rays, geometry):
super().__init__(rays, geometry)
self.min_angle = min_angle
self.max_angle = max_angle
self.step = step
self.angles = np.arange(min_angle, max_angle + 1, step).tolist()
self.angle_pairs = [f"90,{a:.1f}" for a in self.angles]
self.sun_col = 4 # sun direction column in txt output file
class Annual(Direction):
def __init__(self, rays, angle_pairs, geometry):
super().__init__(rays, geometry)
self.angle_pairs = angle_pairs
self.geometry = geometry