pearl-scienta-preprocess.ipf File Reference
ARPES package

preprocessing functions for Scienta detector images. More...

`#include "pearl-fitfuncs"`

Go to the source code of this file.

## Namespaces

| PearlScientaPreprocess
| preprocessing functions for Scienta detector images.

## Functions

variable | prompt_int_linbg_reduction (string *param)
| prompt the user for integrate on linear background reduction parameters. More...
string | capture_int_linbg_cursors ()
| this function is for testing only, until we implement a proper interface More...
string | csr_int_linbg_reduction (string win)
| set reduction parameters from cursors in a graph. More...
threadsafe wave | int_linbg_reduction (wave source, string *param)
| linear-background subtracted integration reduction function. More...
variable | prompt_int_quadbg_reduction (string *param)
threadsafe wave | int_quadbg_reduction (wave source, string *param)
| integrate peak area minus a quadratic background More...
variable | prompt_redim_linbg_reduction (string *param)
| parameter dialog for the redim_linbg_reduction() function More...
threadsafe wave | redim_linbg_reduction (wave source, string *param)
| linear background reduction function for incorrectly dimensioned scienta image More...
variable | test_gauss4_reduction (wave image)
| apply the gauss4_reduction function to a single image More...
variable | prompt_gauss4_reduction (string *param)
| prompt for the gauss4_reduction parameters More...
threadsafe wave | gauss4_reduction (wave source, string *param)
| fit horizontal cuts of an image with up to four gaussian peaks on a linear background More...

## Detailed Description

preprocessing functions for Scienta detector images.

this procedure contains functions for data reduction and instrument-specific normalization.

Author
  matthias muntwiler, matth.nosp@m.ias..nosp@m.muntw.nosp@m.iler.nosp@m.@psi..nosp@m.ch

Copyright
  2013-18 Paul Scherrer Institut
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Definition in file pearl-scienta-preprocess.ipf.

## Function Documentation

## capture_int_linbg_cursors()

string capture_int_linbg_cursors | ( |  | ) |

this function is for testing only, until we implement a proper interface

Definition at line 67 of file pearl-scienta-preprocess.ipf.

## csr_int_linbg_reduction()

string csr_int_linbg_reduction | ( | string | win | ) |

set reduction parameters from cursors in a graph.

PRELIMINARY - function arguments may change

sets reduction parameters from cursors in a graph. 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.

Definition at line 89 of file pearl-scienta-preprocess.ipf.

## gauss4_reduction()

threadsafe wave gauss4_reduction | ( | wave | source,
|  | string * | param
| ) |  |

fit horizontal cuts of an image with up to four gaussian peaks on a linear background

the function fits each horizontal profile (EDC) with four gaussian peaks on a linear background. the position and width of the peaks is kept fixed according to input parameters. the peak amplitude is constrained to positive value.

the width parameter is defined as in Igor's gauss curve fit function (standard deviation divided by the square root of two). the return value in dest1 is the integrated peak of one of the peaks. dest2 returns the corresponding error estimate.

Parameters

  source | source wave. two-dimensional distribution of counts. for correct weighting and error estimation it is important that the source wave contains actual counts (Poisson statistics).

  param

  (in, out) semicolon-separated key=value list of processing parameters. this is a pass-by-reference argument. the following parameters are required. position, width and limit parameters are on the x (energy) scale.
  - rngl low limit of fit interval
  - rngh high limit of fit interval
  - pos1 position of peak 1
  - wid1 width of peak 1
  - pos2 position of peak 2
  - wid2 width of peak 2
  - pos3 position of peak 3
  - wid3 width of peak 3
  - pos4 position of peak 4
  - wid4 width of peak 4
  - npeaks number of peaks to fit: 1...4 the others are held at amplitude 0.
  - ybox box size of averaging in y direction, must be 1 or 3. other values lead to corrupt data.

Returns
  free wave containing references of the result waves. the number of waves is two times the number of peaks that are fit. the first npeaks waves contain the peak integrals, the second npeaks waves the corresponding error estimates.

Definition at line 672 of file pearl-scienta-preprocess.ipf.

## int_linbg_reduction()

threadsafe wave int_linbg_reduction | ( | wave | source,
|  | string * | param
| ) |  |

linear-background subtracted integration reduction function.

data reduction function for adh5_load_reduced_detector. cf. adh5_default_reduction for an explanation of reduction functions.

this function calculates the average pixel value of each angular slice in one center and two background intervals. a background value is calculated at the center position by linear interpolation from the two background values. returns the center minus linear background in dest1. returns the Poisson one-sigma error in dest2.

typical values (peak centered on detector, FWHM ~ 20 % of image) Lcrop=0.11;Hcrop=0.11;Lsize=0.2;Hsize=0.2;Cpos=0.5;Csize=0.2

Parameters

  source | scienta detector image, energy axis along X, angle axis along Y. two-dimensional intensity distribution (image). the scales are carried over to the result waves.

  param

  parameters in a key1=value1;key2=value2;... list. all region parameters are relative to the image size (0...1).
  - Lcrop = size of the lower cropping region
  - Hcrop = size of the upper cropping region
  - Lsize = size of the lower background integration region
  - Hsize = size of the upper background integration region
  - Cpos = center position of the of the peak integration region
  - Csize = size of the peak integration region

Returns
  free wave containing references of the two result waves. the first wave is the integral minus linear background. the second wave is the Poisson one-sigma error.

Definition at line 214 of file pearl-scienta-preprocess.ipf.

## int_quadbg_reduction()

threadsafe wave int_quadbg_reduction | ( | wave | source,
|  | string * | param
| ) |  |

integrate peak area minus a quadratic background

data reduction function for adh5_load_reduced_detector. cf. adh5_default_reduction for an explanation of reduction functions.

this function calculates the average pixel value of each angular slice in one center and two background intervals. a background value is calculated at the center position by linear interpolation from the two background values. returns the center minus linear background in dest1. returns the Poisson one-sigma error in dest2.

typical values (peak centered on detector, FWHM ~ 20 % of image) Lcrop=0.11;Hcrop=0.11;Lsize=0.2;Hsize=0.2;Cpos=0.5;Csize=0.2

Parameters

  source | scienta detector image, energy axis along X, angle axis along Y. two-dimensional intensity distribution (image). the scales are carried over to the result waves.

  param

  parameters in a key1=value1;key2=value2;... list. all region parameters are relative to the image size (0...1).
  - Lcrop = size of the lower cropping region
  - Hcrop = size of the upper cropping region
  - Lsize = size of the lower background integration region
  - Hsize = size of the upper background integration region
  - Cpos = center position of the of the peak integration region
  - Csize = size of the peak integration region

Returns
  free wave containing references of the two result waves. the first wave is the integral minus linear background. the second wave is the Poisson one-sigma error.

Definition at line 367 of file pearl-scienta-preprocess.ipf.

## prompt_gauss4_reduction()

variable prompt_gauss4_reduction | ( | string * | param | ) |

prompt for the gauss4_reduction parameters

Definition at line 580 of file pearl-scienta-preprocess.ipf.

## prompt_int_linbg_reduction()

variable prompt_int_linbg_reduction | ( | string * | param | ) |

prompt the user for integrate on linear background reduction parameters.

Definition at line 35 of file pearl-scienta-preprocess.ipf.

## prompt_int_quadbg_reduction()

variable prompt_int_quadbg_reduction | ( | string * | param | ) |

Definition at line 305 of file pearl-scienta-preprocess.ipf.

## prompt_redim_linbg_reduction()

variable prompt_redim_linbg_reduction | ( | string * | param | ) |

parameter dialog for the redim_linbg_reduction() function

Parameters

  param | parameter string in a key1=value1;key2=value2;... list. the parameter string is passed by reference. see redim_linbg_reduction() for a description of parameters.

Returns
  zero if the user clicked OK, non-zero if the user clicked Cancel.

Definition at line 463 of file pearl-scienta-preprocess.ipf.

## redim_linbg_reduction()

threadsafe wave redim_linbg_reduction | ( | wave | source,
|  | string * | param
| ) |  |

linear background reduction function for incorrectly dimensioned scienta image

if the energy step size does not divide the energy range to an integer number, the scienta image is exported with the wrong array size. this can be fixed by redimensioning the array.

the current implementation works in the case where dimension 0 needs to be incremented. the function may be generalized to dimension 1 and/or decrementing by additional parameters. it is not known yet whether a generalization is needed or whether it can cover all cases.

background subtraction and peak integration is the same as by the int_linbg_reduction() function.

Parameters

  source | source wave Scienta detector image, energy axis along X, angle axis along Y
  param | parameter string in a key1=value1;key2=value2;... list. the parameter string is passed by reference.

all region parameters are relative to the image size (0...1).

- Lcrop size of the lower cropping region
- Hcrop size of the upper cropping region
- Lsize size of the lower background integration region
- Hsize size of the upper background integration region
- Cpos center position of the of the peak integration region
- Csize size of the peak integration region

typical values (peak centered on detector, FWHM ~ 20 % of image) Lcrop=0.11;Hcrop=0.11;Lsize=0.2;Hsize=0.2;Cpos=0.5;Csize=0.2

Returns
  free wave containing references of the two result waves. the first wave is the integral minus linear background. the second wave is the Poisson one-sigma error.

Definition at line 526 of file pearl-scienta-preprocess.ipf.

## test_gauss4_reduction()

variable test_gauss4_reduction | ( | wave | image | ) |

apply the gauss4_reduction function to a single image

useful for testing or manual processing. to debug, (temporarily) remove the threadsafe attribute from the gauss2_reduction function.

Definition at line 546 of file pearl-scienta-preprocess.ipf.