
/* Example of the use of perfect crystal in transmission (laue) geometry 
   We are going to generate a punctual source at 8035eV with vertical
   divergence of 0.1mrad and then we will trace a Silicon (220) crystal
   in transmission geometry with 0.0025 cm thickness. We will analyze
   with PREPLOT the rocking curve                                       */

/* Let's go with the source                                             */

sanchez@sol> GO source
SOURCE selected. Begin procedure.

This procedure generates a SOURCE for SHADOW.
Mode selected [ ? <ret> for HELP ] ? prompt
Call to INPUT
---------------------------------- S H A D O W  ------------------------------- 
 Jan 1992                     F.Cerrina                         ECE - UW         

 Defining source : 
When prompted for a yes/no answer, you may enter:
for   YES  answer      Y, 1
for   NO   answer      anything else




 Do you want a verbose [ 1 ] or terse [ 0 ] output ?
 ------------- SOURCE SPECS ------------------
 Source modelling type [ 0-5 ] ? 
 How many rays [ 1 - 5 000 ] ? 1000
 Seed [ odd, 1000 - 1 000 000 ] ? 092347
 Do you want to optimize the source ? 
 Source type : [ 0 ] regular source
              [ 1 ] normal wiggler
              [ 2 ] undulator
              [ 3 ] elliptical wiggler
 Then ? 
 X-Z plane source type [ 0-3 ] ? 
 Source Depth [ 1-4 ] ? 
 Source Angle Distribution [ 1-6 ] ? 
 Horizontal half-divergence [ (+)x, rads ] ? 0
                            [ (-)x, rads ] ? 0
 Vertical                   [ (+)z, rads ] ? .0005 05
                            [ (-)z, rads ] ? 0 .00005
 Do you want a Photon energy [ Y/N ] ? 1
 Energy distribution [ 1-3 ] ? 1
 Photon Energy [ 0 ] or Angstroms [ 1 ] ? 
 Energy [ eV ] ? 8035
 Do you want to store the optical paths (OPD) [Y/N] ? 
 Do you want to generate the A vectors (electric field)          [Y/N] ?
Exit from INPUT_SOURCE
Calling gen_source with /u1/src/shadow-6000/bin/gen_source start.00
Generated   250 rays out of   1000
            500
            750
            1000
Exit from SOURCE
SOURCE => Source has been succesfully generated.

SOURCE procedure completed.

Shadow:: exit

/* Now we run BRAGG to generate the crystal data needed by SHADOW        */

sanchez@sol> more bragg.inp
0
5.43
2
2
0
SI
SI
.2,9.67
0.3,8.22
0.4,7.2
0.2,9.67
0.3,8.22
0.4,7.2
5000
10000
50
1
1
si10_20.220
0


sanchez@sol> bragg < bragg.inp

/* Let's go with trace.                                                  */


sanchez@sol> GO trace

Ray Tracing Selected. Begin procedure.

Mode selected [ ? <ret> for HELP ] ? prompt
Call to RESET
Exit from RESET
Mode selected is: 
PROMPT                                                                          
Options: to start anew                 [ 0 ] 
            to restart from a given OE [ 1 ] 
 Then ? 
Call to INPUT_OE
---------------------------------- S H A D O W  ------------------------------- 
 Jan 1992                     F.Cerrina                         ECE - UW         
 
When prompted for a yes/no answer, you may enter:
for   YES  answer      Y, 1
for   NO   answer      anything else
 

 Defining Optical Element:  1
 Continue ? [ EXIT to terminate OS ] 




 Do you want a verbose [ 1 ] or terse [ 0 ] output ?
 
Files to write out. Options: 
All............................ [ 0 ] 
Mirror only.....................[ 1 ] 
Image at CP only................[ 2 ] 
None............................[ 3 ] 
  Then ? 
 Optical Element definition:
 Incidence Angle ? 
 Source Distance ? 1000
 Reflection Angle? 
 Image Distance  ? 1000
 Reflector [ 0 ] or refractor [ 1 ] ? 1
              /* Important!! */
 Mirror surface [ 1-9] ? 5
 Is the mirror Cylindrical ? 
 Is this optical element a Fresnel Zone Plate ? 
 Are we dealing with a Grating ? 
 Are we dealing with a crystal [ Y/N ] ? 1
File containing crystal parameters ?
si10_20.220
 Is it a mosaic crystal [ Y/N ] ? 
 What is the crystal thickness [cm] ? .0025
 Is the crystal asymmetric [ Y/N ] ? 1
              /* a symmetrical laue 
 Planes angle [ deg ] ? 90
                             crystal is the same
 Are we working in Johansson geometry [Y/N] ? 
         than an asymmetrical
 Automatic Tuning of Crystal [ Y/N ] ?1
                with alpha=90deg  */
 Energy, in eV, [ 0 ] or wavelength, in Angs., [ 1 ] ? 
 Photon Energy ? 8035
 Is the mirror convex [ Y/N ] ? 
 Orientation Angle [ Alpha ] ? 
 Mirror Dimensions finite [ Y/N ] ?
 Do you want to move the Source [ Y/N ] ? 
 Do you want to move the mirror itself [ Y/N ] ? 
 Distorted surface [ Y/N ] ? 
 Do you want to include surface roughness [Y/N] ? 
 Any screens in this OE [ Y/N ] ? 
 Slit at continuation plane [ Y/N ] ? 
 Extra Image plates [ Y/N ] ? 
 File containing the source array ? begin.dat
Exit from INPUT
Tracing optical element #   1
Call to SETSOUR
Exit from SETSOUR
Call to IMREF
Exit from IMREF
Call to OPTAXIS
Exit from OPTAXIS
Call to MSETUP
Exit from MSETUP
Call to RESTART
Exit from RESTART
Call to MIRROR
Exit from MIRROR
Call to IMAGE
Exit from IMAGE
Call to RESET
Exit from RESET
Do you want to change input mode ? 
Call to INPUT_OE
---------------------------------- S H A D O W  ------------------------------- 
 Jan 1992                     F.Cerrina                         ECE - UW         

 Defining Optical Element:  2
 Continue ? [ EXIT to terminate OS ] exit
End of session

Procedure completed.

Shadow:: exit

/* Done. Let's see the results. You can compare this result with 
   fig 4 of M. Lefeld-Sosnowska and C. Malgrange; phys. stat.sol. 34 
   (1969) pag 642. 
   See also T. Ishikawa, K. Hirano and S. Kikuta, NIM A308 (1991) 356   */

sanchez@sol> preplot
 PREPLOT> Input file ? star.01
Read           1000 rays.
Each ray has   12 entries.
 PREPLOT> How many columns to write out ? 2
 Row [1-12]  : the individual column
Row   [20]  : R = SQRT(X**2 + Y**2 + Z**2)
Row   [21]  : angle from the Y-axis
Row   [22]  : the magnitude of A vector
Row   [23]  : A**2
 PREPLOT> Row # 1 : 6
 PREPLOT>       2 : 23
Options --- Enter
0 for excluding the losses
1 for including losses at a particular O.E.
2 for plotting all the rays .
3 for plotting ONLY the losses (all of them)
4 for plotting ONLY the losses at a given O.E.
 PREPLOT> Then ? 
***********
Found   1000 good points out of  1000
Output options :
  [ 0 ] store rays in a file
  [ 1 ] plot directly on screen
  [ 2 ] both
 Then ? 
 PREPLOT> Output file ? preplot.dat



