Skip to content

Commit f6e9816

Browse files
committed
scene added stacking
1 parent ceb6891 commit f6e9816

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/scene.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,26 @@ def los_rotation_factors(self):
540540
* num.sin(self.phi)
541541
return self._los_factors
542542

543+
def __add__(self, other):
544+
if not self.frame == other.frame:
545+
raise AttributeError('Scene frames do not align!')
546+
self.displacement += other.displacement
547+
548+
tmin = self.meta.time_master \
549+
if self.meta.time_master < other.meta.time_master \
550+
else other.meta.time_master
551+
552+
tmax = self.meta.time_slave \
553+
if self.meta.time_slave > other.meta.time_slave \
554+
else other.meta.time_slave
555+
556+
self.meta.time_master = tmin
557+
self.meta.time_slave = tmax
558+
return self
559+
560+
def __iadd__(self, other):
561+
return self.__add__(other)
562+
543563

544564
class Scene(BaseScene):
545565
'''Scene of unwrapped InSAR ground dispacements measurements

0 commit comments

Comments
 (0)