Skip to content

Commit c91fb5d

Browse files
authored
Merge pull request #2288 from willend/main
NMO Comp/instr: Header fixes. Plus suppresion of mcdisplay.
2 parents 06de8f8 + e040424 commit c91fb5d

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

mcstas-comps/contrib/FlatEllipse_finite_mirror.comp

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* NMO (nested mirror optic) modules
1212
*
1313
* %D
14-
* Simulates NMO (nested mirror optic) modules as concevied by Böni et al., see
14+
* Simulates NMO (nested mirror optic) modules as concevied by Böni et al., see
1515
* Christoph Herb et al., Nucl. Instrum. Meth. A 1040, 1671564 (1-18) 2022.
1616
*
1717
* The component relies on an updated version of conic.h from MIT.
@@ -30,10 +30,10 @@
3030
* mirror_sidelength: [m] side length of the individual mirrors
3131
* doubleReflections: [1] binary value determining whether the mirror backside is reflective
3232
* rfront_inner_file: [str] file of distances to the optical axis of the individual mirrors
33-
* R0: [1] Low-angle reflectivity
33+
* R0: [1] Low-angle reflectivity
3434
* Qc: [AA-1] critical scattering vector
3535
* W: [AA-1] width of supermirror cutoff
36-
* alpha: [AA] Slope of reflectivity
36+
* alpha: [AA] Slope of reflectivity
3737
* %L
3838
* Christoph Herb et al., Nucl. Instrum. Meth. A 1040, 1671564 (1-18) 2022.
3939
* %E
@@ -45,8 +45,8 @@ SETTING PARAMETERS (
4545
sourceDist = 0,
4646
LStart=0.6,
4747
LEnd = 0.6,
48-
lStart = 0.,
49-
lEnd = 0.,
48+
lStart = 0.0,
49+
lEnd = 0.0,
5050
r_0 = 0.02076,
5151
int nummirror= 9,
5252
mf = 4,
@@ -90,7 +90,7 @@ double * get_r_at_z0(int number, double z_0, double r_0, double z_extract, doubl
9090
fprintf(stderr,"NMO comp function get_r_at_z0: malloc() failed. Exit! \n");
9191
exit(-1);
9292
}
93-
r_zExtracts[0] = r_0;
93+
r_zExtracts[0] = r_0;
9494
//helper variables as in conic_finite_mirror.h and explained in swissneutronics_überlegungen
9595
double k1;
9696
double k2;
@@ -249,33 +249,35 @@ FINALLY %{
249249

250250
MCDISPLAY//TODO this does not work as of now does not show the orientation of the flat conics
251251
%{
252-
//Enlarge xy-plane when mcdisplay is ran with --zoom
253-
magnify("xy");
252+
// PW 20260112 Suppressed. Cals to rConic make no sense since the flat mirrors are NOT conical...
254253

255-
//Draw xy-axis contour for Conic Surfaces
256-
int i;
257-
for (i = 0; i < s.num_c; i++) {
258-
double step = (s.c[i].ze-s.c[i].zs)/100;
259-
double cz;
260-
for (cz = s.c[i].zs+step; cz <= s.c[i].ze; cz+= step) {
261-
double rp = rConic(cz-step,s.c[i]);
262-
double rc = rConic(cz, s.c[i]);
254+
/* //Enlarge xy-plane when mcdisplay is ran with --zoom */
255+
/* magnify("xy"); */
263256

264-
line(0,rp,cz-step,0,rc,cz);
265-
line(0,-rp,cz-step,0,-rc,cz);
257+
/* //Draw xy-axis contour for Conic Surfaces */
258+
/* int i; */
259+
/* for (i = 0; i < s.num_f; i++) { */
260+
/* double step = (s.f[i].ze-s.f[i].zs)/100; */
261+
/* double cz; */
262+
/* for (cz = s.f[i].zs+step; cz <= s.f[i].ze; cz+= step) { */
263+
/* double rp = rConic(cz-step,s.f[i]); */
264+
/* double rc = rConic(cz, s.f[i]); */
266265

267-
line(rp,0,cz-step,rc,0,cz);
268-
line(-rp,0,cz-step,-rc,0,cz);
269-
}
270-
}
266+
/* line(0,rp,cz-step,0,rc,cz); */
267+
/* line(0,-rp,cz-step,0,-rc,cz); */
271268

272-
//Draw xy-axis cross hairs for Disks
273-
for (i = 0; i < s.num_di; i++) {
274-
line(s.di[i].r0, 0, s.di[i].z0, s.di[i].r1, 0, s.di[i].z0);
275-
line(-s.di[i].r0, 0, s.di[i].z0, -s.di[i].r1, 0, s.di[i].z0);
276-
line(0, s.di[i].r0, s.di[i].z0, 0, s.di[i].r1,s.di[i].z0);
277-
line(0, -s.di[i].r0, s.di[i].z0, 0, -s.di[i].r1,s.di[i].z0);
278-
}
269+
/* line(rp,0,cz-step,rc,0,cz); */
270+
/* line(-rp,0,cz-step,-rc,0,cz); */
271+
/* } */
272+
/* } */
273+
274+
/* //Draw xy-axis cross hairs for Disks */
275+
/* for (i = 0; i < s.num_di; i++) { */
276+
/* line(s.di[i].r0, 0, s.di[i].z0, s.di[i].r1, 0, s.di[i].z0); */
277+
/* line(-s.di[i].r0, 0, s.di[i].z0, -s.di[i].r1, 0, s.di[i].z0); */
278+
/* line(0, s.di[i].r0, s.di[i].z0, 0, s.di[i].r1,s.di[i].z0); */
279+
/* line(0, -s.di[i].r0, s.di[i].z0, 0, -s.di[i].r1,s.di[i].z0); */
280+
/* } */
279281

280282
%}
281283

mcstas-comps/examples/Tests_optics/Test_NMO/Test_NMO.instr

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@
77
* Origin: TUM
88
* %INSTRUMENT_SITE: Tests_optics
99
*
10-
* Implements a test instrument for the component FlatEllipse_finite_mirror,
11-
* implementing Nested Mirror Optic (NMO) as suggested by B&ouml;ni et al.
10+
* Implements a test instrument for the component FlatEllipse_finite_mirror.
1211
*
1312
* %D
14-
* <instrument description>
15-
*
16-
* Example: <parameters=values>
13+
* Implements a test instrument for the component FlatEllipse_finite_mirror,
14+
* implementing Nested Mirror Optic (NMO) as suggested by B&ouml;ni et al.
1715
*
1816
* %P
19-
* det_width: [m] Detector width
20-
* source_width: [m] Source width
21-
* source_height: [m] Source height
17+
* det_width: [m] Detector width
18+
* source_width: [m] Source width
19+
* source_height: [m] Source height
2220
* lam_source: [AA] Central source wavelength
2321
* dL: [AA] Source wavelength spread
2422
* v_divergence: [deg] Source vertical divergence

0 commit comments

Comments
 (0)