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 b4679de was
b4679de,
checked in by Jae Cho <jhjcho@…>, 15 years ago
|
added 2d and model descpt + correction on polydisp. para.
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[27a0771] | 1 | /** |
---|
| 2 | * Scattering model for a lamellar |
---|
| 3 | * TODO: Add 2D analysis |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | #include "lamellarPS.h" |
---|
| 7 | #include <math.h> |
---|
| 8 | #include "libCylinder.h" |
---|
| 9 | #include <stdio.h> |
---|
| 10 | #include <stdlib.h> |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | /** |
---|
| 14 | * Function to evaluate 1D scattering function |
---|
| 15 | * @param pars: parameters of the lamellar |
---|
| 16 | * @param q: q-value |
---|
| 17 | * @return: function value |
---|
| 18 | */ |
---|
| 19 | double lamellarPS_analytical_1D(LamellarPSParameters *pars, double q) { |
---|
| 20 | double dp[8]; |
---|
[b4679de] | 21 | |
---|
[27a0771] | 22 | // Fill paramater array |
---|
| 23 | dp[0] = pars->scale; |
---|
| 24 | dp[1] = pars->spacing; |
---|
| 25 | dp[2] = pars->delta; |
---|
| 26 | dp[3] = pars->sigma; |
---|
| 27 | dp[4] = pars->contrast; |
---|
| 28 | dp[5] = pars->n_plates; |
---|
| 29 | dp[6] = pars->caille; |
---|
| 30 | dp[7] = pars->background; |
---|
| 31 | |
---|
| 32 | // Call library function to evaluate model |
---|
[b4679de] | 33 | return LamellarPS(dp, q); |
---|
[27a0771] | 34 | } |
---|
| 35 | /** |
---|
| 36 | * Function to evaluate 2D scattering function |
---|
| 37 | * @param pars: parameters of the lamellar |
---|
| 38 | * @param q: q-value |
---|
| 39 | * @return: function value |
---|
| 40 | */ |
---|
| 41 | double lamellarPS_analytical_2DXY(LamellarPSParameters *pars, double qx, double qy) { |
---|
| 42 | double q; |
---|
| 43 | q = sqrt(qx*qx+qy*qy); |
---|
[b4679de] | 44 | return lamellarPS_analytical_1D(pars, q); |
---|
| 45 | } |
---|
[27a0771] | 46 | |
---|
| 47 | |
---|
| 48 | /** |
---|
| 49 | * Function to evaluate 2D scattering function |
---|
| 50 | * @param pars: parameters of the lamellar |
---|
| 51 | * @param q: q-value |
---|
| 52 | * @param phi: angle phi |
---|
| 53 | * @return: function value |
---|
| 54 | */ |
---|
| 55 | double lamellarPS_analytical_2D(LamellarPSParameters *pars, double q, double phi) { |
---|
[b4679de] | 56 | return lamellarPS_analytical_1D(pars,q); |
---|
| 57 | } |
---|
| 58 | |
---|
[27a0771] | 59 | /** |
---|
| 60 | * Function to evaluate 2D scattering function |
---|
| 61 | * @param pars: parameters of the lamellar |
---|
| 62 | * @param q: q-value |
---|
| 63 | * @param q_x: q_x / q |
---|
| 64 | * @param q_y: q_y / q |
---|
| 65 | * @return: function value |
---|
| 66 | */ |
---|
[b4679de] | 67 | |
---|
[27a0771] | 68 | |
---|
Note: See
TracBrowser
for help on using the repository browser.