# SGeMS File I/O¶

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

Generates vtkImageData from the uniform grid defined in the inout 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.

SetOrigin(ox, oy, oz)[source]

Set the origin corner of the grid

SetSpacing(dx, dy, dz)[source]

Set the spacing for each axial direction

_ExtractHeader(content)[source]

Override this. Removes header from single file’s content.

_ReadExtent()[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. tuple
description = 'PVGeo: SGeMS Uniform Grid'
extensions = 'sgems dat geoeas gslib GSLIB txt SGEMS SGeMSgslibgrid mtxset'

## Write vtkImageData To SGeMS Grid Format¶

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

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.

PerformWriteOut(inputDataObject, filename, objectName)[source]

This method must be implemented. This is automatically called by RequestData for single inputs or composite inputs.