source: sasview/sansmodels/igor_wrapper/src/disp_ellipsoid.c @ a5e14410

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 a5e14410 was 25a60dc1, checked in by Jae Cho <jhjcho@…>, 13 years ago

moving a folder

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/**
2 * Scattering intensity for dispersed CEllipsoidModel
3 *
4 * WARNING: THIS FILE WAS GENERATED BY IGORGENERATOR.PY
5 *          DO NOT MODIFY THIS FILE, MODIFY ellipsoid.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 "ellipsoid.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_ellipsoid_2D(double pars[], double q, double phi) {
29        EllipsoidParameters danse_pars;
30       
31    // List of default parameters:
32    //         pars[0]:   scale           = 1.0
33    //         pars[1]:   radius_a        = 20.0 A
34    //         pars[2]:   radius_b        = 400.0 A
35    //         pars[3]:   contrast        = 3e-06 A-2
36    //         pars[4]:   background      = 0.0 cm-1
37    //         pars[5]:   axis_theta      = 1.57 rad
38    //         pars[6]:   axis_phi        = 0.0 rad
39    danse_pars.scale = pars[0];
40    danse_pars.radius_a = pars[1];
41    danse_pars.radius_b = pars[2];
42    danse_pars.contrast = pars[3];
43    danse_pars.background = pars[4];
44    danse_pars.axis_theta = pars[5];
45    danse_pars.axis_phi = pars[6];
46
47        return ellipsoid_analytical_2D(&danse_pars, q, phi);           
48}
49       
50/**
51 * Function to evaluate dispersed 2D scattering function
52 *
53 * @param dp: parameters of the function
54 * @param q: q-value
55 * @param phi: angle of the q-vector in the plane of the detector, relative to q_x
56 * @return: function value
57 *
58     // List of default parameters:
59    //         pars[0]:   scale           = 1.0
60    //         pars[1]:   radius_a        = 20.0 A
61    //         pars[2]:   radius_b        = 400.0 A
62    //         pars[3]:   contrast        = 3e-06 A-2
63    //         pars[4]:   background      = 0.0 cm-1
64    //         pars[5]:   axis_theta      = 1.57 rad
65    //         pars[6]:   axis_phi        = 0.0 rad
66
67    //         pars[7]:   dispersion of radius_a
68    //         pars[8]:   dispersion of radius_b
69    //         pars[9]:   dispersion of axis_theta
70    //         pars[10]:   dispersion of axis_phi
71    //         pars[11]:   number of points in dispersion curve
72
73 */
74double disperse_ellipsoid_analytical_2D(double dp[], double q, double phi) {
75        int paramList[4];
76        double sigmaList[4];
77        int npts;
78        int i;
79        double pars[12];
80       
81    // radius_a
82    paramList[0] = 1;
83    // radius_b
84    paramList[1] = 2;
85    // axis_theta
86    paramList[2] = 5;
87    // axis_phi
88    paramList[3] = 6;
89
90    sigmaList[0] = dp[7];
91    sigmaList[1] = dp[8];
92    sigmaList[2] = dp[9];
93    sigmaList[3] = dp[10];
94
95    npts = (int)(floor(dp[11]));
96
97
98        // Internal copy of parameters
99        for(i=0; i<12; i++ ) {
100                pars[i] = dp[i];
101        }
102
103        return c_disperser( &oriented_ellipsoid_2D, pars, 4, 
104                                        paramList, sigmaList, npts, q, phi ); 
105
106       
107}
108   
Note: See TracBrowser for help on using the repository browser.