Skip to content

Python scripting for scientific visualization software ParaView. Applied to atmospheric netCDF data.

License

Notifications You must be signed in to change notification settings

mjucker/pv_atmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pv_atmos

DOI pypi

Python scripting for scientific visualization software ParaView. Historically, pv_atmos has been developed to work with geophysical, and in particular, atmospheric model data (hence the name). However, pv_atmos has evolved into a very general package, and contains routines for visualizing netCDF data, and the capability to show arbitrary axes and labels in a large variety of geometries (linear and logarithmic axes, spherical geometry).

This package is described in an open access peer-reviewed article: Jucker, M 2014. Scientific Visualisation of Atmospheric Data with ParaView. Journal of Open Research Software 2(1):e4, DOI: https://dx.doi.org/10.5334/jors.al. Please cite this work if you use this software for your publications.

Components

Components are briefly described below. For more information on each function, please use help(.). A list of all function within the modules is provided here.

pv_atmos.basic

Provides functionality to read data on a 2D or 3D linear or logarithmic coordinates grid, including time evolution (if present) from a netCDF file. The netCDF should loosely correspond to the Climate and Forecast (FC) conventions. The important attribute is the time coordinate: ParaView will be looking for the "units: xxxx since xxxx" attribute to decide which dimension corresponds to time.

All functions are written in CamelCase, and variables in camelCase (sorry, it seems that both versions refer to the same animal).

Functions

Higher-order functions that you might want to use regularly are:

  • LoadData()
  • Cart2Spherical()
  • Make3D()
  • TransformCoords()
  • MakeSelectable()
  • DeleteAll()
  • HideAll()
  • ShowAll()
  • CartWind2Sphere()
  • Sphere2xyz()
  • xyz2Sphere()

Helper functions for the above to work are:

  • Cart2Log()
  • GridAspectRatio()
  • ConvertLogCoordString()
  • ExtractBounds()
LoadData()

Read a netCDF file, convert linear to logarithmic (e.g. pressure to log-pressure) coordinate if desired, and transform according to prefered aspect ratio.

Cart2Spherical()

Transform rectangular geometry into a sphere with given radius.

Make3D()

Take a dataset with (a) 2D variable(s), and expand the chosen variable as third dimension. Classic example: Ocean bathymetry on a lon-lat grid.

TransformCoords()

If not already done when loading the data, apply coordinate transformation in Cartesian coordinates, according to specified aspect ratio and logarithmic coordinates.

MakeSelectable()

In order to be able to switch any filter's visibility on/off in the GUI's pipeline, call this helper function.

DeleteAll(), HideAll(), ShowAll()

Delete, hide, or show all filters present in the pipeline.

CartWind2Sphere()

Converts zonal and meridional winds (or any velocity) from m/s into degrees longitude per time step and degrees latitude per time step. It can also convert pressure velocity from hPa/s into the new vertical coordinate measure per time step.

Sphere2xyz(), xyz2Sphere()

Convert a given point in spherical (Cartesian) coordinates into Cartesian (spherical) coordinates, given the transformations applied to the data. Helpful to position labels, camera, etc.

pv_atmos.grids

Provides the possibility to add axes, grid lines, planes (cuts), and labels. In case of spherical geometry, one can also add shells, which are spheres of a radius corresponding to a given vertical level. Planes and shells contain data information, and can therefore be used for data analysis as well as grid information.

These routines are not limited to any kind of data, and can be used with any data, or even without data, to add a custom grid to a visualization.

Functions

Higher-order functions that you might want to use regularly are:

  • AddGrid()
  • SphericalShells()
  • AddGridPlane()
  • AddGridLabel()
  • AddAxisLabel()
  • SphericalLables()
  • WaterMark()

Helper functions for the above to work are:

  • Lin2Log()
  • BoundAspectRatio()
AddGrid()
<