Observation

  1# coding: utf-8
  2from Element import Element
  3
  4
  5class ObservationOrthographic(Element):
  6    def __init__(self):
  7        super().__init__()
  8        self.obs_azimuth = 180
  9        self.obs_zenith = 0
 10        self.obs_R = 3000
 11        self.is_orthophoto_map = False
 12        self.orthophoto_relative_height = 0
 13
 14    def set_obs_azimuth(self, azi):
 15        self.obs_azimuth = azi
 16
 17    def set_obs_zenith(self, zenith):
 18        self.obs_zenith = zenith
 19
 20    def init_obs_from_json(self, json_object):
 21        self.obs_azimuth = json_object["observation"]["obs_azimuth"]
 22        self.obs_zenith = json_object["observation"]["obs_zenith"]
 23        self.obs_R = json_object["observation"]["obs_R"]
 24        if "is_orthophoto_map" in json_object["observation"]:
 25            self.is_orthophoto_map = json_object["observation"]["is_orthophoto_map"]
 26            if self.is_orthophoto_map:
 27                self.orthophoto_relative_height = json_object["observation"]["orthophoto_relative_height"]
 28        return self
 29
 30    def to_json_object(self):
 31        json_object = {"obs_azimuth": self.obs_azimuth,
 32                       "obs_R": self.obs_R,
 33                       "obs_zenith": self.obs_zenith,
 34                       "is_orthophoto_map": self.is_orthophoto_map,
 35                       "orthophoto_relative_height": self.orthophoto_relative_height}
 36        return json_object
 37
 38
 39class ObservationPerspective(Element):
 40    def __init__(self):
 41        super().__init__()
 42        self.obs_o_x = 50
 43        self.obs_o_y = 50
 44        self.obs_o_z = 20
 45        self.obs_t_x = 50
 46        self.obs_t_y = 50
 47        self.obs_t_z = 0
 48        self.relative_height = False
 49
 50    def set_origin_x(self, x):
 51        self.obs_o_x = x
 52
 53    def get_origin_x(self):
 54        return self.obs_o_x
 55
 56    def set_origin_y(self, y):
 57        self.obs_o_y = y
 58
 59    def get_origin_y(self):
 60        return self.obs_o_y
 61
 62    def set_origin_z(self, z):
 63        self.obs_o_z = z
 64
 65    def get_origin_z(self):
 66        return self.obs_o_z
 67
 68    def set_target_x(self, x):
 69        self.obs_t_x = x
 70
 71    def get_target_x(self):
 72        return self.obs_t_x
 73
 74    def set_target_y(self, y):
 75        self.obs_t_y = y
 76
 77    def get_target_y(self):
 78        return self.obs_t_y
 79
 80    def set_target_z(self, z):
 81        self.obs_t_z = z
 82
 83    def get_target_z(self):
 84        return self.obs_t_z
 85
 86    def set_origin(self, origin: tuple):
 87        self.obs_o_x = origin[0]
 88        self.obs_o_y = origin[1]
 89        self.obs_o_z = origin[2]
 90
 91    def set_target(self, target: tuple):
 92        self.obs_t_x = target[0]
 93        self.obs_t_y = target[1]
 94        self.obs_t_z = target[2]
 95
 96    def enable_relative_height(self, true_or_false):
 97        self.relative_height = true_or_false
 98
 99    def init_obs_from_json(self, json_object):
100        self.obs_o_x = json_object["observation"]["obs_o_x"]
101        self.obs_o_y = json_object["observation"]["obs_o_y"]
102        self.obs_o_z = json_object["observation"]["obs_o_z"]
103        self.obs_t_x = json_object["observation"]["obs_t_x"]
104        self.obs_t_y = json_object["observation"]["obs_t_y"]
105        self.obs_t_z = json_object["observation"]["obs_t_z"]
106        self.relative_height = json_object["observation"]["relative_height"]
107        return self
108
109    def to_json_object(self):
110        json_object = {"obs_t_z": self.obs_t_z,
111                       "obs_o_x": self.obs_o_x,
112                       "obs_o_y": self.obs_o_y,
113                       "obs_o_z": self.obs_o_z,
114                       "relative_height": self.relative_height,
115                       "obs_t_x": self.obs_t_x,
116                       "obs_t_y": self.obs_t_y}
117        return json_object
118
119
120class ObservationFisheye(ObservationPerspective):
121    def __init__(self):
122        super().__init__()
123
124
125class ObservationPhotonTracing(ObservationOrthographic):
126    def __init__(self):
127        super().__init__()
class ObservationOrthographic(Element.Element):
 6class ObservationOrthographic(Element):
 7    def __init__(self):
 8        super().__init__()
 9        self.obs_azimuth = 180
10        self.obs_zenith = 0
11        self.obs_R = 3000
12        self.is_orthophoto_map = False
13        self.orthophoto_relative_height = 0
14
15    def set_obs_azimuth(self, azi):
16        self.obs_azimuth = azi
17
18    def set_obs_zenith(self, zenith):
19        self.obs_zenith = zenith
20
21    def init_obs_from_json(self, json_object):
22        self.obs_azimuth = json_object["observation"]["obs_azimuth"]
23        self.obs_zenith = json_object["observation"]["obs_zenith"]
24        self.obs_R = json_object["observation"]["obs_R"]
25        if "is_orthophoto_map" in json_object["observation"]:
26            self.is_orthophoto_map = json_object["observation"]["is_orthophoto_map"]
27            if self.is_orthophoto_map:
28                self.orthophoto_relative_height = json_object["observation"]["orthophoto_relative_height"]
29        return self
30
31    def to_json_object(self):
32        json_object = {"obs_azimuth": self.obs_azimuth,
33                       "obs_R": self.obs_R,
34                       "obs_zenith": self.obs_zenith,
35                       "is_orthophoto_map": self.is_orthophoto_map,
36                       "orthophoto_relative_height": self.orthophoto_relative_height}
37        return json_object
obs_azimuth
obs_zenith
obs_R
is_orthophoto_map
orthophoto_relative_height
def set_obs_azimuth(self, azi):
15    def set_obs_azimuth(self, azi):
16        self.obs_azimuth = azi
def set_obs_zenith(self, zenith):
18    def set_obs_zenith(self, zenith):
19        self.obs_zenith = zenith
def init_obs_from_json(self, json_object):
21    def init_obs_from_json(self, json_object):
22        self.obs_azimuth = json_object["observation"]["obs_azimuth"]
23        self.obs_zenith = json_object["observation"]["obs_zenith"]
24        self.obs_R = json_object["observation"]["obs_R"]
25        if "is_orthophoto_map" in json_object["observation"]:
26            self.is_orthophoto_map = json_object["observation"]["is_orthophoto_map"]
27            if self.is_orthophoto_map:
28                self.orthophoto_relative_height = json_object["observation"]["orthophoto_relative_height"]
29        return self
def to_json_object(self):
31    def to_json_object(self):
32        json_object = {"obs_azimuth": self.obs_azimuth,
33                       "obs_R": self.obs_R,
34                       "obs_zenith": self.obs_zenith,
35                       "is_orthophoto_map": self.is_orthophoto_map,
36                       "orthophoto_relative_height": self.orthophoto_relative_height}
37        return json_object
Inherited Members
Element.Element
set_sim
get_sim
class ObservationPerspective(Element.Element):
 40class ObservationPerspective(Element):
 41    def __init__(self):
 42        super().__init__()
 43        self.obs_o_x = 50
 44        self.obs_o_y = 50
 45        self.obs_o_z = 20
 46        self.obs_t_x = 50
 47        self.obs_t_y = 50
 48        self.obs_t_z = 0
 49        self.relative_height = False
 50
 51    def set_origin_x(self, x):
 52        self.obs_o_x = x
 53
 54    def get_origin_x(self):
 55        return self.obs_o_x
 56
 57    def set_origin_y(self, y):
 58        self.obs_o_y = y
 59
 60    def get_origin_y(self):
 61        return self.obs_o_y
 62
 63    def set_origin_z(self, z):
 64        self.obs_o_z = z
 65
 66    def get_origin_z(self):
 67        return self.obs_o_z
 68
 69    def set_target_x(self, x):
 70        self.obs_t_x = x
 71
 72    def get_target_x(self):
 73        return self.obs_t_x
 74
 75    def set_target_y(self, y):
 76        self.obs_t_y = y
 77
 78    def get_target_y(self):
 79        return self.obs_t_y
 80
 81    def set_target_z(self, z):
 82        self.obs_t_z = z
 83
 84    def get_target_z(self):
 85        return self.obs_t_z
 86
 87    def set_origin(self, origin: tuple):
 88        self.obs_o_x = origin[0]
 89        self.obs_o_y = origin[1]
 90        self.obs_o_z = origin[2]
 91
 92    def set_target(self, target: tuple):
 93        self.obs_t_x = target[0]
 94        self.obs_t_y = target[1]
 95        self.obs_t_z = target[2]
 96
 97    def enable_relative_height(self, true_or_false):
 98        self.relative_height = true_or_false
 99
100    def init_obs_from_json(self, json_object):
101        self.obs_o_x = json_object["observation"]["obs_o_x"]
102        self.obs_o_y = json_object["observation"]["obs_o_y"]
103        self.obs_o_z = json_object["observation"]["obs_o_z"]
104        self.obs_t_x = json_object["observation"]["obs_t_x"]
105        self.obs_t_y = json_object["observation"]["obs_t_y"]
106        self.obs_t_z = json_object["observation"]["obs_t_z"]
107        self.relative_height = json_object["observation"]["relative_height"]
108        return self
109
110    def to_json_object(self):
111        json_object = {"obs_t_z": self.obs_t_z,
112                       "obs_o_x": self.obs_o_x,
113                       "obs_o_y": self.obs_o_y,
114                       "obs_o_z": self.obs_o_z,
115                       "relative_height": self.relative_height,
116                       "obs_t_x": self.obs_t_x,
117                       "obs_t_y": self.obs_t_y}
118        return json_object
obs_o_x
obs_o_y
obs_o_z
obs_t_x
obs_t_y
obs_t_z
relative_height
def set_origin_x(self, x):
51    def set_origin_x(self, x):
52        self.obs_o_x = x
def get_origin_x(self):
54    def get_origin_x(self):
55        return self.obs_o_x
def set_origin_y(self, y):
57    def set_origin_y(self, y):
58        self.obs_o_y = y
def get_origin_y(self):
60    def get_origin_y(self):
61        return self.obs_o_y
def set_origin_z(self, z):
63    def set_origin_z(self, z):
64        self.obs_o_z = z
def get_origin_z(self):
66    def get_origin_z(self):
67        return self.obs_o_z
def set_target_x(self, x):
69    def set_target_x(self, x):
70        self.obs_t_x = x
def get_target_x(self):
72    def get_target_x(self):
73        return self.obs_t_x
def set_target_y(self, y):
75    def set_target_y(self, y):
76        self.obs_t_y = y
def get_target_y(self):
78    def get_target_y(self):
79        return self.obs_t_y
def set_target_z(self, z):
81    def set_target_z(self, z):
82        self.obs_t_z = z
def get_target_z(self):
84    def get_target_z(self):
85        return self.obs_t_z
def set_origin(self, origin: tuple):
87    def set_origin(self, origin: tuple):
88        self.obs_o_x = origin[0]
89        self.obs_o_y = origin[1]
90        self.obs_o_z = origin[2]
def set_target(self, target: tuple):
92    def set_target(self, target: tuple):
93        self.obs_t_x = target[0]
94        self.obs_t_y = target[1]
95        self.obs_t_z = target[2]
def enable_relative_height(self, true_or_false):
97    def enable_relative_height(self, true_or_false):
98        self.relative_height = true_or_false
def init_obs_from_json(self, json_object):
100    def init_obs_from_json(self, json_object):
101        self.obs_o_x = json_object["observation"]["obs_o_x"]
102        self.obs_o_y = json_object["observation"]["obs_o_y"]
103        self.obs_o_z = json_object["observation"]["obs_o_z"]
104        self.obs_t_x = json_object["observation"]["obs_t_x"]
105        self.obs_t_y = json_object["observation"]["obs_t_y"]
106        self.obs_t_z = json_object["observation"]["obs_t_z"]
107        self.relative_height = json_object["observation"]["relative_height"]
108        return self
def to_json_object(self):
110    def to_json_object(self):
111        json_object = {"obs_t_z": self.obs_t_z,
112                       "obs_o_x": self.obs_o_x,
113                       "obs_o_y": self.obs_o_y,
114                       "obs_o_z": self.obs_o_z,
115                       "relative_height": self.relative_height,
116                       "obs_t_x": self.obs_t_x,
117                       "obs_t_y": self.obs_t_y}
118        return json_object
Inherited Members
Element.Element
set_sim
get_sim
class ObservationFisheye(ObservationPerspective):
121class ObservationFisheye(ObservationPerspective):
122    def __init__(self):
123        super().__init__()
class ObservationPhotonTracing(ObservationOrthographic):
126class ObservationPhotonTracing(ObservationOrthographic):
127    def __init__(self):
128        super().__init__()