<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><aclass="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>
<p>The central import functions are psh5_load_reduced and <aclass="el"href="pearl-pshell-import_8ipf.html#af662500c4f992ef7b956f37ed463513d">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 <aclass="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>
<divclass="ttc"id="apearl-pshell-import_8ipf_html_a23a2e4cb2dc5364bfdbab4367ed6f234"><divclass="ttname"><ahref="pearl-pshell-import_8ipf.html#a23a2e4cb2dc5364bfdbab4367ed6f234">psh5_load_scan_meta</a></div><divclass="ttdeci">string psh5_load_scan_meta(dfref file_df, string scanpath)</div><divclass="ttdoc">load metadata of a PShell scan group.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-pshell-import_8ipf_source.html#l01954">pearl-pshell-import.ipf:1954</a></div></div>
<divclass="ttc"id="apearl-pshell-import_8ipf_html_a47513a1db5693f88d64739a5b28926b2"><divclass="ttname"><ahref="pearl-pshell-import_8ipf.html#a47513a1db5693f88d64739a5b28926b2">psh5_close_file</a></div><divclass="ttdeci">variable psh5_close_file(dfref file_df)</div><divclass="ttdoc">close a HDF5 file opened by psh5_open_file.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-pshell-import_8ipf_source.html#l00509">pearl-pshell-import.ipf:509</a></div></div>
<divclass="ttc"id="apearl-pshell-import_8ipf_html_ab684c44d5f0668631e42d9c9c9dfea9e"><divclass="ttname"><ahref="pearl-pshell-import_8ipf.html#ab684c44d5f0668631e42d9c9c9dfea9e">psh5_open_file</a></div><divclass="ttdeci">dfr psh5_open_file(string path_name, string file_name, dfref dest_df=defaultValue)</div><divclass="ttdoc">open a HDF5 file created by the PShell data acquisition program and prepare the data folder.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-pshell-import_8ipf_source.html#l00450">pearl-pshell-import.ipf:450</a></div></div>
<divclass="ttc"id="apearl-pshell-import_8ipf_html_af662500c4f992ef7b956f37ed463513d"><divclass="ttname"><ahref="pearl-pshell-import_8ipf.html#af662500c4f992ef7b956f37ed463513d">psh5_load_dataset_reduced</a></div><divclass="ttdeci">string psh5_load_dataset_reduced(dfref file_df, string datasetpath, funcref reduction_func, string reduction_params, variable create_folders=defaultValue, variable progress=defaultValue, variable nthreads=defaultValue)</div><divclass="ttdoc">load a dataset with reduced dimensionality</div><divclass="ttdef"><b>Definition</b><ahref="pearl-pshell-import_8ipf_source.html#l01472">pearl-pshell-import.ipf:1472</a></div></div>
<p>The <aclass="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>
<thclass="markdownTableHeadNone">Parameter </th><thclass="markdownTableHeadNone">Description </th><thclass="markdownTableHeadNone">Typical value </th></tr>
<tdclass="markdownTableBodyNone">Lcrop </td><tdclass="markdownTableBodyNone">size of the low-energy cropping region </td><tdclass="markdownTableBodyNone">0.11 (fixed mode) </td></tr>
<tdclass="markdownTableBodyNone">Lsize </td><tdclass="markdownTableBodyNone">size of the low-energy background region </td><tdclass="markdownTableBodyNone">0.2 </td></tr>
<tdclass="markdownTableBodyNone">Hcrop </td><tdclass="markdownTableBodyNone">size of the high-energy cropping region </td><tdclass="markdownTableBodyNone">0.11 </td></tr>
<tdclass="markdownTableBodyNone">Hsize </td><tdclass="markdownTableBodyNone">size of the high-energy background region </td><tdclass="markdownTableBodyNone">0.2 </td></tr>
<tdclass="markdownTableBodyNone">Cpos </td><tdclass="markdownTableBodyNone">position of the peak center </td><tdclass="markdownTableBodyNone">0.5 </td></tr>
<tdclass="markdownTableBodyNone">Csize </td><tdclass="markdownTableBodyNone">size of the center region </td><tdclass="markdownTableBodyNone">0.3 </td></tr>
<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>
<p>The <aclass="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>
<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>
<p>See the documentation and source code of <aclass="el"href="pearl-scienta-preprocess_8ipf.html#a1e91197cd7a3581b70bc59a194d3f43b">int_linbg_reduction</a>, <aclass="el"href="pearl-scienta-preprocess_8ipf.html#a83cdbd96c5b59011914d53118e5ef71c">gauss4_reduction</a> and <aclass="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 <aclass="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>
<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 <aclass="el"href="pearl-anglescan-panel_8ipf.html">pearl-anglescan-panel.ipf</a> (<aclass="el"href="pearl-anglescan-panel_8ipf.html#a452f09c3057638056ac2b5a15ac660b2">asp_show_panel</a> function or the PEARL/process menu).</p>
<divclass="ttc"id="apearl-area-display_8ipf_html_a8fad5aebaca72887d5898b4c421bcdae"><divclass="ttname"><ahref="pearl-area-display_8ipf.html#a8fad5aebaca72887d5898b4c421bcdae">ad_display_profiles</a></div><divclass="ttdeci">string ad_display_profiles(wave image, string filter=defaultValue)</div><divclass="ttdoc">open a new profiles graph window.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-area-display_8ipf_source.html#l00168">pearl-area-display.ipf:168</a></div></div>
</div><!-- fragment --><p>To update the display after changes to NormData1: </p><divclass="fragment"><divclass="line"><aclass="code hl_function"href="pearl-area-display_8ipf.html#afa2546f9cb03dfa8bf0cc9966f0b7a45">ad_update_profiles</a>(NormData1)</div>
<divclass="ttc"id="apearl-area-display_8ipf_html_afa2546f9cb03dfa8bf0cc9966f0b7a45"><divclass="ttname"><ahref="pearl-area-display_8ipf.html#afa2546f9cb03dfa8bf0cc9966f0b7a45">ad_update_profiles</a></div><divclass="ttdeci">variable ad_update_profiles(wave image)</div><divclass="ttdoc">update a profiles graph with new data.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-area-display_8ipf_source.html#l00377">pearl-area-display.ipf:377</a></div></div>
<p>Crop the detector angle axis to a useful range (usually about -25 to +25 degrees): </p><divclass="fragment"><divclass="line"><aclass="code hl_function"href="pearl-anglescan-process_8ipf.html#ab65d25af7476ed18f7bf7359614a912b">crop_strip</a>(NormData1, -25, 25)</div>
<divclass="ttc"id="apearl-anglescan-process_8ipf_html_ab65d25af7476ed18f7bf7359614a912b"><divclass="ttname"><ahref="pearl-anglescan-process_8ipf.html#ab65d25af7476ed18f7bf7359614a912b">crop_strip</a></div><divclass="ttdeci">variable crop_strip(wave strip, variable xlo, variable xhi)</div><divclass="ttdoc">crop a strip at the sides.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-anglescan-process_8ipf_source.html#l00747">pearl-anglescan-process.ipf:747</a></div></div>
<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>
<divclass="ttc"id="apearl-anglescan-process_8ipf_html_a48b7d774ed8d3f4329e9923e18e580e8"><divclass="ttname"><ahref="pearl-anglescan-process_8ipf.html#a48b7d774ed8d3f4329e9923e18e580e8">normalize_strip_x</a></div><divclass="ttdeci">variable normalize_strip_x(wave strip, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue)</div><divclass="ttdoc">divide the strip by the average X distribution.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-anglescan-process_8ipf_source.html#l00252">pearl-anglescan-process.ipf:252</a></div></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><divclass="fragment"><divclass="line">display check_dist, check_smoo</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>
<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° 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>
<divclass="ttc"id="apearl-anglescan-process_8ipf_html_aaa734fddecdd75c7cabe20ba777b41b9"><divclass="ttname"><ahref="pearl-anglescan-process_8ipf.html#aaa734fddecdd75c7cabe20ba777b41b9">normalize_strip_phi</a></div><divclass="ttdeci">variable normalize_strip_phi(wave strip, wave theta, wave phi, variable theta_offset=defaultValue, variable theta_range=defaultValue, variable check=defaultValue)</div><divclass="ttdoc">divide the strip by a sine function in phi (wobble correction).</div><divclass="ttdef"><b>Definition</b><ahref="pearl-anglescan-process_8ipf_source.html#l00348">pearl-anglescan-process.ipf:348</a></div></div>
<divclass="ttc"id="apearl-anglescan-process_8ipf_html_a9b56897bd92d926d65f4c67bef1d41bb"><divclass="ttname"><ahref="pearl-anglescan-process_8ipf.html#a9b56897bd92d926d65f4c67bef1d41bb">normalize_strip_theta</a></div><divclass="ttdeci">variable normalize_strip_theta(wave strip, wave theta, variable theta_offset=defaultValue, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue)</div><divclass="ttdoc">divide the strip by the average polar distribution.</div><divclass="ttdef"><b>Definition</b><ahref="pearl-anglescan-process_8ipf_source.html#l00433">pearl-anglescan-process.ipf:433</a></div></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 <aclass="el"href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a> for details.</p>
<p>The <aclass="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 <aclass="el"href="pearl-anglescan-process_8ipf.html#a229770447193d4fd12032b235aab4d28">pizza_service_2</a> function.</p>
<p>Additional parameters of the <aclass="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><aclass="anchor"id="sec_plot_refine"></a>
Refinements</h2>
<p>To remove high polar angles above θ = 80 from the plot (and data):</p>
</div><!-- fragment --><p>The <code>matrix =</code> line optionally removes artefacts at high polar angles. Replace the cut-off angle with your own.</p>
<p>The <aclass="el"href="pearl-anglescan-process_8ipf.html#ae57302acfc822c4817f2b7eef55efea2">display_hemi_scan</a> and <aclass="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>
<tdclass="markdownTableBodyCenter">kProjStereo = 1 </td><tdclass="markdownTableBodyCenter">stereographic </td><tdclass="markdownTableBodyCenter">r = c * tan theta/2 </td><tdclass="markdownTableBodyLeft">circles on sphere map to circles </td></tr>
<tdclass="markdownTableBodyCenter">kProjArea = 2 </td><tdclass="markdownTableBodyCenter">azimuthal equal-area </td><tdclass="markdownTableBodyCenter">r = c * sin theta/2 </td><tdclass="markdownTableBodyLeft">preserves area measure </td></tr>
<tdclass="markdownTableBodyCenter">kProjOrtho = 4 </td><tdclass="markdownTableBodyCenter">orthographic </td><tdclass="markdownTableBodyCenter">r = c * sin theta </td><tdclass="markdownTableBodyLeft">momentum mapping in ARPES and LEED </td></tr>
<p>For a description of the different projections, see <ahref="https://en.wikipedia.org/wiki/Map_projection">Wikipedia</a>, for example. The projections in this package are defined for 0 <= theta < 90.</p>
<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>
<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>
<divclass="ttc"id="apearl-anglescan-process_8ipf_html_a48cbd596656bc6d849c53afb4c58b90d"><divclass="ttname"><ahref="pearl-anglescan-process_8ipf.html#a48cbd596656bc6d849c53afb4c58b90d">save_hemi_scan</a></div><divclass="ttdeci">variable save_hemi_scan(string nickname, string pathname, string filename)</div><divclass="ttdoc">save a hemispherical scan to an Igor text file</div><divclass="ttdef"><b>Definition</b><ahref="pearl-anglescan-process_8ipf_source.html#l03097">pearl-anglescan-process.ipf:3097</a></div></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>
<divclass="line">en = 123.4 <spanclass="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>
<divclass="fragment"><divclass="line">Save /G /M=<spanclass="stringliteral">"\n"</span> /O /P=home en, pol, az, values, sig as <spanclass="stringliteral">"Nickname1.etpis.txt"</span></div>
</div><!-- fragment --></div></div><!-- contents -->
<liclass="footer">Generated on Mon Dec 22 2025 17:26:40 for PEARL Procedures by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.8 </li>