new features: data reduction, angle scan panel

- new data reduction interface for more efficient multi-peak fitting.
  the new interface breaks compatibility with pre-2.0 data reduction
  functions. user-defined functions must be adapted to the new
  interface.
- new angle scan processing panel for interactive data analysis.
This commit is contained in:
2018-02-06 11:39:57 +01:00
parent e1f1aa9636
commit fda49c3195
171 changed files with 7539 additions and 2554 deletions

View File

@ -164,10 +164,10 @@ end
///
/// @param[in] smooth_method smoothing method
/// @arg 0 none
/// @arg 1 (default) binomial, see Igor's Smooth operation
/// @arg 1 binomial, see Igor's Smooth operation
/// @arg 2 boxcar, see Igor's Smooth operation
/// @arg 3 scienta_ang_transm() function fit
/// @arg 4 LOESS smoothing, see Igor's Loess operation
/// @arg 4 (default) LOESS smoothing, see Igor's Loess operation
///
/// @param[in] smooth_factor num parameter of Igor's Smooth operation.
/// the default value depends on smooth_method.
@ -189,7 +189,7 @@ function normalize_strip_x(strip, [smooth_method, smooth_factor, check])
variable check
if (ParamIsDefault(smooth_method))
smooth_method = 1
smooth_method = 4
endif
if (ParamIsDefault(smooth_factor))
switch(smooth_method)
@ -419,6 +419,89 @@ function normalize_strip_theta(strip, theta, [theta_offset, smooth_method, smoot
endif
end
/// divide the strip by a smooth polar-azimuthal distribution.
///
/// this is a simple way to remove the polar angle dependence.
/// in contrast to @ref normalize_strip_theta this function also removes a smooth variation over azimuthal angles.
///
/// the strip is normalized in place, previous data is overwritten.
///
/// @warning experimental. this function is under development.
///
/// @param[in,out] strip 2D data, X-axis = analyser angle, Y-axis = arbitrary manipulator scan
/// @param[in] theta polar manipulator angle, 0 = normal emission, 90 = grazing emission
/// @param[in] phi azimuthal manipulator angle.
/// @param[in] theta_offset
/// @param[in] smooth_method smoothing method
/// @arg 0 none
/// @arg 4 (default) Loess, see Igor's Loess operation
///
/// @param[in] smooth_factor smoothing parameter, depends on smooth_method
/// @arg loess: see Igor's Loess operation, 0 <= smooth_factor <= 1, default 0.5
///
/// @param check enable output of intermediate results
/// @arg 0 (default) don't create additional waves
/// @arg 1 create check waves in the current folder
/// @arg 2 calculate check waves only, do not modify strip
///
/// @return if check waves are enabled, the following waves are created (overwritten if existing):
/// @arg check_dist average theta distribution
/// @arg check_smoo smoothed distribution used to normalize the strip
///
function normalize_strip_thetaphi(strip, theta, phi, [theta_offset, smooth_method, smooth_factor, check])
wave strip
wave theta
wave phi
variable theta_offset
variable smooth_method
variable smooth_factor
variable check
if (ParamIsDefault(check))
check = 0
endif
if (ParamIsDefault(theta_offset))
theta_offset = 0
endif
if (ParamIsDefault(smooth_method))
smooth_method = 4
endif
if (ParamIsDefault(smooth_factor))
smooth_factor = 0.5
endif
// average over analyser angles
wave dist = ad_profile_y(strip, -inf, inf, "")
// smooth distribution function
duplicate /free dist, dist_smoo
duplicate /free theta, theta_int
theta_int = theta - theta_offset
setscale /p x theta_int[0], theta_int[1] - theta_int[0], waveunits(theta,-1), dist, dist_smoo
variable nx = dimsize(strip, 0)
variable ix
switch(smooth_method)
case 4:
loess /dest=dist_smoo /smth=(smooth_factor) srcWave=dist, factors={theta_int, phi}
break
default:
abort "smooth method not supported"
endswitch
// divide
if (check != 2)
strip /= dist_smoo[q]
endif
// check
if (check)
duplicate /o dist, check_dist
duplicate /o dist_smoo, check_smoo
setscale /p x dimoffset(dist,0), dimdelta(dist,0), waveunits(dist,0), check_dist, check_smoo
endif
end
/// divide the strip by a two-dimensional normalization function.
///
/// @warning experimental. this function is under development.
@ -1479,11 +1562,13 @@ end
/// @param nickname name prefix of holo waves.
/// may be empty.
///
/// @param projection mapping function from polar to cartesian coordinates
/// @arg 0 linear
/// @arg 1 stereographic (default)
/// @arg 2 azimuthal
/// @arg 3 gnomonic (0 <= polar < 90).
/// @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
///
/// @param graphtype type of graph
/// @arg 1 (pol, az) trace in Igor "New Polar" (default).