SGeMS File I/O

SGeMS Grid Reader

class PVGeo.gslib.sgems.SGeMSGridReader(origin=(0.0, 0.0, 0.0), spacing=(1.0, 1.0, 1.0), **kwargs)[source]

Bases: GSLibReader

Generates vtkImageData from the uniform grid defined in the input file in the SGeMS grid format. This format is simply the GSLIB format where the header line defines the dimensions of the uniform grid.

RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get output data object for given time step. Constructs the vtkImageData

RequestInformation(request, inInfo, outInfo)[source]

Used by pipeline to set grid extents.

__parse_extent(header)
_extract_header(content)[source]

Internal helper to parse header info for the SGeMS file format

_read_extent()[source]

Reads the input file for the SGeMS format to get output extents. Computationally inexpensive method to discover whole output extent.

Returns:

This returns a tuple of the whole extent for the uniform grid to be made of the input file (0,n1-1, 0,n2-1, 0,n3-1). This output should be directly passed to set the whole output extent.

Return type:

tuple

description = 'PVGeo: SGeMS Uniform Grid'
extensions = 'sgems dat geoeas gslib GSLIB txt SGEMS SGeMSgslibgrid mtxset'
set_origin(ox, oy, oz)[source]

Set the origin corner of the grid

set_spacing(dx, dy, dz)[source]

Set the spacing for each axial direction

Write vtkImageData To SGeMS Grid Format

class PVGeo.gslib.sgems.WriteImageDataToSGeMS(inputType='vtkImageData')[source]

Bases: WriterBase

Writes a vtkImageData object to the SGeMS uniform grid format. This writer can only handle point data. Note that this will only handle CellData as that is convention with SGeMS.

perform_write_out(input_data_object, filename, object_name)[source]

Write out the input vtkImage data to the SGeMS file format