Changeset e0ebd56 in sasview for src


Ignore:
Timestamp:
May 18, 2017 12:07:12 PM (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:
9e2535e
Parents:
8e15dce
git-author:
Jeff Krzywon <krzywon@…> (05/18/17 12:07:12)
git-committer:
krzywon <krzywon@…> (05/18/17 12:07:12)
Message:

Revert changes to manipulations.py to minimize conflicts with log_binning branch.

File:
1 edited

Legend:

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

    r8e15dce re0ebd56  
    430430            z_max = max(data2D.q_data) 
    431431            z_min = min(data2D.q_data) 
    432             dqx_at_z_max = data2D.dqx_data[np.argmax(data2D.q_data)] 
    433             dqx_at_z_min = data2D.dqx_data[np.argmin(data2D.q_data)] 
    434             dqy_at_z_max = data2D.dqy_data[np.argmax(data2D.q_data)] 
    435             dqy_at_z_min = data2D.dqy_data[np.argmin(data2D.q_data)] 
     432            x_max = data2D.dqx_data[data2D.q_data[z_max]] 
     433            x_min = data2D.dqx_data[data2D.q_data[z_min]] 
     434            y_max = data2D.dqy_data[data2D.q_data[z_max]] 
     435            y_min = data2D.dqy_data[data2D.q_data[z_min]] 
    436436            # Find qdx at q = 0 
    437             dq_overlap_x = ((dqx_at_z_min * z_max - dqx_at_z_max * z_min) / 
     437            dq_overlap_x = ((x_min * z_max - x_max * z_min) / 
    438438                            (z_max - z_min)) 
    439439            # when extrapolation goes wrong 
     
    442442            dq_overlap_x *= dq_overlap_x 
    443443            # Find qdx at q = 0 
    444             dq_overlap_y = ((dqy_at_z_min * z_max - dqy_at_z_max * z_min) / 
     444            dq_overlap_y = ((y_min * z_max - y_max * z_min) / 
    445445                            (z_max - z_min)) 
    446446            # when extrapolation goes wrong 
     
    453453            # Final protection of dq 
    454454            if dq_overlap < 0: 
    455                 dq_overlap = dqy_at_z_min 
     455                dq_overlap = y_min 
    456456            dqx_data = data2D.dqx_data[np.isfinite(data2D.data)] 
    457457            dqy_data = data2D.dqy_data[np.isfinite(data2D.data)] - dq_overlap 
     
    787787            z_max = max(data2D.q_data) 
    788788            z_min = min(data2D.q_data) 
    789             dqx_at_z_max = data2D.dqx_data[np.argmax(data2D.q_data)] 
    790             dqx_at_z_min = data2D.dqx_data[np.argmin(data2D.q_data)] 
    791             dqy_at_z_max = data2D.dqy_data[np.argmax(data2D.q_data)] 
    792             dqy_at_z_min = data2D.dqy_data[np.argmin(data2D.q_data)] 
     789            x_max = data2D.dqx_data[data2D.q_data[z_max]] 
     790            x_min = data2D.dqx_data[data2D.q_data[z_min]] 
     791            y_max = data2D.dqy_data[data2D.q_data[z_max]] 
     792            y_min = data2D.dqy_data[data2D.q_data[z_min]] 
    793793            # Find qdx at q = 0 
    794             dq_overlap_x = ((dqx_at_z_min * z_max - dqx_at_z_max * z_min) / 
     794            dq_overlap_x = ((x_min * z_max - x_max * z_min) / 
    795795                            (z_max - z_min)) 
    796796            # when extrapolation goes wrong 
     
    799799            dq_overlap_x *= dq_overlap_x 
    800800            # Find qdx at q = 0 
    801             dq_overlap_y = ((dqy_at_z_min * z_max - dqy_at_z_max * z_min) / 
     801            dq_overlap_y = ((y_min * z_max - y_max * z_min) / 
    802802                            (z_max - z_min)) 
    803803            # when extrapolation goes wrong 
     
    809809            dq_overlap = np.sqrt((dq_overlap_x + dq_overlap_y) / 2.0) 
    810810            if dq_overlap < 0: 
    811                 dq_overlap = dqy_at_z_min 
     811                dq_overlap = y_min 
    812812            dqx_data = data2D.dqx_data[np.isfinite(data2D.data)] 
    813813            dqy_data = data2D.dqy_data[np.isfinite(data2D.data)] - dq_overlap 
Note: See TracChangeset for help on using the changeset viewer.