Changeset 95986b5 in sasview
- Timestamp:
- Oct 29, 2008 1:58:33 PM (16 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:
- d7d143b0
- Parents:
- 92320e5
- Location:
- sansmodels/src/sans/models
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/CoreShellCylinderModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY core_shell_cylinder.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/core_shell_cylinder.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class CoreShellCylinderModel(CCoreShellCylinderModel, BaseComponent): 17 29 """ Class that evaluates a CoreShellCylinderModel model. 18 This file was auto-generated from core_shell_cylinder.h.30 This file was auto-generated from ../c_extensions/core_shell_cylinder.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 42 54 ## Name of the model 43 55 self.name = "CoreShellCylinderModel" 44 self.description ="""P(q,alpha)= scale/Vs*f(q)^(2) + bkg Where:\n\56 self.description ="""P(q,alpha)= scale/Vs*f(q)^(2) + bkg Where:\n\ 45 57 f(q)= 2(core_sld- solvant_sld)* Vc*sin[qLcos(alpha/2)]/\n\ 46 58 [qLcos(alpha/2)]*J1(qRsin(alpha))/[qRsin(alpha)] +\n 2(shell_sld-solvent_sld)*Vs … … 76 88 def clone(self): 77 89 """ Return a identical copy of self """ 78 obj = CoreShellCylinderModel() 79 obj.params = copy.deepcopy(self.params) 80 return obj 90 return self._clone(CoreShellCylinderModel()) 81 91 82 92 def run(self, x = 0.0): … … 95 105 96 106 return CCoreShellCylinderModel.runXY(self, x) 107 108 def set_dispersion(self, parameter, dispersion): 109 """ 110 Set the dispersion object for a model parameter 111 @param parameter: name of the parameter [string] 112 @dispersion: dispersion object of type DispersionModel 113 """ 114 return CCoreShellCylinderModel.set_dispersion(self, parameter, dispersion.cdisp) 115 97 116 98 117 # End of file -
sansmodels/src/sans/models/CoreShellModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY core_shell.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/core_shell.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class CoreShellModel(CCoreShellModel, BaseComponent): 17 29 """ Class that evaluates a CoreShellModel model. 18 This file was auto-generated from core_shell.h.30 This file was auto-generated from ../c_extensions/core_shell.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 39 51 ## Name of the model 40 52 self.name = "CoreShellModel" 41 self.description =""""""""53 self.description ="""""""" 42 54 ## Parameter details [units, min, max] 43 55 self.details = {} … … 53 65 def clone(self): 54 66 """ Return a identical copy of self """ 55 obj = CoreShellModel() 56 obj.params = copy.deepcopy(self.params) 57 return obj 67 return self._clone(CoreShellModel()) 58 68 59 69 def run(self, x = 0.0): … … 72 82 73 83 return CCoreShellModel.runXY(self, x) 84 85 def set_dispersion(self, parameter, dispersion): 86 """ 87 Set the dispersion object for a model parameter 88 @param parameter: name of the parameter [string] 89 @dispersion: dispersion object of type DispersionModel 90 """ 91 return CCoreShellModel.set_dispersion(self, parameter, dispersion.cdisp) 92 74 93 75 94 # End of file -
sansmodels/src/sans/models/CylinderModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY Cylinder.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/cylinder.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class CylinderModel(CCylinderModel, BaseComponent): 17 29 """ Class that evaluates a CylinderModel model. 18 This file was auto-generated from Cylinder.h.30 This file was auto-generated from ../c_extensions/cylinder.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 39 51 ## Name of the model 40 52 self.name = "CylinderModel" 41 self.description ="""P(q,alpha)= scale/V*f(q)^(2)+bkg53 self.description ="""P(q,alpha)= scale/V*f(q)^(2)+bkg 42 54 f(q)= 2*(scatter_sld - solvent_sld)*V*sin(qLcos(alpha/2))/[qLcos(alpha/2)]* 43 55 J1(qRsin(alpha/2))/[qRsin(alpha)] … … 62 74 def clone(self): 63 75 """ Return a identical copy of self """ 64 obj = CylinderModel() 65 obj.params = copy.deepcopy(self.params) 66 return obj 76 return self._clone(CylinderModel()) 67 77 68 78 def run(self, x = 0.0): … … 81 91 82 92 return CCylinderModel.runXY(self, x) 93 94 def set_dispersion(self, parameter, dispersion): 95 """ 96 Set the dispersion object for a model parameter 97 @param parameter: name of the parameter [string] 98 @dispersion: dispersion object of type DispersionModel 99 """ 100 return CCylinderModel.set_dispersion(self, parameter, dispersion.cdisp) 101 83 102 84 103 # End of file -
sansmodels/src/sans/models/EllipsoidModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY ellipsoid.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/ellipsoid.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class EllipsoidModel(CEllipsoidModel, BaseComponent): 17 29 """ Class that evaluates a EllipsoidModel model. 18 This file was auto-generated from ellipsoid.h.30 This file was auto-generated from ../c_extensions/ellipsoid.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 39 51 ## Name of the model 40 52 self.name = "EllipsoidModel" 41 self.description =""""P(q.alpha)= scale*f(q)^(2)+ bkg\n\53 self.description =""""P(q.alpha)= scale*f(q)^(2)+ bkg\n\ 42 54 f(q)= 3*(scatter_sld- scatter_solvent)*V*[sin(q*r(Ra,Rb,alpha)) - q*r*cos(qr(Ra,Rb,alpha))] 43 55 /[qr(Ra,Rb,alpha)]^(3)" … … 61 73 def clone(self): 62 74 """ Return a identical copy of self """ 63 obj = EllipsoidModel() 64 obj.params = copy.deepcopy(self.params) 65 return obj 75 return self._clone(EllipsoidModel()) 66 76 67 77 def run(self, x = 0.0): … … 80 90 81 91 return CEllipsoidModel.runXY(self, x) 92 93 def set_dispersion(self, parameter, dispersion): 94 """ 95 Set the dispersion object for a model parameter 96 @param parameter: name of the parameter [string] 97 @dispersion: dispersion object of type DispersionModel 98 """ 99 return CEllipsoidModel.set_dispersion(self, parameter, dispersion.cdisp) 100 82 101 83 102 # End of file -
sansmodels/src/sans/models/EllipticalCylinderModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY elliptical_cylinder.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/elliptical_cylinder.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class EllipticalCylinderModel(CEllipticalCylinderModel, BaseComponent): 17 29 """ Class that evaluates a EllipticalCylinderModel model. 18 This file was auto-generated from elliptical_cylinder.h.30 This file was auto-generated from ../c_extensions/elliptical_cylinder.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 41 53 ## Name of the model 42 54 self.name = "EllipticalCylinderModel" 43 self.description =""""""""55 self.description ="""""""" 44 56 ## Parameter details [units, min, max] 45 57 self.details = {} … … 57 69 def clone(self): 58 70 """ Return a identical copy of self """ 59 obj = EllipticalCylinderModel() 60 obj.params = copy.deepcopy(self.params) 61 return obj 71 return self._clone(EllipticalCylinderModel()) 62 72 63 73 def run(self, x = 0.0): … … 76 86 77 87 return CEllipticalCylinderModel.runXY(self, x) 88 89 def set_dispersion(self, parameter, dispersion): 90 """ 91 Set the dispersion object for a model parameter 92 @param parameter: name of the parameter [string] 93 @dispersion: dispersion object of type DispersionModel 94 """ 95 return CEllipticalCylinderModel.set_dispersion(self, parameter, dispersion.cdisp) 96 78 97 79 98 # End of file -
sansmodels/src/sans/models/Gaussian.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY gaussian.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/gaussian.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class Gaussian(CGaussian, BaseComponent): 17 29 """ Class that evaluates a Gaussian model. 18 This file was auto-generated from gaussian.h.30 This file was auto-generated from ../c_extensions/gaussian.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 35 47 ## Name of the model 36 48 self.name = "Gaussian" 37 self.description ="""f(x)=scale * 1/(sigma^2*2pi)e^(-(x-mu)^2/2sigma^2)"""49 self.description ="""f(x)=scale * 1/(sigma^2*2pi)e^(-(x-mu)^2/2sigma^2)""" 38 50 ## Parameter details [units, min, max] 39 51 self.details = {} … … 45 57 def clone(self): 46 58 """ Return a identical copy of self """ 47 obj = Gaussian() 48 obj.params = copy.deepcopy(self.params) 49 return obj 59 return self._clone(Gaussian()) 50 60 51 61 def run(self, x = 0.0): … … 64 74 65 75 return CGaussian.runXY(self, x) 76 77 def set_dispersion(self, parameter, dispersion): 78 """ 79 Set the dispersion object for a model parameter 80 @param parameter: name of the parameter [string] 81 @dispersion: dispersion object of type DispersionModel 82 """ 83 return CGaussian.set_dispersion(self, parameter, dispersion.cdisp) 84 66 85 67 86 # End of file -
sansmodels/src/sans/models/Lorentzian.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY lorentzian.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/lorentzian.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class Lorentzian(CLorentzian, BaseComponent): 17 29 """ Class that evaluates a Lorentzian model. 18 This file was auto-generated from lorentzian.h.30 This file was auto-generated from ../c_extensions/lorentzian.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 35 47 ## Name of the model 36 48 self.name = "Lorentzian" 37 self.description ="""f(x)=scale * 1/pi 0.5gamma / [ (x-x_0)^2 + (0.5gamma)^2 ]"""49 self.description ="""f(x)=scale * 1/pi 0.5gamma / [ (x-x_0)^2 + (0.5gamma)^2 ]""" 38 50 ## Parameter details [units, min, max] 39 51 self.details = {} … … 45 57 def clone(self): 46 58 """ Return a identical copy of self """ 47 obj = Lorentzian() 48 obj.params = copy.deepcopy(self.params) 49 return obj 59 return self._clone(Lorentzian()) 50 60 51 61 def run(self, x = 0.0): … … 64 74 65 75 return CLorentzian.runXY(self, x) 76 77 def set_dispersion(self, parameter, dispersion): 78 """ 79 Set the dispersion object for a model parameter 80 @param parameter: name of the parameter [string] 81 @dispersion: dispersion object of type DispersionModel 82 """ 83 return CLorentzian.set_dispersion(self, parameter, dispersion.cdisp) 84 66 85 67 86 # End of file -
sansmodels/src/sans/models/SphereModel.py
r9316609 r95986b5 1 1 #!/usr/bin/env python 2 """ 3 This software was developed by the University of Tennessee as part of the 4 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 project funded by the US National Science Foundation. 6 7 If you use DANSE applications to do scientific research that leads to 8 publication, we ask that you acknowledge the use of the software with the 9 following sentence: 10 11 "This work benefited from DANSE software developed under NSF award DMR-0520547." 12 13 copyright 2008, University of Tennessee 14 """ 15 2 16 """ Provide functionality for a C extension model 3 17 4 18 WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 5 DO NOT MODIFY THIS FILE, MODIFY sphere.h19 DO NOT MODIFY THIS FILE, MODIFY ../c_extensions/sphere.h 6 20 AND RE-RUN THE GENERATOR SCRIPT 7 21 8 @author: Mathieu Doucet / UTK9 @contact: mathieu.doucet@nist.gov10 22 """ 11 23 … … 16 28 class SphereModel(CSphereModel, BaseComponent): 17 29 """ Class that evaluates a SphereModel model. 18 This file was auto-generated from sphere.h.30 This file was auto-generated from ../c_extensions/sphere.h. 19 31 Refer to that file and the structure it contains 20 32 for details of the model. … … 36 48 ## Name of the model 37 49 self.name = "SphereModel" 38 self.description ="""P(q)=(scale/V)*[3V(scatter_sld-solvent_sld)*(sin(qR)-qRcos(qR))/(qR)^3]^(2)50 self.description ="""P(q)=(scale/V)*[3V(scatter_sld-solvent_sld)*(sin(qR)-qRcos(qR))/(qR)^3]^(2) 39 51 +bkg 40 52 bkg: background level … … 53 65 def clone(self): 54 66 """ Return a identical copy of self """ 55 obj = SphereModel() 56 obj.params = copy.deepcopy(self.params) 57 return obj 67 return self._clone(SphereModel()) 58 68 59 69 def run(self, x = 0.0): … … 72 82 73 83 return CSphereModel.runXY(self, x) 84 85 def set_dispersion(self, parameter, dispersion): 86 """ 87 Set the dispersion object for a model parameter 88 @param parameter: name of the parameter [string] 89 @dispersion: dispersion object of type DispersionModel 90 """ 91 return CSphereModel.set_dispersion(self, parameter, dispersion.cdisp) 92 74 93 75 94 # End of file -
sansmodels/src/sans/models/c_models/WrapperGenerator.py
r9316609 r95986b5 3 3 """ 4 4 5 import os, sys 5 import os, sys,re 6 6 7 7 class WrapperGenerator: … … 137 137 break 138 138 except: 139 raise 139 140 raise ValueError, "Could not parse file %s" % self.file 140 141 elif find_description==1: … … 240 241 raise ValueError, "Could not parse file %s" % self.file 241 242 242 243 243 244 244 245 def write_c_wrapper(self): … … 260 261 "[PYTHONCLASS]", 'C'+self.pythonClass) 261 262 #Catch model description 262 newline = self.replaceToken(tmp_line,263 "[DESCRIPTION]", self.description)263 #newline = self.replaceToken(tmp_line, 264 # "[DESCRIPTION]", self.description) 264 265 # Catch C model name 265 266 newline = self.replaceToken(newline, … … 351 352 "[SET_DISPERSION]", set_weights) 352 353 353 354 354 # Write new line to the wrapper .c file 355 355 file.write(newline+'\n') … … 386 386 newline = self.replaceToken(newline, 387 387 "[DEFAULT_LIST]", self.default_list) 388 388 # model description 389 newline = self.replaceToken(newline, 390 "[DESCRIPTION]", self.description) 389 391 # Parameter details 390 392 newline = self.replaceToken(newline, 391 393 "[PAR_DETAILS]", self.details) 392 # Parameter details 393 newline = self.replaceToken(newline, 394 "[DESCRIPTION]", self.description) 394 395 395 396 396 # Write new line to the wrapper .c file … … 419 419 if len(sys.argv)>1: 420 420 print "Will look for file %s" % sys.argv[1] 421 #app = WrapperGenerator('../c_extensions/elliptical_cylinder.h') 421 422 app = WrapperGenerator(sys.argv[1]) 422 423 else:
Note: See TracChangeset
for help on using the changeset viewer.