libpsf icon indicating copy to clipboard operation
libpsf copied to clipboard

Support for designParamVals.info

Open michaelnt opened this issue 13 years ago • 2 comments

designParamVals.info seems to be in text format.

Trying to load it into a PSFDataSet and running get_header_properties segfaults.

michaelnt avatar Jan 08 '12 01:01 michaelnt

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())

michaelnt avatar Jan 10 '12 12:01 michaelnt

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).

henjo avatar Jan 10 '12 21:01 henjo