PEARL Procedures
rev-distro-3.0.0-0-gfa24916-dirty
Igor procedures for the analysis of PEARL data
|
processing and holographic mapping of angle scanned XPD data. More...
#include "pearl-vector-operations"
#include "pearl-polar-coordinates"
#include <New Polar Graphs>
Go to the source code of this file.
Namespaces | |
PearlAnglescanProcess | |
processing and holographic mapping of angle scanned XPD data. | |
Functions | |
string | strip_append (wave strip1, wave strip2) |
append an angle scan strip to another one More... | |
variable | strip_delete_frames (wave strip, variable qlo, variable qhi, wave theta, wave tilt, wave phi) |
delete a contiguous range of frames from a strip. More... | |
variable | normalize_strip_x (wave strip, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue) |
divide the strip by the average X distribution. More... | |
variable | normalize_strip_phi (wave strip, wave theta, wave phi, variable theta_offset=defaultValue, variable theta_range=defaultValue, variable check=defaultValue) |
divide the strip by a sine function in phi (wobble correction). More... | |
variable | normalize_strip_theta (wave strip, wave theta, variable theta_offset=defaultValue, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue) |
divide the strip by the average polar distribution. More... | |
variable | normalize_strip_thetaphi (wave strip, wave theta, wave phi, variable theta_offset=defaultValue, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue) |
divide the strip by a smooth polar-azimuthal distribution. More... | |
variable | normalize_strip_theta_scans (wave strip, wave theta, variable theta_offset=defaultValue, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue) |
divide the strip piecewise by a smooth polar distribution. More... | |
variable | normalize_strip_2d (wave strip, wave theta, variable theta_offset=defaultValue, variable smooth_method=defaultValue, variable smooth_factor=defaultValue, variable check=defaultValue) |
divide the strip by a two-dimensional normalization function. More... | |
variable | crop_strip (wave strip, variable xlo, variable xhi) |
crop a strip at the sides. More... | |
variable | crop_strip_theta (wave strip, variable theta_lo, variable theta_hi, wave theta, wave tilt, wave phi) |
crop a strip in theta. More... | |
variable | pizza_service (wave data, string nickname, variable theta_offset, variable tilt_offset, variable phi_offset, variable npolar=defaultValue, variable nograph=defaultValue, variable folding=defaultValue, variable xpdplot=defaultValue) |
create a pizza plot from a measured (energy-integrated) data strip More... | |
variable | pizza_service_2 (wave data, string nickname, wave m_theta, wave m_tilt, wave m_phi, variable npolar=defaultValue, variable nograph=defaultValue, variable folding=defaultValue, variable xpdplot=defaultValue) |
create a pizza plot from a measured (energy-integrated) data strip More... | |
variable | show_analyser_line (variable theta, variable tilt, variable phi, variable theta_offset, variable tilt_offset, variable phi_offset, variable npolar=defaultValue, variable nograph=defaultValue, variable xpdplot=defaultValue) |
calculate and display the line seen by the analyser for a specific emission angle More... | |
variable | convert_angles_ttpd2polar (wave theta, wave tilt, wave phi, wave data, wave polar, wave azi) |
convert angles from TTPA (theta-tilt-phi-analyser) scheme to polar coordinates. More... | |
variable | convert_angles_ttpa2polar (wave theta, wave tilt, wave phi, wave analyser, wave polar, wave azi) |
convert angles from TTPA (theta-tilt-phi-analyser) scheme to polar coordinates. More... | |
static variable | line_average (wave source, wave dest) |
static variable | calc_nth (variable Theta_st, variable Theta_in, variable th, variable Phi_ran, variable Phi_ref, string Holomode) |
calculate the number of phis for a given theta More... | |
static variable | calc_phi_step (variable Theta_in, variable th, variable Theta_st, variable Phi_ran, variable Phi_ref, string Holomode) |
calculate delta-phi for a given theta More... | |
static variable | Calc_The_step (variable th, variable Theta_st, string Holomode) |
calculate delta-theta for a given theta More... | |
static variable | CalcN_Theta (string HoloMode, variable Theta_in, variable Theta_ran, variable Theta_st) |
calculate the number of thetas for a pattern More... | |
variable | make_hemi_grid (variable npol, string nickname, variable xpdplot=defaultValue) |
create a hemispherical, constant solid angle grid More... | |
string | get_hemi_nickname (wave w) |
finds the nick name given any hemi wave More... | |
string | get_hemi_prefix (wave w) |
finds the prefix given any hemi wave More... | |
dfr | find_hemi_data (string nickname, string *prefix, string *intwave) |
finds the folder, prefix and name of holo waves given their nick name More... | |
variable | clear_hemi_grid (string nickname) |
clear a hemispherical scan grid More... | |
variable | duplicate_hemi_scan (string source_nickname, dfref dest_folder, string dest_nickname, variable xpdplot=defaultValue) |
duplicate a hemispherical scan dataset. More... | |
variable | rotate_hemi_scan (string nickname, variable angle) |
azimuthally rotate a hemispherical scan dataset. More... | |
string | prepare_hemi_scan_display (string nickname, variable projection=defaultValue) |
create waves for plotting a hemispherical angle scan. More... | |
string | display_hemi_scan (string nickname, variable projection=defaultValue, variable graphtype=defaultValue, variable do_ticks=defaultValue, variable do_grids=defaultValue, string graphname=defaultValue) |
display a plot of a hemispherical angle scan. More... | |
static string | display_polar_graph (string graphname, variable angle_offset=defaultValue, variable do_ticks=defaultValue) |
displays an empty polar graph More... | |
static string | draw_hemi_axes (string graphname, variable do_grids=defaultValue) |
draw polar and azimuthal grids in an existing polar graph. More... | |
variable | draw_diffraction_cone (string graphname, string groupname, variable theta_axis, variable theta_inner, variable phi) |
draw the circle of a diffraction cone in a stereographic polar graph. More... | |
string | display_scanlines (string nickname, variable alpha_lo, variable alpha_hi, wave m_theta, wave m_tilt, wave m_phi, variable folding=defaultValue, variable projection=defaultValue) |
display a polar graph with lines indicating the angles covered by an angle scan. More... | |
threadsafe variable | calc_graph_radius (variable polar, variable projection=defaultValue) |
calculate the projected polar angle More... | |
threadsafe variable | calc_graph_polar (variable x, variable y, variable projection=defaultValue) |
calculate polar angle from Cartesian coordinate More... | |
threadsafe variable | calc_graph_azi (variable x, variable y, variable projection=defaultValue, variable zeroAngle=defaultValue) |
calculate azimuthal angle from Cartesian coordinate More... | |
static variable | update_polar_info (string graphname) |
update the angles info based on cursors A and B of a given polar graph window More... | |
static variable | polar_graph_hook (WMWinHookStruct *s) |
polar graph window hook More... | |
variable | set_polar_graph_cursor (string nickname, string cursorname, variable polar_angle, variable azim_angle, string graphname=defaultValue) |
variable | hemi_add_anglescan (string nickname, wave values, wave polar, wave azi, wave weights=defaultValue) |
add arbitrary angle scan data to a hemispherical scan grid. More... | |
static threadsafe dfr | add_anglescan_worker (variable ith, wave values, wave weights, wave polar, wave azi, wave w_polar, wave w_azim, wave w_theta, wave w_index, wave w_dphi, wave w_nphis) |
thread worker for hemi_add_anglescan More... | |
static threadsafe variable | add_aziscan_core (wave values, wave weights, variable polar, wave azi, wave w_theta, wave w_azim, wave w_index, wave w_dphi, wave w_totals, wave w_weights) |
thread worker for hemi_add_anglescan and hemi_add_aziscan More... | |
variable | hemi_add_aziscan (string nickname, wave values, variable polar, wave azi, wave weights=defaultValue) |
add azimuthal data to a hemispherical scan grid. More... | |
variable | interpolate_hemi_scan (string nickname, variable projection=defaultValue) |
interpolate a hemispherical scan onto a rectangular grid More... | |
variable | quick_pizza_image (wave data, string nickname, variable theta_offset, variable tilt_offset, variable phi_offset, variable npolar=defaultValue, variable nograph=defaultValue, variable folding=defaultValue) |
map angle scan data onto a rectangular grid in stereographic projection More... | |
variable | save_hemi_scan (string nickname, string pathname, string filename) |
save a hemispherical scan to an Igor text file More... | |
variable | load_hemi_scan (string nickname, string pathname, string filename) |
load a hemispherical scan from an Igor text file More... | |
variable | import_tpi_scan (string nickname, wave theta, wave phi, wave intensity, variable folding=defaultValue, variable npolar=defaultValue, variable nograph=defaultValue, variable xpdplot=defaultValue) |
import a hemispherical scan from theta-phi-intensity waves and display it More... | |
variable | trim_hemi_scan (string nickname, variable theta_max) |
trim a hemispherical scan at grazing angle More... | |
wave | hemi_polar_cut (string nickname, variable azim) |
extract a polar cut from a hemispherical scan. More... | |
wave | hemi_azi_cut (string nickname, variable pol) |
extract an azimuthal cut from a hemispherical scan More... | |
static variable | check_contrast (wave values, variable pcmin, variable pcmax, variable *vmin, variable *vmax, variable sym) |
variable | set_contrast (variable pcmin, variable pcmax, string graphname=defaultValue, string colortable=defaultValue, variable reversecolors=defaultValue, variable symmetric=defaultValue) |
set the pseudocolor contrast by percentile. More... | |
variable | AngleToK (wave inwave) |
k-space mapping of 2D angle-energy distribution (scienta image) More... | |
Variables | |
const variable | kProjDist = 0 |
const variable | kProjStereo = 1 |
const variable | kProjArea = 2 |
const variable | kProjGnom = 3 |
const variable | kProjOrtho = 4 |
static const variable | kProjScaleDist = 2 |
static const variable | kProjScaleStereo = 2 |
static const variable | kProjScaleArea = 2 |
static const variable | kProjScaleGnom = 0.06744519021 |
static const variable | kProjScaleOrtho = 2 |
processing and holographic mapping of angle scanned XPD data.
the functions in this file map angle scanned data measured at PEARL onto a hemispherical angle grid which is compatible with XPDplot. the resulting data are in a canonical polar coordinate system (normal emission <=> polar angle = 0, azimuthal axis right-handed) which is anchored in the sample surface. the orientation of polar graphs (phi = 0 at 3 o'clock) created by this procedure corresponds to a top view of the sample surface at normal emission, and the handle of the sample plate pointing to the left (phi = 180). this is the canonical orientation of a spherical coordinate system where phi = 0 corresponds to the positive part of the x axis.
the measurement geometry is hard-coded but may be parametrized in the future. the theta rotation axis is perpendicular to the scattering plane. the angle dispersive axis of the analyser is parallel to the theta rotation axis. the tilt rotation axis is in the scattering plane. it rotates with theta. at normal emission it is perpendicular to the axis of the lens stack of the analyser. the phi rotation axis corresponds to the surface normal of the sample. it rotates with theta and with tilt. at normal emission it is parallel to the axis of the lens stack of the analyser.
coordinate transformations: (to be revised - v1.6)
* theta_sample = theta_manipulator - theta_offset * phi_sample = phi_manipulator - phi_offset *
valid for theta_manipulator = normal emission only: (to be revised - v1.6)
* theta_sample = | -(tilt_manipulator - tilt_offset) | * phi_sample = 270 if tilt_manipulator - tilt_offset > 0 * phi_sample = 90 if tilt_manipulator - tilt_offset < 0 *
Definition in file pearl-anglescan-process.ipf.
|
static |
thread worker for hemi_add_anglescan
this function extracts one azimuthal scan from the input data and adds it to an existing holo scan. it should be considered as a part of hemi_add_anglescan and not used elsewhere, as its interface may change in the future.
the function takes as input the entire input data, an existing hemi grid and the index of a polar angle to work on. the results are a w_totals and w_weights wave that can be added to the hemi scan. the two waves are returned in a free data folder referenced by the return value of the function. the function does not change global data.
Definition at line 2711 of file pearl-anglescan-process.ipf.
|
static |
thread worker for hemi_add_anglescan and hemi_add_aziscan
this function adds one azimuthal scan to an existing holo scan. it should be considered as a part of hemi_add_anglescan and hemi_add_aziscan and not used elsewhere, as its interface may change in the future.
the function takes as input an azimuthal scan and an existing hemi grid. the results are added to w_totals and w_weights waves.
Definition at line 2761 of file pearl-anglescan-process.ipf.
variable AngleToK | ( | wave | inwave | ) |
k-space mapping of 2D angle-energy distribution (scienta image)
courtesy of F. Matsui
inwave | 2D wave, x = kinetic energy (eV), y = polar angle (deg) note: the kinetic energy is with reference to the vacuum level at the sample. if the work functions of the analyser and the sample differ: Ekin,sample = Ekin,analyser + WFanalyser - WFsample where WFanalyser = Ephot - EFermi |
Definition at line 3562 of file pearl-anglescan-process.ipf.
threadsafe variable calc_graph_azi | ( | variable | x, |
variable | y, | ||
variable | projection = defaultValue , |
||
variable | zeroAngle = defaultValue |
||
) |
calculate azimuthal angle from Cartesian coordinate
x,y | projected Cartesian coordinate |
projection | mapping function from polar to cartesian coordinates. all supported projections are azimuthal, they have no effect on the azimuthal coordinate. see Projections for details.
|
zeroAngle | zeroAngleWhere parameter of polar graphs
|
Definition at line 2467 of file pearl-anglescan-process.ipf.
threadsafe variable calc_graph_polar | ( | variable | x, |
variable | y, | ||
variable | projection = defaultValue |
||
) |
calculate polar angle from Cartesian coordinate
this is the reverse mapping to calc_graph_radius()
x,y | projected Cartesian coordinate |
projection | mapping function from polar to cartesian coordinates. see Projections for details.
|
Definition at line 2414 of file pearl-anglescan-process.ipf.
threadsafe variable calc_graph_radius | ( | variable | polar, |
variable | projection = defaultValue |
||
) |
calculate the projected polar angle
polar | polar angle in degrees |
projection | mapping function from polar to cartesian coordinates. see Projections for details.
|
Definition at line 2369 of file pearl-anglescan-process.ipf.
|
static |
calculate the number of phis for a given theta
adapted from XPDplot 8.03
Definition at line 1223 of file pearl-anglescan-process.ipf.
|
static |
calculate delta-phi for a given theta
adapted from XPDplot 8.03
Definition at line 1252 of file pearl-anglescan-process.ipf.
|
static |
calculate delta-theta for a given theta
adapted from XPDplot 8.03
Definition at line 1296 of file pearl-anglescan-process.ipf.
|
static |
calculate the number of thetas for a pattern
adapted from XPDplot 8.03
Definition at line 1327 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 3407 of file pearl-anglescan-process.ipf.
variable clear_hemi_grid | ( | string | nickname | ) |
clear a hemispherical scan grid
values and weights waves are set to zero. the intensity wave is set to NaN.
nickname | folder name or name prefix of holo waves. may be empty. |
Definition at line 1606 of file pearl-anglescan-process.ipf.
variable convert_angles_ttpa2polar | ( | wave | theta, |
wave | tilt, | ||
wave | phi, | ||
wave | analyser, | ||
wave | polar, | ||
wave | azi | ||
) |
convert angles from TTPA (theta-tilt-phi-analyser) scheme to polar coordinates.
the angles are in the manipulator coordinate system.
[in] | theta | offset-corrected theta angle, normal emission = 0, grazing emission = 90. one dimensional wave. |
[in] | tilt | offset-corrected tilt angle, normal emission = 0 same dimension size and scale as theta |
[in] | phi | phi angle, range -360 < phi < +360 offset correction is optional as long as the angles lie in the accepted range. same dimension size and scale as theta |
[in] | analyser | analyser angle scale corresponding to the slices scale of Scienta. one dimensional wave. this values are constant regardless of manipulator angle. |
[out] | polar | wave to receive the polar coordinates. |
[out] | azi | wave to receive the azimuthal coordinates. |
for the output parameters polar and azi, you need to pass in existing numeric waves. dimension size does not matter, the waves are redimensioned by the function so that they have the same dimensions as the intensity data set. X dimension = analyser scale, Y dimension = manipulator scan.
Definition at line 1162 of file pearl-anglescan-process.ipf.
variable convert_angles_ttpd2polar | ( | wave | theta, |
wave | tilt, | ||
wave | phi, | ||
wave | data, | ||
wave | polar, | ||
wave | azi | ||
) |
convert angles from TTPA (theta-tilt-phi-analyser) scheme to polar coordinates.
similar to convert_angles_ttpa2polar() but reads the analyser angles from the X scale of data
Definition at line 1123 of file pearl-anglescan-process.ipf.
variable crop_strip | ( | wave | strip, |
variable | xlo, | ||
variable | xhi | ||
) |
crop a strip at the sides.
the strip is cropped in place, data outside the region of interest is lost.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | xlo | lowest analyser angle to keep (will be rounded to nearest existing point) |
[in] | xhi | highest analyser angle to keep (will be rounded to nearest existing point) |
Definition at line 747 of file pearl-anglescan-process.ipf.
variable crop_strip_theta | ( | wave | strip, |
variable | theta_lo, | ||
variable | theta_hi, | ||
wave | theta, | ||
wave | tilt, | ||
wave | phi | ||
) |
crop a strip in theta.
the strip is cropped in place, data outside the region of interest is lost.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | ylo | lowest polar angle to keep (will be rounded to nearest existing point) |
[in] | yhi | highest polar angle to keep (will be rounded to nearest existing point) |
[in,out] | theta | polar angle along the Y dimension of strip. this wave is modified: cropped rows are deleted. |
[in,out] | tilt | tilt angle along the Y dimension of strip. this wave is modified: cropped rows are deleted. |
[in,out] | phi | azimuthal angle along the Y dimension of strip. this wave is modified: cropped rows are deleted. |
Definition at line 779 of file pearl-anglescan-process.ipf.
string display_hemi_scan | ( | string | nickname, |
variable | projection = defaultValue , |
||
variable | graphtype = defaultValue , |
||
variable | do_ticks = defaultValue , |
||
variable | do_grids = defaultValue , |
||
string | graphname = defaultValue |
||
) |
display a plot of a hemispherical angle scan.
the scan data must exist in the current data folder. azimuth = 0 should be at 9 o'clock. then the orientation is the same as the sample at normal emission and phi = 0, the handle of the sample plate pointing to the left.
nickname | name prefix of holo waves. may be empty. |
projection | mapping function from polar to cartesian coordinates. see Projections for details.
|
graphtype | type of graph
|
do_ticks | select which ticks to draw. value must be the arithmetic OR of all selected items. default: 3
|
do_grids | select which grids to draw. value must be the arithmetic OR of all selected items. default: 3
|
graphname | name of graph window. default: nickname if empty, a default name is assigned. if a window with this name is existing, the function brings it to the front, and does nothing else. |
Definition at line 1858 of file pearl-anglescan-process.ipf.
|
static |
displays an empty polar graph
the graph is drawn using Wavemetrics "New Polar Graphs.ipf".
initially the graph is empty. hemispherical scans are displayed by adding a trace that coveres the whole plot area, and setting the trace color to a function of the intensity. traces are added by calling WMPolarAppendTrace.
the following items of the graph > packages menu might be useful:
parameters can be changed programmatically as shown in the code of this function. after programmatic parameter changes, call WMPolarAxesRedrawGraphNow(graphname).
graphname | requested name of new graph window. if empty, a default name is assigned. if a window with this name is existing, the function brings it to the front, and does nothing else. |
angle_offset | azimuth (on screen) where angle 0 is plotted (zeroAngleWhere parameter of polar graphs). starting with version 1.6, the default is 0. for hemi grids created with earlier versions, it should be set to 180 for correct orientation. |
do_ticks | select which ticks to draw. value must be the arithmetic OR of all selected items. default: 3
|
Definition at line 2003 of file pearl-anglescan-process.ipf.
string display_scanlines | ( | string | nickname, |
variable | alpha_lo, | ||
variable | alpha_hi, | ||
wave | m_theta, | ||
wave | m_tilt, | ||
wave | m_phi, | ||
variable | folding = defaultValue , |
||
variable | projection = defaultValue |
||
) |
display a polar graph with lines indicating the angles covered by an angle scan.
nickname | nick name for output data. this will become the name of a child folder containing the output. |
alpha_lo | low limit of the analyser angle. |
alpha_hi | high limit of the analyser angle. |
m_theta | manipulator theta angles, 0 = normal emission. size = dimsize(data, 1) |
m_tilt | manipulator tilt angles, 0 = normal emission. size = dimsize(data, 1) |
m_phi | manipulator phi angles, 0 = azimuthal origin. size = dimsize(data, 1) |
folding | rotational averaging, default = 1 |
projection | mapping function from polar to cartesian coordinates. see calc_graph_radius(). |
Definition at line 2254 of file pearl-anglescan-process.ipf.
variable draw_diffraction_cone | ( | string | graphname, |
string | groupname, | ||
variable | theta_axis, | ||
variable | theta_inner, | ||
variable | phi | ||
) |
draw the circle of a diffraction cone in a stereographic polar graph.
the diffraction cone consists of a circle marking the diffraction ring, and a dot marking the axis. the cone is drawn as a group of draw objects on the UserFront layer. the objects can be edited interactively.
graphname | name of graph window (not implemented yet). |
groupname | name of a drawing group. if the group exists (from a previous cone) it is replaced. if the group doesn't exist, a new one is created. |
theta_axis | polar angle of the cone axis in degrees. |
theta_inner | polar angle of the innermost point of the circle in degrees. |
phi | azimuthal angle of the cone axis in degrees. |
Definition at line 2190 of file pearl-anglescan-process.ipf.
|
static |
draw polar and azimuthal grids in an existing polar graph.
the function adds the following draw objects to a polar graph:
the objects are added to the ProgFront drawing layer and will appear in front of the data trace. in interactive drawing mode, you can select the active drawing layer by clicking the tree icon while holding the Alt key.
the graph must have been created by display_polar_graph(). the function reads the projection mode from the window user data "projection".
graphname | name of graph window. |
do_grids | select which optional grids to draw. value must be the arithmetic OR of all selected items. default: 3
|
Definition at line 2118 of file pearl-anglescan-process.ipf.
variable duplicate_hemi_scan | ( | string | source_nickname, |
dfref | dest_folder, | ||
string | dest_nickname, | ||
variable | xpdplot = defaultValue |
||
) |
duplicate a hemispherical scan dataset.
this function works only for hemi scans created by make_hemi_grid() (or compatible functions). the angle grid is recreated rather than copied point-by-point. the new dataset is independent from the original one.
if the version of the source dataset is pre 1.6, it is converted to version 1.6.
source_nickname | name prefix for waves. source data must be in current data folder. |
dest_folder | destination folder. folder must exist. |
dest_nickname | name prefix for destination waves. must be unique in the current data folder. otherwise existing waves get overwritten. may be empty. |
xpdplot | XPDplot compatibility
|
Definition at line 1653 of file pearl-anglescan-process.ipf.
dfr find_hemi_data | ( | string | nickname, |
string * | prefix, | ||
string * | intwave | ||
) |
finds the folder, prefix and name of holo waves given their nick name
the function looks for holo waves in the following order:
[in] | nickname | folder name or name prefix of holo waves. may be empty. |
[out] | prefix | name prefix of waves. may be empty. |
[out] | intwave | name of intensity/values wave |
Definition at line 1572 of file pearl-anglescan-process.ipf.
string get_hemi_nickname | ( | wave | w | ) |
finds the nick name given any hemi wave
the nick name is either the name of a child folder in the current data folder (PEARL specification), or a prefix of the hemi wave names (XPDplot specification).
Definition at line 1516 of file pearl-anglescan-process.ipf.
string get_hemi_prefix | ( | wave | w | ) |
finds the prefix given any hemi wave
the prefix is the part of the wave name before the first underscore. the prefix is used by XPDplot where it is identical to the nick name. the prefix is empty in the PEARL specification.
Definition at line 1541 of file pearl-anglescan-process.ipf.
variable hemi_add_anglescan | ( | string | nickname, |
wave | values, | ||
wave | polar, | ||
wave | azi, | ||
wave | weights = defaultValue |
||
) |
add arbitrary angle scan data to a hemispherical scan grid.
the function fills the input data into bins defined by the hemi scan grid. it sums up the values and weights of the data points which fall into each bin, and adds the results to the totals and weights waves of the existing hemi grid. finally, it updates the values wave (values divided by weights).
the hemi grid must have been created in the current data folder by the make_hemi_grid() function. the function does not clear previous values before adding new data. values are added to the _tot wave, weights to the _wt wave. the intensity (_i/values) wave is calculated as _tot divided by _wt.
nickname | name prefix of holo waves. empty if waves are in current data folder. |
values | counts/intensity values at the positions given in the polara nd azi waves. one- or two-dimensional. NaN values are ignored. |
polar | polar angles (in degrees) of each data point. allowed range 0 <= theta <= 90. no specific ordering required. |
azi | azimuthal angles (in degrees) of each data point. allowed range -360 <= phi < +360. no specific order required. |
weights | weight or accumulation time of each point of values. weights must be positive. values with weight 0 are ignored. defaults to 1 if not specified. |
the values, weights, polar and azi waves must have the same dimensions (one- or two-dimensional). no specific order is required, the function sorts (copies of) the arrays internally.
the actual binning is delegated to the thread-safe add_anglescan_worker() function under Igor's automatic multi-threading facility.
Definition at line 2637 of file pearl-anglescan-process.ipf.
variable hemi_add_aziscan | ( | string | nickname, |
wave | values, | ||
variable | polar, | ||
wave | azi, | ||
wave | weights = defaultValue |
||
) |
add azimuthal data to a hemispherical scan grid.
the hemi grid must have been created in the current data folder by the make_hemi_grid() function. the function determines the bin size at the given polar angle, sums up the values and weights of the data points which fall into each bin, and adds the results to the totals and weights waves of the existing hemi grid. finally, it updates the values wave (values divided by weights).
nickname | name prefix of holo waves. empty if waves are in current data folder. |
values | counts/intensity values of the azimuthal scan at the positions given in the azi parameter. |
polar | polar angle (in degrees) where to add the azi scan. |
azi | angle positions of the azimuthal scan. acceptable range: >= -360 and < +360. no specific order required, the function sorts the array internally. |
weights | weight or accumulation time of each point of values. defaults to 1 if not specified. |
the actual binning is delegated to the thread-safe add_aziscan_core() function shared with hemi_add_anglescan().
Definition at line 2844 of file pearl-anglescan-process.ipf.
wave hemi_azi_cut | ( | string | nickname, |
variable | pol | ||
) |
extract an azimuthal cut from a hemispherical scan
the function extracts all azimuthal angles that are present for the given polar angle.
the hemi grid must have been created in the current data folder by the make_hemi_grid function. correct ordering is required.
nickname | name of the scan dataset. can be empty if no prefix is used. the dataset must be in the current datafolder. |
pol | polar angle in degrees |
Definition at line 3354 of file pearl-anglescan-process.ipf.
wave hemi_polar_cut | ( | string | nickname, |
variable | azim | ||
) |
extract a polar cut from a hemispherical scan.
for each polar angle, the function first extracts all azimuthal angles. the intensity is then interpolated between the nearest neighbours of the given azimuth.
the hemi grid must have been created in the current data folder by the make_hemi_grid function. correct ordering is required.
nickname | name of the scan dataset. can be empty if no prefix is used. the dataset must be in the current datafolder. |
azim | azimuthal angle in degrees |
Definition at line 3268 of file pearl-anglescan-process.ipf.
variable import_tpi_scan | ( | string | nickname, |
wave | theta, | ||
wave | phi, | ||
wave | intensity, | ||
variable | folding = defaultValue , |
||
variable | npolar = defaultValue , |
||
variable | nograph = defaultValue , |
||
variable | xpdplot = defaultValue |
||
) |
import a hemispherical scan from theta-phi-intensity waves and display it
in the tpi format, the hemi scan data is represented by a triple of flat one-dimensional waves corresponding to the polar angle (theta), azimuthal angle (phi) and intensity. no specific sort order is required.
nickname | nick name for output data
|
theta | theta angles, 0 = normal emission. |
phi | phi angles, 0 = azimuthal origin. size = dimsize(data, 1) |
intensity | intensity wave, see requirements above. |
npolar | number of polar angles, determines polar and azimuthal step size. default = 91 (1 degree steps) |
folding | rotational averaging. example: 3 = average to 3-fold symmetry. default = 1. |
nograph | display a new graph window?
|
xpdplot | XPDplot compatibility
|
Definition at line 3179 of file pearl-anglescan-process.ipf.
variable interpolate_hemi_scan | ( | string | nickname, |
variable | projection = defaultValue |
||
) |
interpolate a hemispherical scan onto a rectangular grid
the scan data must exist in the current data folder or in the sub-folder given by the nickname parameter.
the interpolated data is written to a new two-dimensional wave "matrix". the wave has a fixed size of 181 x 181 points optimized for 1-degree polar steps.
missing values (nan) are interpolated. this works well only if the missing values are reasonable sparse. the function also applies a gaussian filter to smooth the image. empty rings at high polar angles map are preserved.
to display the result call display_hemi_scan() with graphtype=3.
nickname | name prefix of holo waves. may be empty. |
projection | mapping function from polar to cartesian coordinates. see Projections for details.
|
Definition at line 2920 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 1205 of file pearl-anglescan-process.ipf.
variable load_hemi_scan | ( | string | nickname, |
string | pathname, | ||
string | filename | ||
) |
load a hemispherical scan from an Igor text file
Definition at line 3130 of file pearl-anglescan-process.ipf.
variable make_hemi_grid | ( | variable | npol, |
string | nickname, | ||
variable | xpdplot = defaultValue |
||
) |
create a hemispherical, constant solid angle grid
all necessary waves are created in the current data folder with step size 90 / (npol - 1)
adapted from XPDplot 8.03
npol | number of polar angles, determines polar and azimuthal step size. recommended 91 for 1-degree steps. |
nickname | name prefix for waves. nick name must be unique in the current data folder. otherwise existing waves get overwritten. may be empty. |
xpdplot | XPDplot compatibility
|
Definition at line 1365 of file pearl-anglescan-process.ipf.
variable normalize_strip_2d | ( | wave | strip, |
wave | theta, | ||
variable | theta_offset = defaultValue , |
||
variable | smooth_method = defaultValue , |
||
variable | smooth_factor = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip by a two-dimensional normalization function.
check | enable output of intermediate results
|
Definition at line 686 of file pearl-anglescan-process.ipf.
variable normalize_strip_phi | ( | wave | strip, |
wave | theta, | ||
wave | phi, | ||
variable | theta_offset = defaultValue , |
||
variable | theta_range = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip by a sine function in phi (wobble correction).
the sine function is a curve fit to the intensity integrated over detector angle with a period of 360°.
this normalization may be useful if the intensity varies with a 360° periodicity in the azimuthal angle, e.g. due to misalignment of the surface normal and the azimuthal rotation axis of the manipulator (wobble). note, however, that this function does not correct other effects of wobble such as angle shifts.
the strip is normalized in place, previous data is overwritten.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | theta | polar manipulator angle. |
[in] | phi | azimuthal manipulator angle, arbitrary offset. |
[in] | theta_offset | theta value corresponding to normal emission (default 0). |
[in] | theta_range | maximum (offset corrected) theta to consider in the sine fit (default 10). |
check | enable output of intermediate results
|
Definition at line 348 of file pearl-anglescan-process.ipf.
variable normalize_strip_theta | ( | wave | strip, |
wave | theta, | ||
variable | theta_offset = defaultValue , |
||
variable | smooth_method = defaultValue , |
||
variable | smooth_factor = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip by the average polar distribution.
this is a simple way to remove the polar angle dependence. the strip is normalized in place, previous data is overwritten.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | theta | polar manipulator angle, 0 = normal emission, 90 = grazing emission |
[in] | theta_offset | |
[in] | smooth_method | smoothing method
|
[in] | smooth_factor | smoothing parameter, depends on smooth_method
|
check | enable output of intermediate results
|
Definition at line 433 of file pearl-anglescan-process.ipf.
variable normalize_strip_theta_scans | ( | wave | strip, |
wave | theta, | ||
variable | theta_offset = defaultValue , |
||
variable | smooth_method = defaultValue , |
||
variable | smooth_factor = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip piecewise by a smooth polar distribution.
Definition at line 594 of file pearl-anglescan-process.ipf.
variable normalize_strip_thetaphi | ( | wave | strip, |
wave | theta, | ||
wave | phi, | ||
variable | theta_offset = defaultValue , |
||
variable | smooth_method = defaultValue , |
||
variable | smooth_factor = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip by a smooth polar-azimuthal distribution.
this is a simple way to remove the polar angle dependence. in contrast to normalize_strip_theta this function also removes a smooth variation over azimuthal angles.
the strip is normalized in place, previous data is overwritten.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | theta | polar manipulator angle, 0 = normal emission, 90 = grazing emission |
[in] | phi | azimuthal manipulator angle. |
[in] | theta_offset | |
[in] | smooth_method | smoothing method
|
[in] | smooth_factor | smoothing parameter, depends on smooth_method
|
check | enable output of intermediate results
|
Definition at line 533 of file pearl-anglescan-process.ipf.
variable normalize_strip_x | ( | wave | strip, |
variable | smooth_method = defaultValue , |
||
variable | smooth_factor = defaultValue , |
||
variable | check = defaultValue |
||
) |
divide the strip by the average X distribution.
this is a simple way to remove the effect of the angle-dependence of the analyser transmission function. the strip is normalized in place, previous data is overwritten.
the function can handle sparse NaNs.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan |
[in] | smooth_method | smoothing method
|
[in] | smooth_factor | num parameter of Igor's Smooth operation. the default value depends on smooth_method. it is 0.5 for LOESS smoothing, 2 otherwise. |
[in] | check | enable output of intermediate results
|
Definition at line 252 of file pearl-anglescan-process.ipf.
variable pizza_service | ( | wave | data, |
string | nickname, | ||
variable | theta_offset, | ||
variable | tilt_offset, | ||
variable | phi_offset, | ||
variable | npolar = defaultValue , |
||
variable | nograph = defaultValue , |
||
variable | folding = defaultValue , |
||
variable | xpdplot = defaultValue |
||
) |
create a pizza plot from a measured (energy-integrated) data strip
accepts angle-scan data as returned by adh5_load_reduced(), maps them onto a hemispherical scan grid, and displays a polar graph.
data | 2D intensity wave, see requirements above
|
nickname | nick name for output data
|
theta_offset | manipulator theta angle corresponding to normal emission. the offset is subtracted from the ManipulatorTheta wave before processing. |
tilt_offset | manipulator tilt angle corresponding to normal emission the offset is subtracted from the ManipulatorTilt wave before processing. |
phi_offset | manipulator phi angle corresponding to phi_result = 0 the offset is subtracted from the ManipulatorPhi wave before processing. |
npolar | number of polar angles, determines polar and azimuthal step size. default = 91 (1 degree steps) |
folding | rotational averaging, default = 1 |
nograph | display a new graph window?
|
xpdplot | XPDplot compatibility
|
Definition at line 843 of file pearl-anglescan-process.ipf.
variable pizza_service_2 | ( | wave | data, |
string | nickname, | ||
wave | m_theta, | ||
wave | m_tilt, | ||
wave | m_phi, | ||
variable | npolar = defaultValue , |
||
variable | nograph = defaultValue , |
||
variable | folding = defaultValue , |
||
variable | xpdplot = defaultValue |
||
) |
create a pizza plot from a measured (energy-integrated) data strip
accepts angle-scan data as returned by adh5_load_reduced(), maps them onto a hemispherical scan grid, and displays a polar graph.
the behaviour of this function is the same as pizza_service() except that the manipulator waves are specified explicitly.
data | 2D intensity wave, see requirements above
|
nickname | nick name for output data
|
m_theta | manipulator theta angles, 0 = normal emission. size = dimsize(data, 1) |
m_tilt | manipulator tilt angles, 0 = normal emission. size = dimsize(data, 1) |
m_phi | manipulator phi angles, 0 = azimuthal origin. size = dimsize(data, 1) |
npolar | number of polar angles, determines polar and azimuthal step size. default = 91 (1 degree steps) |
folding | rotational averaging, default = 1 |
nograph | display a new graph window?
|
xpdplot | XPDplot compatibility
|
Definition at line 936 of file pearl-anglescan-process.ipf.
|
static |
polar graph window hook
this hook converts the cursor positions to polar coordinates and displays them in a text box on the graph. the text box is visible while the cursor info box is visible.
Definition at line 2547 of file pearl-anglescan-process.ipf.
string prepare_hemi_scan_display | ( | string | nickname, |
variable | projection = defaultValue |
||
) |
create waves for plotting a hemispherical angle scan.
the scan data must exist in the current data folder.
nickname | name prefix of holo waves. may be empty. |
projection | mapping function from polar to cartesian coordinates. see Projections for details.
|
Definition at line 1776 of file pearl-anglescan-process.ipf.
variable quick_pizza_image | ( | wave | data, |
string | nickname, | ||
variable | theta_offset, | ||
variable | tilt_offset, | ||
variable | phi_offset, | ||
variable | npolar = defaultValue , |
||
variable | nograph = defaultValue , |
||
variable | folding = defaultValue |
||
) |
map angle scan data onto a rectangular grid in stereographic projection
accepts angle-scan data as returned by adh5_load_reduced, maps them onto a rectangular grid in stereographic projection
data | 2D data wave, X-axis = analyser angle, Y-axis = manipulator scan (no specific ordering required) |
Definition at line 2986 of file pearl-anglescan-process.ipf.
variable rotate_hemi_scan | ( | string | nickname, |
variable | angle | ||
) |
azimuthally rotate a hemispherical scan dataset.
this function works only for hemi scans created by make_hemi_grid() (or compatible functions).
nickname | name prefix for waves. source data must be in current data folder. |
angle | azimuthal rotation angle in degrees. |
Definition at line 1728 of file pearl-anglescan-process.ipf.
variable save_hemi_scan | ( | string | nickname, |
string | pathname, | ||
string | filename | ||
) |
save a hemispherical scan to an Igor text file
Definition at line 3097 of file pearl-anglescan-process.ipf.
variable set_contrast | ( | variable | pcmin, |
variable | pcmax, | ||
string | graphname = defaultValue , |
||
string | colortable = defaultValue , |
||
variable | reversecolors = defaultValue , |
||
variable | symmetric = defaultValue |
||
) |
set the pseudocolor contrast by percentile.
set the minimum and maximum values of the pseudocolor scale such that a specified percentile of the distribution lies outside the limits.
the new contrast is applied to traces and images of the selected graph that have pseudocolor tables.
the function is not specific to angle scans. it can be used for any pseudocolor trace or image plots except contour plots.
pcmin | percentile below the minimum color (0-100). |
pcmax | percentile above the maximum color (0-100). |
graphname | name of graph. default: top graph. |
colortable | name of new colortable. default: keep current table. |
reversecolors | reverse colors of new colorable. takes effect only if colortable argument is defined.
|
symmetric | make scale symmetric about zero (for modulation functions, e.g.).
|
Definition at line 3463 of file pearl-anglescan-process.ipf.
variable set_polar_graph_cursor | ( | string | nickname, |
string | cursorname, | ||
variable | polar_angle, | ||
variable | azim_angle, | ||
string | graphname = defaultValue |
||
) |
Definition at line 2567 of file pearl-anglescan-process.ipf.
variable show_analyser_line | ( | variable | theta, |
variable | tilt, | ||
variable | phi, | ||
variable | theta_offset, | ||
variable | tilt_offset, | ||
variable | phi_offset, | ||
variable | npolar = defaultValue , |
||
variable | nograph = defaultValue , |
||
variable | xpdplot = defaultValue |
||
) |
calculate and display the line seen by the analyser for a specific emission angle
this can be used to compare to an hemispherical plot and check the manipulator angle.
theta | manipulator theta angle |
tilt | manipulator tilt angle |
phi | manipulator phi angle |
theta_offset | manipulator theta angle corresponding to normal emission |
tilt_offset | manipulator tilt angle corresponding to normal emission |
phi_offset | manipulator phi angle corresponding to phi_result = 0 |
npolar | number of polar angles, determines polar and azimuthal step size. default = 91 (1 degree steps) |
nograph | display a new graph window?
|
xpdplot | XPDplot compatibility
|
Definition at line 1053 of file pearl-anglescan-process.ipf.
string strip_append | ( | wave | strip1, |
wave | strip2 | ||
) |
append an angle scan strip to another one
concatenate two angle scan strips including matching attribute waves and replace the first strip with the resulting waves. this is useful if a scan was interrupted and continues in a second data file.
all accompanying 1D waves which have a matching length and exist in both source and destination folders are concatenated and stored in the destination. 'accompanying waves' are those in the same folder as the 2D strip wave and those in the :attr sub-folder.
[in,out] | strip1 | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan. this is the first source wave and destination wave. |
[in] | strip2 | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan. this is the second source wave. |
Definition at line 106 of file pearl-anglescan-process.ipf.
variable strip_delete_frames | ( | wave | strip, |
variable | qlo, | ||
variable | qhi, | ||
wave | theta, | ||
wave | tilt, | ||
wave | phi | ||
) |
delete a contiguous range of frames from a strip.
this can be used to remove a region of bad frames due to, e.g., measurement problems. the function operates on 2D intensity data and manipulator coordinates at the same time.
[in,out] | strip | 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan. the result is written to the original wave. |
[in,out] | theta | 1D data, manipulator scan. the result is written to the original wave. |
[in,out] | tilt | 1D data, manipulator scan. the result is written to the original wave. |
[in,out] | phi | 1D data, manipulator scan. the result is written to the original wave. |
[in] | qlo | point index of first frame to delete. |
[in] | qhi | point index of last frame to delete. qhi must be greater or equal than qlo. |
Definition at line 170 of file pearl-anglescan-process.ipf.
variable trim_hemi_scan | ( | string | nickname, |
variable | theta_max | ||
) |
trim a hemispherical scan at grazing angle
the function recalaculates the values wave from totals and weights but sets elements above a given polar angle to nan.
nickname | name of the scan dataset. can be empty if no prefix is used. the dataset must be in the current datafolder. |
theta_max | highest polar angle to keep (0...90 degrees). |
Definition at line 3229 of file pearl-anglescan-process.ipf.
|
static |
update the angles info based on cursors A and B of a given polar graph window
the function reads the projection mode from the user data of the graph window and the zeroAngleWhere variable from the associated WMPolarGraph data folder.
the calculated angles are written to the csrA_theta, csrA_phi, csrB_theta, and csrB_phi global variables in the polar graph data folder. the angles text box of the graph updates from to these variables dynamically.
graphname | name of polar graph window |
Definition at line 2512 of file pearl-anglescan-process.ipf.
const variable kProjArea = 2 |
Definition at line 2344 of file pearl-anglescan-process.ipf.
const variable kProjDist = 0 |
Definition at line 2342 of file pearl-anglescan-process.ipf.
const variable kProjGnom = 3 |
Definition at line 2345 of file pearl-anglescan-process.ipf.
const variable kProjOrtho = 4 |
Definition at line 2346 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 2350 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 2348 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 2352 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 2353 of file pearl-anglescan-process.ipf.
|
static |
Definition at line 2349 of file pearl-anglescan-process.ipf.
const variable kProjStereo = 1 |
Definition at line 2343 of file pearl-anglescan-process.ipf.