Changeset afd45674 in sasview for sanscalculator/src/sans


Ignore:
Timestamp:
Jan 18, 2013 6:05:38 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:
afcb052
Parents:
1c6c1b7
Message:

Added total volume param in the sasgen model

File:
1 edited

Legend:

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

    rcd89c6f rafd45674  
    6161        self.params['background']  = 0.0 
    6262        self.params['solvent_SLD']     = 0.0 
     63        self.params['total_volume'] = 1.0 
    6364        self.params['Up_frac_in']     = 1.0 
    6465        self.params['Up_frac_out']    = 1.0 
     
    7071        self.details['background'] = ['[1/cm]', None, None] 
    7172        self.details['solvent_SLD']    = ['1/A^(2)', None, None] 
     73        self.details['total_volume']    = ['A^(3)', None, None] 
    7274        self.details['Up_frac_in']    = ['[u/(u+d)]', None, None] 
    7375        self.details['Up_frac_out']   = ['[u/(u+d)]', None, None] 
     
    113115 
    114116        mod.genicom(model, len_q, x, y, i) 
    115         return  self.params['scale'] * i + self.params['background'] 
     117        vol_correction = self.data_total_volume / self.params['total_volume'] 
     118        return  self.params['scale'] * vol_correction * i + \ 
     119                        self.params['background'] 
    116120         
    117121    def set_sld_data(self, sld_data=None):    
     
    129133        self.data_mz = sld_data.sld_mz 
    130134        self.data_vol = sld_data.vol_pix 
     135        self.data_total_volume = sum(sld_data.vol_pix) 
     136        self.params['total_volume'] = sum(sld_data.vol_pix) 
    131137         
    132138    def getProfile(self): 
Note: See TracChangeset for help on using the changeset viewer.