viscid.readers.athena_bin module

Athena binary file reader

At the moment, this reader assumes the conserved fields are in the files. The Athena custom Grid has methods to do vx = M1 / d, etc.

class viscid.readers.athena_bin.AthenaBinDataWrapper(file_wrapper, fld_name, expected_shape, fld_number)[source]

Bases: viscid.readers.vfile.DataWrapper

dtype
expected_shape = None
file_wrapper = None
filename = None
fld_name = None
fld_number = None
len()[source]
read_direct(*args, **kwargs)[source]
shape

zyx shape since that’s the shape __array__ returns

Type:Returns
class viscid.readers.athena_bin.AthenaBinFile(fname, crds=None, float_type_name=None, var_type=None, **kwargs)[source]

Bases: viscid.readers.athena.AthenaFile, viscid.readers.vfile_bucket.ContainerFile

An Athena binary file reader

classmethod collective_name_from_group(fnames)[source]
float_type_name = None
get_file_wrapper(filename)[source]
classmethod group_fnames(fnames)[source]

Group File names

The default implementation just returns fnames, but some file types might do something fancy here

Parameters:fnames (list) – names that can be logically grouped, as in a bunch of file names that are different time steps of a given run
Returns:A list of things that can be given to the constructor of this class
load(fname)[source]
set_file_wrapper(wrapper)[source]
var_type = None
class viscid.readers.athena_bin.AthenaBinFileWrapper(filename, keep_crd_clist=False, float_type_name=None, var_type=None)[source]

Bases: object

A File-like object for interfacing with Athena binary files

float_type_name

default float data type, should be ‘f4’ or ‘f8’; deufaults to double (‘f8’)

Type:str
close()[source]
count = None
crd_clist = None
dt = None
field_names
filename = None
fld_names = None
float_dtype
float_type_name = 'f8'
isopen
keep_crd_clist = None
nscalars = None
nvars = None
open()[source]
read_field(fld_id)[source]

Read a field given a seekable location

Parameters:fld_id (int) – number of field in file
Returns:tuple array
read_header()[source]
shape = None
time = None
var_type = 'cons'