Skip to content

Commit 2ec44d2

Browse files
author
Emmanuel FARHI
committed
mcxtrace: SX: use sensible delta_d_d / mosaic values when only one is given.
1 parent ceab640 commit 2ec44d2

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

mcxtrace-comps/samples/Single_crystal.comp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* The mosaic may EITHER be specified isotropic by setting the mosaic input
3232
* parameter, OR anisotropic by setting the mosaic_a, mosaic_b, and mosaic_c
3333
* parameters.
34+
* If you get strange results, check the mosaicity and delta(d)/d parameters, as this
35+
* component is not suited for ideal/perfect mosaic crystals.
3436
* The crystal lattice can be bent locally, keeping the external geometry unchanged.
3537
* Curvature is spherical along vertical and horizontal axes.
3638
*
@@ -61,7 +63,7 @@
6163
* (Also known as "phenomenological mosaicity").
6264
*
6365
* <b>Powder-mode</b>
64-
* When these two modes are used (powder=1 ), a randomised transformation
66+
* When the powder mode is used (powder=0-1), a randomised transformation
6567
* of the particle direction is made before and after scattering, thereby letting
6668
* the single crystal behave as a crystallite of either a powder (crystallite
6769
* orientation fully randomised).
@@ -148,7 +150,7 @@
148150
*
149151
* A diamond crystal plate, cut for (002) reflections
150152
* Single_crystal(xwidth = 0.002, yheight = 0.1, zdepth = 0.1,
151-
* mosaic = 30, reflections = "C-diamond.lau",
153+
* mosaic = 5, delta_d_d=3e-4, reflections = "C-diamond.lau",
152154
* ax=0, ay=2.14, az=-1.24,
153155
* bx = 0, by = 0, bz = 2.47,
154156
* cx = 6.71, cy = 0, cz = 0)
@@ -169,12 +171,12 @@
169171
* yheight: [m] Height of crystal
170172
* zdepth: [m] Depth of crystal (no extinction simulated)
171173
* geometry: [str] Name of an Object File Format (OFF) or PLY file for complex geometry. The OFF/PLY file may be generated from XYZ coordinates using qhull/powercrust
172-
* delta_d_d: [1] Lattice spacing variance, gaussian RMS (longitudinal mosaic)
173-
* mosaic: [arc minutes] Crystal mosaic (isotropic), gaussian RMS. Puts the crystal in the isotropic mosaic model state, thus disregarding other mosaicity parameters.
174-
* mosaic_a: [arc minutes] Horizontal (rotation around lattice vector a) mosaic (anisotropic), gaussian RMS. Put the crystal in the anisotropic crystal vector state. I.e. model mosaicity through rotation around the crystal lattice vectors. Has precedence over in-plane mosaic model.
174+
* delta_d_d: [1] Lattice spacing variance, gaussian RMS (longitudinal mosaic) e.g. 1e-4 to 1e-3.
175+
* mosaic: [arc minutes] Crystal mosaic (isotropic), gaussian RMS. Puts the crystal in the isotropic mosaic model state, thus disregarding other mosaicity parameters, e.g. 1-10.
176+
* mosaic_a: [arc minutes] Horizontal (rotation around lattice vector a) mosaic (anisotropic), gaussian RMS. Put the crystal in the anisotropic crystal vector state. i.e. model mosaicity through rotation around the crystal lattice vectors. Has precedence over in-plane mosaic model.
175177
* mosaic_b: [arc minutes] Vertical (rotation around lattice vector b) mosaic (anisotropic), gaussian RMS.
176178
* mosaic_c: [arc minutes] Out-of-plane (Rotation around lattice vector c) mosaic (anisotropic), gaussian RMS
177-
* mosaic_AB: [arc_minutes, arc_minutes,1, 1, 1, 1, 1, 1] In Plane mosaic rotation and plane vectors (anisotropic), mosaic_A, mosaic_B, A_h,A_k,A_l, B_h,B_k,B_l. Puts the crystal in the in-plane mosaic state. Vectors A and B define plane in which the crystal roation is defined, and mosaic_A, mosaic_B, denotes the resp. mosaicities (gaussian RMS) with respect to the two reflections chosen by A and B (Miller indices).
179+
* mosaic_AB: [arc_minutes, arc_minutes,1, 1, 1, 1, 1, 1] In-plane mosaic rotation and plane vectors (anisotropic), mosaic_A, mosaic_B, A_h,A_k,A_l, B_h,B_k,B_l. Puts the crystal in the in-plane mosaic state. Vectors A and B define plane in which the crystal roation is defined, and mosaic_A, mosaic_B, denotes the resp. mosaicities (gaussian RMS) with respect to the two reflections chosen by A and B (Miller indices).
178180
*
179181
* recip_cell: [1] Choice of direct/reciprocal (0/1) unit cell definition
180182
* ax: [AA or AA^-1] Coordinates of first (direct/recip) unit cell vector
@@ -197,7 +199,7 @@
197199
* aa: [deg] Unit cell angles alpha, beta and gamma. Then uses norms of vectors a,b and c as lattice parameters
198200
* bb: [deg] Beta angle
199201
* cc: [deg] Gamma angle
200-
* barns: [1] Flag to indicate if |F|^2 from 'reflections' is in barns or fm^2. barns=1 for laz and isotropic constant elastic scattering (reflections=NULL), barns=0 for lau type files
202+
* barns: [1] Flag to indicate if |F|^2 from 'reflections' is in barns or fm^2. barns=1 for laz/cif and isotropic constant elastic scattering (reflections=NULL), barns=0 for lau type files
201203
* RX: [m] Radius of horizontal along X lattice curvature. flat for 0
202204
* RY: [m] Radius of vertical along Y lattice curvature. flat for 0
203205
* powder: [1] Flag to indicate powder mode, for simulation of Debye-Scherrer cones via random crystallite orientation. A powder texture can be approximated with powder within 0-1
@@ -290,7 +292,7 @@ vector ki.
290292
DEFINE COMPONENT Single_crystal
291293

292294
SETTING PARAMETERS(string reflections=0, string geometry=0, vector mosaic_AB={0,0, 0,0,0, 0,0,0},
293-
xwidth=0, yheight=0, zdepth=0, radius=0, delta_d_d=1e-4,
295+
xwidth=0, yheight=0, zdepth=0, radius=0, delta_d_d=1e-3,
294296
mosaic = -1, mosaic_a = -1, mosaic_b = -1, mosaic_c = -1,
295297
recip_cell=0, barns=0,
296298
ax = 0, ay = 0, az = 0,
@@ -598,11 +600,13 @@ SHARE
598600

599601
if (nb_atoms > 1) { info->sigma_i *= nb_atoms; }
600602
if (info->m_delta_d_d <=0) {
601-
info->m_delta_d_d=1e-5;
603+
info->m_delta_d_d=SC_mosaic > 0 ? SC_mosaic*MIN2RAD : MIN2RAD; // MIN2RAD = 3e-4
602604
MPI_MASTER(
603605
fprintf(stderr,"Single_crystal: %s: WARNING: Delta_d/d is <=0 (longitudinal mosaic). Setting delta_d_d=%g\n",
604606
info->compname, info->m_delta_d_d);
605607
);
608+
} else if (SC_mosaic < 0 && SC_mosaic_a < 0 && SC_mosaic_b < 0 && SC_mosaic_c < 0) {
609+
if (info->m_delta_d_d > 0) SC_mosaic=info->m_delta_d_d/MIN2RAD;
606610
}
607611

608612
/* special cases for the structure definition */
@@ -1504,7 +1508,7 @@ TRACE
15041508

15051509
if (hkl_info.flag_barns) {
15061510
/*If cross sections are given in barns, we need a scaling factor of 100
1507-
to get scattering lengths in m, since V0 is assumed to be in AA*/
1511+
to get scattering lengths in m, since V0 is assumed to be in AA*/
15081512
abs_xlen *= 100; inc_xlen *= 100;
15091513
} /* else assume fm^2 */
15101514
L = hkl_list;

0 commit comments

Comments
 (0)