YamlSerialized_OversampledImagePSF

class snappl.psf.YamlSerialized_OversampledImagePSF(_parent_class=False, **kwargs)[source]

Bases: OversampledImagePSF

An OversampledImagePSF with a definfed serialization format.

Call read() to load and write() to save.

The format is a yaml file. At the base of the yaml is a dictionary with six keys:

x0float. The x position on the array where the psf was

evaluated. This should probably have been called “x” not “x0”, because it matches the “x” parameters, not the “x0” parameter, to get_stamp, but oh well.

y0float. The y position on the array where the psf was

evaluated. Likewise, would be better called “y”, but oh well.

shape0int. The shape of the array to read is (shape0, shape1),

so shape0 is the y-size of the oversampled psf thumbnail, and shape1 is the x-size. Probably shape0 and shape1 should be the same, as there is probably code elsewhere that assumes square thumbnails!

shape1 : int. See above.

dtype : str. The numpy datatype of the data array. WORRY ABOUT ENDIANNESS.

datastr. Base-64 encoded flattend data array. (Because yaml is

a text format, not a binary format, we take the 25% size hit here to make sure it’s all ASCII and won’t cause everybody to get all confused and start running around screaming and waving their hands over their heads.)

See OversampledImagePSF constructor docs.

Methods Summary

read(filepath)

write(filepath)

Methods Documentation

read(filepath)[source]
write(filepath)[source]