Changeset f2ea95a in sasview for src/sas/sascalc/calculator
- Timestamp:
- Jun 16, 2017 12:51:12 PM (8 years ago)
- 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 940d034, fca1f50
- Parents:
- c0ef8da (diff), d9c1551 (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. - Location:
- src/sas/sascalc/calculator
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/kiessig_calculator.py
rb699768 r235f514 49 49 return None 50 50 # check if delta_q is zero 51 if dq == 0.0 or dq ==None:51 if dq == 0.0 or dq is None: 52 52 return None 53 53 else: -
src/sas/sascalc/calculator/resolution_calculator.py
r9c0f3c17 r7432acb 608 608 a_value *= 1.0E-16 609 609 # if lamda is give (broad meanning of A) return 2* lamda^2 * A 610 if lamda !=None:610 if lamda is not None: 611 611 a_value *= (4 * lamda * lamda) 612 612 return a_value -
src/sas/sascalc/calculator/sas_gen.py
rd1bee3f rf2ea95a 3 3 SAS generic computation and sld file readers 4 4 """ 5 from __future__ import print_function 6 5 7 import sas.sascalc.calculator.core.sld2i as mod 6 8 from sas.sascalc.calculator.BaseComponent import BaseComponent … … 97 99 :Param volume: pixel volume [float] 98 100 """ 99 if self.data_vol ==None:101 if self.data_vol is None: 100 102 raise 101 103 self.data_vol = volume … … 119 121 pos_z = self.data_z 120 122 len_x = len(pos_x) 121 if self.is_avg ==None:123 if self.is_avg is None: 122 124 len_x *= -1 123 125 pos_x, pos_y, pos_z = transform_center(pos_x, pos_y, pos_z) … … 257 259 self.sld_n = np.zeros(length) 258 260 259 if omfdata.mx ==None:261 if omfdata.mx is None: 260 262 self.mx = np.zeros(length) 261 if omfdata.my ==None:263 if omfdata.my is None: 262 264 self.my = np.zeros(length) 263 if omfdata.mz ==None:265 if omfdata.mz is None: 264 266 self.mz = np.zeros(length) 265 267 … … 558 560 vol_pix = np.append(vol_pix, vol) 559 561 except: 560 print "Error: set the sld of %s to zero"% atom_name562 print("Error: set the sld of %s to zero"% atom_name) 561 563 sld_n = np.append(sld_n, 0.0) 562 564 sld_mx = np.append(sld_mx, 0) … … 609 611 Write 610 612 """ 611 print "Not implemented... "613 print("Not implemented... ") 612 614 613 615 class SLDReader(object): … … 691 693 output.set_pix_type('pixel') 692 694 output.set_pixel_symbols('pixel') 693 if vol_pix !=None:695 if vol_pix is not None: 694 696 output.set_pixel_volumes(vol_pix) 695 697 return output … … 703 705 :Param data: MagSLD data object 704 706 """ 705 if path ==None:707 if path is None: 706 708 raise ValueError, "Missing the file path." 707 if data ==None:709 if data is None: 708 710 raise ValueError, "Missing the data to save." 709 711 x_val = data.pos_x … … 713 715 length = len(x_val) 714 716 sld_n = data.sld_n 715 if sld_n ==None:717 if sld_n is None: 716 718 sld_n = np.zeros(length) 717 719 sld_mx = data.sld_mx 718 if sld_mx ==None:720 if sld_mx is None: 719 721 sld_mx = np.zeros(length) 720 722 sld_my = np.zeros(length) … … 867 869 self.sld_theta = None 868 870 self.pix_symbol = None 869 if sld_mx != None and sld_my != None and sld_mz !=None:871 if sld_mx is not None and sld_my is not None and sld_mz is not None: 870 872 self.set_sldms(sld_mx, sld_my, sld_mz) 871 873 self.set_nodes() … … 935 937 :Params pixel: str; pixel or atomic symbol, or array of strings 936 938 """ 937 if self.sld_n ==None:939 if self.sld_n is None: 938 940 return 939 941 if symbol.__class__.__name__ == 'str': … … 947 949 :Params pixel: str; pixel or atomic symbol, or array of strings 948 950 """ 949 if self.sld_n ==None:951 if self.sld_n is None: 950 952 return 951 953 if vol.__class__.__name__ == 'ndarray': … … 1044 1046 from mpl_toolkits.mplot3d import Axes3D 1045 1047 current_dir = os.path.abspath(os.path.curdir) 1046 print current_dir1048 print(current_dir) 1047 1049 for i in range(6): 1048 1050 current_dir, _ = os.path.split(current_dir)
Note: See TracChangeset
for help on using the changeset viewer.