pyFAI icon indicating copy to clipboard operation
pyFAI copied to clipboard

[config] method to retrieve config object from a .poni object without creating a worker

Open EdgarGF93 opened this issue 1 year ago • 2 comments

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

EdgarGF93 avatar Aug 26 '24 12:08 EdgarGF93

Why don't you add this as an export method to PoniFile ?

class PoniFile:
[...]
    def as_integration_config(self):
        [...]
        return config

kif avatar Aug 26 '24 13:08 kif

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 )

EdgarGF93 avatar Aug 26 '24 13:08 EdgarGF93

Fixed in #2252

kif avatar Dec 08 '24 20:12 kif