***************************************************************************

   DEMO      record file

   
====================
 
  Description of POWER  distribution calculations.

  Prerequisite:		run of SHADOW with appropriate reflectivities ON.

  Programs used:	INTENS
     			H2KOL
     			FMAX
     			FILEX
     			TDTEK
******************************************************************************


System PSLC (vms 4.3)

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

PASCAL upgraded to version 3.3. Read $BULLETIN.
Ingres user's -- to avoid unnecessary file charges read $BULLETIN.

    Last interactive login on Tuesday, 29-APR-1986 22:37
    Last non-interactive login on Tuesday, 25-FEB-1986 21:46

You are logged into _RTA1:

Graphic device [ e.g. TTB3: ] : tt:

All logical names command defined.

Enter $GO to activate SHADOW.

Enter HELPSHA for help.

Type NEWS for recent modifications.:

$ sd [.demo.temp]
$ 
$ 
$ 
$ 
$ 
$ //
$ //		To generate a power file source, we run INTENS on the
$ //		output of SHADOW, followed by H2KOL on the output from INTENS.
$ // 		FILEX is used to rescale arrays.
$ //
$ //		The run must have been performed with the reflectivity 'ON'
$ //
$ //
$ 
$ intens
File for Intensity calculations ? 
MIRR.01
Read         2000rays.
Total intensity is :   437.0125    
Normalize by the number of rays [ y=1, n=0 ] ? 
Y
What ? [ Program expects integer number input ]
Normalize by the number of rays [ y=1, n=0 ] ? 
1
Normalized intensity is :  0.2185063    
Do you want a local plot ? 
1
Options:
Intensity transmitted/reflected ....... 0
Intensity absorbed .................... 1
Local reflectivity/transmission ....... 2
 Then ? 
1						//  We want absorbed power
 Power = [ 1 ], # photons = [ 0 ] 
1
Input I0 file : 
BEGIN.DAT					//  Incoming power file
Renormalize I0 file [ Y/N ] ? 
N
File-name  for [x,y] file ? 
M1					
Bi [ 0 ] or Tri-dimensional plot [ 1 ] ? 
0						//  Must be 2-d for further
     						//  manipulations
Row for plot x-axis ? 
2
File for Intensity calculations ? 
MIRR.02
Read         2000rays.
Total intensity is :   257.7355    
Normalize by the number of rays [ y=1, n=0 ] ? 
1
Normalized intensity is :  0.1288678    
Do you want a local plot ? 
1
Options:
Intensity transmitted/reflected ....... 0
Intensity absorbed .................... 1
Local reflectivity/transmission ....... 2
 Then ? 
1
 Power = [ 1 ], # photons = [ 0 ] 
1
Input I0 file : 
STAR.01
Renormalize I0 file [ Y/N ] ? 
N
File-name  for [x,y] file ? 
M2
Bi [ 0 ] or Tri-dimensional plot [ 1 ] ? 
0
Row for plot x-axis ? 
2
File for Intensity calculations ? 
^C
$ 
$ //  			The two files contain the absorbed fraction of power
$ //  			from each ray at the intercept
$ 
$ fmax
File-name ?
m1.dat
Read         1000 points.
Found :
XMIN	  -1.433238      . Set at :  -1.755963    
XMAX	   1.435431                   1.758156    
YMIN	  1.0568811E-17              1.0264918E-17
YMAX	  1.3270088E-17              1.3573982E-17
Good luck !
$ 
$ 
$ fmax
File-name ?
m2.dat
Read         1000 points.
Found :
XMIN	  -3.728565      . Set at :  -4.588326    
XMAX	   3.913751                   4.773512    
YMIN	  3.6025858E-18              3.5526712E-18
YMAX	  4.0462723E-18              4.0961868E-18
Good luck !
$ 
$ //  
$ //  				Build up the histograms
$ //  
$ 
$ h2kol
Input file ? 
m1.dat
Column to analyze       [ 1 or 2 ] ? 
1
Center  ? 
0
Width ? 
3.5
Number of bins          [ max=100 ] ? 
17
Normalization kind. Enter :
0	for no normalization
1	to normalize to 1         [ at the peak ]
2	to the total counts       [ divide by N ] 
3	use the other col. to fill in the bins 
<?>
3
Read         2000
$ 
$ 
$ h2kol
Input file ? 
m2
Column to analyze       [ 1 or 2 ] ? 
1
Center  ? 
0
Width ? 
8.4
Number of bins          [ max=100 ] ? 
17
Normalization kind. Enter :
0	for no normalization
1	to normalize to 1         [ at the peak ]
2	to the total counts       [ divide by N ] 
3	use the other col. to fill in the bins 
<?>
3
Read         2000
$ 
$ 
$ t h2kol.dat;*



 -4.200000      0.0000000E+00
 -3.675000      2.9188454E-16
 -3.150000      5.2802313E-16
 -2.625000      5.3847028E-16
 -2.100000      5.3306674E-16
 -1.575000      5.1017816E-16
 -1.050000      5.0364849E-16
-0.5249999      5.2887059E-16
 0.0000000E+00  5.5003143E-16
 0.5250001      4.9525132E-16
  1.050000      5.4680275E-16
  1.575000      4.8872975E-16
  2.100000      5.4585260E-16
  2.625000      5.5984050E-16
  3.150000      5.3590689E-16
  3.675000      4.5911102E-16
  4.200000      0.0000000E+00



 -1.750000      0.0000000E+00
 -1.531250      5.9401600E-17
 -1.312500      1.8980702E-15
 -1.093750      1.8265103E-15
-0.8750000      1.9936953E-15
-0.6562500      1.7845784E-15
-0.4375000      2.0187412E-15
-0.2187500      1.7040385E-15
 0.0000000E+00  1.9176676E-15
 0.2187500      1.8100296E-15
 0.4375000      1.7362693E-15
 0.6562500      1.7138647E-15
 0.8750000      1.9259223E-15
  1.093750      1.6664359E-15
  1.312500      1.7914486E-15
  1.531250      8.3393120E-17
  1.750000      0.0000000E+00
$ 
$ 
$ 
$ 
$ //   The absorbed power is of course per photon. It must be renormalized
$ //   by the total source output.
$ 
$ //   For example, if the source emits a total power of 25 W in the sampled
$ //   volume, we can determine a conversion factor in the following way:
$ 
$ preplot
PREPLOT> Input file ? 
begin.dat
PREPLOT> Output file ? 
beg
PREPLOT> How many rows to write out ? 
2
Row [1-12]  : the individual column
Row   [13]  : R = SQRT(X**2 + Y**2 + Z**2)
Row   [14]  : angle from the Y-axis
Row   [15]  : the magnitude of A vector
Row   [16]  : A**2
PREPLOT> Row # 1 : 
11
PREPLOT>       2 : 
16
Option:    Angstroms        [ 0 ] 
           Electronvolts    [ 1 ] 
           Cm-1             [ 2 ] 
PREPLOT> Then ? 
1
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 ? 
0
***********
Found         2000 good points out of        2000
$ 
$ 
$ 
$ //   The file "beg.dat" contains {photon energy, A^2}.
$ 
$ t beg.dat
 0.25550719E+03           0.50000000E+00
 0.25644699E+03           0.50000000E+00
 0.27710345E+03           0.50000000E+00
 0.25891879E+03           0.50000000E+00
 0.27312643E+03           0.50000000E+00
^O					//  Suppresses output
^O					//  Resumes Output
 0.25161171E+03           0.50000000E+00
 0.26942551E+03           0.50000000E+00
 0.26202133E+03           0.50000000E+00
 0.27226688E+03           0.50000000E+00
 0.25160616E+03           0.50000000E+00
 0.27603320E+03           0.50000000E+00
 0.25824911E+03           0.50000000E+00
 0.27972183E+03           0.50000000E+00
$ //  
$ //   A^2 is 0.5 because the beam was linearly polarized at 45 deg.
$ //  
$ 
$ filex
FILEX > ?
                    PROGRAM       FILEX                                         
                                                                                
                                                                                
 This program is a file manipulation utility. Operations are performed on       
two files having the format of an (x,y) table and the same number of elements.  
Command format is:                                                              
                                                                                
                 file-out = file1 /oper/ file2                                  
                                                                                
where /oper/ is an operation symbol, like *, +, -, /.                           
                                                                                
 If file2 is written as %123, then 123 will be used as a factor for the         
Y (second) column.                                                              
                                                                                
 The following symbols operates only on one file. They are                      
                                                                                
    &      Sum of X,Y                       #        Computes 1/Y               
    ^      Derivative of Y                  ~                 SQRT (Y)          
    @      Integral of second column                                            
    "      Interchange X and Y                                                  
    \      Inverts the sequential order ( 1 --> N, N --> 1 )                    
    |      Replace Y with X*Y                                                   
FILEX > 
temp = beg |					//  Multiplies eV by A^2
FILEX > read         2000 records.
FILEX > Succesful completion
FILEX > 
temp = temp * %1.6e-19				//  Go to Joules
FILEX > read         2000 records.
FILEX > Succesful completion
FILEX > 
nl: = temp &				//  Computes the sum of the energies
FILEX > read         2000 records.
FILEX > Sum of temp                           X column : 
  530407.3066599998    
FILEX > Sum of temp                           Y column : 
 4.2432584532800002E-14
FILEX > Succesful completion
FILEX > 
$ 
$ //  
$ //   The factor:
$ //  
$ //              x =  (total power) / (sum of rays energy)
$ //  
$ //   gives the conversion factor. In our case:
$ //  
$ //              x =  25 / 4.2432e-14 = 5.892 E 14
$ //  
$ dir h2kol

Directory D2:[SHADOW.DEMO.TEMP]

H2KOL.DAT;2               2  29-APR-1986 23:56  (RWED,RWED,RE,RE)
H2KOL.DAT;1               2  29-APR-1986 23:56  (RWED,RWED,RE,RE)

Total of 2 files, 4 blocks.
$ 
$ 
$ //  
$ //   Now build the final power distributions
$ //  
$ filex
FILEX > 
M1_Y = H2KOL.DAT;1 * %5.892E14		//  Scale the histograms to 25 watts
FILEX > read           17 records.
FILEX > Succesful completion
FILEX > 
NL: = M1_Y &
FILEX > read           17 records.
FILEX > Sum of M1_Y                           X column : 
 0.0000000000000000E+00
FILEX > Sum of M1_Y                           Y column : 
  14.09959525250400    			//  Power absorbed at M1
FILEX > Succesful completion
FILEX > 
M2_Y = H2KOL.DAT * %5.892E14
FILEX > read           17 records.
FILEX > Succesful completion
FILEX > 
NL: = M2_Y &
FILEX > read           17 records.
FILEX > Sum of M2_Y                           X column : 
 1.9999999967268423E-07
FILEX > Sum of M2_Y                           Y column : 
  4.487151697548000    			//  Power absorbed at M2
FILEX > Succesful completion
FILEX > 
$ 
$
$
$ //   By comparison, if 25 W is the incoming power from the source, the data
$ //   from EFFIC.xx gives an absorbed value (total) of 18.68 watts vs. 18.58
$ //   watts.
$ //   Notice that the rescaled M1_Y and M2_Y gives the power absorbed in each
$ //   bin, i.e., the local power density.
$
$ 
$ LOGO
  SHADOW       logged out at 30-APR-1986 00:17:44.12
