Add rotatable globe based on VTK

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
matlab, numpy, python

Research direction

Start at the existing PySide6 MainWindow and Background Worker, then evaluate the proposed PyVista QtInteractor/VTK integration and the CF-to-regular-lat/lon remapping path. Done means a real-time rotatable globe supports mouse interaction, viewpoint and timestep controls, and produces publishable matplotlib visualizations from the selected data.

Written by the indexing model from the issue text.

Description

It'd be nice to have a global visualiser tool that we could manipulate in real time, and generate the beautiful publishable matplotlibs once the right thing had been selected. We'd want to move the viewpoint and rotate under mouse control.

The relevant technology is VTK

  • VTK (Visualization Toolkit) has a native Qt widget (QVTKRenderWindowInteractor) that embeds directly into Qt6 layouts. It handles globe rendering, texture mapping CF data onto a sphere, mouse rotation, and real-time interaction natively.
  • CF/MATLAB-generated data gets mapped as a texture or scalar field onto a vtkSphereSource
  • Mouse drag = built-in trackball interactor (no extra code)
  • Sliders in Qt → call VTK camera/actor update methods

Which we can access via pyvista, with an architecture something like this:

PySide6 MainWindow
├── PyVista QtInteractor (pyvista.plotting.qt_interactor)
│   └── vtkRenderWindowInteractor (mouse rotate/zoom free)
├── QSlider / QDial → camera lon/lat/altitude
└── QSlider → timestep (if animated)

Background Worker (existing)
└── CF data → reproject to regular lat/lon grid (numpy 2D array)
    └── Signal → main thread → update globe texture/scalars

Would require remapping data onto lat/lon (if not already) for easist use.

This more thoroughly explored in this claude conversation

Dominant language
Python
Stars
6
Forks
1
Avg merge
1d 4h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NCAS-CMS/xconv2

All issues in NCAS-CMS/xconv2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.