Skip to content
Snippets Groups Projects
Commit 572745cf authored by MoritzThomasHuebner's avatar MoritzThomasHuebner
Browse files

Simplified some more

parent 6d269449
No related branches found
No related tags found
1 merge request!124Simplify wg redundant code
......@@ -122,15 +122,16 @@ class WaveformGenerator(object):
def _strain_from_model(self, model_data_points, model):
self.__full_source_model_keyword_arguments.update(self.parameters)
return model(model_data_points, **self.__full_source_model_keyword_arguments)
strain = model(model_data_points, **self.__full_source_model_keyword_arguments)
if isinstance(strain, np.ndarray):
return strain
else:
raise TypeError("The model return value should be of type numpy.ndarray, but actually was {}"
.format(type(transformed_model_strain)))
def _strain_from_transformed_model(self, transformed_model_data_points, transformed_model, transformation_function):
transformed_model_strain = self._strain_from_model(transformed_model_data_points, transformed_model)
if isinstance(transformed_model_strain, np.ndarray):
model_strain = transformation_function(transformed_model_strain, self.sampling_frequency)
else:
raise TypeError("Strain should be of tupe numpy.ndarray, but actually was {}"
.format(type(transformed_model_strain)))
model_strain = transformation_function(transformed_model_strain, self.sampling_frequency)
for key in transformed_model_strain:
if transformation_function == utils.nfft:
model_strain[key], self.frequency_array = \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment