pyFAI.gui.helper package

pyFAI.gui.helper.MarkerManager module

class pyFAI.gui.helper.MarkerManager.MarkerManager(plot, markerModel, pixelBasedPlot=False)

Bases: object

Synchronize the display of markers from MarkerModel to a plot.

__init__(plot, markerModel, pixelBasedPlot=False)

Initialize self. See help(type(self)) for accurate signature.

createMarkGeometryAction(parent, mousePos)
createMarkPixelAction(parent, mousePos)
createRemoveClosestMaskerAction(parent, mousePos)
dataToChiTth(data)

Returns chi and 2theta angles in radian from data coordinate

findClosestMarker(mousePos, delta=20)
getMarkerLocation(marker)

Returns the location of the marker in the plot axes

updatePhysicalMarkerPixels(geometry)
updateProjection(geometry, radialUnit, wavelength, directDist, redraw=True)

pyFAI.gui.helper.ProcessingWidget module

pyFAI.gui.helper.ProcessingWidget.createProcessingWidgetOverlay(parent)

Create a widget overlay to show that the application is processing data to update the plot.

Parameters

widget (qt.QWidget) – Widget containing the overlay

Return type

qt.QWidget

pyFAI.gui.helper.RingCalibration module

class pyFAI.gui.helper.RingCalibration.GeometryRefinementContext(*args, **kwargs)

Bases: object

Store the full context of the GeometryRefinement object

Right now, GeometryRefinement store the bound but do not store the fixed constraints. It make the context difficult to manage and to trust.

PARAMETERS = ['wavelength', 'dist', 'poni1', 'poni2', 'rot1', 'rot2', 'rot3']
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

bounds()
chi2()
fixed()
getParams()

Returns list of parameters

guess_poni()
refine(maxiter)
setBounds(bounds)
setFixed(fixed)
setParams(params)

Set the fit parameter values from the list of values

class pyFAI.gui.helper.RingCalibration.RingCalibration(image, mask, calibrant, detector, wavelength, peaks, method)

Bases: object

__init__(image, mask, calibrant, detector, wavelength, peaks, method)

Initialize self. See help(type(self)) for accurate signature.

defaultGeometryConstraintsModel()

Returns the default constraints

Not the one used, but the one initially set to the refinement engine.

fromGeometryConstraintsModel(constraintsModel)
fromGeometryModel(model, resetResidual=True)
getBeamCenter()
getMask()

Returns the mask used to compute the tth.

getPoni()

“Returns the PONI coord in image coordinate.

That’s an approximation of the PONI coordinate at pixel precision

getPyfaiGeometry()
getRings()

Returns polygons of rings

Returns

List of ring angles available

Return type

List[float]

getRms()

Returns the RMS (root mean square) computed from the current fitting.

The unit is the radian.

getTwoThetaArray()

Returns the 2th array corresponding to the calibrated image

init(peaks, method, geometry, constraintsModel)
isValid()

Returns true if it can be use to calibrate the data.

refine(max_iter=500, seconds=10)

Contains the common geometry refinement part

toGeometryConstraintsModel(contraintsModel, reachFromGeoRef=True)
toGeometryModel(model)
update(image, mask, calibrant, detector, wavelength=None)

pyFAI.gui.helper.RingExtractor module

class pyFAI.gui.helper.RingExtractor.RingExtractorThread(parent)

Bases: PyQt5.QtCore.QThread

Job to process data and collect peaks according to a diffraction ring modelization.

__init__(parent)

Constructor

errorString()

Returns the error message in case of failure

isAborted()

Returns whether the theard was aborted or not.

Note

Aborted thead are not finished theads.

resultPeaks()

Returns the extracted peaks.

Return type

dict

run(self)
runProcess()

Extract the peaks.

Raises

ValueError – If a mandatory setting is not initialized.

Return type

bool

Returns

True if successed

setExperimentSettings(experimentSettings, copy)

Set the experiment data.

Parameters
  • experimentSettings (.model.ExperimentSettingsModel.ExperimentSettingsModel) – Contains the modelization of the problem

  • copy (bool) – If true copy the data for a thread safe processing

setGeometryModel(geometryModel)

Define a geometry model as source of the diffraction ring modelization

setMaxRings(maxRings)

Set max ring to extract

setPeaksModel(peaksModel)

Define a set of peaks as source of the diffraction ring modelization

setPointPerDegree(pointPerDegree)

Specify the amount of peak to extract per degree

setRingNumbers(ringNumbers)

Specify a set of rings to extract

Parameters

ringNumbers (List[int]) – List of number (1 is the 1st ring)

setUserData(name, value)

Store key-value information from caller to be retrived when the processing finish.

sigProcessLocationChanged
toGeometryModel(model)
userData(name)

Returns a stored user data.

pyFAI.gui.helper.SynchronizeMaskToolColor module

Utils to update the plot background according to the changes of the application styles

class pyFAI.gui.helper.SynchronizeMaskToolColor.SynchronizeMaskToolColor(maskTool=None)

Bases: object

__init__(maskTool=None)

Initialize self. See help(type(self)) for accurate signature.

getMaskTool()

pyFAI.gui.helper.SynchronizePlotBackground module

Utils to update the plot background according to the changes of the application styles

class pyFAI.gui.helper.SynchronizePlotBackground.SynchronizePlotBackground(plot=None)

Bases: object

__init__(plot=None)

Initialize self. See help(type(self)) for accurate signature.

getPlot()

pyFAI.gui.helper.SynchronizeRawView module

class pyFAI.gui.helper.SynchronizeRawView.SynchronizeRawView

Bases: object

Synchronize the raw view of plots altogether.

The active plot of each tasks synchonizing a model containing information to reach the loacation of the view.

When the task is shown, the view of the visible plot is synchronized only if the shared view was changed.

__init__()

Initialize self. See help(type(self)) for accurate signature.

registerModel(model)
registerPlot(plot)
registerTask(task)

pyFAI.gui.helper.model_transform module

Helper to transform or extract information from the abstratc model.

pyFAI.gui.helper.model_transform.createControlPoints(model)

Create ControlPoints object from the calibration model

Return type

pyFAI.control_points.ControlPoints

pyFAI.gui.helper.model_transform.createPeaksArray(model)

Create a contiguous peak array containing (y, x, ring number)

Parameters

model (PeakSelectionModel) – A set of selected peaks

Return type

numpy.ndarray

pyFAI.gui.helper.model_transform.createRing(points, peakSelectionModel, ringNumber=None, context=None)

Create a new ring from a group of points

Return type

PeakModel

pyFAI.gui.helper.model_transform.filterControlPoints(filterCallback, peakSelectionModel, removedPeaks=None)

Filter each peaks of the model using a callback

Parameters
  • filter (Callable[int,int,bool]) – Filter returning true is the peak have to stay in the result.

  • peakSelectionModel (PeakSelectionModel) – Model to filter

  • removedPeaks (List[Tuple[int,int]]) – Provide a list to feed it with removed peaks from the model.

pyFAI.gui.helper.model_transform.geometryModelToGeometry(geometryModel, geometry)
pyFAI.gui.helper.model_transform.initPeaksFromControlPoints(peakSelectionModel, controlPoints, context=None)

Initialize peak selection model using control points object

Return type

pyFAI.control_points.ControlPoints

Module contents

Helper relative to the calibration app