libpsf
libpsf copied to clipboard
Support for designParamVals.info
designParamVals.info seems to be in text format.
Trying to load it into a PSFDataSet and running get_header_properties segfaults.
psfasc from pycircuit can be used, not sure if the intention is that libpsf is used via pycircuit or directly.
from pycircuit.post.cds import psfasc
ascfile = psfasc.parse("psfasc", open(self.result_dir + "/psf/designParamVals.info").read())
self._params = dict(ascfile.values.children[0].value.getValue())
Ideally libpsf should handle ASCII PSF files but currently it doesn't and it is not trivial to add support for it. The idea is that libpsf should be usable directly and not only through pycircuit.
In the meantime I changed resultpsf in pycircuit to fall back to the Python PSF reader if it identify the file as a PSF ascii file.
I have also added an exception that will be thrown when PSFDataset is instantiated with an invalid file (like PSF ascii).