Commit fedba9e5 authored by Thomas Vincent's avatar Thomas Vincent

adapt qspace widget to multiple energies

parent f0a6736d
......@@ -61,7 +61,7 @@ class ConversionParamsWidget(Qt.QWidget):
def __init__(self,
medfiltDims=None,
normalizers=None,
beamEnergy=None,
beamEnergies=None,
directBeam=None,
channelsPerDegree=None,
**kwargs):
......@@ -82,7 +82,8 @@ class ConversionParamsWidget(Qt.QWidget):
self.__acqParamWid = AcqParamsWidget()
# Set default values with provided info
self.__acqParamWid.beam_energy = beamEnergy
self.__acqParamWid.setBeamEnergyFromList(beamEnergies)
self.__acqParamWid.setBeamEnergyEnabled(len(set(beamEnergies)) == 1)
self.__acqParamWid.direct_beam_v = directBeam[0]
self.__acqParamWid.direct_beam_h = directBeam[1]
self.__acqParamWid.chperdeg_v = channelsPerDegree[0]
......@@ -369,7 +370,10 @@ class ConversionParamsWidget(Qt.QWidget):
def getBeamEnergy(self):
"""Returns beam energy in eV or None if no input"""
if self.__acqParamWid.isBeamEnergyEnabled():
return self.__acqParamWid.beam_energy
else:
return None
def getDirectBeam(self):
"""Returns direct beam calibration position None if no input
......@@ -568,18 +572,18 @@ class QSpaceWidget(Qt.QDialog):
topLayout.addWidget(convGbx, 1, 0, alignment=Qt.Qt.AlignTop)
if entries: # Get default config from first entry
beamEnergy = xsocsH5.beam_energy(entries[0])
directBeam = xsocsH5.direct_beam(entries[0])
channelsPerDegree = xsocsH5.chan_per_deg(entries[0])
else: # This should not happen
beamEnergy = ''
directBeam = '', ''
channelsPerDegree = '', ''
beamEnergies = [xsocsH5.beam_energy(entry) for entry in entries]
self.__paramsWid = ConversionParamsWidget(
medfiltDims=self.__converter.medfilt_dims,
normalizers=xsocsH5.normalizers(),
beamEnergy=beamEnergy,
beamEnergies=beamEnergies,
directBeam=directBeam,
channelsPerDegree=channelsPerDegree)
self.__paramsWid.setNormalizer(normalizer)
......@@ -647,7 +651,7 @@ class QSpaceWidget(Qt.QDialog):
img_size=xsocsH5.image_size(entry),
center_chan=xsocsH5.direct_beam(entry),
chan_per_deg=xsocsH5.chan_per_deg(entry),
beam_energy=xsocsH5.beam_energy(entry),
beam_energy=beamEnergies,
phi=phi,
eta=eta,
nu=nu,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment