Download and compile the program waviness_gen.f (A DOS-compiled version is also available: waviness_gen.exe)
We are going to show the use of the waviness model. The process is the following:
We will use a circular source of .1mm diameter and divergences of
200urad(H) x 50urad(V). We will use an ellipsoidal mirror with
magnification factor equal to 1/3.
We want a slope error about 0.6 arcsec along the mirror and about 2.3 arcsec in transversal direction.
Reference: M. Sanchez del Rio and A. Marcelli, NIM A319 (1992) 170-177
First run waviness_gen. You can run interactively or use an input
file (you do not get tired typing all the harmonics)
expgc.shadow<82> cat waviness.inp waviness.dat 10 100 /*Npoints in X and Y directions (respectively) */ 1.5 35.0 /* Mirror dimensions (X and Y) */ 32 0.64 /*number of harmonics to consider and estimated slope error rms value [in arcsec' */ 9786565 /* seed for the random number generator */ 1 0 0 /* amplitude, initial shift and interval for the shift for the harmonic zero. The amplitud set to one means to use that harmonic, zero means to ignore it, and other values are used as a weight */ 1 0 0 /* idem for 1st harmonic */ 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 1 0 0.1 expgc.shadow<83> waviness_gen < waviness.inp Name of output file for shadow ? input number of points along the X(transversal) and Y(along) directions of the mirror ? input mirror width and mirror length [in user units] ? input # of harmonics to be considered and an estimation of the wanted slope error [arcsec] ? Input the seed for the random number generator : Now for each harmonic input three values: i) C: weighting coefficient 0<=C<=1 ii) y: an initial random phase shift iii) g: a fraction of the total lenght interval for harmonic # 0 input C,y,g ? 4.88727E-05 0. 0. for harmonic # 1 input C,y,g ? 1.62909E-05 0. 0. for harmonic # 2 input C,y,g ? 9.77454E-06 0. 1.00000E-01 for harmonic # 3 input C,y,g ? 6.98182E-06 0. 1.00000E-01 for harmonic # 4 input C,y,g ? 5.43030E-06 0. 1.00000E-01 for harmonic # 5 input C,y,g ? 4.44297E-06 0. 1.00000E-01 for harmonic # 6 input C,y,g ? 3.75944E-06 0. 1.00000E-01 for harmonic # 7 input C,y,g ? 3.25818E-06 0. 1.00000E-01 for harmonic # 8 input C,y,g ? 2.87487E-06 0. 1.00000E-01 for harmonic # 9 input C,y,g ? 2.57225E-06 0. 1.00000E-01 for harmonic # 10 input C,y,g ? 2.32727E-06 0. 1.00000E-01 for harmonic # 11 input C,y,g ? 2.12490E-06 0. 1.00000E-01 for harmonic # 12 input C,y,g ? 1.95491E-06 0. 1.00000E-01 for harmonic # 13 input C,y,g ? 1.81010E-06 0. 1.00000E-01 for harmonic # 14 input C,y,g ? 1.68527E-06 0. 1.00000E-01 for harmonic # 15 input C,y,g ? 1.57654E-06 0. 1.00000E-01 for harmonic # 16 input C,y,g ? 1.48099E-06 0. 1.00000E-01 for harmonic # 17 input C,y,g ? 1.39636E-06 0. 1.00000E-01 for harmonic # 18 input C,y,g ? 1.32088E-06 0. 1.00000E-01 for harmonic # 19 input C,y,g ? 1.25315E-06 0. 1.00000E-01 for harmonic # 20 input C,y,g ? 1.19202E-06 0. 1.00000E-01 for harmonic # 21 input C,y,g ? 1.13657E-06 0. 1.00000E-01 for harmonic # 22 input C,y,g ? 1.08606E-06 0. 1.00000E-01 for harmonic # 23 input C,y,g ? 1.03984E-06 0. 1.00000E-01 for harmonic # 24 input C,y,g ? 9.97402E-07 0. 1.00000E-01 for harmonic # 25 input C,y,g ? 9.58288E-07 0. 1.00000E-01 for harmonic # 26 input C,y,g ? 9.22127E-07 0. 1.00000E-01 for harmonic # 27 input C,y,g ? 8.88595E-07 0. 1.00000E-01 for harmonic # 28 input C,y,g ? 8.57416E-07 0. 1.00000E-01 for harmonic # 29 input C,y,g ? 8.28351E-07 0. 1.00000E-01 for harmonic # 30 input C,y,g ? 8.01192E-07 0. 1.00000E-01 for harmonic # 31 input C,y,g ? 7.75757E-07 0. 1.00000E-01 for harmonic # 32 input C,y,g ? 7.51888E-07 0. 1.00000E-01 Slope error RMS along Y is: 0.602292 arcsec Slope error RMS along X is: 2.35124 arcsec Output file is : waviness.dat Don`t forget to run PRESURFACE before SHADOW
As a result, you obtain the slope error of the generated surface. If is OK, you can continue, otherwise rerun waviness_gen modifying the input of the estimated slope error in Y in the correct sense. If you want to increase (reduce) the slope error value in (X) you should reduce (increase) the number of points in X.
expgc.shadow<84> presurface File containing the surface mesh ? waviness.dat Setting up 10 by 100 array. Array read correctly. Compute spline. Spline succesfully completed. Please enter file-name for storage: waviness.sha Task completed. Spline stored in waviness.sha expgc.shadow<85> go source SOURCE selected. Begin procedure. This procedure generates a SOURCE for SHADOW. Mode selected [ ?
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 ?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 ] ? How many rays [ 1 - 5 000 ] ? 5000 Seed [ odd, 1000 - 1 000 000 ] ? 234777 Do you want to optimize the source ? Source type : [ 0 ] regular source [ 1 ] normal wiggler [ 2 ] undulator [ 3 ] elliptical wiggler Then ? 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 ] ? 2 Source Width [ x ] ? .01 Height [ z ] ? .01 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 ] ? 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 ] ? 1 Horizontal half-divergence [ (+)x, rads ] ? 100e-6 [ (-)x, rads ] ? 100e-6 Vertical [ (+)z, rads ] ? 25e-6 [ (-)z, rads ] ? 25e-6 Do you want a Photon energy [ Y/N ] ? 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 /civa/users/b/shadow/shadow92/bin/gen_source start.00 Generated 250 rays out of 5000 500 750 1000 1250 1500 1750 2000 2250 2500 2750 3000 3250 3500 3750 4000 4250 4500 4750 5000 Exit from SOURCE SOURCE => Source has been succesfully generated. SOURCE procedure completed. Shadow:: trace Ray Tracing Selected. Begin procedure. Mode selected [ ? 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 ?1 You may save disk space by not writing out the intermediate STAR or MIRR data files. In general you will not need them unless you have specific needs (footprints, etc.) Files to write out. Options: All............................ [ 0 ] Mirror only.....................[ 1 ] Image at CP only................[ 2 ] None............................[ 3 ] Then ? 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 ? 88.5 Source Distance ? 3000 Reflection Angle? 88.5 Image Distance ? 1000 Reflector [ 0 ] or refractor [ 1 ] ? 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] ? 2 Do you want to specify the mirror parameters ?0 Is the mirror Cylindrical ? 0 Is this optical element a Fresnel Zone Plate ? 0 Are we dealing with a Grating ? 0 Are we dealing with a crystal [ Y/N ] ? Is the mirror convex [ Y/N ] ? Reflectivity of Surface. SHADOW may solve the Fresnel equations locally. Available options:No reflectivity .......... 0 Full polarization dependence .......... 1 No " " .......... 2 Reflectivity mode [ 0,1,2 ] ? 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 ] ? Mirror Dimensions finite [ Y/N ] ? The mirror will be computed from the optical parameters that you supply. For example,in the case of a spherical mirror I will compute the radius of the mirror to satisfy the equation 1/p + 1/q = 2/(R*cos(theta)) given p,q and theta. This will NOT affect in any way the placement of the mirror in the optical element. Focii placed at continuation planes [ Y/N ] ? 1 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 ] ? --- 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 ] ? Distorted surface [ Y/N ] ? 1 Sinusoidal ripple (0) Gaussian ripple (1) External spline (2) Type of distortion ? 2 File to read ? waviness.sha 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 expgc.shadow<86> idl IDL. Version 2.2.2 (sunos sparc). Copyright 1989-1992, Research Systems, Inc. All rights reserved. Unauthorized reproduction prohibited. Site: 1796. Licensed for use by: ESRF IDL> set_plot,'ps' IDL> device,filename='plotxy.ps' IDL> plotxy,'star.01',1,3,/cart % Compiled module: PLOTXY. % Compiled module: READSH. % Compiled module: GETRAYS. 12cols 5000points 0=error flag % Compiled module: ROUND. % Compiled module: CART_AXES. % Compiled module: HISTOGRAMW. IDL> exit expgc.shadow<87> ls XtermLog.a3913 end.00 optax.01 start.00 waviness.inp begin.dat end.01 plotxy.ps start.01 waviness.sha effic.01 mirr.01 star.01 waviness.dat