pyFAI
pyFAI copied to clipboard
[config] method to retrieve config object from a .poni object without creating a worker
example:
from pyFAI.io.PoniFile import PoniFile
from pyFAI.io.integration_config import poni_to_config
poni_filename = "example.poni"
poni = PoniFile(poni_filename)
config = poni_to_config(poni)
equivalent method to
from pyFAI.worker import Worker
from pyFAI import load
ai = load(poni_filename)
worker = Worker(azimuthalIntegrator=ai)
config = worker.get_config()
to avoid instantiation of the worker
Why don't you add this as an export method to PoniFile ?
class PoniFile:
[...]
def as_integration_config(self):
[...]
return config
We could do that, I was thinking about writing this method inside the worker module since it will contain all the possible keys for the worker (see #2252 )
Fixed in #2252