Commit 45cab2ca authored by Unknown's avatar Unknown
Browse files

More PEP8

parent df724721
......@@ -624,9 +624,9 @@ class BELoopModel(Model):
# step 5: Move the voltage dimension to the first dim
order_dc_outside_nd = [self._dc_offset_index] + list(range(self._dc_offset_index)) + \
list(range(self._dc_offset_index + 1, len(fit_nd.shape)))
list(range(self._dc_offset_index + 1, len(fit_nd.shape)))
order_dc_offset_reverse = list(range(1, self._dc_offset_index + 1)) + [0] + \
list(range(self._dc_offset_index + 1, len(fit_nd.shape)))
list(range(self._dc_offset_index + 1, len(fit_nd.shape)))
fit_nd2 = np.transpose(fit_nd, tuple(order_dc_outside_nd))
dim_names_dc_out = dim_names_orig[order_dc_outside_nd]
if verbose:
......@@ -946,7 +946,7 @@ class BELoopModel(Model):
self.data = None
guess = self.h5_guess[self._start_pos:self._end_pos,
self._current_met_spec_slice].reshape([-1, 1])
self._current_met_spec_slice].reshape([-1, 1])
self.guess = compound_to_scalar(guess)[:, :-1]
def _create_guess_datasets(self):
......
......@@ -208,7 +208,7 @@ def getIndicesforPlotGroup(h5_udvs_inds, ds_udvs, plt_grp_name):
step_bin_indices[indx, :] = np.where(spec_ind_udvs_step_col == step)[0]
oneD_indices = step_bin_indices.reshape((step_bin_indices.shape[0] * step_bin_indices.shape[1]))
return (step_bin_indices, oneD_indices, udvs_plt_grp_col)
return step_bin_indices, oneD_indices, udvs_plt_grp_col
def reshapeToOneStep(raw_mat, num_steps):
......
......@@ -311,7 +311,7 @@ class BEodfRelaxationTranslator(Translator):
for pix_ind in range(num_pix):
print('Reading pixel #{}, file position {}'.format(pix_ind, hex(pix_ind * bytes_per_pix)))
pix_vec = np.fromstring(f_real.read(int(bytes_per_pix)), dtype='f') + \
1j * np.fromstring(f_imag.read(int(bytes_per_pix)), dtype='f')
1j * np.fromstring(f_imag.read(int(bytes_per_pix)), dtype='f')
# Make chronologically correct
pix_mat = np.reshape(pix_vec, (parm_dict['BE_bins_per_read'],
......
......@@ -194,11 +194,11 @@ class BEPSndfTranslator(Translator):
for prsr in parsers:
wave_type = prsr.get_wave_type()
if self.parm_dict['VS_mode'] == 'AC modulation mode with time reversal' and \
self.BE_bin_inds is not None:
if np.sign(wave_type) == -1:
bin_fft = self.BE_wave[self.BE_bin_inds]
elif np.sign(wave_type) == 1:
bin_fft = self.BE_wave_rev[self.BE_bin_inds]
self.BE_bin_inds is not None:
if np.sign(wave_type) == -1:
bin_fft = self.BE_wave[self.BE_bin_inds]
elif np.sign(wave_type) == 1:
bin_fft = self.BE_wave_rev[self.BE_bin_inds]
else:
bin_fft = None
......@@ -258,7 +258,7 @@ class BEPSndfTranslator(Translator):
ds_pos_ind = MicroDataset('Position_Indices',
self.pos_mat[self.ds_pixel_start_indx:self.ds_pixel_start_indx +
self.ds_pixel_index, :],
self.ds_pixel_index, :],
dtype=np.uint)
ds_pos_ind.attrs['labels'] = pos_slice_dict
......@@ -283,7 +283,7 @@ class BEPSndfTranslator(Translator):
self.pos_vals_list[:, 2] *= 1E+6 # convert to microns
pos_val_mat = np.float32(self.pos_mat[self.ds_pixel_start_indx:self.ds_pixel_start_indx +
self.ds_pixel_index, :])
self.ds_pixel_index, :])
for col_ind, targ_dim_name in enumerate(['X', 'Y', 'Z']):
if targ_dim_name in self.pos_labels:
......
......@@ -369,9 +369,11 @@ def apply_find(file_path_h5, file_name_h5, file_path_png, file_name_png, filter_
for k1 in range(-filter_width, filter_width + 1):
for k2 in range(-filter_width, filter_width + 1):
mat_large[filter_width - k1:-(filter_width + k1) - 1,
filter_width - k2:-(filter_width + k2) - 1] = np.minimum(mat_large[filter_width - k1:-filter_width - k1 - 1,
filter_width - k2:-filter_width - k2 - 1],
h5_image)
filter_width - k2:-(filter_width + k2) - 1] = np.minimum(mat_large[filter_width - k1:
-filter_width - k1 - 1,
filter_width - k2:
-filter_width - k2 - 1],
h5_image)
deconv_mat_temp = mat_large[filter_width:len(mat_larg[1, :]) - filter_width,
filter_width:len(mat_larg[:, 1]) - filter_width]
......
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