silx-kit / pyFAI

Fast Azimuthal Integration in Python
Other
106 stars 95 forks source link

detector not found if using config.json (from pyFAI-integrate) to run diffmap #2130

Closed EdgarGF93 closed 7 months ago

EdgarGF93 commented 7 months ago
{
    "application": "pyfai-integrate",
    "version": 3,
    "wavelength": 3.7380000000000004e-11,
    "dist": 0.18352000680503333,
    "poni1": 0.13032588094799352,
    "poni2": 0.11127533501437878,
    "rot1": 0.014561540164214496,
    "rot2": -0.010992447540998289,
    "rot3": 2.1944567622347524e-09,
    "detector": "Eiger2CdTe_9M",
    "detector_config": {
        "orientation": 3
    },
    "do_mask": true,
    "mask_file": "fabio:///users/edgar1993a/work/pilx_test/mask.npy",
    "do_dark": false,
    "dark_current": null,
    "do_flat": false,
    "flat_field": null,
    "do_polarization": false,
    "polarization_factor": 0.0,
    "do_dummy": false,
    "val_dummy": null,
    "delta_dummy": null,
    "do_2D": true,
    "nbpt_rad": 3000,
    "unit": "2th_deg",
    "do_radial_range": false,
    "radial_range_min": null,
    "radial_range_max": null,
    "do_azimuthal_range": false,
    "azimuth_range_min": null,
    "azimuth_range_max": null,
    "chi_discontinuity_at_0": false,
    "do_solid_angle": true,
    "error_model": null,
    "method": [
        "bbox",
        "csr",
        "opencl"
    ],
    "opencl_device": [
        0,
        0
    ]
(py311) (base) edgar1993a@linada01:/home/edgar1993a/work/pyFAI$ pyFAI-diffmap ../pilx_test/RAW_DATA/scan0001/eiger/eiger_0000.h5 -r 6 -t 6 -o /tmp/kkk.h5 --config ../pilx_test/config.json --no-gui
INFO:numexpr.utils:Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
INFO:pyFAI.method_registry:Degrading method from Method(dim=1, split='pseudo', algo='histogram', impl='*', target=None) -> Method(dim=1, split='bbox', algo='histogram', impl='*', target=None)
ERROR:pyFAI.io.ponifile:PoniFile claim to be version 2 but contains no `detector_config` !!!
Traceback (most recent call last):
  File "/home/edgar1993a/py311/bin/pyFAI-diffmap", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/app/diff_map.py", line 75, in main
    dt.configure_worker(config["ai"])
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/diffmap.py", line 352, in configure_worker
    self.worker.set_config(dico or self.poni)
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/worker.py", line 458, in set_config
    _init_ai(self.ai, config, consume_keys=True, read_maps=False)
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/worker.py", line 154, in _init_ai
    poni = config_reader.pop_ponifile()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/io/integration_config.py", line 221, in pop_ponifile
    return ponifile.PoniFile(dico)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/io/ponifile.py", line 66, in __init__
    self.read_from_dict(data)
  File "/home/edgar1993a/py311/lib/python3.11/site-packages/pyFAI/io/ponifile.py", line 153, in read_from_dict
    detector_name = config["detector"]
                    ~~~~~~^^^^^^^^^^^^
KeyError: 'detector'
EdgarGF93 commented 7 months ago

it's not a gui/no-gui issue, it fails both ways

EdgarGF93 commented 7 months ago

to #2131