Skip to content

Commit

Permalink
Merge pull request #70 from rmsare/parallelize-by-default
Browse files Browse the repository at this point in the history
Parallelize by default
  • Loading branch information
rmsare authored Apr 9, 2019
2 parents 29880ba + 9b34a47 commit eec4202
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions scarplet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ def calculate_best_fit_parameters_serial(dem,
for this_angle in orientations:
for this_age in ages:
this_amp, this_age, this_angle, this_snr = match_template(dem,
Template,
scale,
this_age,
this_angle,
**kwargs)
Template,
scale,
this_age,
this_angle,
**kwargs)

best_amp = numexpr.evaluate("(best_snr > this_snr)*best_amp + \
(best_snr < this_snr)*this_amp")
Expand Down Expand Up @@ -283,7 +283,13 @@ def match(data, Template, **kwargs):
if 'age' in kwargs:
results = calculate_best_fit_parameters(data, Template, **kwargs)
else:
results = calculate_best_fit_parameters_serial(data, Template, **kwargs)
ages = 10 ** np.arange(0, 3.5, 0.1)
ny, nx = data._griddata.shape
results = [calculate_best_fit_parameters(data,
Template,
age=age,
**kwargs) for age in ages]
results = compare(results, ny, nx)

return results

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="scarplet",
version="0.1.3",
version="0.1.4",
author=["Robert Sare", "George Hilley"],
author_email="[email protected]",
description="A Python package for topographic template matching",
Expand Down

0 comments on commit eec4202

Please sign in to comment.