1/******************************************************************************* 2* McXtrace instrument definition URL=http://www.mcxtrace.org 3* 4* Instrument: SAXS_saxslab (rename also the example and DEFINE lines below) 5* 6* %Identification 7* Written by: Erik Knudsen (erkn@risoe.dtu.dk) 8* Date: September 24th, 2009 9* Origin: Risø DTU, (Finnair flight AY67 to Hong Kong) 10* Release: McXtrace 11* Version: 0.1_alpha 12* %INSTRUMENT_SITE: SAXSLAB 13* 14* Crude model of a laboratory SAXS-instrument mimicking the type sold by SAXSlab/JJ-Xray Systems. 15* 16* %Description 17* 18* 19* %Parameters 20* pin2_pos: [m] distance between 1st and 2nd pinhole in beam tube 21* pin3_pos: [m] distance between 2nd and 3rd pinhole in beam tube 22* optic_L: [m] length of the focusing optic 23* sample_pos:[m] distance from 3rd pinhole to sample 24* detector_pos: [m] distance from 3rd pinhole to detector 25* 26* %Example: pin2_pos=0.2 pin3_pos=0.4 optic_L=0.1 sample_pos=0.2 detector_pos=2 Detector: psd1_I=7.8629e-05 27* 28* %Link 29* A reference/HTML link for more information 30* 31* %End 32*******************************************************************************/ 33 34DEFINE INSTRUMENT SAXS_saxlab(pin2_pos=0.2, pin3_pos=0.4, optic_L=0.1, sample_pos=0.2, detector_pos=2) 35 36DECLARE 37%{ 38%} 39 40INITIALIZE 41%{ 42%} 43 44TRACE 45 46COMPONENT Origin = Progress_bar() 47 AT (0,0,0) ABSOLUTE 48 49COMPONENT apparent_source=Source_flat( 50 xwidth=8e-3,yheight=.04e-3,dist=0.1,focus_yh=0.001,focus_xw=0.01,lambda0=1.54,dlambda=0.1 51) 52AT (0,0,0) RELATIVE PREVIOUS 53 54COMPONENT psd00=PSD_monitor( 55 filename="psd00.dat",xwidth=0.2,yheight=0.2,restore_xray=1 56) 57 AT(0,0,0.0999) RELATIVE PREVIOUS 58 59 COMPONENT optic_arm=Arm() 60AT(0,0,0.1) RELATIVE apparent_source 61ROTATED(0,0,-90) RELATIVE apparent_source 62 63COMPONENT optic=Mirror_curved( 64 radius=20,length=0.2) 65AT(0,0,0) RELATIVE optic_arm 66ROTATED(0,2.75,0) RELATIVE optic_arm 67EXTEND 68%{ 69 if (!SCATTERED) ABSORB; 70%} 71 72COMPONENT beam_tube_axis=Arm() 73AT(0,0,0.1) RELATIVE apparent_source 74ROTATED (5.5,0,0) RELATIVE Origin 75 76COMPONENT pinhole1=Slit(xwidth=0.1,yheight=0.1) 77 AT(0,0,0.15) RELATIVE beam_tube_axis 78 79COMPONENT psd01=PSD_monitor( 80 filename="psd01.dat",xwidth=0.2,yheight=0.2,restore_xray=1 81) 82 AT(0,0,1e-3) RELATIVE PREVIOUS 83 84COMPONENT pinhole2=Slit(xwidth=0.1,yheight=0.1) 85 AT(0,0,pin2_pos) RELATIVE beam_tube_axis 86 87/*COMPONENT psd02=PSD_monitor( 88 filename="psd02.dat",xwidth=0.2,yheight=0.2 89) 90AT (0,0,1e-3) RELATIVE PREVIOUS 91*/ 92COMPONENT pinhole3=Slit(xwidth=0.1,yheight=0.1) 93 AT(0,0,pin3_pos) RELATIVE beam_tube_axis 94COMPONENT psd03=PSD_monitor( 95 filename="psd02.dat",xwidth=0.2,yheight=0.2 96) 97AT (0,0,1e-3) RELATIVE PREVIOUS 98 99COMPONENT psd1=PSD_monitor( 100 filename="psd1.dat",xwidth=0.4,yheight=0.4 101) 102AT (0,0,2) RELATIVE psd03 103 104/* This section is executed when the simulation ends (C code). Other */ 105/* optional sections are : SAVE */ 106FINALLY 107%{ 108%} 109/* The END token marks the instrument definition end */ 110END 111 112 113