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.2.tar.gz (44.0 MB view details)

Uploaded Source

Built Distribution

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

visl3d-0.2-py3-none-any.whl (392.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: visl3d-0.2.tar.gz
  • Upload date:
  • Size: 44.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for visl3d-0.2.tar.gz
Algorithm Hash digest
SHA256 7a9da3cde7f25b01be33ae16cc1f29fece73755a2088f8be4cbf08c24ebb24bd
MD5 99807a9b33163f9dd18b6d07e29f9fdc
BLAKE2b-256 65a7bfb574538a2daa589efe61a74d8ff88244f260353c23a97ed2605511a2fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: visl3d-0.2-py3-none-any.whl
  • Upload date:
  • Size: 392.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for visl3d-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf014e1c8ee22f1169dc3652ef81c6d7602ac6d4678c604e3fd71eebcc73951f
MD5 481b71734d3b1ea72cbcdb99f2fd7063
BLAKE2b-256 18be1acdccd253fb27dfe367708f9c091b00245c91f151890104c9ca99989cab

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