diff --git a/doc/source/publications.rst b/doc/source/publications.rst index d0abdfcfe..dcb2a8ced 100644 --- a/doc/source/publications.rst +++ b/doc/source/publications.rst @@ -34,7 +34,8 @@ Publications about pyFAI * *Application of signal separation to diffraction image compression and serial crystallography*; Jérôme Kieffer, Julien Orlans, Nicolas Coquelle, Samuel Debionne, Shibom Basu, Alejandro Homs, Gianluca Santonia and Daniele De Sanctis; - `Accepted 10.48550/arXiv.2411.09515>`_ in **J. Applied Crystallography** (2024), DOI:10.1107/S1600576724011038; + **Journal of Applied Crystallography** (2025) 58, https://doi.org/10.1107/S1600576724011038. + `Accepted `_ In depth explainaion of sigma-clipping background assessment and error models. The latest paper should be the cited in publications using pyFAI. diff --git a/src/pyFAI/diffmap.py b/src/pyFAI/diffmap.py index d5c521f34..ab2487ed8 100644 --- a/src/pyFAI/diffmap.py +++ b/src/pyFAI/diffmap.py @@ -31,7 +31,7 @@ __contact__ = "Jerome.Kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "13/12/2024" +__date__ = "19/12/2024" __status__ = "development" __docformat__ = 'restructuredtext' @@ -291,18 +291,27 @@ def parse(self, sysargv=None, with_config=False): config["input_data"] = [(i, None) for i in self.inputfiles] if options.mask: - mask = urlparse(options.mask).path + urlmask = urlparse(options.mask) + elif ai.get("do_mask", False) or ai.get("mask_file", None): + urlmask = urlparse(ai.get("mask_file", None)) elif config.get("do_mask", False) or config.get("mask_file", None): - mask = urlparse(config.get("mask_file", None)).path + # compatibility with elder config files... + deprecated_warning("Config of mask no more top-level, but in ai config group", "mask_file", deprecated_since="2024.12.0") + urlmask = urlparse(config.get("mask_file", None)) else: - mask = "" - if os.path.isfile(mask): - logger.info("Reading Mask file from: %s", mask) - self.mask = os.path.abspath(mask) + urlmask = urlparse("") + if "::" in urlmask.path: + mask_filename, idx = urlmask.path.split("::", 1) + mask_filename = os.path.abspath(mask_filename) + urlmask = urlparse(f"fabio://{mask_filename}?slice={idx}") + + if os.path.isfile(urlmask.path): + logger.info("Reading Mask file from: %s", urlmask.path) + self.mask = urlmask.geturl() ai["mask_file"] = self.mask ai["do_mask"] = True else: - logger.warning("No such mask file %s", mask) + logger.warning("No such mask file %s", urlmask.path) if options.poni: if os.path.isfile(options.poni): logger.info("Reading PONI file from: %s", options.poni) diff --git a/src/pyFAI/io/image.py b/src/pyFAI/io/image.py index cea2e2b2b..8377b6dd1 100644 --- a/src/pyFAI/io/image.py +++ b/src/pyFAI/io/image.py @@ -32,7 +32,7 @@ __contact__ = "jerome.kieffer@ESRF.eu" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" -__date__ = "11/12/2024" +__date__ = "19/12/2024" __status__ = "development"