Skip to main content

Python library to create interactive 3D visualisations of astrophysical spectral line data

Project description

ViSL3D

Ixaka Labadie García
07/08/2024

ViSL3D is a Python package that creates X3D and HTML files to visualize datacubes from astrophysics in 3D in an interactive way. We use X3D and x3dom to represent figures in 3D and to integrate them into an HTML. The models have been made taking the x3d-pathway (Vogt et al. 2016) as a starting point. The current code was made for radio data, although it can be used with other types of 3D data.

Installation

pip install visl3d

How to use

Examples of how to use the package are provided in the Jupyter notebook jupyter_example.ipynb.

The produced HTML file can be visualised in any standard browser.

Prerequisites to visualise external X3D file (createX3D/createHTML)

  1. Install a local HTTP Server. Visualisations produced by ViSL3D must be opened through a local server in order to be displayed. There are a few options:

    • Apache is a popular HTTP server that can be installed in most operating systems.
    • Python has a built-in HTTP server that can be used by running python -m http.server in the directory where the HTML and X3D files are located.
    • VS Code has a built-in HTTP server that can be used by installing the Live Preview extension.
  2. Copy the x3dom folder into the server root directory. This should be the directory where the HTML and X3D files are located. By default, in Apache, it is /var/www/html in Linux, C:\Apache24\htdocs in Windows and /usr/local/var/www (or similar) in Mac. The DocumentRoot can be found and modified in the httpd.config file.

  3. Move the created X3D and HTML files into the Apache DocumentRoot directory and open the visualisation in a browser (most common browsers are supported) by typing the URL localhost\example_file.html.

Features

  • Plot any number of contour surfaces.
  • Plot galaxies with labels.
  • Add a 2D image in any wavelength in background.
  • Change the scale of the velocity axis.
  • Shift 2D image along velocity axis and display the value.
  • Rotate, zoom and pan complete figure.
  • Hide/Show different components of the figure.
  • Change ax labels.
  • Change viewpoints.
  • Change the colormap
  • Add markers

References

Vogt, Owen, Verdes-Montenegro & Borthakur, Advanced Data Visualization in Astrophysics: the X3D Pathway, ApJ 818, 115 (2016) (arxiv; ADS)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

visl3d-0.4.tar.gz (397.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visl3d-0.4-py3-none-any.whl (394.3 kB view details)

Uploaded Python 3

File details

Details for the file visl3d-0.4.tar.gz.

File metadata

  • Download URL: visl3d-0.4.tar.gz
  • Upload date:
  • Size: 397.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for visl3d-0.4.tar.gz
Algorithm Hash digest
SHA256 d771250390e79991501d1d5684cc8a26d77e3a6aa10a76a2195eed1eb1799917
MD5 9b53ad61a20739bc874c050df5854ec8
BLAKE2b-256 fd1986485cdf361fdab5d91113ee5cccdfe5f9a9152db1d4ab49fa010af3bbce

See more details on using hashes here.

File details

Details for the file visl3d-0.4-py3-none-any.whl.

File metadata

  • Download URL: visl3d-0.4-py3-none-any.whl
  • Upload date:
  • Size: 394.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for visl3d-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d76c02e6fe9af000084f2885a126c11045c10250586f6125168f4ca4939160c6
MD5 3502ef90601353e5bf447daad0504228
BLAKE2b-256 0a6fe09a494115caeafd0ff513464d68c96a1d70fc0cbe186e3361c8f29fc017

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page