distro release 2.1.1

This commit is contained in:
2020-06-09 12:31:05 +02:00
parent b7390cb46f
commit ef9d08e5f5
168 changed files with 3286 additions and 1205 deletions

View File

@ -62,7 +62,33 @@ function prompt_int_linbg_reduction(param)
return v_flag
end
/// this function is for testing only, until we implement a proper interface
/// capture linear background reduction parameters from cursors in a graph.
///
/// PRELIMINARY - function arguments may change
///
/// sets reduction parameters from cursors in a graph.
/// the resulting parameters are copied to the global `s_reduction_params` string
/// used by the data explorer.
///
/// an even number of cursors (2 or more) must be set on the image.
/// cursor names and order do not matter,
/// except that the alphabetically first cursor which is attached to an image selects the image.
/// the cursors mark the following positions, from innermost to outermost pair:
///
/// 1. low and high limits of peak region.
/// if no cursors are present, the limits are set at 40% and 60% of the x-scale.
/// 2. peak-side boundary of lower and upper background region.
/// if two or less cursors are present, the default background region applies,
/// which extends from the peak limits up to the default cropping region.
/// the background region extends up to the cropping region defined by the third pair.
/// 3. lower and upper cropping region.
/// if four or less cursors are present, the default cropping region applies,
/// which is 11% on either side of the image in fixed mode, and 0% otherwise.
/// fixed mode is detected by the number of pixels (>= 992).
///
/// @note on profile graphs, the necessary cursors can be configured easily
/// by calling the ad_profile_cursor_mode() function, e.g.
/// `ad_profiles_cursor_mode(root:packages:pearl_explorer:preview_image, 1)`.
///
function /s capture_int_linbg_cursors()
string param = csr_int_linbg_reduction("")
@ -73,18 +99,36 @@ function /s capture_int_linbg_cursors()
return param
end
/// set reduction parameters from cursors in a graph.
/// calculate linear background reduction parameters from cursors in a graph.
///
/// PRELIMINARY - function arguments may change
///
/// sets reduction parameters from cursors in a graph.
/// calculates reduction parameters from cursors in a graph.
/// the resulting parameters are returned in a string.
///
/// an even number of cursors (2 or more) must be set on the image.
/// cursor names and order do not matter,
/// except that the alphabetically first cursor which is attached to an image selects the image.
/// the cursors mark the following positions, from innermost to outermost pair:
/// 1) low and high limits of peak region.
/// 2) peak-side boundary of lower and upper background region.
/// 3) lower and upper cropping region.
///
/// 1. low and high limits of peak region.
/// if no cursors are present, the limits are set at 40% and 60% of the x-scale.
/// 2. peak-side boundary of lower and upper background region.
/// if two or less cursors are present, the default background region applies,
/// which extends from the peak limits up to the default cropping region.
/// the background region extends up to the cropping region defined by the third pair.
/// 3. lower and upper cropping region.
/// if four or less cursors are present, the default cropping region applies,
/// which is 11% on either side of the image in fixed mode, and 0% otherwise.
/// fixed mode is detected by the number of pixels (>= 992).
///
/// @note on profile graphs, the necessary cursors can be configured easily
/// by calling the ad_profile_cursor_mode() function, e.g.
/// `ad_profiles_cursor_mode(root:packages:pearl_explorer:preview_image, 1)`.
///
/// @param win graph window name or empty string for top window.
///
/// @return parameter string for linear background subtraction
///
function /s csr_int_linbg_reduction(win)
string win
@ -127,8 +171,8 @@ function /s csr_int_linbg_reduction(win)
// map innermost cursor pair to peak center and size
variable ip2 = np / 2
variable ip1 = ip2 - 1
variable Cpos = (positions[ip1] + positions[ip2]) / 2
variable Csize = positions[ip2] - positions[ip1]
variable Cpos
variable Csize
if (ip1 >= 0)
Cpos = (positions[ip1] + positions[ip2]) / 2
Csize = positions[ip2] - positions[ip1]
@ -155,15 +199,17 @@ function /s csr_int_linbg_reduction(win)
// crop region
ip1 -= 1
ip2 += 1
variable Lcrop
variable Hcrop
variable Lcrop = 0
variable Hcrop = 0
if (ip1 >= 0)
Lcrop = positions[ip1]
Hcrop = 1 - positions[ip2]
else
// default: dead corners of the EW4000 at PEARL
Lcrop = 0.11
Hcrop = 0.11
// default: in fixed mode: dark corners of the EW4000 at PEARL, 0 otherwise
if (dimsize(image, 0) >= 992)
Lcrop = 0.11
Hcrop = 0.11
endif
endif
Lsize = max(Lsize - Lcrop, 0)
Hsize = max(Hsize - Hcrop, 0)