Density.to_memmap#
- Density.to_memmap()[source]#
Converts
Density.data
to anumpy.memmap
.See also
Examples
The following outlines how to use the
Density.to_memmap()
method.>>> from tme import Density >>> large_density = Density.from_file("/path/to/large_file.mrc") >>> large_density.to_memmap()
A more efficient solution to achieve the result outlined above is to provide the
use_memmap
flag inDensity.from_file()
.>>> Density.from_file("/path/to/large_file.mrc", use_memmap = True)
In practice, the
Density.to_memmap()
method finds application, if a large number ofDensity
instances need to be in memory at once, without occupying the full phyiscal memory required to storeDensity.data
.