Changeset 4cbaf35 in sasview


Ignore:
Timestamp:
Jan 7, 2010 5:00:43 PM (15 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:
c451be9
Parents:
4d270706
Message:

corrected problems in parameters called from Wrapper

Location:
sansmodels/src/sans/models
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/BinaryHSModel.py

    rfe9c19b4 r4cbaf35  
    3636         vol_frac_ls     = 0.1  
    3737         vol_frac_ss     = 0.2  
     38         ls_sld          = 3.5e-006 [1/A^(2)] 
     39         ss_sld          = 5e-007 [1/A^(2)] 
     40         solvent_sld     = 6.36e-006 [1/A^(2)] 
     41         background      = 0.001 [1/cm] 
    3842 
    3943    """ 
     
    6468        self.details['vol_frac_ls'] = ['', None, None] 
    6569        self.details['vol_frac_ss'] = ['', None, None] 
     70        self.details['ls_sld'] = ['[1/A^(2)]', None, None] 
     71        self.details['ss_sld'] = ['[1/A^(2)]', None, None] 
     72        self.details['solvent_sld'] = ['[1/A^(2)]', None, None] 
     73        self.details['background'] = ['[1/cm]', None, None] 
    6674 
    6775        ## fittable parameters 
     
    7785    def __getstate__(self): 
    7886        """ return object state for pickling and copying """ 
    79         print "__dict__",self.__dict__ 
    80         #self.__dict__['params'] = self.params 
    81         #self.__dict__['dispersion'] = self.dispersion 
    82         #self.__dict__['log'] = self.log 
    8387        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    8488         
  • sansmodels/src/sans/models/BinaryHSPSF11Model.py

    rfe9c19b4 r4cbaf35  
    8888    def __getstate__(self): 
    8989        """ return object state for pickling and copying """ 
    90         print "__dict__",self.__dict__ 
    91         #self.__dict__['params'] = self.params 
    92         #self.__dict__['dispersion'] = self.dispersion 
    93         #self.__dict__['log'] = self.log 
    9490        model_state = {'params': self.params, 'dispersion': self.dispersion, 'log': self.log} 
    9591         
  • sansmodels/src/sans/models/c_extensions/binaryHS.h

    r27972c1d r4cbaf35  
    3838 
    3939        ///     large sphere scattering length density [1/A^(2)] 
    40     //  [DEFAULT]=ls_sld= 3.5e-6 [1/A^{2}] 
     40    //  [DEFAULT]=ls_sld= 3.5e-6 [1/A^(2)] 
    4141    double ls_sld; 
    4242 
  • sansmodels/src/sans/models/c_models/CBinaryHSModel.cpp

    r71e2de7 r4cbaf35  
    9090         
    9191        // Initialize parameter dictionary 
     92        PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.100000)); 
     93        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000)); 
     94        PyDict_SetItemString(self->params,"vol_frac_ss",Py_BuildValue("d",0.200000)); 
     95        PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000006)); 
     96        PyDict_SetItemString(self->params,"ls_sld",Py_BuildValue("d",0.000003)); 
     97        PyDict_SetItemString(self->params,"ss_sld",Py_BuildValue("d",0.000000)); 
    9298        PyDict_SetItemString(self->params,"s_radius",Py_BuildValue("d",25.000000)); 
    93         PyDict_SetItemString(self->params,"vol_frac_ss",Py_BuildValue("d",0.200000)); 
    9499        PyDict_SetItemString(self->params,"l_radius",Py_BuildValue("d",100.000000)); 
    95         PyDict_SetItemString(self->params,"vol_frac_ls",Py_BuildValue("d",0.100000)); 
    96100        // Initialize dispersion / averaging parameter dict 
    97101        DispersionVisitor* visitor = new DispersionVisitor(); 
     
    234238         
    235239            // Reader parameter dictionary 
     240    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
     241    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
     242    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
     243    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 
     244    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") ); 
     245    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") ); 
    236246    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") ); 
    237     self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
    238247    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") ); 
    239     self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
    240248    // Read in dispersion parameters 
    241249    PyObject* disp_dict; 
     
    307315         
    308316            // Reader parameter dictionary 
     317    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
     318    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
     319    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
     320    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 
     321    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") ); 
     322    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") ); 
    309323    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") ); 
    310     self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
    311324    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") ); 
    312     self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
    313325    // Read in dispersion parameters 
    314326    PyObject* disp_dict; 
     
    367379         
    368380            // Reader parameter dictionary 
     381    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
     382    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
     383    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
     384    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 
     385    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") ); 
     386    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") ); 
    369387    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") ); 
    370     self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
    371388    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") ); 
    372     self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
    373389    // Read in dispersion parameters 
    374390    PyObject* disp_dict; 
     
    396412         
    397413            // Reader parameter dictionary 
     414    self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
     415    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
     416    self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
     417    self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 
     418    self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") ); 
     419    self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") ); 
    398420    self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") ); 
    399     self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 
    400421    self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") ); 
    401     self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 
    402422    // Read in dispersion parameters 
    403423    PyObject* disp_dict; 
Note: See TracChangeset for help on using the changeset viewer.