Changeset 3657667 in sasview for sanscalculator/src/sans
- Timestamp:
- Jan 12, 2013 2:45:21 PM (12 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 5917637
- Parents:
- 3540156
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sanscalculator/src/sans/calculator/sans_gen.py
r3540156 r3657667 8 8 import numpy 9 9 import os 10 import copy 10 11 11 12 MFactor_AM = 2.853E-12 … … 52 53 self.data_mz = None 53 54 self.data_vol = None #[A^3] 55 self.is_avg = False 54 56 ## Name of the model 55 57 self.name = "GenSAS" … … 58 60 self.params['scale'] = 1.0 59 61 self.params['background'] = 0.0 62 self.params['solvent_SLD'] = 0.0 60 63 self.params['Up_frac_in'] = 0.5 61 64 self.params['Up_frac_out'] = 0.5 … … 66 69 self.details['scale'] = ['', None, None] 67 70 self.details['background'] = ['[1/cm]', None, None] 71 self.details['solvent_SLD'] = ['1/A^(2)', None, None] 68 72 self.details['Up_frac_in'] = ['[u/(u+d)]', None, None] 69 73 self.details['Up_frac_out'] = ['[u/(u+d)]', None, None] … … 80 84 raise 81 85 self.data_vol = volume 82 86 87 def set_is_avg(self, is_avg=False): 88 """ 89 Sets is_avg: [bool] 90 """ 91 self.is_avg = is_avg 92 83 93 def _gen(self, x, y, i): 84 94 """ … … 90 100 """ 91 101 len_x = len(self.data_x) 102 if self.is_avg: 103 len_x *= -1 92 104 len_q = len(x) 105 sldn = copy.deepcopy(self.data_sldn) 106 sldn -= self.params['solvent_SLD'] 93 107 model = mod.new_GenI(len_x, self.data_x, self.data_y, self.data_z, 94 s elf.data_sldn, self.data_mx, self.data_my,108 sldn, self.data_mx, self.data_my, 95 109 self.data_mz, self.data_vol, 96 110 self.params['Up_frac_in'],
Note: See TracChangeset
for help on using the changeset viewer.