-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1815 from kif/1808_calib2
Alternative visulalization of geometry
- Loading branch information
Showing
13 changed files
with
151 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
__date__ = "21/01/2020" | ||
__date__ = "24/02/2023" | ||
__status__ = "production" | ||
|
||
import os | ||
|
@@ -569,7 +569,7 @@ def main(): | |
silx.config.DEFAULT_PLOT_BACKEND = "opengl" | ||
|
||
# Make sure matplotlib is loaded first by silx | ||
import silx.gui.plot.matplotlib | ||
import silx.gui.utils.matplotlib | ||
from pyFAI.gui.CalibrationWindow import CalibrationWindow | ||
from pyFAI.gui.CalibrationContext import CalibrationContext | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
__date__ = "22/02/2023" | ||
__date__ = "24/02/2023" | ||
__status__ = "stable" | ||
__docformat__ = 'restructuredtext' | ||
|
||
|
@@ -2218,7 +2218,7 @@ def integrate2d_ng(self, data, npt_rad, npt_azim=360, | |
norm2d = None | ||
var2d = None | ||
|
||
if method.algo_lower in ("csr", "lut"): | ||
if method.algo_lower in ("csr", "csc", "lut"): | ||
intpl = None | ||
cython_method = IntegrationMethod.select_method(method.dimension, method.split_lower, method.algo_lower, "cython")[0] | ||
if cython_method not in self.engines: | ||
|
@@ -2936,14 +2936,14 @@ def sigma_clip_legacy(self, data, npt_rad=1024, npt_azim=512, | |
:param metadata: any other metadata, | ||
:type metadata: JSON serializable dict | ||
:param safe: unset to save some checks on sparse matrix shape/content. | ||
:return: Integrate1D-like result | ||
:kwargs: unused, just for signature compatibility when used within Worker. | ||
:return: Integrate1D like result like | ||
Nota: The initial 2D-integration requires pixel splitting | ||
""" | ||
#compatibility layer with sigma_clip_ng | ||
# compatibility layer with sigma_clip_ng | ||
if "npt" in kwargs: | ||
npt_rad = kwargs["npt"] | ||
|
||
# We use NaN as dummies | ||
if dummy is None: | ||
dummy = numpy.NaN | ||
|
@@ -2971,7 +2971,8 @@ def sigma_clip_legacy(self, data, npt_rad=1024, npt_azim=512, | |
dummy=dummy, delta_dummy=delta_dummy, | ||
correctSolidAngle=correctSolidAngle, | ||
polarization_factor=polarization_factor, | ||
normalization_factor=normalization_factor,safe=safe) | ||
normalization_factor=normalization_factor, | ||
safe=safe) | ||
image = res2d.intensity | ||
if (method.impl_lower == "opencl"): | ||
if (method.algo_lower == "csr") and \ | ||
|
@@ -3086,8 +3087,9 @@ def sigma_clip_ng(self, data, | |
``|I - <I>| < thres * σ(I)`` | ||
This enforces a symmetric, bell-shaped distibution (i.e. gaussian-like) and is very good at extracting | ||
background or amorphous isotropic scattering out of Bragg peaks. | ||
This enforces a symmetric, bell-shaped distibution (i.e. gaussian-like) | ||
and is very good at extracting background or amorphous isotropic scattering | ||
out of Bragg peaks. | ||
:param data: input image as numpy array | ||
:param npt_rad: number of radial points | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ Serial implementation based on a sparse CSC matrix multiplication | |
|
||
__author__ = "Jérôme Kieffer" | ||
__contact__ = "[email protected]" | ||
__date__ = "08/09/2022" | ||
__date__ = "31/01/2023" | ||
__status__ = "stable" | ||
__license__ = "MIT" | ||
|
||
|
@@ -184,7 +184,7 @@ class HistoBBox2d(CscIntegrator, SplitBBoxIntegrator): | |
self.bin_centers1 = numpy.linspace(self.pos1_min + 0.5 * self.delta1, | ||
self.pos1_max - 0.5 * self.delta1, | ||
self.bins[1]) | ||
csc = self.calc_lut_2d().to_csr() | ||
csc = sparse.csr_matrix(self.calc_lut_2d().to_csr()).tocsc() | ||
#Call the constructor of the parent class | ||
CscIntegrator.__init__(self, (csc.data, csc.indices, csc.indptr), self.size, numpy.prod(bins), empty or 0.0) | ||
self.lut_checksum = crc32(self.data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ Sparse matrix represented using the CompressedSparseColumn. | |
|
||
__author__ = "Jérôme Kieffer" | ||
__contact__ = "[email protected]" | ||
__date__ = "09/09/2022" | ||
__date__ = "31/01/2023" | ||
__status__ = "stable" | ||
__license__ = "MIT" | ||
|
||
|
@@ -169,7 +169,7 @@ class FullSplitCSC_2d(CscIntegrator, FullSplitIntegrator): | |
|
||
csc = sparse.csr_matrix(self.calc_lut_2d().to_csr()).tocsc() | ||
#Call the constructor of the parent class | ||
CscIntegrator.__init__(self, (csc.data, csc.indices, csc.indptr), self.pos.shape[0], self.bins, empty or 0.0) | ||
CscIntegrator.__init__(self, (csc.data, csc.indices, csc.indptr), self.pos.shape[0], numpy.prod(bins), empty or 0.0) | ||
|
||
self.lut_checksum = crc32(self.data) | ||
self.lut_nbytes = sum([i.nbytes for i in self.lut]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.