Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select newest init-time and carry over multilayering #1047

Merged
merged 3 commits into from
Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions mslib/msui/multilayers.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,24 @@ def reload_sync(self):
self.synced_reference.vtimes = vtimes
self.synced_reference.allowed_crs = crs

if self.current_layer:
if not self.synced_reference.level:
self.synced_reference.level = self.current_layer.level
if not self.synced_reference.itime:
self.synced_reference.itime = self.current_layer.itime
if not self.synced_reference.vtime:
self.synced_reference.vtime = self.current_layer.vtime

if self.synced_reference.level not in self.synced_reference.levels:
self.synced_reference.level = self.synced_reference.levels[0] if self.synced_reference.levels else None
self.synced_reference.level = levels[0] if levels else None

if self.synced_reference.itime not in self.synced_reference.itimes:
self.synced_reference.itime = self.synced_reference.itimes[0] if self.synced_reference.itimes else None
self.synced_reference.itime = itimes[-1] if itimes else None

if self.synced_reference.vtime not in self.synced_reference.vtimes:
self.synced_reference.vtime = self.synced_reference.vtimes[0] if self.synced_reference.vtimes else None
if self.synced_reference.vtime not in self.synced_reference.vtimes or \
self.synced_reference.vtime < self.synced_reference.itime:
self.synced_reference.vtime = next((vtime for vtime in vtimes if
vtime >= self.synced_reference.itime), None) if vtimes else None

def filter_multilayers(self, filter_string=None):
"""
Expand Down