****************************************************************************** 
 This is a demo on how to ray-trace a Fresnel Zone Plate with SHADOW.
****************************************************************************** 
System PSLC (vms 4.5)

Username: XRAYOP
Password: 
                    Welcome to VAX/VMS Version 4.5
                  University of Wisconsin - Madison
                     Physical Sciences Laboratory


    Last interactive login on Saturday, 16-JAN-1988 13:51
    Last non-interactive login on Wednesday, 13-JAN-1988 13:21

    You are logged into _RTA1:



Defining Logical Names and Environmental Parameters
Graphics device [e.g. TTD3: ] ? : TT

All logical names and command defined.

Enter $GO to activate SHADOW.

Enter HELPSHA for help.

Type NEWS for recent modifications.: 
$ SD [.FZP]
$ DIR
%DIRECT-W-NOFILES, no files found
!
! Let us look at the simple case of a point source being refocus by the Zone
! Plate.
!
$ GO SOURCE



  :::::::  :::    ::            :::    :::::::        :::::     :::  ::  ::
 ::::::::  :::    ::           ::::    ::::::::      :::::::    :::  ::  ::
:::        :::    ::          ::: :    :::   :::    :::    ::   :::  ::  ::
:::        :::    ::         ::: ::    :::    ::    :::    ::   :::  ::  ::
 :::::::   :::::::::        :::  ::    :::    ::    :::    ::   :::  ::  ::
  :::::::  :::::::::       :::   ::    :::    ::    :::    ::   :::  ::  ::
       ::  :::    ::      :::    ::    :::    ::    :::    ::   :::  ::  ::
      :::  :::    ::     :::     ::    :::   :::    :::   :::   ::: ::: :::
::::::::   :::    ::    :::      ::    ::::::::      :::::::     :::::::::
:::::::    :::    ::   :::       ::    :::::::        :::::       ::: :::




VERSION     87.3                                               1 December 1987




Hit <RETURN> when ready: 


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  ------------------------------- 
Mar 1987                                         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 ? 1

------------- SOURCE SPECS ------------------
Options available:
Random in  BOTH REAL and MOMENTUM space		      0
Grid       BOTH					      1
Grid       REAL, random  MOMENTUM	              2
Random     REAL,  grid   MOMENTUM		      3
Ellipses in PHASE space, random around each ellipse   4
Ellipses in PHASE space,   grid around each ellipse   5
Source modelling type [ 0-5 ] ?  0
How many rays [ 1 - 5 000 ] ?  500
Seed [ odd, 1000 - 1 000 000 ] ?  12579
Do you want to optimize the source ?  0

Is this a wiggler source ?  0

 The source is specified in the laboratory reference frame. The program will then rotate the set of 
rays in the mirror frame.

Type of source,now.

         use  ( 0 ) for point source  
              ( 1 ) for rectangular s.
              ( 2 ) for elliptical  s.
              ( 3 ) for gaussian    s.

X-Z plane source type [ 0-3 ] ?  0

Source depth. The actual source will be centered on the no-depth position. Use 
         	(1) for no depth,
         	(2) for flat depth distribution,
         	(3) for gaussian depth distribution,
                (4) for a synchrotron source depth distr.

                   	Then ? 
Source Depth [ 1-4 ] ?  1


O.K., got it so far.
         Source distribution now. We may use 
             ( 1 ) for a flat source
             ( 2 )       uniform   s.
             ( 3 )       gaussian  s.
             ( 4 )       synchrotron 
             ( 5 )       conical 
             ( 6 )       exact synchrotron 

Source Angle Distribution [ 1-6 ] ?  2
Horizontal half-divergence [ (+)x, rads ] ?  0.005
                           [ (-)x, rads ] ?  0.005
Vertical                   [ (+)z, rads ] ?  0.005
                           [ (-)z, rads ] ?  0.005
Do you want a Photon energy [ Y/N ] ? 
Y
We have these choices :
Single line ......................... 1
Several lines ....................... 2
Uniform source....................... 3
Energy distribution [ 1-3 ] ?  1
Photon Energy [ 0 ] or Angstroms [ 1 ] ?  1
Wavelength [ A ] ?  5000

Do you want to store the optical paths (OPD) [Y/N] ?  O
Do you want to generate the A vectors (electric field) [Y/N] ? O
Exit from INPUT_SOURCE


Generated          250 rays out of          500
                   500
Exit from SOURCE
SOURCE => Source has been succesfully generated.

SOURCE procedure completed.

!
! Now the zone plate is defined as a transmission holographic grating, with 
! a REAL recording source on one side and a virtual source on the other side.
!
Shadow:: TRACE


Ray Tracing Selected. Begin procedure.


Mode selected [ ? <ret> for HELP ] ? : PROMPT
PROMPT selected.
Call to RESET
Exit from RESET


Mode selected is: 
PROMPT                                                                          
Options: to start anew                 [ 0 ] 
            to restart from a given OE [ 1 ] 
Then ?  0
Call to INPUT_OE


---------------------------------- S H A D O W  ------------------------------- 
Mar 1987                                         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 ? [ ^Z or %EXIT to terminate OS ]  1

 
Do you want a verbose [ 1 ] or terse [ 0 ] output ? 1

	Let's define the optical or central axis of the system
for this particular optical element.
	By this I mean a "virtual" line that runs throughout
the optical system. Along this line are located the 
"continuation" planes, where the OS is subdivided in the
individual OE. This line does not have to coincide with the
true optical axis, as it is used mainly for bookeeping the
data, but it helps greatly in the data analysis if this
identity is preserved as everything in the program is referredto it.
	Once established, you still have complete freedom of
"moving" around the mirrors. 
In the case of a grating, you will have several choices. The 
program may override your specifications for the central axis 
and locate the source and image at the "best" position. 
You will be prompted later for this option.
It is recommended to use CM as units. This is not critical for
 most cases, but it is in the case of diffraction elements.
Optical Element definition:
Incidence Angle ?  0
Source Distance ?  10
Reflection Angle?  180
Image Distance  ?  10
Reflector [ 0 ] or refractor [ 1 ] ?  1		! Transmission case

Enter the index of refraction in OBJECT space:
Object space: 1.0
Enter the index of refraction in IMAGE space:
Image space:  1.0

Lets define the mirror. I may compute its parameters, like the
radius or the axes. This will not affect the rest of the calcu
lations; all the geometrical parameters may be modified later.
Or, you may wish to specify the mirror parameters yourself.


What kind of surface are we dealing with ?
spherical    = 1
elliptical   = 2
toroidal     = 3
paraboloid   = 4
plane        = 5
Codling slit = 6
hyperbolical = 7
cone	      = 8
polynomial   = 9

Mirror surface [ 1-9] ?  5
Is the mirror Cylindrical ?  0
Is this optical element a Fresnel Zone Plate ?  1
Are we dealing with a Grating ?  1

 For a Fresnel Zone Plate select the appropriate  Holographic case.
Type of ruling.
0    ruling density constant on the X-Y plane
1    for ruling density constant onto the mirror surface.
2    for an holographic grating.
3    for an oriental-fan type
4    reserved
5    polynomial line density
Then:  2
Hologram Recording Parameters.
The angles are positive if the source is on the side of the Y-axis.
"EnS" means Entrance Slit Side Source
"Rotation" refers to rotation around Z
Distances [ cm! ] and angles [ degrees ] refer to hologram.
EnS distance:  10
EnS incidence angle:     0
EnS rotation  angle:     0
ExS distance:  10
ExS incidence angle:     180
ExS rotation  angle:     0
Recording Wavelength [ Angs ] ?  5000
Type of recording sources. We have the choices: 
Both    SPHERICAL                    0
Source  PLANE,     image SPHERICAL   1
Source  SPHERICAL, image PLANE       2
Source  PLANE,     image PLANE       3
Source type [ 0-3 ]. Then ?  0
The SPHERICAL source can also be specified to be CYLINDRICAL, with axis perpendi
cular to recording plane.
Use: 
None   Cylindrical                    0
Source Cylindrical, image Spherical   1
Source Spherical,   image Cylindrical 2
Both   Cylindrical                    3
Cylindrical [ 0-3 ] ?  0
Sources REAL/ VIRTUAL: 
EnS real,    ExS real		0
EnS real,    ExS virtual: 	1
EnS virtual, ExS real:  	2
EnS virtual, ExS virtual 	3
Then ?  1				! Notice REAL/REAL will NOT work.
 
We follow the European convention. NEGATIVE orders are inside.
Diffraction Order ?  -1
Enter 1 if you want me to position the grating at the correct
wavelength, 0 to leave everything as it is.
Auto Tuning of Grating [ Y/N ] ?  0	! DO NOT use auto tuning.

Is the mirror convex [ Y/N ] ?  0


Mirror orientation angle. Angles are measured CCW, in deg,
referring to the mirror normal. Alpha=0 is the mirror
sitting at the origin, facing up. Alpha = 90 is the 
mirror standing at your right and facing left when you 
look along the beam STANDING ON THE PREVIOUS MIRROR and so on.
Orientation Angle [ Alpha ] ?  0

Mirror Dimensions finite [ Y/N ] ? 0

 The Optical Element and the the relative mirror are now fully 
defined. The mirror pole is now located at the "center" of the 
optical element. It is possible to override this situation and 
"move" the mirror without affecting the rest of the system.
 It is also possible to move the "source" without affecting the
rest of the system.
 The movements are expressed in the DEFAULT Mirror Ref. Frame.
 so that if you move BOTH source and mirror the relative
movement is the vector sum of the individual ones.
A word of caution: SOURCE movements and MIRROR movements are
NOT equivalent from the point of view of the whole system.
Do you want to move the Source [ Y/N ] ?  0
   
--- Mirror rotations and position. ---
We define three angles, as rotations around the three axis.
These rotation are  defined in the program as corrections to
the mirror nominal position; that is, they modify the mirror
position relative to the Default Mirror Reference Frame, where
all the calculations are performed. Remember that rotations
do NOT commute. I apply them in the same order of entry.
CW ROTATIONS are (+) angles. A translation can be also applied to the mirror.
Do you want to move the mirror itself [ Y/N ] ?  0
Rippled surface [ Y/N ] ?  0

Any screens in this OE [ Y/N ] ?  0

Slit at continuation plane [ Y/N ] ?  0
Extra Image plates [ Y/N ] ?  0
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  ------------------------------- 
Mar 1987                                         F.Cerrina        ECE - UW      

Defining Optical Element:  2
Continue ? [ ^Z or %EXIT to terminate OS ]  %EXIT


End of session

 
Procedure completed. Return to COMMAND level


Procedure completed.

Shadow:: EXIT


Exit to DCL
! 
! First see if we have a point image.
! 
$ MINMAX
Input file ? 
STAR.01
Options --- Enter
0 for excluding the losses
1 for including losses at a particular O.E.
2 for including all the losses.
Then ? 
0
Comment ?
Checking image size at focal plane.
***********
File examined is :
D13:[XRAYOP.FZP]STAR.01;1                                   
Was created :
16-JAN-1988 14:07
***********
Found          500 good points out of         500
Here we are.
X max is  6.9388939E-18
X min is -9.5409791E-18
Y max is  3.0279297E-34
Y min is -4.6167839E-34
Z max is  1.0476316E-17
Z min is -6.8709191E-18
X prime max is  4.9590040E-03
X prime min is -4.8578912E-03
Y prime max is   1.000000    
Y prime min is  0.9999781    
Z prime max is  4.9963933E-03
Z prime min is -4.9846838E-03
!
! Now look at the rays from source to image.
!
$ SYSPLOT
File [ 0 ]  or tt [ 1 ] ?  1
Bidimensional [ 0 ] or 3d plot [ 1 ] ? 0
How many mirrors ? 1
How many rays [ suggest no more than 200 (500 max) ] ? 50
Optaxis file ? OPTAX.01
Source file and (final) image file ?
BEGIN.DAT
STAR.01
Mirror N.            1 ?
MIRR.01
Plot all the losses too [ Y/N ] ? N

Columns to plot out (first is horizontal) ?
2			! Y
3			! X
$ TDFILE
TOP DRAWER (10/10/80) NOW EXECUTING

LIMIT X 0 20 Y -0.05 0.05
           1  LIMIT X 0 20 Y -0.05 0.05                                                                 
                                                                           
@SYSPLOT.DAT
READING FROM INDIRECT COMMAND FILE: SYSPLOT.DAT                     
           2    0.0000000E+00  0.0000000E+00                                                            
                                                                           
           3     10.00000      3.0748326E-02                                                            
                                                                           
           4     20.00000      0.0000000E+00                                                            
                                                                           
           5   JOIN 1                                                                                   
                                                                           
           6    0.0000000E+00  0.0000000E+00                                                            
	.		.
	.		.
	.		.
                                                                           
END
         202  END                                                                                       
                                                                           
FORTRAN STOP
$ LOG
  XRAYOP       logged out at 16-JAN-1988 14:11:51.92
