Binary/Serialized File I/O

Madagascar SSRSF Reader

class PVGeo.readers.binaries.MadagascarReader(**kwargs)[source]

Bases: PVGeo.readers.binaries.PackedBinariesReader

This reads in float or double data that is packed into a Madagascar binary file format with a leader header. The reader ignores all of the ascii header details by searching for the sequence of three special characters: EOL EOL EOT and it will treat the followng binary packed data as one long array and make a vtkTable with one column of that data. The reader uses defaults to import as floats with native endianness. Use the Table to Uniform Grid or the Reshape Table filters to give more meaning to the data. We will later implement the ability to create a gridded volume from the header info. This reader is a quick fix for Samir. We chose to use a vtkTable object as the output of this reader because it gives us more flexibility in the filters we can apply to this data down the pipeline and keeps thing simple when using filters in this repository. Details Here.

_ReadRawFile(fileName)[source]
description = 'PVGeo: Madagascar Single Stream RSF Files'

Packed Binaries Reader

class PVGeo.readers.binaries.PackedBinariesReader(**kwargs)[source]

Bases: PVGeo.base.ReaderBase

This reads in float or double data that is packed into a binary file format. It will treat the data as one long array and make a vtkTable with one column of that data. The reader uses defaults to import as floats with native endianness. Use the Table to Uniform Grid or the Reshape Table filters to give more meaning to the data. We chose to use a vtkTable object as the output of this reader because it gives us more flexibility in the filters we can apply to this data down the pipeline and keeps thing simple when using filters in this repository.

ConvertArray(arr)[source]

Converts the numpy array to a vtkDataArray

GetDataName()[source]
GetDataTypes()[source]
GetEndian()[source]
RequestData(request, inInfo, outInfo)[source]

Used by pipeline to request data for current timestep

SetDataName(dataName)[source]

The string name of the data array generated from the inut file.

SetDataType(dtype)[source]

The data type of the binary file: double=’d’, float=’f’, int=’i’

SetEndian(endian)[source]

The endianness of the data file.

Parameters:endian (int or char) – no preference = ‘’ or 0, Little = 1 or < or Big = 2 >.
_GetFileContents(idx=None)[source]
_GetRawData(idx=0)[source]

This will return the proper data for the given timestep

_ReadRawFile(fileName)[source]
_ReadUpFront()[source]

Should not need to be overridden

description = 'PVGeo: Packed Binaries Reader'
extensions = 'H@ bin rsf rsf@ HH npz'