pyFAI.gui.model package#

pyFAI.gui.model.AbstractModel module#

class pyFAI.gui.model.AbstractModel.AbstractModel(parent=None)#

Bases: QObject

__init__(parent=None)#
changed#
isLocked()#

Returns True if the events are locked.

Return type:

bool

isValid()#
lockContext()#

Context manager to lock and unlock signals.

lockSignals()#

Lock the change events

staticMetaObject = PySide6.QtCore.QMetaObject("AbstractModel" inherits "QObject": Methods:   #4 type=Signal, signature=changed() )#
unlockSignals()#

Unlock the change events

Returns:

False if the model is still locked, else True

wasChanged()#

Emit the change event in case of the model was not locked.

Returns:

True if the signal was emitted.

pyFAI.gui.model.CalibrantModel module#

class pyFAI.gui.model.CalibrantModel.CalibrantModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
calibrant() Calibrant | None#
isValid() bool#
setCalibrant(calibrant: Calibrant | None)#
staticMetaObject = PySide6.QtCore.QMetaObject("CalibrantModel" inherits "AbstractModel": )#

pyFAI.gui.model.CalibrationModel module#

class pyFAI.gui.model.CalibrationModel.CalibrationModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
experimentSettingsModel()#
Return type:

ExperimentSettingsModel

fittedGeometry()#
geometryConstraintsModel()#
Return type:

GeometryConstraintsModel

geometryHistoryModel()#
Return type:

GeometryHistoryModel

integrationSettingsModel()#
Return type:

IntegrationSettingsModel

isValid()#
markerModel()#
Return type:

MarkerModel

peakGeometry()#
Return type:

GeometryModel

peakSelectionModel()#
Return type:

PeakSelectionModel

rawPlotView()#

Store definition of the RAW data view.

This view is shared by some plots

Return type:

PlotViewModel

staticMetaObject = PySide6.QtCore.QMetaObject("CalibrationModel" inherits "AbstractModel": )#

pyFAI.gui.model.ConstraintModel module#

class pyFAI.gui.model.ConstraintModel.ConstraintModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
fillDefault(other)#

Fill unset values of this model with the other model

Parameters:

other (GeometryConstraintsModel)

hasConstraint()#
isFixed()#
isRangeConstrained()#
range()#
set(other)#
setFixed(fixed=True)#
setRangeConstraint(minValue, maxValue)#
staticMetaObject = PySide6.QtCore.QMetaObject("ConstraintModel" inherits "AbstractModel": )#

pyFAI.gui.model.DataModel module#

class pyFAI.gui.model.DataModel.DataModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
isValid()#
setValue(value)#
staticMetaObject = PySide6.QtCore.QMetaObject("DataModel" inherits "AbstractModel": )#
value()#

pyFAI.gui.model.DataModelAdaptor module#

class pyFAI.gui.model.DataModelAdaptor.DataModelAdaptor(parent=None, model=None)#

Bases: AbstractModel

__init__(parent=None, model=None)#
fromModel(data)#
isValid()#
setValue(value)#
staticMetaObject = PySide6.QtCore.QMetaObject("DataModelAdaptor" inherits "AbstractModel": )#
toModel(data)#
value()#

pyFAI.gui.model.DetectorModel module#

class pyFAI.gui.model.DetectorModel.DetectorModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
detector()#
isValid()#
setDetector(detector)#
staticMetaObject = PySide6.QtCore.QMetaObject("DetectorModel" inherits "AbstractModel": )#

pyFAI.gui.model.ExperimentSettingsModel module#

class pyFAI.gui.model.ExperimentSettingsModel.ExperimentSettingsModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
calibrantModel()#
dark()#
detector()#

Detector getter synchronizing internal detector configuration to match the input image.

detectorModel()#
flat()#
image()#
isValid()#
jsonFile()#
mask()#
maskedImage()#
parallaxCorrection()#
polarizationFactor()#
poniFile()#
preprocessedImage()#
staticMetaObject = PySide6.QtCore.QMetaObject("ExperimentSettingsModel" inherits "AbstractModel": )#
wavelength()#

pyFAI.gui.model.FilenameModel module#

class pyFAI.gui.model.FilenameModel.FilenameModel(parent=None)#

Bases: DataModel

Model storing a filename and if the data is still synchronized.

__init__(parent=None)#
filename()#

Returns the filename associated with this model.

Return type:

Union[None,str]

hasFilename()#

True if this model contains a filename.

Return type:

bool

isSynchronized()#

Returns True if the filename and the data are synchronized.

Both contains the same data.

setFilename(filename)#

Set a filename to this model

Parameters:

filename (str) – The new filename

setSynchronized(isSynchronized)#

” Set if the filename and the data are synchronized.

setValue(value)#
staticMetaObject = PySide6.QtCore.QMetaObject("FilenameModel" inherits "DataModel": )#

pyFAI.gui.model.Fit2dGeometryModel module#

class pyFAI.gui.model.Fit2dGeometryModel.Fit2dGeometryModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
centerX()#
centerY()#
distance()#
isValid(checkWaveLength=True)#

Check if all the modele have a meaning.

Parameters:

checkWaveLength (bool) – If true (default) the wavelength is checked

setFrom(geometry)#
staticMetaObject = PySide6.QtCore.QMetaObject("Fit2dGeometryModel" inherits "AbstractModel": )#
tilt()#
tiltPlan()#

pyFAI.gui.model.GeometryConstraintsModel module#

class pyFAI.gui.model.GeometryConstraintsModel.GeometryConstraintsModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
copy(parent=None)#

Copy this model to a new model

Parameters:

parent (qt.QObject) – Parent of the copied model

Return type:

GeometryConstraintsModel

distance()#
fillDefault(other)#

Fill unset values of this model with the other model

Parameters:

other (GeometryConstraintsModel)

isValid()#
poni1()#
poni2()#
rotation1()#
rotation2()#
rotation3()#
set(other)#

Set this geometry constraints with the other information.

Parameters:

other (GeometryConstraintsModel)

staticMetaObject = PySide6.QtCore.QMetaObject("GeometryConstraintsModel" inherits "AbstractModel": )#
wavelength()#

pyFAI.gui.model.GeometryHistoryModel module#

class pyFAI.gui.model.GeometryHistoryModel.GeometryHistoryModel(parent=None)#

Bases: ListModel

appendGeometry(label, time, geometry, rms)#
Parameters:
  • label (str) – Named geometry

  • time (datetime.datetime) – time of the record

  • geometry (GeometryModel) – Geometry to store

  • rms (float) – Root mean share of this geometry

lastGeometryIsValid() bool#
Returns:

True if the last geometry is valid

staticMetaObject = PySide6.QtCore.QMetaObject("GeometryHistoryModel" inherits "ListModel": )#
class pyFAI.gui.model.GeometryHistoryModel.StoredGeometry(parent, label, time, geometry, rms)#

Bases: AbstractModel

Single element stored in the history of geometries.

Parameters:
  • time (datetime.datetime) – time of the record

  • geometry (GeometryModel) – Geometry to store

  • rms (float)

__init__(parent, label, time, geometry, rms)#
geometry()#
Return type:

GeometryModel

label()#
Return type:

str

rms()#
Return type:

float

staticMetaObject = PySide6.QtCore.QMetaObject("StoredGeometry" inherits "AbstractModel": )#
time()#
Return type:

datetime.datetime

pyFAI.gui.model.GeometryModel module#

class pyFAI.gui.model.GeometryModel.GeometryModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
copy()#
distance()#
isValid(checkWaveLength=True)#

Check if all the model have a meaning.

Parameters:

checkWaveLength (bool) – If true (default) the wavelength is checked

poni1()#
poni2()#
rotation1()#
rotation2()#
rotation3()#
setFrom(geometry)#
staticMetaObject = PySide6.QtCore.QMetaObject("GeometryModel" inherits "AbstractModel": )#
wavelength()#

pyFAI.gui.model.ImageModel module#

class pyFAI.gui.model.ImageModel.ImageFilenameModel(parent=None)#

Bases: DataModel

Model storing an image using it’s filename.

filename()#

Returns the filename associated with this model.

Return type:

Union[None,str]

filenameChanged#
hasFilename()#

True if this model contains a filename.

Return type:

bool

setFilename(filename)#

Set a filename to this model

Parameters:

filename (str) – The new filename

staticMetaObject = PySide6.QtCore.QMetaObject("ImageFilenameModel" inherits "DataModel": )#
class pyFAI.gui.model.ImageModel.ImageFromFilenameModel(parent=None)#

Bases: DataModel

Model storing an image array which could come from a filename.

This model deal with unsynchronized filename/data.

__init__(parent=None)#
filename()#

Returns the filename associated with this model.

Return type:

Union[None,str]

filenameChanged#
hasFilename()#

True if this model contains a filename.

Return type:

bool

isSynchronized()#

Returns True if the filename and the data are synchronized.

Both contains the same data.

setFilename(filename)#

Set a filename to this model

Parameters:

filename (str) – The new filename

setSynchronized(isSynchronized)#

” Set if the filename and the data are synchronized.

setValue(value)#

Set the value of this image model.

staticMetaObject = PySide6.QtCore.QMetaObject("ImageFromFilenameModel" inherits "DataModel": Methods:   #5 type=Signal, signature=filenameChanged() )#
unlockSignals()#

Unlock the change events

Returns:

False if the model is still locked, else True

class pyFAI.gui.model.ImageModel.ImageModel(parent=None)#

Bases: DataModel

setValue(value)#

Set the value of this image model.

staticMetaObject = PySide6.QtCore.QMetaObject("ImageModel" inherits "DataModel": )#

pyFAI.gui.model.IntegrationSettingsModel module#

class pyFAI.gui.model.IntegrationSettingsModel.IntegrationSettingsModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
isValid()#
nPointsAzimuthal()#
nPointsRadial()#
radialUnit()#
staticMetaObject = PySide6.QtCore.QMetaObject("IntegrationSettingsModel" inherits "AbstractModel": )#

pyFAI.gui.model.ListModel module#

class pyFAI.gui.model.ListModel.ChangeEvent(index, item, added=False, removed=False, updated=False)#

Bases: object

__init__(index, item, added=False, removed=False, updated=False)#

Define a change done on an item from the ListModel.

Parameters:
  • index (int) – The location where to put/remove the item (before the change) or the current index of the changed item

  • item (object) – The item involved in this change

  • updated (bool) – True if the item was changed

  • added (bool) – True if the item was added

  • removed (bool) – True if the item was removed

class pyFAI.gui.model.ListModel.ChangeListEvent#

Bases: object

A container of consecutive change events

__init__()#
hasOnlyStructuralEvents()#

True if only structural change (added, removed) is part of the changes

Return type:

bool

hasOnlyUpdateEvents()#

True if only updates events (updated) is part of the changes

Return type:

bool

hasStructuralEvents()#

True if a structural change (added, removed) is part of the changes

Return type:

bool

hasUpdateEvents()#

True if an update change (updated) is part of the changes

Return type:

bool

class pyFAI.gui.model.ListModel.ListModel(parent=None)#

Bases: AbstractModel

List of AbstractModel managing signals when items are edited, added and removed.

Atomic events for each add/remove of items. To manage it in a better way, structureAboutToChange and structureChanged, in order to compute all the atomic events in a single time.

Parameters:

parent – Owner of this model

__init__(parent=None)#
append(item)#

Add a new item to the end of the list.

changed#
clear()#

Remove all the items from the list.

contentChanged#

Emitted when the content of the elements changed.

index(item)#

Returns the index of the item in the list structure

isValid()#
remove(item)#

Remove an item.

staticMetaObject = PySide6.QtCore.QMetaObject("ListModel" inherits "AbstractModel": Methods:   #5 type=Signal, signature=changed(PyObject), parameters=PyObject   #6 type=Signal, signature=structureChanged()   #7 type=Signal, signature=contentChanged() )#
structureChanged#

Emitted at the end of a structural change.

unlockSignals()#

Unlock the change events

Returns:

False if the model is still locked, else True

pyFAI.gui.model.MarkerModel module#

class pyFAI.gui.model.MarkerModel.Marker(name)#

Bases: object

Abstract marker

__init__(name)#
name()#
class pyFAI.gui.model.MarkerModel.MarkerModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
add(marker)#
remove(marker)#
removeLabel(label)#
staticMetaObject = PySide6.QtCore.QMetaObject("MarkerModel" inherits "AbstractModel": )#
class pyFAI.gui.model.MarkerModel.PhysicalMarker(name, chi, tth)#

Bases: Marker

Mark a point at a specific location of chi/tth

__init__(name, chi, tth)#
physicalPosition()#
pixelPosition()#
removePixelPosition()#
setPixelPosition(x, y)#
class pyFAI.gui.model.MarkerModel.PixelMarker(name, x, y)#

Bases: Marker

Mark a pixel at a specific location of an image

__init__(name, x, y)#
pixelPosition()#

pyFAI.gui.model.MaskedImageModel module#

class pyFAI.gui.model.MaskedImageModel.MaskedImageModel(parent=None, image=None, mask=None)#

Bases: DataModel

Image cleaned up by setting masked pixels to NaN

__init__(parent=None, image=None, mask=None)#
staticMetaObject = PySide6.QtCore.QMetaObject("MaskedImageModel" inherits "DataModel": )#
value()#

pyFAI.gui.model.PeakModel module#

class pyFAI.gui.model.PeakModel.PeakModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
color()#
coords()#

Returns coords as numpy array.

The first index identify a coord, the second identify the coord dimensions.

List of axis/ord can be reached like that.

coords = group.coords()
yy = coords[:, 0]
xx = coords[:, 1]
copy(parent=None)#
distanceTo(coord)#

Returns the smallest distance to this coord.

None is returned if the group contains no peaks.

Parameters:

coord (Tuple[float,float]) – Distance to measure

isEnabled()#

True if this group has to be taken into account.

Return type:

bool

isValid()#
mergeCoords(coords)#

Merge new coords to the current list of coords.

Duplicated values are removed from the new coords, and the is added the end of the previous list.

Parameters:

coords ([numpy.ndarray,PeakModel])

name()#
ringNumber()#
setColor(color)#
setCoords(coords)#

Set coords as numpy array.

Parameters:

coords (numpy.ndarray) – Array of coords (1st dimension is the index of the coord; the second dimension contains y as first index, and x as second index).

setEnabled(isEnabled)#

Set this group to be taken into account (or not).

Parameters:

isEnabled (bool) – True to enable this group.

setName(name)#
setRingNumber(ringNumber)#
staticMetaObject = PySide6.QtCore.QMetaObject("PeakModel" inherits "AbstractModel": )#

pyFAI.gui.model.PeakSelectionModel module#

class pyFAI.gui.model.PeakSelectionModel.PeakSelectionModel(parent=None)#

Bases: AbstractModel

__init__(parent=None)#
append(peak)#
clear()#
closestGroup(coord, threshold=None)#

Returns the closest group from coord.

Parameters:
  • Tuple[float,float] – Position coord to search around.

  • threshold (float) – If specified, filter out groups when the distance is higher than this value.

contentChanged#

Emitted when the content of the elements changed.

index(peak)#
isValid()#
peakCount()#

Returns the amount of peak selected through all the groups

Return type:

int

peakFromRingNumber(ringNumber)#

Returns a peak model from it’s ring number.

If no peaks where found, returns None.

Return type:

Union[PeakModel,None]

remove(peak)#
staticMetaObject = PySide6.QtCore.QMetaObject("PeakSelectionModel" inherits "AbstractModel": Methods:   #5 type=Signal, signature=structureChanged()   #6 type=Signal, signature=contentChanged() )#
structureChanged#

Emitted when there is different elements in the list.

unlockSignals()#

Unlock the change events

Returns:

False if the model is still locked, else True

pyFAI.gui.model.PlotViewModel module#

class pyFAI.gui.model.PlotViewModel.PlotViewModel(parent=None)#

Bases: DataModel

This model allow to store and restitute a plot view.

Stored data can be applied to another plot in order to synchronize location of the data coords.

setFromPlot(plot)#
staticMetaObject = PySide6.QtCore.QMetaObject("PlotViewModel" inherits "DataModel": )#
synchronizePlotConfig(plot)#
synchronizePlotView(plot)#

Module contents#

Models relative to calibration