My semester working on yt-idv through NCSA SPIN
@ Aidan Sochowski | Thursday, Jan 27, 2022 | 3 minute read | Update at Thursday, Jan 27, 2022

A brief overview of my contributions to yt-idv this past semester.

My semester working on yt-idv

This past semester I worked on adding a few new features to yt-idv through NCSA’s Student Pushing INnovation (SPIN) internship program. Since I just wrapped up my semester, here’s a quick summary of the largest changes I’ve been working on.

Isocontours

By far the largest feature I was working on this semester was adding isocontours to yt-idv (PR #40). Isocontours serve as a method to view any level set of your data by simply setting some value and tolerance.

We compute these isocontour layers in a fairly simple way. Currently, all of the fragment shaders in yt-idv utilize some form of ray-tracing to determine the colormap output on the screen. Our isocontour shader does the exact same thing, except it searches for the first vertex in any defined isocontour layer (within the range of some set tolerance), and renders that one on the screen. The user can define up to 32 isocontour layers (essentially an unlimited amount) by clicking “Add Layer” and can change the tolerance using the slider when the isocontour shader is selected.

Here are few examples of isocontours in yt-idv in action:

A simple single layer isocontour: this gif shows the process of adding a single isocontour layer at a density value of 10^-24, using one of yt’s sample datasets, IsolatedGalaxy.

Creating isocontours with multiple layers: this gif shows the process of adding and deleting multiple isocontour layers, demonstrated on the ActiveParticleTwoSphere sample dataset.

Spherical Rendering

The other main feature I worked on this semester was spherical rendering in yt-idv (PR #42). Many datasets are natively stored as (r, theta, phi) spherical coordinates rather than as (x, y, z) cartesian coordinates, so it would make sense for yt-idv to support these datasets, letting the user avoid the hassle of converting these datasets to utilize a cartesian coordinate system instead.

The rendering approach here is comprised of two steps. The geometry shader essentially converts the coordinates from spherical to cartesian, splitting up what was once a collection of rectangular subsections of (r, theta, phi) into a collection of wedge-shaped subsections of (x, y, z). These are subsequently passed down to our ray-tracing fragment shader, in which we do our standard ray-tracing regimen (with a few spherical to cartesian adjustments) to render fragments onto the screen.

This part isn’t entirely complete, as right now, the shader can only sample one constant value in each block:

Max intensity projection using spherical rendering, colormap using theta value

Max intensity projection using spherical rendering, colormap using phi value

Final Thoughts

Overall, I’m very glad I had the opportunity to work on some new features for yt-idv this past semester. It was a really good way to dive deep into OpenGL, and I’m really thankful for the help that Matt and Chris have gave me throughout this past semester. I’m looking forward to working more with OpenGL in the future!

yt extension modules

yt has many extension packages to help you in your scientific workflow! Check these out, or create your own.

ytini

ytini is set of tools and tutorials for using yt as a tool inside the 3D visual effects software Houdini or a data pre-processor externally to Houdini.

Trident

Trident is a full-featured tool that projects arbitrary sightlines through astrophysical hydrodynamics simulations for generating mock spectral observations of the IGM and CGM.

pyXSIM

pyXSIM is a Python package for simulating X-ray observations from astrophysical sources.

ytree

Analyze merger tree data from multiple sources. It’s yt for merger trees!

yt_idv

yt_idv is a package for interactive volume rendering with yt! It provides interactive visualization using OpenGL for datasets loaded in yt. It is written to provide both scripting and interactive access.

widgyts

widgyts is a jupyter widgets extension for yt, backed by rust/webassembly to allow for browser-based, interactive exploration of data from yt.

yt_astro_analysis

yt_astro_analysis is the yt extension package for astrophysical analysis.

Make your own!!

Finally, check out our development docs on writing your own yt extensions!

Contributing to the Blog

Are you interested in contributing to the yt blog?

Check out our post on contributing to the blog for a guide!

We welcome contributions from all members of the yt community. Feel free to reach out if you need any help.

the yt data hub

The yt hub at https://girder.hub.yt/ has a ton of resources to check out, whether you have yt installed or not.

The collections host all sorts of data that can be loaded with yt. Some have been used in publications, and others are used as sample frontend data for yt. Maybe there’s data from your simulation software?

The rafts host the yt quickstart notebooks, where you can interact with yt in the browser, without needing to install it locally. Check out some of the other rafts too, like the widgyts release notebooks – a demo of the widgyts yt extension pacakge; or the notebooks from the CCA workshop – a user’s workshop on using yt.

Social Links