Monday, May 22, 2017

pv_atmos

"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: http://dx.doi.org/10.5334/jors.al. Please cite this work if you use this software for your publications.

The modules and functions within them include

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.

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.

AddGrid()
Add a full grid, including grid lines at custom levels of all dimensions. This includes the appropriate lables of the grid lines, and labeling the axes.
SphericalShells()
Similar to AddGrid() in Cartesian coordinates, this adds shells around a sphere to serve as grid. These shells are labeled with the appropriate level value, and a water mark can be added to the outermost shell.
AddGridPlane()
Add one grid plane along one dimension.
AddGridLabel()
Add one label along one dimension.
AddAxisLabel()
Label one given axis
SphericalLabels()
Label any number of vertical levels in spherical geometry.
WaterMark()
Add a water mark to one of the spherical shells. Nice to brand your viz.
LonLat2Polar()
Project 2D longitude-latitude or 3D longitude-latitude-vertical data onto polar coordinates around the North or South pole. This has a little 3D twist, in that the projection can be domed in the vertical.

https://github.com/mjucker/pv_atmos

No comments:

Post a Comment