Commit 482160e0 authored by Thomas Vincent's avatar Thomas Vincent

unroll unwanted changes

parent 5ab1f07b
......@@ -44,7 +44,6 @@ img_base = '/path/to/img/dir/'
# the beam energy (note that this value can be changed later when calling the
# img_2_qpeak function)
# Set to None to read it from scan headers
beam_energy = 8000.
# merge_scan_data will take all scans from the spec file that have a matching
......
......@@ -154,11 +154,6 @@ class AcqParamsWidget(Qt.QWidget):
self.__chpdeg_h_edit.clear()
self.__chpdeg_v_edit.clear()
@property
def beamEnergyEditor(self):
"""Beam energy editor widget (QLineEdit)"""
return self.__beam_nrg_edit
@property
def beam_energy(self):
text = self.__beam_nrg_edit.text()
......
......@@ -147,14 +147,6 @@ class KmapMerger(object):
self.__thread = None
self.beam_energy = None
"""Beam energy in eV to set for all scans.
If None (the default) the energy is read from SPEC for each scan.
Union[float,None]
"""
self.prefix = None
self.__set_status(self.READY)
......@@ -274,22 +266,13 @@ class KmapMerger(object):
results = {}
self.__proc_indices = {}
for proc_idx, (scan_id, infos) in enumerate(scans.items()):
# Get beam energy
if self.beam_energy is not None: # Use forced beam energy
beam_energy = self.beam_energy
else: # Read beam energy from each scan header
nrj_kev = self.get_calibration(scan_id).get('mononrj', None)
if nrj_kev is None:
raise RuntimeError("Cannot read beam energy")
beam_energy = nrj_kev * 1000. # From keV to eV
args = (scan_id,
proc_idx,
self.__spec_h5,
self.__output_dir,
infos['output'],
infos['image'],
beam_energy,
self.beam_energy,
self.chan_per_deg,
self.center_chan,
self.compression,
......@@ -482,6 +465,8 @@ class KmapMerger(object):
def check_parameters(self):
errors = []
if self.beam_energy is None:
errors.append('invalid "Beam energy"')
if self.output_dir is None:
errors.append('invalid "Output directory"')
if self.center_chan is None:
......@@ -490,6 +475,12 @@ class KmapMerger(object):
errors.append('invalid "Channel per degree"')
return errors
beam_energy = property(lambda self: self.__params['beam_energy'])
@beam_energy.setter
def beam_energy(self, beam_energy):
self.__params['beam_energy'] = float(beam_energy)
chan_per_deg = property(lambda self: self.__params['chan_per_deg'])
@chan_per_deg.setter
......
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