Ignore:
Timestamp:
Apr 4, 2017 12:50:04 PM (8 years ago)
Author:
Ricardo Ferraz Leal <ricleal@…>
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:
f2940c4
Parents:
463e7ffc (diff), 1779e72 (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.
Message:

After merge conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/resolution_calculator.py

    r463e7ffc r9c0f3c17  
    1212from math import sqrt 
    1313import math 
    14 import numpy 
     14import numpy as np 
    1515import sys 
    1616import logging 
     
    395395        dx_size = (self.qx_max - self.qx_min) / (1000 - 1) 
    396396        dy_size = (self.qy_max - self.qy_min) / (1000 - 1) 
    397         x_val = numpy.arange(self.qx_min, self.qx_max, dx_size) 
    398         y_val = numpy.arange(self.qy_max, self.qy_min, -dy_size) 
    399         q_1, q_2 = numpy.meshgrid(x_val, y_val) 
     397        x_val = np.arange(self.qx_min, self.qx_max, dx_size) 
     398        y_val = np.arange(self.qy_max, self.qy_min, -dy_size) 
     399        q_1, q_2 = np.meshgrid(x_val, y_val) 
    400400        #q_phi = numpy.arctan(q_1,q_2) 
    401401        # check whether polar or cartesian 
     
    889889        x_value = x_val - x0_val 
    890890        y_value = y_val - y0_val 
    891         phi_i = numpy.arctan2(y_val, x_val) 
     891        phi_i = np.arctan2(y_val, x_val) 
    892892 
    893893        # phi correction due to the gravity shift (in phi) 
     
    895895        phi_i = phi_i - phi_0 + self.gravity_phi 
    896896 
    897         sin_phi = numpy.sin(self.gravity_phi) 
    898         cos_phi = numpy.cos(self.gravity_phi) 
     897        sin_phi = np.sin(self.gravity_phi) 
     898        cos_phi = np.cos(self.gravity_phi) 
    899899 
    900900        x_p = x_value * cos_phi + y_value * sin_phi 
     
    910910        nu_value = -0.5 * (new_x * new_x + new_y * new_y) 
    911911 
    912         gaussian = numpy.exp(nu_value) 
     912        gaussian = np.exp(nu_value) 
    913913        # normalizing factor correction 
    914914        gaussian /= gaussian.sum() 
     
    956956            nu_value *= nu_value 
    957957            nu_value *= -0.5 
    958             gaussian *= numpy.exp(nu_value) 
     958            gaussian *= np.exp(nu_value) 
    959959            gaussian /= sigma 
    960960            # normalize 
     
    10281028                                                           offset_x, offset_y) 
    10291029        # distance [cm] from the beam center on detector plane 
    1030         detector_ind_x = numpy.arange(detector_pix_nums_x) 
    1031         detector_ind_y = numpy.arange(detector_pix_nums_y) 
     1030        detector_ind_x = np.arange(detector_pix_nums_x) 
     1031        detector_ind_y = np.arange(detector_pix_nums_y) 
    10321032 
    10331033        # shif 0.5 pixel so that pix position is at the center of the pixel 
     
    10431043        detector_ind_y = detector_ind_y * pix_y_size 
    10441044 
    1045         qx_value = numpy.zeros(len(detector_ind_x)) 
    1046         qy_value = numpy.zeros(len(detector_ind_y)) 
     1045        qx_value = np.zeros(len(detector_ind_x)) 
     1046        qy_value = np.zeros(len(detector_ind_y)) 
    10471047        i = 0 
    10481048 
     
    10631063 
    10641064        # p min and max values among the center of pixels 
    1065         self.qx_min = numpy.min(qx_value) 
    1066         self.qx_max = numpy.max(qx_value) 
    1067         self.qy_min = numpy.min(qy_value) 
    1068         self.qy_max = numpy.max(qy_value) 
     1065        self.qx_min = np.min(qx_value) 
     1066        self.qx_max = np.max(qx_value) 
     1067        self.qy_min = np.min(qy_value) 
     1068        self.qy_max = np.max(qy_value) 
    10691069 
    10701070        # Appr. min and max values of the detector display limits 
     
    10901090            from sas.sascalc.dataloader.data_info import Data2D 
    10911091            output = Data2D() 
    1092             inten = numpy.zeros_like(qx_value) 
     1092            inten = np.zeros_like(qx_value) 
    10931093            output.data = inten 
    10941094            output.qx_data = qx_value 
     
    11091109        plane_dist = dx_size 
    11101110        # full scattering angle on the x-axis 
    1111         theta = numpy.arctan(plane_dist / det_dist) 
    1112         qx_value = (2.0 * pi / wavelength) * numpy.sin(theta) 
     1111        theta = np.arctan(plane_dist / det_dist) 
     1112        qx_value = (2.0 * pi / wavelength) * np.sin(theta) 
    11131113        return qx_value 
    11141114 
Note: See TracChangeset for help on using the changeset viewer.