mirror of https://github.com/silx-kit/pyFAI.git
only config copy
This commit is contained in:
parent
afa5476d81
commit
4896d8c85f
|
@ -226,21 +226,11 @@ If the number of files is too large, use double quotes like "*.edf" """
|
||||||
self.inputfiles = [i[0] for i in config.get("input_data", [])]
|
self.inputfiles = [i[0] for i in config.get("input_data", [])]
|
||||||
if "ai" in config:
|
if "ai" in config:
|
||||||
ai = config["ai"]
|
ai = config["ai"]
|
||||||
|
elif config.get("application", None) == "pyfai-integrate":
|
||||||
|
ai = config.copy()
|
||||||
else:
|
else:
|
||||||
ai = {}
|
ai = {}
|
||||||
|
|
||||||
ai_keys = [
|
|
||||||
"wavelength",
|
|
||||||
"dist",
|
|
||||||
"poni1", "poni2",
|
|
||||||
"rot1", "rot2", "rot3",
|
|
||||||
"detector", "detector_config",
|
|
||||||
"nbpt_rad", "nbpt_azim",
|
|
||||||
]
|
|
||||||
for poni_key in ai_keys:
|
|
||||||
if not poni_key in ai.keys() and config.get(poni_key, None):
|
|
||||||
ai[poni_key] = config[poni_key]
|
|
||||||
|
|
||||||
self.poni = config["ai"] = ai
|
self.poni = config["ai"] = ai
|
||||||
if "output_file" in config:
|
if "output_file" in config:
|
||||||
self.hdf5 = config["output_file"]
|
self.hdf5 = config["output_file"]
|
||||||
|
@ -272,7 +262,7 @@ If the number of files is too large, use double quotes like "*.edf" """
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("No such flat files")
|
raise RuntimeError("No such flat files")
|
||||||
|
|
||||||
if ocl and (options.gpu or 'opencl' in config.get("method", "")):
|
if ocl and options.gpu:
|
||||||
ai["opencl_device"] = ocl.select_device(type="gpu")
|
ai["opencl_device"] = ocl.select_device(type="gpu")
|
||||||
ai["method"] = ["full", "csr", "opencl"]
|
ai["method"] = ["full", "csr", "opencl"]
|
||||||
|
|
||||||
|
@ -296,15 +286,6 @@ If the number of files is too large, use double quotes like "*.edf" """
|
||||||
ai["do_mask"] = True
|
ai["do_mask"] = True
|
||||||
else:
|
else:
|
||||||
logger.warning("No such mask file %s", mask)
|
logger.warning("No such mask file %s", mask)
|
||||||
elif config.get("do_mask", None) and config.get("mask_file", None):
|
|
||||||
mask = urlparse(config["mask_file"]).path
|
|
||||||
if os.path.isfile(mask):
|
|
||||||
logger.info("Reading Mask file from: %s", mask)
|
|
||||||
self.mask = os.path.abspath(mask)
|
|
||||||
ai["mask_file"] = self.mask
|
|
||||||
ai["do_mask"] = True
|
|
||||||
else:
|
|
||||||
logger.warning("No such mask file %s", mask)
|
|
||||||
if options.poni:
|
if options.poni:
|
||||||
if os.path.isfile(options.poni):
|
if os.path.isfile(options.poni):
|
||||||
logger.info("Reading PONI file from: %s", options.poni)
|
logger.info("Reading PONI file from: %s", options.poni)
|
||||||
|
|
Loading…
Reference in New Issue