LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Functions
lsst.afw.fits.pickleFits Namespace Reference

Functions

def reduceToFits
 
def unreduceFromFits
 

Function Documentation

def lsst.afw.fits.pickleFits.reduceToFits (   obj)
Pickle to FITS

Intended to be used by the __reduce__ method of a class.

Assumes the existence of a "writeFits" method on the object.

Definition at line 3 of file pickleFits.py.

3 
4 def reduceToFits(obj):
5  """Pickle to FITS
6 
7  Intended to be used by the __reduce__ method of a class.
8 
9  Assumes the existence of a "writeFits" method on the object.
10  """
11  manager = MemFileManager()
12  obj.writeFits(manager)
13  size = manager.getLength()
14  data = cdata(manager.getData(), size);
15  return (unreduceFromFits, (obj.__class__, data, size))
def lsst.afw.fits.pickleFits.unreduceFromFits (   cls,
  data,
  size 
)
Unpickle from FITS

Unpacks data produced by reduceToFits.

Assumes the existence of a "readFits" method on the object.

Definition at line 16 of file pickleFits.py.

16 
17 def unreduceFromFits(cls, data, size):
18  """Unpickle from FITS
19 
20  Unpacks data produced by reduceToFits.
21 
22  Assumes the existence of a "readFits" method on the object.
23  """
24  manager = MemFileManager(size + 1) # Allow an extra char for nul
25  memmove(manager.getData(), data)
26  return cls.readFits(manager)