Changeset 0d26e91 in sasmodels for sasmodels/resolution.py
- Timestamp:
- Mar 6, 2019 3:44:39 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 15f5138
- Parents:
- da3638f (diff), e589e9a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Paul Kienzle <pkienzle@…> (03/06/19 15:44:39)
- git-committer:
- GitHub <noreply@…> (03/06/19 15:44:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/resolution.py
rda3638f r0d26e91 445 445 q = np.sort(q) 446 446 if q_min + 2*MINIMUM_RESOLUTION < q[0]: 447 n_low = np.ceil((q[0]-q_min) / (q[1]-q[0])) if q[1] > q[0] else 15448 q_low = np.linspace(q_min, q[0], int(n_low)+1)[:-1]447 n_low = int(np.ceil((q[0]-q_min) / (q[1]-q[0]))) if q[1] > q[0] else 15 448 q_low = np.linspace(q_min, q[0], n_low+1)[:-1] 449 449 else: 450 450 q_low = [] 451 451 if q_max - 2*MINIMUM_RESOLUTION > q[-1]: 452 n_high = np.ceil((q_max-q[-1]) / (q[-1]-q[-2])) if q[-1] > q[-2] else 15453 q_high = np.linspace(q[-1], q_max, int(n_high)+1)[1:]452 n_high = int(np.ceil((q_max-q[-1]) / (q[-1]-q[-2]))) if q[-1] > q[-2] else 15 453 q_high = np.linspace(q[-1], q_max, n_high+1)[1:] 454 454 else: 455 455 q_high = [] … … 498 498 if q_min < 0: 499 499 q_min = q[0]*MINIMUM_ABSOLUTE_Q 500 n_low = np.ceil(log_delta_q * (log(q[0])-log(q_min)))501 q_low = np.logspace(log10(q_min), log10(q[0]), int(n_low)+1)[:-1]500 n_low = int(np.ceil(log_delta_q * (log(q[0])-log(q_min)))) 501 q_low = np.logspace(log10(q_min), log10(q[0]), n_low+1)[:-1] 502 502 else: 503 503 q_low = [] 504 504 if q_max > q[-1]: 505 n_high = np.ceil(log_delta_q * (log(q_max)-log(q[-1])))506 q_high = np.logspace(log10(q[-1]), log10(q_max), int(n_high)+1)[1:]505 n_high = int(np.ceil(log_delta_q * (log(q_max)-log(q[-1])))) 506 q_high = np.logspace(log10(q[-1]), log10(q_max), n_high+1)[1:] 507 507 else: 508 508 q_high = []
Note: See TracChangeset
for help on using the changeset viewer.