bug fixes in angle scan processing and documentation
This commit is contained in:
parent
9a81493a1a
commit
0fb0fd92c8
@ -34,12 +34,16 @@ Matthias Muntwiler, <mailto:matthias.muntwiler@psi.ch>
|
||||
Copyright
|
||||
---------
|
||||
|
||||
Copyright 2009-2018 by [Paul Scherrer Institut](http://www.psi.ch)
|
||||
Copyright 2009-2019 by [Paul Scherrer Institut](http://www.psi.ch)
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
## rev-distro-2.0.3
|
||||
|
||||
- The interpolate_hemi_scan function now requires a projection argument unless stereographic projection is desired.
|
||||
|
||||
## rev-distro-2.0.0
|
||||
|
||||
- The interface of data reduction functions has changed to make data reduction more efficient in multi-peak fits. The supplied reduction functions and dialogs have been refactored. If you want to use your own reduction functions written for pre-2.0, you have to adapt them to the new interface.
|
||||
|
@ -768,7 +768,8 @@ INPUT = ../pearl \
|
||||
# possible encodings.
|
||||
# The default value is: UTF-8.
|
||||
|
||||
INPUT_ENCODING = CP1252
|
||||
#INPUT_ENCODING = CP1252
|
||||
INPUT_ENCODING = ISO-8859-15
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
|
||||
@ -874,14 +875,15 @@ INPUT_FILTER =
|
||||
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
|
||||
# patterns match the file name, INPUT_FILTER is applied.
|
||||
|
||||
FILTER_PATTERNS = "*.ipf=\"gawk -f doxygen-filter-ipf.awk\""
|
||||
#FILTER_PATTERNS = "*.ipf=\"/usr/bin/gawk -f doxygen-filter-ipf.awk\""
|
||||
FILTER_PATTERNS = "*.ipf=/bin/sh doxygen-filter-ipf.sh"
|
||||
|
||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
||||
# INPUT_FILTER) will also be used to filter the input files that are used for
|
||||
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
|
||||
# The default value is: NO.
|
||||
|
||||
FILTER_SOURCE_FILES = YES
|
||||
FILTER_SOURCE_FILES = NO
|
||||
|
||||
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
|
||||
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
|
||||
|
3
doc/doxygen-filter-ipf.sh
Executable file
3
doc/doxygen-filter-ipf.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
gawk -b -f doxygen-filter-ipf.awk "$1"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
@tableofcontents
|
||||
|
||||
\section sec_intro Introduction
|
||||
\section sec_anglescan_intro Introduction
|
||||
|
||||
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.
|
||||
@ -170,6 +170,9 @@ Depending on the quality of the measured data,
|
||||
only some of the following processing steps are necessary.
|
||||
Use your own judgement.
|
||||
|
||||
There is a GUI for the processing steps in @ref pearl-anglescan-panel.ipf
|
||||
(@ref asp_show_panel function or the PEARL/process menu).
|
||||
|
||||
\subsection sec_norm_prep Preparations
|
||||
|
||||
Start by creating a new copy of the data and inspecting it:
|
||||
@ -216,7 +219,7 @@ Then set <code>check=1</code> to apply the normalization to <code>NormData1</cod
|
||||
\subsection sec_norm_wobble Azimuthal variation (wobble)
|
||||
|
||||
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°ree; period.
|
||||
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.
|
||||
@ -324,6 +327,25 @@ ModifyGraph zColor(polarY0)={mod_values,-0.2,0.2,BlueGreenOrange,0}
|
||||
@endcode
|
||||
|
||||
|
||||
\subsection sec_projection Projection
|
||||
|
||||
The @ref display_hemi_scan and @ref interpolate_hemi_scan functions take an optional argument `projection`
|
||||
which selects one of the following projections.
|
||||
By default, stereographic projection is selected.
|
||||
|
||||
| Selector | Projection | Function | Properties |
|
||||
| :----: | :----: | :----: | :---- |
|
||||
| kProjDist = 0 | azimuthal equidistant | r = c * theta | radius is proportional to polar angle |
|
||||
| kProjStereo = 1 | stereographic | r = c * tan theta/2 | circles on sphere map to circles |
|
||||
| kProjArea = 2 | azimuthal equal-area | r = c * sin theta/2 | preserves area measure |
|
||||
| kProjGnom = 3 | gnomonic | r = c * tan theta | great circles map to straight lines |
|
||||
| kProjOrtho = 4 | orthographic | r = c * sin theta | momentum mapping in ARPES and LEED |
|
||||
|
||||
For a description of the different projections,
|
||||
see [Wikipedia](https://en.wikipedia.org/wiki/Map_projection), for example.
|
||||
The projections in this package are defined for 0 <= theta < 90.
|
||||
|
||||
|
||||
\section sec_export Data export
|
||||
|
||||
\subsection sec_export_plot Export picture
|
||||
|
@ -552,7 +552,6 @@ function asp_calculate_output()
|
||||
|
||||
nvar folding=output_folding
|
||||
nvar horizon=output_horizon
|
||||
nvar graph_mode
|
||||
|
||||
do_init_process(0)
|
||||
do_crop_alpha(0)
|
||||
@ -570,8 +569,6 @@ function asp_calculate_output()
|
||||
values = pol <= horizon ? values : nan
|
||||
endif
|
||||
|
||||
interpolate_hemi_scan("")
|
||||
|
||||
SetDataFolder saveDF
|
||||
end
|
||||
|
||||
@ -609,6 +606,11 @@ function /s asp_display_output([data_df, data_name])
|
||||
|
||||
dfref saveDF = GetDataFolderDFR()
|
||||
setdatafolder data_df
|
||||
|
||||
if (graph_mode == 3)
|
||||
interpolate_hemi_scan(data_name, projection=graph_projection)
|
||||
endif
|
||||
|
||||
string graphname = data_name
|
||||
graphname = display_hemi_scan(data_name, projection=graph_projection, graphtype=graph_mode, graphname=graphname)
|
||||
if (ParamIsDefault(data_df))
|
||||
|
@ -257,9 +257,9 @@ end
|
||||
/// 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°ree;.
|
||||
/// with a period of 360°.
|
||||
///
|
||||
/// this normalization may be useful if the intensity varies with a 360°ree; periodicity in the azimuthal angle,
|
||||
/// 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.
|
||||
///
|
||||
@ -1565,6 +1565,58 @@ function rotate_hemi_scan(nickname, angle)
|
||||
setdatafolder saveDF
|
||||
end
|
||||
|
||||
/// create waves for plotting a hemispherical angle scan.
|
||||
///
|
||||
/// the scan data must exist in the current data folder.
|
||||
///
|
||||
/// @param nickname name prefix of holo waves.
|
||||
/// may be empty.
|
||||
///
|
||||
/// @param projection mapping function from polar to cartesian coordinates.
|
||||
/// see @ref PageProjections for details.
|
||||
/// @arg kProjDist = 0 azimuthal equidistant
|
||||
/// @arg kProjStereo = 1 stereographic (default)
|
||||
/// @arg kProjArea = 2 azimuthal equal-area
|
||||
/// @arg kProjGnom = 3 gnomonic (0 <= polar < 90)
|
||||
/// @arg kProjOrtho = 4 orthographic
|
||||
///
|
||||
///
|
||||
function /s prepare_hemi_scan_display(nickname, [projection])
|
||||
string nickname
|
||||
variable projection
|
||||
|
||||
dfref savedf = getdatafolderdfr()
|
||||
|
||||
if (ParamIsDefault(projection))
|
||||
projection = 1
|
||||
endif
|
||||
|
||||
// hemi grid waves
|
||||
string s_prefix = ""
|
||||
string s_int = "values"
|
||||
dfref df = find_hemi_data(nickname, s_prefix, s_int)
|
||||
|
||||
string s_polar = s_prefix + "pol"
|
||||
string s_azim = s_prefix + "az"
|
||||
|
||||
wave /sdfr=df /z values = $s_int
|
||||
wave /sdfr=df /z azim = $s_azim
|
||||
wave /sdfr=df /z polar = $s_polar
|
||||
|
||||
setdatafolder df
|
||||
string s_ster_rad = s_prefix + "ster_rad"
|
||||
duplicate /o polar, $s_ster_rad /wave=ster_rad
|
||||
ster_rad = calc_graph_radius(polar, projection=projection)
|
||||
|
||||
string s_ster_x = s_prefix + "ster_x"
|
||||
string s_ster_y = s_prefix + "ster_y"
|
||||
duplicate /o azim, $s_ster_x /wave=ster_x, $s_ster_y /wave=ster_y
|
||||
ster_x = ster_rad * cos(azim * pi / 180)
|
||||
ster_y = ster_rad * sin(azim * pi / 180)
|
||||
|
||||
setdatafolder savedf
|
||||
end
|
||||
|
||||
/// display a plot of a hemispherical angle scan.
|
||||
///
|
||||
/// the scan data must exist in the current data folder.
|
||||
@ -1641,6 +1693,8 @@ function /s display_hemi_scan(nickname, [projection, graphtype, do_ticks, do_gri
|
||||
endif
|
||||
endif
|
||||
|
||||
prepare_hemi_scan_display(nickname, projection=projection)
|
||||
|
||||
// hemi grid waves
|
||||
string s_prefix = ""
|
||||
string s_int = "values"
|
||||
@ -1649,23 +1703,15 @@ function /s display_hemi_scan(nickname, [projection, graphtype, do_ticks, do_gri
|
||||
string s_polar = s_prefix + "pol"
|
||||
string s_azim = s_prefix + "az"
|
||||
string s_matrix = s_prefix + "matrix"
|
||||
string s_ster_rad = s_prefix + "ster_rad"
|
||||
|
||||
wave /sdfr=df /z values = $s_int
|
||||
wave /sdfr=df /z azim = $s_azim
|
||||
wave /sdfr=df /z polar = $s_polar
|
||||
wave /sdfr=df /z ster_rad = $s_ster_rad
|
||||
wave /sdfr=df /z matrix = $s_matrix
|
||||
|
||||
setdatafolder df
|
||||
string s_ster_rad = s_prefix + "ster_rad"
|
||||
duplicate /o polar, $s_ster_rad /wave=ster_rad
|
||||
ster_rad = calc_graph_radius(polar, projection=projection)
|
||||
|
||||
string s_ster_x = s_prefix + "ster_x"
|
||||
string s_ster_y = s_prefix + "ster_y"
|
||||
duplicate /o azim, $s_ster_x /wave=ster_x, $s_ster_y /wave=ster_y
|
||||
ster_x = ster_rad * cos(azim * pi / 180)
|
||||
ster_y = ster_rad * sin(azim * pi / 180)
|
||||
|
||||
variable azim_offset = 0
|
||||
if (!(NumberByKey("version", note(azim), "=", "\r") >= 1.6))
|
||||
DoAlert /T="display hemi scan" 0, "your dataset doesn't include the version 1.6 flag. if it was created with an earlier version that might be okay. please check that the orientation is correct!"
|
||||
@ -2534,12 +2580,12 @@ end
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// the function requires the ster_x and ster_y waves that are created by display_hemi_scan,
|
||||
/// and thus implicitly uses the same projection.
|
||||
///
|
||||
/// 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.
|
||||
@ -2547,26 +2593,47 @@ end
|
||||
///
|
||||
/// to display the result call display_hemi_scan() with graphtype=3.
|
||||
///
|
||||
function interpolate_hemi_scan(nickname)
|
||||
/// @param nickname name prefix of holo waves.
|
||||
/// may be empty.
|
||||
///
|
||||
/// @param projection mapping function from polar to cartesian coordinates.
|
||||
/// see @ref PageProjections for details.
|
||||
/// @arg kProjDist = 0 azimuthal equidistant
|
||||
/// @arg kProjStereo = 1 stereographic (default)
|
||||
/// @arg kProjArea = 2 azimuthal equal-area
|
||||
/// @arg kProjGnom = 3 gnomonic (0 <= polar < 90)
|
||||
/// @arg kProjOrtho = 4 orthographic
|
||||
///
|
||||
///
|
||||
function interpolate_hemi_scan(nickname, [projection])
|
||||
string nickname
|
||||
variable projection
|
||||
|
||||
dfref savedf = GetDataFolderDFR()
|
||||
|
||||
if (ParamIsDefault(projection))
|
||||
projection = 1
|
||||
endif
|
||||
|
||||
string s_prefix = ""
|
||||
string s_int = "values"
|
||||
dfref df = find_hemi_data(nickname, s_prefix, s_int)
|
||||
|
||||
prepare_hemi_scan_display(nickname, projection=projection)
|
||||
|
||||
string s_polar = s_prefix + "pol"
|
||||
string s_azim = s_prefix + "az"
|
||||
string s_matrix = s_prefix + "matrix"
|
||||
string s_ster_rad = s_prefix + "ster_rad"
|
||||
string s_ster_x = s_prefix + "ster_x"
|
||||
string s_ster_y = s_prefix + "ster_y"
|
||||
|
||||
wave /sdfr=df values = $s_int
|
||||
wave /sdfr=df azim = $s_azim
|
||||
wave /sdfr=df polar = $s_polar
|
||||
wave /sdfr=df ster_x = $s_ster_x
|
||||
wave /sdfr=df ster_y = $s_ster_y
|
||||
|
||||
wave /sdfr=df /z values = $s_int
|
||||
wave /sdfr=df /z azim = $s_azim
|
||||
wave /sdfr=df /z polar = $s_polar
|
||||
wave /sdfr=df /z ster_rad = $s_ster_rad
|
||||
wave /sdfr=df /z ster_x = $s_ster_x
|
||||
wave /sdfr=df /z ster_y = $s_ster_y
|
||||
|
||||
variable min_ster_x = wavemin(ster_x)
|
||||
variable max_ster_x = wavemax(ster_x)
|
||||
variable x0 = min_ster_x
|
||||
@ -3040,7 +3107,6 @@ static function check_contrast(values, pcmin, pcmax, vmin, vmax)
|
||||
variable imax = round(numpnts(index) * (100 - pcmax) / 100)
|
||||
vmin = values[index[imin]]
|
||||
vmax = values[index[imax]]
|
||||
KillDataFolder dfr
|
||||
setdatafolder save_df
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user