Commit 4f359bef authored by ssomnath's avatar ssomnath
Browse files

Moving parm standardization to common area

parent e5eac3d7
......@@ -155,7 +155,18 @@ class BEodfTranslator(Translator):
print('\treading parameters from text file')
isBEPS, parm_dict = parmsToDict(path_dict['parm_txt'])
# Initial text files named some parameters differently
elif 'old_mat_parms' in path_dict.keys():
if self._verbose:
print('\treading parameters from old mat file')
parm_dict = self._get_parms_from_old_mat(path_dict['old_mat_parms'], verbose=self._verbose)
if parm_dict['VS_steps_per_full_cycle'] == 0:
isBEPS=False
else:
isBEPS=True
else:
raise FileNotFoundError('No parameters file found! Cannot translate this dataset!')
# Initial text / mat files named some parameters differently
if parm_dict['VS_mode'] == 'AC modulation mode':
warn('Updating parameter "VS_mode" from invalid value'
' of "AC modulation mode" to "AC modulation mode with '
......@@ -164,7 +175,7 @@ class BEodfTranslator(Translator):
if parm_dict['BE_phase_content'] == 'chirp':
warn('Updating parameter "BE_phase_content" from older value'
' of "chirp" to "chirp-sinc hybrid"')
parm_dict['BE_phase_content'] ='chirp-sinc hybrid'
parm_dict['BE_phase_content'] = 'chirp-sinc hybrid'
if parm_dict['BE_amplitude_[V]'] < 1E-2:
new_val = 0.5151
warn('Updating parameter "BE_amplitude_[V]" from invalid value'
......@@ -172,17 +183,6 @@ class BEodfTranslator(Translator):
new_val))
parm_dict['BE_amplitude_[V]'] = new_val
elif 'old_mat_parms' in path_dict.keys():
if self._verbose:
print('\treading parameters from old mat file')
parm_dict = self._get_parms_from_old_mat(path_dict['old_mat_parms'], verbose=self._verbose)
if parm_dict['VS_steps_per_full_cycle'] == 0:
isBEPS=False
else:
isBEPS=True
else:
raise FileNotFoundError('No parameters file found! Cannot translate this dataset!')
if self._verbose:
keys = list(parm_dict.keys())
keys.sort()
......
Supports Markdown
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