-
Notifications
You must be signed in to change notification settings - Fork 54
HOWTO: McXtrace reflectivity files
This page is intended to document how reflectivity datafiles for use with McXtrace may be generated.
McXtrace includes a few data-files (in the data folder of your installation), that may be used as examples, but other than that these are simply ascii-files that contain either material parameters from which one may compute reflectivity number or reflectivity itself. McXtrace accepts a few different parametrizations of reflectivity, e.g. as function of q, or as a function of Energy and glancing angle θ.
The top of the file should look like this:
#param=q
#q_min=0.1
#q_max=0.2
#q_step=0.01
0.1 1.0
0.101 0.99
...
The order of the header lines is not significant. The q_min,q_max,q_step lines are not strictly necessary but it is advisable. Any other lines (before the data block) beginning with # are ignored, so it is possible (and desirable) to include additional comments about what the contents of the file, e.g. recipe for multilayer.
The top of the file should the look like:
#param=eth
#E_min=0.1
#E_max=120
#E_step=0.001
#theta_min=0.001
#theta_max=2
#theta_step=0.0002
1.0 0.99 0.989 0.987 0.8 ...
0.99 0.98 0.979 0.976 0.77 ...
...
In this case the energy and theta values are implicit. The columns correspond to theta in degrees, and rows to energy in keV.
Using a version of the script/program found in support/scripts - layer_SiO2.pro we may generate a mirror reflectivity file by means of the following recipe (on Linux), assuming you have access to IDL and IMD.
- Start IDL:
idl
- From within the IDL command prompt, compile but don't actually run imd by
.compile imd
. You can also do:.r imd
but then you have quit the GUI before continuing. - Generate a set of layer depths:
Example: zdepths=[100,200,300]
- Specify a set of materials: Example:
mats=['Cr','Zr','Ir']
- Set q limits and number of sampled points in the format [q_min,Nq,q_max] : Example:
qq=[0.001,200,1.001]
- Run the scripting layer:
Example:qcompute, OUTFILE='output_data', mats, zdepths, qq,comment='I am a comment to appear in the header'
If an energy,theta parameterization is what you want, replace step 6 with something akin to:
ethcompute, OUTFILE='output_data', mats, zdepths, Energy, g_angle, comment='I am a comment to appear in the header'
,
where Energy and g_angle are triplets similar to qq above.
If you only have access to the 7 minute demo version of IDL, you may call qcompute
and ethcompute
without setting OUTFILE and copy-the console output to a file manually, but be aware that you may introduce additional linebreaks in the Energy,theta case if you have a large number of sample steps in theta.