Skip to content
Open
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions docs/tutorials/tutorial_introduction_topview.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
Top View and Selecting of Layers
--------------------------------
Altitude-based Color Coding in Top View
----------------------------------------

A new feature allows users to visualize flight altitude directly in the Top View using color coding.

How to Enable
~~~~~~~~~~~~~

1. Open the Top View window.
2. Click on the Map Appearance settings.
3. Enable the option **"Color flight track by altitude"**.
4. Click Apply.

Behavior
~~~~~~~~

- When enabled, the flight track is rendered using a color gradient.
- Different colors represent different altitude levels.
- When disabled, the flight track is displayed in a single default color.

Use Case
~~~~~~~~

This feature helps users quickly identify altitude changes along the flight path,
making vertical profile interpretation easier directly from the Top View.

Selection and display of different data in the Top View with the help of the layer chooser.

Expand Down
17 changes: 11 additions & 6 deletions mslib/msui/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,22 @@
import platformdirs
from pathlib import Path

HOME = Path.home()
MSUI_CONFIG_PATH = Path(os.getenv("MSUI_CONFIG_PATH", HOME / ".config" / "msui"))
def _get_config_path():
home = Path.home()
return Path(os.getenv("MSUI_CONFIG_PATH", home / ".config" / "msui"))

MSUI_CONFIG_PATH = _get_config_path()
MSUI_CONFIG_SYSPATH = str(MSUI_CONFIG_PATH.resolve())
GRAVATAR_DIR_PATH = MSUI_CONFIG_PATH / "gravatars"

MSUI_CACHE_PATH = platformdirs.user_cache_path("msui", "mss")
def _get_settings_path():
return Path(os.getenv("MSUI_SETTINGS", MSUI_CONFIG_PATH / "msui_settings.json"))

GRAVATAR_DIR_PATH = MSUI_CONFIG_PATH / "gravatars"
def _get_autoplot_path():
return Path(os.getenv("MSS_AUTOPLOT", MSUI_CONFIG_PATH / "mssautoplot.json"))

MSUI_SETTINGS = Path(os.getenv('MSUI_SETTINGS', MSUI_CONFIG_PATH / "msui_settings.json"))
MSUI_SETTINGS = _get_settings_path()
MSS_AUTOPLOT = _get_autoplot_path()

MSS_AUTOPLOT = Path(os.getenv('MSS_AUTOPLOT', MSUI_CONFIG_PATH / "mssautoplot.json"))

AUTH_LOGIN_CACHE = {}
10 changes: 10 additions & 0 deletions mslib/msui/qt5/ui_multiple_flightpath_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@


class Ui_MultipleViewWidget(object):
def closeEvent(self, event):
self._disconnect_signals()
super().closeEvent(event)

def _disconnect_signals(self):
try:
self.mainui.some_signal.disconnect(self.update_function)
except (TypeError, RuntimeError):
pass

def setupUi(self, MultipleViewWidget):
MultipleViewWidget.setObjectName("MultipleViewWidget")
MultipleViewWidget.resize(798, 282)
Expand Down
4 changes: 2 additions & 2 deletions mslib/mswms/dataaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __init__(self, rootpath, domain_id, skip_dim_check=None, **kwargs):
self._mfDatasetArgsDict = {"skip_dim_check": skip_dim_check}
self._file_cache = {}

def _determine_filename(self, variable, vartype, init_time, valid_time, reload=True):
def _determine_filename(self, variable, vartype, init_time, valid_time, reload=True):
"""
Determines the name of the data file that contains
the variable <variable> with type <vartype> of the forecast specified
Expand Down Expand Up @@ -455,7 +455,7 @@ def _determine_filename(self, variable, vartype, init_time, valid_time, reload=T
except (KeyError, OSError) as ex:
if reload:
self.setup()
self._determine_filename(self, variable, vartype, init_time, valid_time, reload=False)
return self._determine_filename(variable, vartype, init_time, valid_time, reload=False)
else:
logging.error("Could not identify filename. %s %s %s %s %s %s",
variable, vartype, init_time, valid_time, type(ex), ex)
Expand Down
2 changes: 2 additions & 0 deletions mslib/utils/netCDF4tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ class MFDatasetCommonDims(netCDF4.MFDataset):

def __init__(self, files, exclude=None, skip_dim_check=None,
require_dim_num=False):
super().__init__(files, *args, **kwargs)

"""
Open a Dataset spanning multiple files sharing common dimensions but
containing different record variables, making it look as if it was a
Expand Down
18 changes: 16 additions & 2 deletions tutorials/tutorial_kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,22 @@ def _change_color_and_linewidth():
create_tutorial_images()
_change_linewidth('topviewwindow-2-00.png', lambda: (pag.hotkey(CTRL, 'a'),
[pag.press('down') for _ in range(8)],
type_and_key('2.50'), pag.sleep(1),
type_and_key('5.50')))
def linewidth_actions():
pag.hotkey(CTRL, 'a')
pag.sleep(0.3)

for _ in range(8):
pag.press('down')
pag.sleep(0.1)

type_and_key('2.50')
pag.press(ENTER)
pag.sleep(0.5)

type_and_key('5.50')
pag.press(ENTER)
pag.sleep(0.5)



def _change_color(img_name, actions):
Expand Down