Changeset 324e0bf in sasview for src/sas/sascalc/dataloader


Ignore:
Timestamp:
May 19, 2017 9:41:37 AM (8 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
edc7852
Parents:
8de66b6
Message:

Support numpy v1.12 - integer indices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/manipulations.py

    r46cd1c3 r324e0bf  
    199199    z_max = max(data2D.q_data) 
    200200    z_min = min(data2D.q_data) 
    201     x_max = data2D.dqx_data[data2D.q_data[z_max]] 
    202     x_min = data2D.dqx_data[data2D.q_data[z_min]] 
    203     y_max = data2D.dqy_data[data2D.q_data[z_max]] 
    204     y_min = data2D.dqy_data[data2D.q_data[z_min]] 
     201    dqx_at_z_max = data2D.dqx_data[np.argmax(data2D.q_data)] 
     202    dqx_at_z_min = data2D.dqx_data[np.argmin(data2D.q_data)] 
     203    dqy_at_z_max = data2D.dqy_data[np.argmax(data2D.q_data)] 
     204    dqy_at_z_min = data2D.dqy_data[np.argmin(data2D.q_data)] 
    205205    # Find qdx at q = 0 
    206     dq_overlap_x = (x_min * z_max - x_max * z_min) / (z_max - z_min) 
     206    dq_overlap_x = (dqx_at_z_min * z_max - dqx_at_z_max * z_min) / (z_max - z_min) 
    207207    # when extrapolation goes wrong 
    208208    if dq_overlap_x > min(data2D.dqx_data): 
     
    210210    dq_overlap_x *= dq_overlap_x 
    211211    # Find qdx at q = 0 
    212     dq_overlap_y = (y_min * z_max - y_max * z_min) / (z_max - z_min) 
     212    dq_overlap_y = (dqy_at_z_min * z_max - dqy_at_z_max * z_min) / (z_max - z_min) 
    213213    # when extrapolation goes wrong 
    214214    if dq_overlap_y > min(data2D.dqy_data): 
     
    220220    # Final protection of dq 
    221221    if dq_overlap < 0: 
    222         dq_overlap = y_min 
     222        dq_overlap = dqy_at_z_min 
    223223    dqx_data = data2D.dqx_data[np.isfinite(data2D.data)] 
    224224    dqy_data = data2D.dqy_data[np.isfinite( 
Note: See TracChangeset for help on using the changeset viewer.