Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This shows an example workflow with vapor. We begin by creating a session and opening a dataset. You can have multiple sessions open at the same time.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import example_utils
      2 from vapor import session, renderer, dataset, camera

File ~/work/vapor-python-cookbook/vapor-python-cookbook/notebooks/example_utils.py:20
     16     sys.path.append('..')
     19 from inspect import signature
---> 20 import numpy as np
     21 from math import sin
     23 def SampleFunctionOnRegularGrid(f, ext=None, shape=None):

ModuleNotFoundError: No module named 'numpy'

Dump the dataset metadata

Render the first 2D variable as a pseudocolor

Render U10 and V10 as barbs over a map

Simulate and render a flow advection

Volume render a 3D variable

Scale the dataset Z axis

Vapor will automatically scale the Z axis of a dataset to produce reasonable results. This can be manually adjusted as shown below.

Add axis annotations to the rendering

Export the session for use in the Vapor GUI application

Sessions created in Python can be saved as a .vs3 file. These files can then be opened in the Vapor GUI application and explored interactively. Conversely, sessions created in the Vapor GUI can be loaded into Python with Session.Load(path)

Since this example uses a dynamically generated dataset, the session cannot be saved as it would point to a dataset that does not exist on disk. If you were using a physical dataset, this would work.