Skip to content

Commit 98053f4

Browse files
committed
switched the log_delta_q parameter in the first place so the variable name is accurate
1 parent a2b169e commit 98053f4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sasmodels/resolution.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -510,20 +510,20 @@ def geometric_extrapolation(q, q_min, q_max, points_per_decade=None):
510510
data_min, data_max = q[0], q[-1]
511511
if points_per_decade is None:
512512
if data_max > data_min:
513-
log_delta_q = (len(q) - 1) / (log(data_max) - log(data_min))
513+
log_delta_q = (log(data_max) - log(data_min)) / (len(q) - 1)
514514
else:
515-
log_delta_q = DEFAULT_POINTS_PER_DECADE / log(10.)
515+
log_delta_q = log(10.) / DEFAULT_POINTS_PER_DECADE
516516
else:
517-
log_delta_q = points_per_decade / log(10.)
517+
log_delta_q = log(10.) / points_per_decade
518518
if q_min < data_min:
519519
if q_min < 0:
520520
q_min = data_min*MINIMUM_ABSOLUTE_Q
521-
n_low = int(np.ceil(log_delta_q * (log(q[0])-log(q_min))))
521+
n_low = int(np.ceil((log(q[0])-log(q_min)) / log_delta_q))
522522
q_low = np.logspace(log10(q_min), log10(q[0]), n_low+1)[:-1]
523523
else:
524524
q_low = []
525525
if q_max > data_max:
526-
n_high = int(np.ceil(log_delta_q * (log(q_max)-log(data_max))))
526+
n_high = int(np.ceil((log(q_max)-log(data_max)) / log_delta_q))
527527
q_high = np.logspace(log10(data_max), log10(q_max), n_high+1)[1:]
528528
else:
529529
q_high = []

0 commit comments

Comments
 (0)