Data Containers

Data containers for accessing image data (i.e., numpy.ndarray) uniformly whether they are kept in memory, as memory mapped files (load), or stored to/loaded from a file as whole arrays.

Author:

Mihai Cara (contact: help@stsci.edu)

License:

LICENSE

class wiimatch.containers.WMData[source]

Base class for all data containers. Provides a common interface to access data.

abstract property data

Sets/Gets linked data.

Parameters:
dataobject

Data to be set.

kind = 'mapped'

Hints to how data are stored: 'mapped', 'file', or 'in-memory'. May be used by code for performance optimization.

abstract property shape

Returns a tuple describing the shape of linked data.

class wiimatch.containers.WMInMemoryData(data)[source]

Acessor for in-memory numpy.ndarray data.

property data

Sets/gets linked numpy.ndarray.

Parameters:
dataobject

Data to be set.

kind = 'in-memory'

Hints to how data are stored: 'mapped', 'file', or 'in-memory'. May be used by code for performance optimization.

property shape

Returns a tuple describing the shape of linked data.

class wiimatch.containers.WMMappedData(data, tmpfile=None, prefix='tmp_wiimatch_', suffix='.npy', tmpdir='')[source]

Data container for arrays stored in temporary files. This is best suited when array data are needed in memory all at once and when array is not needed - it can be stored to a file.

To access small segments of data, use cls:WMMemMappedData.

property data

Sets/gets linked numpy.ndarray.

Parameters:
dataobject

Data to be set.

kind = 'file'

Hints to how data are stored: 'mapped', 'file', or 'in-memory'. May be used by code for performance optimization.

property shape

Returns a tuple describing the shape of linked data.

class wiimatch.containers.WMMemMappedData(data, tmpfile=None, prefix='tmp_wiimatch_', suffix='.npy', tmpdir='')[source]

Data container for arrays stored in temporary files. This is best suited when array data are needed in memory all at once and when array is not needed - it can be stored to a file.

To access entire data arrays, use cls:WMMappedData.

property data

Sets/gets linked numpy.ndarray.

Parameters:
dataobject

Data to be set.

kind = 'mapped'

Hints to how data are stored: 'mapped', 'file', or 'in-memory'. May be used by code for performance optimization.

property shape

Returns a tuple describing the shape of linked data.