source: sasview/sansmodels/igor_wrapper/src/disp_elliptical_cylinder.c @ eb4f2fd

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since eb4f2fd was 25a60dc1, checked in by Jae Cho <jhjcho@…>, 13 years ago

moving a folder

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/**
2 * Scattering intensity for dispersed CEllipticalCylinderModel
3 *
4 * WARNING: THIS FILE WAS GENERATED BY IGORGENERATOR.PY
5 *          DO NOT MODIFY THIS FILE, MODIFY elliptical_cylinder.h
6 *          AND RE-RUN THE GENERATOR SCRIPT
7 *
8 * This code was written as part of the DANSE project
9 * http://danse.us/trac/sans/
10 *
11 * Copyright 2007: University of Tennessee, for the DANSE project
12 */
13
14#include "elliptical_cylinder.h"
15#include <math.h>
16#include "libCylinder.h"
17#include "libSphere.h"
18#include "c_disperser.h"
19
20/**
21 * Function to evaluate 2D scattering function
22 *
23 * @param dp: parameters of the function
24 * @param q: q-value
25 * @param phi: angle of the q-vector in the plane of the detector, relative to q_x
26 * @return: function value
27 */
28double oriented_elliptical_cylinder_2D(double pars[], double q, double phi) {
29        EllipticalCylinderParameters danse_pars;
30       
31    // List of default parameters:
32    //         pars[0]:   scale           = 1.0
33    //         pars[1]:   r_minor         = 20.0 A
34    //         pars[2]:   r_ratio         = 1.5 A
35    //         pars[3]:   length          = 400.0 A
36    //         pars[4]:   contrast        = 3e-06 A-2
37    //         pars[5]:   background      = 0.0 cm-1
38    //         pars[6]:   cyl_theta       = 1.57 rad
39    //         pars[7]:   cyl_phi         = 0.0 rad
40    //         pars[8]:   cyl_psi         = 0.0 rad
41    danse_pars.scale = pars[0];
42    danse_pars.r_minor = pars[1];
43    danse_pars.r_ratio = pars[2];
44    danse_pars.length = pars[3];
45    danse_pars.contrast = pars[4];
46    danse_pars.background = pars[5];
47    danse_pars.cyl_theta = pars[6];
48    danse_pars.cyl_phi = pars[7];
49    danse_pars.cyl_psi = pars[8];
50
51        return elliptical_cylinder_analytical_2D(&danse_pars, q, phi);         
52}
53       
54/**
55 * Function to evaluate dispersed 2D scattering function
56 *
57 * @param dp: parameters of the function
58 * @param q: q-value
59 * @param phi: angle of the q-vector in the plane of the detector, relative to q_x
60 * @return: function value
61 *
62     // List of default parameters:
63    //         pars[0]:   scale           = 1.0
64    //         pars[1]:   r_minor         = 20.0 A
65    //         pars[2]:   r_ratio         = 1.5 A
66    //         pars[3]:   length          = 400.0 A
67    //         pars[4]:   contrast        = 3e-06 A-2
68    //         pars[5]:   background      = 0.0 cm-1
69    //         pars[6]:   cyl_theta       = 1.57 rad
70    //         pars[7]:   cyl_phi         = 0.0 rad
71    //         pars[8]:   cyl_psi         = 0.0 rad
72
73    //         pars[9]:   dispersion of r_minor
74    //         pars[10]:   dispersion of r_ratio
75    //         pars[11]:   dispersion of cyl_theta
76    //         pars[12]:   dispersion of cyl_phi
77    //         pars[13]:   number of points in dispersion curve
78
79 */
80double disperse_elliptical_cylinder_analytical_2D(double dp[], double q, double phi) {
81        int paramList[4];
82        double sigmaList[4];
83        int npts;
84        int i;
85        double pars[14];
86       
87    // r_minor
88    paramList[0] = 1;
89    // r_ratio
90    paramList[1] = 2;
91    // cyl_theta
92    paramList[2] = 6;
93    // cyl_phi
94    paramList[3] = 7;
95
96    sigmaList[0] = dp[9];
97    sigmaList[1] = dp[10];
98    sigmaList[2] = dp[11];
99    sigmaList[3] = dp[12];
100
101    npts = (int)(floor(dp[13]));
102
103
104        // Internal copy of parameters
105        for(i=0; i<14; i++ ) {
106                pars[i] = dp[i];
107        }
108
109        return c_disperser( &oriented_elliptical_cylinder_2D, pars, 4, 
110                                        paramList, sigmaList, npts, q, phi ); 
111
112       
113}
114   
Note: See TracBrowser for help on using the repository browser.