LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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)