HDF & netCDF I/O for PVGeo

Documentation Status Documentation Built by gendocs Build Status GitHub

An offshoot of PVGeo for HDF5 and netCDF data formats.

Why isn’t this included in PVGeo?

These features are experimental and we are concerned about how netCDF/HDF files do not have any inherit structure that might define spatially referenced data. We are also concerned that some of the dependancies for HDF5 I/O libraries might make PVGeo’s installation process a bit cumbersome for the average user.

If we find that this framework is simple, and doesn’t add to much weight to PVGeo, then we will merge this project into a new suite within PVGeo.

This project is a work in progress!

Installation

git clone https://github.com/OpenGeoVis/PVGeo-HDF5.git
cd PVGeo-HDF5

pip install -e .

Examples

Take a look at the notebook examples under the examples directory

Current Statistics

base reader
2 2

About PVGeo-HDF5

  • Author: Bane Sullivan
  • License: BSD-3-Clause
  • Copyright: 2018, Bane Sullivan
  • Version: 0.0.2

pvgeohdf: An offshoot of PVGeo for HDF5 and netCDF data formats in ParaView

Base Classes

These provide base classes to simplify making new classes.

netCDF Points Reader Base
class pvgeohdf.base.netCDFPointsReaderBase(nOutputPorts=1, outputType='vtkPolyData', **kwargs)[source]

Bases: pvgeohdf.base.netCDFReaderBase

netCDFPointsReaderBase: for netCDF files that will produce a point+attribute dataset.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get data for current timestep and populate the output data object. This assumes that self._GetRawData() will return a dataset ready for PVGeo’s interface.pointsToPolyData().

net CDF Reader Base
class pvgeohdf.base.netCDFReaderBase(nOutputPorts=1, outputType='vtkPolyData', **kwargs)[source]

Bases: PVGeo.base.ReaderBaseBase

GetFileName()[source]

Super class has file names as a list but we will only handle a single netCDF file. This provides a conveinant way of making sure we only access that single file. A user could still access the list of file names using GetFileNames().

GetTimestepValues()[source]

Use this in ParaView decorator to register timesteps on the pipeline.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get data for current timestep and populate the output data object.

RequestInformation(request, inInfo, outInfo)[source]

This will handle setting the timesteps appropriately based on the number of file names when the pipeline needs to know the time information.

_GetFileContents(idx=None)[source]

This opens a netCDF4 DataSet. This happens up front so the data read happens only once and ParaView will be able to make calls on the RequestData method to get the data for a specific timestep

_GetRawData(idx=0)[source]

Get the data as the called for data object. Return type depends on higher level API.

Parameters:idx (int) – the timestep index
_ReadUpFront()[source]

OVERRIDE: This parses the loaded dataset.

_UpdateTimeSteps()[source]

For internal use only: appropriately sets the timesteps.

extensions = 'nc netCDF netcdf'

netCDF I/O

This module contains general readers and writers for netCDF formats.

CMAQ Reader
class pvgeohdf.netcdf.CMAQReader(**kwargs)[source]

Bases: pvgeohdf.base.netCDFReaderBase

CMAQ read for Ziwei Wu

GetExtent(dim=False)[source]
RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get data for current timestep and populate the output data object. This assumes that self._GetRawData() will return a dataset ready for PVGeo’s interface.pointsToPolyData().

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to set grid extents.

SetOrigin(ox, oy, oz)[source]

Set the origin corner of the grid

SetSpacing(dx, dy, dz)[source]

Set the spacing for each axial direction

_GetRawData(idx=0)[source]

Get the Points as numpy ndarrays or pandas dataframe where first three columns are the XYZ coordinates

_ReadUpFront()[source]

This parses the loaded dataset to a NumPy ndarray. The first axis represents a time step in the model space.

SVC Parcel Reader
class pvgeohdf.netcdf.SVCParcelReader(**kwargs)[source]

Bases: pvgeohdf.base.netCDFPointsReaderBase

SVCParcelReader for Kelton

SetDataName(name)[source]

This is an example of how to set a property for this reader to use. Note that we do not use this property.

_GetRawData(idx=0)[source]

Get the Points as numpy ndarrays or pandas dataframe where first three columns are the XYZ coordinates

_ReadUpFront()[source]

This parses the loaded dataset to a NumPy ndarray. The first axis represents a time step in the model space.

Docs Automatically Generated

Learn more about automatic documentation