perses.storage.NetCDFStorage

class perses.storage.NetCDFStorage(filename, mode='w')[source]

NetCDF storage layer.

Methods

close()

Close the storage layer.

get_object(envname, modname, varname[, …])

Get the serialized Python object.

sync()

Flush write buffer.

write_array(varname, array[, iteration])

Write a numpy array as a native NetCDF array

write_configuration(varname, positions, topology)

Write a configuration (or one of a sequence of configurations) to be stored as a native NetCDF array

write_object(varname, obj[, iteration])

Serialize a Python object, encoding as pickle when storing as string in NetCDF.

write_quantity(varname, value[, iteration])

Write a floating-point number

__init__(filename, mode='w')[source]

Create NetCDF storage layer, creating or appending to an existing file.

Parameters
filenamestr

Name of storage file to bind to.

modestr, optional, default=’w’

File open mode, ‘w’ for (over)write, ‘a’ for append.

Methods

__init__(filename[, mode])

Create NetCDF storage layer, creating or appending to an existing file.

close()

Close the storage layer.

get_object(envname, modname, varname[, …])

Get the serialized Python object.

sync()

Flush write buffer.

write_array(varname, array[, iteration])

Write a numpy array as a native NetCDF array

write_configuration(varname, positions, topology)

Write a configuration (or one of a sequence of configurations) to be stored as a native NetCDF array

write_object(varname, obj[, iteration])

Serialize a Python object, encoding as pickle when storing as string in NetCDF.

write_quantity(varname, value[, iteration])

Write a floating-point number