igor-public/doc/html/pag_anglescan_processing.html

278 lines
28 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PEARL Procedures: Angle-scan processing</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">PEARL Procedures
&#160;<span id="projectnumber">rev-distro-2.1.1-1-gf419e92-dirty</span>
</div>
<div id="projectbrief">Igor procedures for the analysis of PEARL data</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('pag_anglescan_processing.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Angle-scan processing </div> </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#sec_anglescan_intro">Introduction</a></li>
<li class="level1"><a href="#sec_import">Data reduction</a><ul><li class="level2"><a href="#sec_import_basics">Basic steps</a></li>
<li class="level2"><a href="#sec_import_intlinbg">Peak integration over linear background</a></li>
<li class="level2"><a href="#sec_import_peakfit">Peak fitting</a></li>
<li class="level2"><a href="#sec_import_custom">Custom reduction functions</a></li>
</ul>
</li>
<li class="level1"><a href="#sec_norm">Normalization</a><ul><li class="level2"><a href="#sec_norm_prep">Preparations</a></li>
<li class="level2"><a href="#sec_norm_crop">Detector angle range</a></li>
<li class="level2"><a href="#sec_norm_angle">Normalize detector angle</a></li>
<li class="level2"><a href="#sec_norm_wobble">Azimuthal variation (wobble)</a></li>
<li class="level2"><a href="#sec_norm_theta">Polar dependence</a></li>
</ul>
</li>
<li class="level1"><a href="#sec_plot">Binning and plotting</a><ul><li class="level2"><a href="#sec_plot_basics">Basic steps</a></li>
<li class="level2"><a href="#sec_plot_refine">Refinements</a></li>
<li class="level2"><a href="#sec_plot_interp">Interpolation</a></li>
<li class="level2"><a href="#sec_modulation">Modulation function</a></li>
<li class="level2"><a href="#sec_projection">Projection</a></li>
</ul>
</li>
<li class="level1"><a href="#sec_export">Data export</a><ul><li class="level2"><a href="#sec_export_plot">Export picture</a></li>
<li class="level2"><a href="#sec_export_data">Export processed data</a></li>
</ul>
</li>
</ul>
</div>
<div class="textblock"><h1><a class="anchor" id="sec_anglescan_intro"></a>
Introduction</h1>
<p>This page describes the data processing steps of angle-scans using the PEARL Procedures. The description relies on using the command line regardless of available GUIs.</p>
<h1><a class="anchor" id="sec_import"></a>
Data reduction</h1>
<p>The goal of this step is to import raw data and at the same time eliminate the energy dimension. We want a two-dimensional wave where the first dimension is the angle axis of the detector and the second dimension is the sequence of measurements, scanning one or multiple manipulator angles. The second dimension requires additional one-dimensional waves that describe the polar, tilt and azimuthal angle setting of the manipulator for each dimension index.</p>
<p>The processing steps depend on the complexity of the measured spectrum. The user may have to adopt one of the predefined or a custom procedure accordingly. Here, we describe two procedures that may cover many generic cases or that can serve as a starting point for a refined, customized procedure. However, any procedure that produces the datasets mentioned above is, of course, a valid approach. For instance, you could load the complete three-dimensional ScientaImage dataset, and generate the two-dimensional dataset using your own procedures.</p>
<h2><a class="anchor" id="sec_import_basics"></a>
Basic steps</h2>
<p>The central import functions are <a class="el" href="pearl-pshell-import_8ipf.html#a3eefc2f84a09f2ce29893c71ef44ae32">psh5_load_reduced</a> and <a class="el" href="pearl-pshell-import_8ipf.html#a13a45e8618c1ab7406e1aa5e608e21fe">psh5_load_dataset_reduced</a>. The first form is sufficient if the file contains just one scan and region. Further regions/scans need to be loaded using the second form. The first form is also exposed in the PEARL data explorer window.</p>
<p>The functions require a data reduction function and processing parameters as arguments. Some particular reduction functions are described further below. More can be found in the source code (or obtained from other users). A list of functions that look like reduction functions can be got from <a class="el" href="pearl-area-import_8ipf.html#aa5e29dc1a380311d00a5f85be867e47b">adh5_list_reduction_funcs</a>.</p>
<p>The basic call sequence looks as follows. Substitute the arguments in angle brackets as necessary. You may have to analyse a reference spectrum or the complete ScientaImage to figure out the processing parameters beforehand.</p>
<p>First form:</p>
<div class="fragment"><div class="line">setdatafolder root:</div><div class="line"><span class="keywordtype">string</span> sparam</div><div class="line">sparam = <span class="stringliteral">&quot;&lt;param1=1.5;param2=test;&gt;&quot;</span></div><div class="line"><a class="code" href="pearl-pshell-import_8ipf.html#a3eefc2f84a09f2ce29893c71ef44ae32">psh5_load_reduced</a>(<span class="stringliteral">&quot;&lt;igor-datafolder&gt;&quot;</span>, <span class="stringliteral">&quot;&lt;igor-filepath&gt;&quot;</span>, <span class="stringliteral">&quot;&lt;filename&gt;&quot;</span>, &lt;reduction_function&gt;, sparam)</div></div><!-- fragment --><p>Second form:</p>
<div class="fragment"><div class="line"><span class="comment">// open the file</span></div><div class="line">setdatafolder root: <span class="comment">// or other parent folder</span></div><div class="line">variable fid</div><div class="line"><span class="keywordtype">string</span> sparam</div><div class="line">fid = <a class="code" href="pearl-pshell-import_8ipf.html#accc20b0fc6bda95ba0cd0aea6633086f">psh5_open_file</a>(<span class="stringliteral">&quot;&lt;igor-datafolder&gt;&quot;</span>, <span class="stringliteral">&quot;&lt;igor-filepath&gt;&quot;</span>, <span class="stringliteral">&quot;&lt;filename&gt;&quot;</span>)</div><div class="line"></div><div class="line"><span class="comment">// load metadata for scaling</span></div><div class="line"><a class="code" href="pearl-pshell-import_8ipf.html#aa56c25d64b3e59f74d6dd92a599cce4f">psh5_load_scan_meta</a>(fileID, &quot;&lt;scan 1&gt;&quot;)</div><div class="line">newdatafolder /s /o attr</div><div class="line"><a class="code" href="pearl-pshell-import_8ipf.html#aec191d0167bbf606d24396f4658104b5">psh5_load_scan_attrs</a>(fileID, &quot;&lt;scan 1&gt;&quot;)</div><div class="line">setdatafolder ::</div><div class="line"></div><div class="line"><span class="comment">// load and reduce dataset</span></div><div class="line">sparam = &quot;&lt;param1=1.5;param2=test;&gt;&quot;</div><div class="line"><a class="code" href="pearl-pshell-import_8ipf.html#a13a45e8618c1ab7406e1aa5e608e21fe">psh5_load_dataset_reduced</a>(fid, &quot;&lt;scan 1/region1&gt;&quot;, &quot;&lt;ScientaImage&gt;&quot;, &lt;reduction_function&gt;, sparam)</div><div class="line"></div><div class="line"><span class="comment">// close the file</span></div><div class="line"><a class="code" href="pearl-pshell-import_8ipf.html#a2fc497747287d6fe40c6de997ed4a90d">psh5_close_file</a>(fid)</div><div class="line">fid = 0</div></div><!-- fragment --><h2><a class="anchor" id="sec_import_intlinbg"></a>
Peak integration over linear background</h2>
<p>The <a class="el" href="pearl-scienta-preprocess_8ipf.html#a1e91197cd7a3581b70bc59a194d3f43b">int_linbg_reduction</a> function converts a two-dimensional Scienta image I(angle, energy) into a one-dimensional angle distribution I(angle). For each angle slice, it calculates a linear background. Then, it integrates the difference between the original data and the background over a specified interval.</p>
<p>The function requires the following, fixed parameters:</p>
<table class="doxtable">
<tr>
<th>Parameter </th><th>Description </th><th>Typical value </th></tr>
<tr>
<td>Lcrop </td><td>size of the low-energy cropping region </td><td>0.11 (fixed mode) </td></tr>
<tr>
<td>Lsize </td><td>size of the low-energy background region </td><td>0.2 </td></tr>
<tr>
<td>Hcrop </td><td>size of the high-energy cropping region </td><td>0.11 </td></tr>
<tr>
<td>Hsize </td><td>size of the high-energy background region </td><td>0.2 </td></tr>
<tr>
<td>Cpos </td><td>position of the peak center </td><td>0.5 </td></tr>
<tr>
<td>Csize </td><td>size of the center region </td><td>0.3 </td></tr>
</table>
<p>All parameters are relative to the size of the image (length of the energy interval) and must be in the range from 0 to 1.</p>
<p>The cropping region is cut away from the image for the rest of the processing. This is necessary to remove the dark corners in fixed mode but can be neglected in swept mode (cropping size = 0).</p>
<p>The low and high background regions are adjacent to the cropping regions on either side. The function calculates two fix points of the linear background in the center of each background region. The intensity value of each fix point is the average intensity in the background region.</p>
<p>The peak region is integrated over the integral given by the Csize parameter centered at Cpos.</p>
<p>The background-subtracted peak integral is returned in ReducedData1. ReducedData2 receives the error estimate of the peak integral (assuming Poisson statistics).</p>
<h2><a class="anchor" id="sec_import_peakfit"></a>
Peak fitting</h2>
<p>The <a class="el" href="pearl-scienta-preprocess_8ipf.html#a83cdbd96c5b59011914d53118e5ef71c">gauss4_reduction</a> function converts a two-dimensional Scienta image I(angle, energy) into a one-dimensional angle distribution I(angle). For each angle slice, it performs a Gaussian curve fit with up to four components on a linear background.</p>
<p>To improve the stability of the fit, the peak positions and widths are kept fixed while the amplitudes of the peaks and the background parameters are variable but constrained to reasonable values (positive amplitude). Furthermore, the function can optionally do a box averaging over three slices.</p>
<p>The function requires the following, fixed parameters:</p>
<table class="doxtable">
<tr>
<th>Parameter </th><th>Description </th></tr>
<tr>
<td>rngl </td><td>lower limit of the fit interval </td></tr>
<tr>
<td>rngh </td><td>upper limit of the fit interval </td></tr>
<tr>
<td>npeaks </td><td>number of components </td></tr>
<tr>
<td>pos1 </td><td>center energy of peak 1 </td></tr>
<tr>
<td>wid1 </td><td>width of peak 1 </td></tr>
<tr>
<td>pos2 </td><td>center energy of peak 2 </td></tr>
<tr>
<td>wid2 </td><td>width of peak 2 </td></tr>
<tr>
<td>pos3 </td><td>center energy of peak 3 </td></tr>
<tr>
<td>wid3 </td><td>width of peak 3 </td></tr>
<tr>
<td>pos4 </td><td>center energy of peak 3 </td></tr>
<tr>
<td>wid4 </td><td>width of peak 3 </td></tr>
<tr>
<td>ybox </td><td>box size of slice averaging (1 or 3) </td></tr>
</table>
<p>The peak parameters should be determined beforehand from fitting a reference spectrum, or the angle-scan integrated over all angles. Peak positions and widths have to be specified only up to the given number of peaks.</p>
<p>The data reduction procedure returns the peak integrals (amplitude times width times square root of 2) in waves named ReducedDataN where N is a numeric index from 1 to npeaks. The waves starting with an index of npeaks+1 contain the corresponding error estimate of the peak integral.</p>
<h2><a class="anchor" id="sec_import_custom"></a>
Custom reduction functions</h2>
<p>See the documentation and source code of <a class="el" href="pearl-scienta-preprocess_8ipf.html#a1e91197cd7a3581b70bc59a194d3f43b">int_linbg_reduction</a>, <a class="el" href="pearl-scienta-preprocess_8ipf.html#a83cdbd96c5b59011914d53118e5ef71c">gauss4_reduction</a> and <a class="el" href="pearl-area-import_8ipf.html#ade69cb0f82e0c9cf6082d5fcc29f742f">adh5_default_reduction</a> for help on writing custom reduction functions. To integrate your function with the PEARL data explorer, you have to provide an additional function that prompts for reduction parameters such as <a class="el" href="pearl-scienta-preprocess_8ipf.html#a145c7275b8809c5e789b932ef46e4811">prompt_int_linbg_reduction</a>, for example. Since reduction functions cannot be called from the command line, it is redommended to also write an adapter function for testing.</p>
<h1><a class="anchor" id="sec_norm"></a>
Normalization</h1>
<p>The goal of the data normalization is to get a (still two-dimensional) dataset that ideally contains intensity variations due to diffraction features and statistical fluctuations only. In particular, instrumental variations should be removed. In some cases, it may be necessary to preserve the overall polar dependence of the intensity. Note that this latter case is not properly treated with the methods described here.</p>
<p>Depending on the quality of the measured data, only some of the following processing steps are necessary. Use your own judgement.</p>
<p>There is a GUI for the processing steps in <a class="el" href="pearl-anglescan-panel_8ipf.html">pearl-anglescan-panel.ipf</a> (<a class="el" href="pearl-anglescan-panel_8ipf.html#a452f09c3057638056ac2b5a15ac660b2">asp_show_panel</a> function or the PEARL/process menu).</p>
<h2><a class="anchor" id="sec_norm_prep"></a>
Preparations</h2>
<p>Start by creating a new copy of the data and inspecting it: </p><div class="fragment"><div class="line">duplicate ReducedData1, NormData1</div><div class="line"><a class="code" href="pearl-area-display_8ipf.html#a8fad5aebaca72887d5898b4c421bcdae">ad_display_profiles</a>(NormData1)</div></div><!-- fragment --><p>To update the display after changes to NormData1: </p><div class="fragment"><div class="line"><a class="code" href="pearl-area-display_8ipf.html#afa2546f9cb03dfa8bf0cc9966f0b7a45">ad_update_profiles</a>(NormData1)</div></div><!-- fragment --><h2><a class="anchor" id="sec_norm_crop"></a>
Detector angle range</h2>
<p>Crop the detector angle axis to a useful range (usually about -25 to +25 degrees): </p><div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#ab65d25af7476ed18f7bf7359614a912b">crop_strip</a>(NormData1, -25, 25)</div></div><!-- fragment --><h2><a class="anchor" id="sec_norm_angle"></a>
Normalize detector angle</h2>
<p>Remove inhomogeneity of the detector in the detector angle axis. This component may also include a contribution from the sample. If your raw data shows a flat distribution, this step is not necessary.</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#a48b7d774ed8d3f4329e9923e18e580e8">normalize_strip_x</a>(NormData1, smooth_method=4, smooth_factor=0.15, check=2)</div></div><!-- fragment --><p>Note that the argument <code>check=2</code> causes the function to generate two check waves but not to modify the original data. To inspect the check waves: </p><div class="fragment"><div class="line">display check_dist, check_smoo</div><div class="line">ModifyGraph rgb(check_dist)=(0,0,0)</div></div><!-- fragment --><p>Vary the <code>smooth_factor</code> (between 0.1 and 1.0) until it follows the instrumental curve but does not affect diffraction features. Then set <code>check=1</code> to apply the normalization to <code>NormData1</code>.</p>
<h2><a class="anchor" id="sec_norm_wobble"></a>
Azimuthal variation (wobble)</h2>
<p>Reduce the effect of azimuthal wobble (misaligned surface) on intensity. A misaligned surface may cause a sinusoidal variation of the intensity as a function of azimuthal angle with a 360&deg; period. A strong azimuthal variation may affect the polar normalization in the next step. The azimuthal normalization can be based on a restricted range of polar angles (theta range). You have to find out which value works best for your sample.</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#aaa734fddecdd75c7cabe20ba777b41b9">normalize_strip_phi</a>(NormData1, :attr:ManipulatorTheta, :attr:ManipulatorPhi, theta_offset=-8.8, theta_range=10, check=2)</div></div><!-- fragment --><p>Note, however, that his function does not correct for angle shifts induced by the misalignment!</p>
<h2><a class="anchor" id="sec_norm_theta"></a>
Polar dependence</h2>
<p>Remove the polar angle dependence (matrix element and excitation/detection geometry).</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#a9b56897bd92d926d65f4c67bef1d41bb">normalize_strip_theta</a>(NormData1, :attr:ManipulatorTheta, theta_offset=-8.8, smooth_method=4, smooth_factor=0.5, check=2)</div></div><!-- fragment --><p>Use the check waves and the <code>check</code> argument as described above.</p>
<h1><a class="anchor" id="sec_plot"></a>
Binning and plotting</h1>
<h2><a class="anchor" id="sec_plot_basics"></a>
Basic steps</h2>
<p>You can bin and plot the data in one step:</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#afed227ae79873fd32c96afbf606d1965">pizza_service</a>(NormData1, <span class="stringliteral">&quot;Nickname1&quot;</span>, -8.8, 0.5, 6)</div></div><!-- fragment --><p>or two steps:</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#afed227ae79873fd32c96afbf606d1965">pizza_service</a>(NormData1, <span class="stringliteral">&quot;Nickname2&quot;</span>, -8.8, 0.5, 6, nograph=1)</div><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a>(&quot;Nickname2&quot;)</div></div><!-- fragment --><p>The benefit of the latter is that you have more control over the graph through optional arguments. In particular, you can select the projection or hide the ticks and grids. See <a class="el" href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a> for details.</p>
<p>The <a class="el" href="pearl-anglescan-process_8ipf.html#afed227ae79873fd32c96afbf606d1965">pizza_service</a> function requires the waves with manipulator positions in a specific place, namely <code>:attr:ManipulatorTheta</code> (for the polar angle), and the normal emission values as function arguments. If you have moved the waves, or if you have subtracted the offsets yourself, use the alternative <a class="el" href="pearl-anglescan-process_8ipf.html#a229770447193d4fd12032b235aab4d28">pizza_service_2</a> function.</p>
<p>Additional parameters of the <a class="el" href="pearl-anglescan-process_8ipf.html#afed227ae79873fd32c96afbf606d1965">pizza_service</a> function allow for rotational averaging, larger angle steps (default 1 degree), or the creation of metadata including a notebook for xpdPlot.</p>
<p>Note there is currently a bug in the nick name argument of some of the following functions. If the lines shown below do not work, try to switch to the data folder that contains the generated polar plot data, and call the function with an empty nickname <code>""</code>.</p>
<h2><a class="anchor" id="sec_plot_refine"></a>
Refinements</h2>
<p>To remove high polar angles above &theta; = 80 from the plot (and data):</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#a5dc0cc7db9d3d7a6b3fa3f1b04d84a5e">trim_hemi_scan</a>(<span class="stringliteral">&quot;Nickname1&quot;</span>, 80)</div></div><!-- fragment --><p>Modify the pseudocolor scale by changing the <code>polarY0</code> trace:</p>
<div class="fragment"><div class="line">ModifyGraph zColor(polarY0)={mod_values, *, *, BlueGreenOrange, 0}</div><div class="line">ModifyGraph zColor(polarY0)={mod_values, -0.2, 0.2, BlueGreenOrange, 0}</div></div><!-- fragment --><p>To set the contrast to clip specified percentiles of the data points, use the </p><ul>
<li>set_contrast function:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#a666dab03bb2e97ffef81cea450184d42">set_contrast</a>(2, 2, graphname=<span class="stringliteral">&quot;graph_Nickname1&quot;</span>, colortable=<span class="stringliteral">&quot;BlueGreenOrange&quot;</span>)</div></div><!-- fragment --><h2><a class="anchor" id="sec_plot_interp"></a>
Interpolation</h2>
<p>Polar plots can also be interpolated to a rectangular matrix, which may in some cases produce nicer images:</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#acca0130cccf2286863bbf5b7f91c5b3b">interpolate_hemi_scan</a>(<span class="stringliteral">&quot;Nickname1&quot;</span>)</div><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a>(&quot;Nickname1&quot;, graphtype=3, graphname=&quot;intp&quot;)</div><div class="line">matrix = sqrt(x^2 + y^2) &lt;= <a class="code" href="pearl-anglescan-process_8ipf.html#a75219b38ea58012abcffc848d536faa4">calc_graph_radius</a>(80) ? matrix : nan</div><div class="line">ModifyImage matrix ctab= {*,*,BlueGreenOrange,0}</div></div><!-- fragment --><p>The <code>matrix =</code> line optionally removes artefacts at high polar angles. Replace the cut-off angle with your own.</p>
<h2><a class="anchor" id="sec_modulation"></a>
Modulation function</h2>
<p>To calculate the modulation function and substitute it in the graph:</p>
<div class="fragment"><div class="line">setdatafolder Nickname1</div><div class="line">calc_modulation(values, factor1=pol, factor2=az)</div><div class="line">ModifyGraph zColor(polarY0)={mod_values,-0.2,0.2,BlueGreenOrange,0}</div></div><!-- fragment --><h2><a class="anchor" id="sec_projection"></a>
Projection</h2>
<p>The <a class="el" href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a> and <a class="el" href="pearl-anglescan-process_8ipf.html#acca0130cccf2286863bbf5b7f91c5b3b">interpolate_hemi_scan</a> functions take an optional argument <code>projection</code> which selects one of the following projections. By default, stereographic projection is selected.</p>
<table class="doxtable">
<tr>
<th align="center">Selector </th><th align="center">Projection </th><th align="center">Function </th><th align="left">Properties </th></tr>
<tr>
<td align="center">kProjDist = 0 </td><td align="center">azimuthal equidistant </td><td align="center">r = c * theta </td><td align="left">radius is proportional to polar angle </td></tr>
<tr>
<td align="center">kProjStereo = 1 </td><td align="center">stereographic </td><td align="center">r = c * tan theta/2 </td><td align="left">circles on sphere map to circles </td></tr>
<tr>
<td align="center">kProjArea = 2 </td><td align="center">azimuthal equal-area </td><td align="center">r = c * sin theta/2 </td><td align="left">preserves area measure </td></tr>
<tr>
<td align="center">kProjGnom = 3 </td><td align="center">gnomonic </td><td align="center">r = c * tan theta </td><td align="left">great circles map to straight lines </td></tr>
<tr>
<td align="center">kProjOrtho = 4 </td><td align="center">orthographic </td><td align="center">r = c * sin theta </td><td align="left">momentum mapping in ARPES and LEED </td></tr>
</table>
<p>For a description of the different projections, see <a href="https://en.wikipedia.org/wiki/Map_projection">Wikipedia</a>, for example. The projections in this package are defined for 0 &lt;= theta &lt; 90.</p>
<h1><a class="anchor" id="sec_export"></a>
Data export</h1>
<h2><a class="anchor" id="sec_export_plot"></a>
Export picture</h2>
<p>The following line is an example of how to export a graph window. Click on the desired graph window, then issue the following command, substituting the file path and file name as appropriate.</p>
<div class="fragment"><div class="line">SavePICT/P=home/E=-5/B=144/O as <span class="stringliteral">&quot;some_filename.png&quot;</span></div></div><!-- fragment --><h2><a class="anchor" id="sec_export_data"></a>
Export processed data</h2>
<p>The following line saves the dataset to an Igor text file. The file contains all data necessary to recreate a polar plot without further processing.</p>
<div class="fragment"><div class="line"><a class="code" href="pearl-anglescan-process_8ipf.html#a48cbd596656bc6d849c53afb4c58b90d">save_hemi_scan</a>(<span class="stringliteral">&quot;Nickname1&quot;</span>, <span class="stringliteral">&quot;home&quot;</span>, <span class="stringliteral">&quot;some_filename&quot;</span>)</div></div><!-- fragment --><p>For structural optimization using the PMSCO software, it is necessary to generate an ETPI file. There is currently no special function for this. Instead, you have to create and set an energy wave,</p>
<div class="fragment"><div class="line">duplicate pol, en</div><div class="line">en = 123.4 <span class="comment">// kinetic energy of the photoelectron</span></div></div><!-- fragment --><p>and write the four waves <code>en, pol, az, values</code> to a general text file. Be careful about the ordering of the waves! You will also have to rename the file to the <code>.etpi</code> extension because Igor always saves with <code>.txt</code> extension. If you have a wave with statistical errors, add a fifth column and use the <code>.etpis</code> extension.</p>
<div class="fragment"><div class="line">Save /G /M=<span class="stringliteral">&quot;\n&quot;</span> /O /P=home en, pol, az, values, sig as <span class="stringliteral">&quot;Nickname1.etpis.txt&quot;</span></div></div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Tue Jun 16 2020 14:32:36 for PEARL Procedures by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>