Changeset 3657667 in sasview for sanscalculator/src


Ignore:
Timestamp:
Jan 12, 2013 2:45:21 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

Added arbitrary orientation for pdb atomic data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sanscalculator/src/sans/calculator/sans_gen.py

    r3540156 r3657667  
    88import numpy 
    99import os 
     10import copy 
    1011 
    1112MFactor_AM = 2.853E-12 
     
    5253        self.data_mz = None 
    5354        self.data_vol = None #[A^3] 
     55        self.is_avg = False 
    5456        ## Name of the model 
    5557        self.name = "GenSAS" 
     
    5860        self.params['scale']       = 1.0 
    5961        self.params['background']  = 0.0 
     62        self.params['solvent_SLD']     = 0.0 
    6063        self.params['Up_frac_in']     = 0.5 
    6164        self.params['Up_frac_out']    = 0.5 
     
    6669        self.details['scale']      = ['', None, None] 
    6770        self.details['background'] = ['[1/cm]', None, None] 
     71        self.details['solvent_SLD']    = ['1/A^(2)', None, None] 
    6872        self.details['Up_frac_in']    = ['[u/(u+d)]', None, None] 
    6973        self.details['Up_frac_out']   = ['[u/(u+d)]', None, None] 
     
    8084            raise 
    8185        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           
    8393    def _gen(self, x, y, i): 
    8494        """ 
     
    90100        """ 
    91101        len_x = len(self.data_x) 
     102        if self.is_avg: 
     103            len_x *= -1 
    92104        len_q = len(x) 
     105        sldn = copy.deepcopy(self.data_sldn) 
     106        sldn -= self.params['solvent_SLD'] 
    93107        model = mod.new_GenI(len_x, self.data_x, self.data_y, self.data_z,  
    94                              self.data_sldn, self.data_mx, self.data_my,  
     108                             sldn, self.data_mx, self.data_my,  
    95109                             self.data_mz, self.data_vol, 
    96110                             self.params['Up_frac_in'],  
Note: See TracChangeset for help on using the changeset viewer.