fermilevel¶
This module is part of the Python NavARP library. It defines the functions for extracting the Fermi level energy.
- fermilevel.align_fermi_index(efermis, energies, data)¶
Align each detector image to the fermi level.
- Parameters
energies (ndarray) – Energy axis of the analyzer data;
scans (ndarray) – Scan axis of the data acquisition;
data0 (ndarray) – The matrix composed by the detector images, the matrix must be ordered as data[scans, angles, energies];
- Returns
energies_algn (ndarray): Unified energy axis for data;
data_algn (ndarray): Each detector image aligned to the same fermi level.
- Return type
(tuple)
- fermilevel.align_to_same_eb(efermis, energies, data)¶
Align each detector image to the same binding energy axis from efermis.
- Parameters
efermis (float) – The fermi level values for each detector image;
energies (ndarray) – Energy axis of the analyzer data;
data (ndarray) – The matrix composed by the detector images, the matrix must be ordered as data[scans, angles, energies];
- Returns
e_bins (ndarray): Unified binding energy axis;
energies_algn (ndarray): Each kinetic energy axis aligned to e_bins;
data_algn (ndarray): Each detector image are aligned to e_bins.
- Return type
(tuple)
- fermilevel.fermi_fun(ekin, efermi, sigma, amp, slope, intercet)¶
- fermilevel.fit_efermi(energies, data_sum, energy_range=None)¶
Find fermi level using logaritmic derivative and then fit
- Parameters
energies (ndarray) – Energy axis of the analyzer data;
data_sum (ndarray) – The integrated 1-Dim data to fit;
energy_range (ndarray) – Energy range where to find fermi level [min, max];
- Returns
- Optimal values for the parameters so that the sum of
the squared residuals of fermi_fun - integrated data is minimized.
- Return type
pout (ndarray)
isocut¶
This module is part of the Python NavARP library. It defines the functions for the extraction of the iso-value map (maps_sum) and lines (lines_sum).
- isocut.lines_sum(value, delta, array, matrix, axis=None, return_counts=False)¶
Sum of lines over a given axis in range value-delta:value+delta
- Parameters
value (float) – The center of the interval;
delta (float) – The range is value-delta:value+delta;
array (ndarray) – The 1D-array where to find the indexes;
matrix (ndarray) – The 2D-matrix to be integrated along the range;
axis (None or int, optional) – Matrix axis along which sum is performed;
return_counts (bool, optional) – If True, also return the number of integrated elements.
- Returns
isocut_sum (ndarray): 1D-array integrated between value-delta:value+delta;
num_ind (int, optional): number of integrated elements.
- Return type
(tuple)
- isocut.maps_sum(value, delta, array, matrix, axis=None, return_counts=False)¶
Sum of matrix over a given axis in range value-delta:value+delta
- Parameters
value (float) – The center of the interval;
delta (float) – The range is value-delta:value+delta;
array (ndarray) – The 1D-array where to find the indexes;
matrix (ndarray) – The 3D-matrix to be integrated along the range;
axis (None or int, optional) – Matrix axis along which sum is performed;
return_counts (bool, optional) – If True, also return the number of intergrated elements.
- Returns
isocut_sum (ndarray): 2D-matrix integrated between value-delta:value+delta;
num_ind (int, optional): number of integrated elements.
- Return type
(tuple)
isomclass¶
This module is part of the Python NavARP library. It defines the isomap class which are extracted from a NavEntry.
- class isomclass.IsoAngle(entry, angle, dangle=0, norm_mode='no', sigma=None, order=2, curvature=None, kbins=None)¶
Bases:
object
Sum of entry.data over the angle axis in [angle-dangle, angle+dangle]
- Parameters
entry (NavEntry class) – The class for the data explored by NavARP;
angle (float) – Angular value on the;
dangle (float) – Delta angular value;
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal.
- angle¶
Angular value on the;
- Type
float
- dangle¶
Delta angular value;
- Type
float
- data¶
The matrix composed by the detector images;
- Type
ndarray
- data_init¶
The matrix composed by the detector images without any normalization;
- Type
ndarray
- ebins¶
Binding energy axis;
- Type
ndarray
- efermi¶
Fermi level kinetic energy (or energies);
- Type
ndarray
- ekins¶
Kinetic energy axis of the analyzer;
- Type
ndarray
- hv¶
Photon energy without any reshape, it is present only in the case of hv scan;
- Type
ndarray
- scan_type¶
Acquisition method;
- Type
str
- scans¶
Scan axis of the acquisition method.
- Type
ndarray
- dataprocessing(norm_mode, sigma, order, curvature)¶
Use data post-processing procedure
- Parameters
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal.
- show(xname='auto', yname='auto', cmap='magma_r', ax=None, z_range=None, style=None, print_out=False, cmapscale='linear')¶
Plot the isomap
- Parameters
xname (string, optional, auto/phi/hv) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
cmap (string, optional) – Colormap;
ax (matplotlib.axes, optional) – Axes, if None it is created inside the function;
z_range (array, optional, [min, max]) – Extreme values for z scale;
style (string, optional) – See navplt.give_style function;
print_out (boolean, optional) – If True, print the axes dimension with them adaptations;
cmapscale (string, optional, linear/log/power) – Select the scale mode.
- Returns
- The returned value is the object matplotlib.collections.QuadMesh
from ax.pcolormesh.
- class isomclass.IsoEnergy(entry, ebin, debin=0, norm_mode='no', sigma=None, order=2, curvature=None, kbins=None)¶
Bases:
object
Sum of entry.data over the ebin axis within [ebin-debin, ebin+debin]
- Parameters
entry (NavEntry class) – The class for the data explored by NavARP;
ebin (float) – Binding energy value;
debin (float) – Delta binding energy value;
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal;
kbins (array, optional, default=None) – if not None the data are interpolated on a uniform k-array binned with the kbins number.
- angles¶
Angular axis of the analyzer;
- Type
ndarray
- data¶
The matrix composed by the detector images;
- Type
ndarray
- data_init¶
The matrix composed by the detector images without any normalization;
- Type
ndarray
- debin¶
Delta binding energy value;
- Type
float
- ebin¶
Binding energy value;
- Type
ndarray
- hv¶
Photon energy without any reshape, it is present only in the case of hv scan;
- Type
ndarray
- ks¶
k vector along the direction consistent with the scan axis;
- Type
ndarray
- kx¶
k vector along the slit;
- Type
ndarray
- scan_type¶
Acquisition method;
- Type
str
- scans¶
Scan axis of the acquisition method.
- Type
ndarray
- dataprocessing(norm_mode, sigma, order, curvature, kbins)¶
Use data post-processing procedure
- Parameters
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal;
kbins (array, optional, default=None) – if not None, the data are interpolated on a uniform k-array binned following the [kxbins, kybins] numbers; kbins must be an array of two integer [kxbins, kybins] not equal; if from the input kxbins == kybins then kybins = kybins + 1 to make it different from kxbins (this is necessary due to how the code recognize the element order and placement in the data matrix).
- export_as_itx(file_path_itx, xname='auto', yname='auto', wave_name='NavARP_isoenergy')¶
Save the isomap as Igor Text file
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
wave_name (string, optiona) – name of the wave.
- export_as_nxs(file_path_nxs, xname='auto', yname='auto', title='NavARP_isoenergy')¶
Save the isomap as NXdata nexus class
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
title (string, optiona) – data title.
- get_axs_and_data(xname='auto', yname='auto')¶
Return the data and relative axes
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable.
- Returns
xax, yax, data, xname, yname
- show(xname='auto', yname='auto', cmap='magma_r', ax=None, z_range=None, style=None, print_out=False, cmapscale='linear')¶
Plot the isomap
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/phi/hv/ky/kz) – Select the y variable;
cmap (string, optional) – Colormap;
ax (matplotlib.axes, optional) – Axes, if None it is created inside the function;
z_range (array, optional, [min, max]) – Extreme values for z scale;
style (string, optional) – See navplt.give_style function;
print_out (boolean, optional) – If True, print the axes dimension with them adaptations;
cmapscale (string, optional, linear/log/power) – Select the scale mode.
- Returns
- The returned value is the object matplotlib.collections.QuadMesh
from ax.pcolormesh.
- class isomclass.IsoK(entry, kx_pts, ky_pts, klabels=None, ebins_interp=None, kbins=None, mask_once=True, norm_mode='no', sigma=None, order=2, curvature=None)¶
Bases:
object
Interpolate the entry.data along specified k-points
- Parameters
entry (NavEntry class) – the class for the data explored by NavARP;
kx_pts (ndarray) – kx coordinate of the points defining the path;
ky_pts (ndarray) – ky coordinate of the points defining the path;
klabels (list of string, optional) – list of the labels for each point in the kspace;
ebins_interp (ndarray, optional) – The binding energies vector to sample the entry.data at, if None then it is entry.ebins;
kbins (int, optional) – defines the number of equal-width bins in the given path, if None then it is calculated from kx;
mask_once (boolean, optional) – If True, the region (mask), where the interpolation function is going to be defined (the smaller the faster is the interpolation procedure), is generated once and used in all the ebins_interp range;
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal.
- data_init¶
The matrix composed by interpolated values along the path without any normalization;
- Type
ndarray
- data¶
The matrix composed by interpolated values along the path with the normalization;
- Type
ndarray
- ebins¶
Binding energy axis;
- Type
ndarray
- efermi¶
Fermi level kinetic energy (or energies);
- Type
ndarray
- ekins¶
Kinetic energy axis of the analyzer (defined only if scan is not on the photon energy);
- Type
ndarray
- hv¶
Photon energy without any reshape, it is present only in the case of hv scan;
- Type
ndarray
- krho¶
the distance vector from the first point;
- Type
ndarray
- kxy_interp¶
the (kx, ky) points along the path;
- Type
ndarray
- kx_pts¶
kx coordinate of the points defining the path;
- Type
ndarray
- ky_pts¶
ky coordinate of the points defining the path;
- Type
ndarray
- klabels¶
Array of the labels for each k_ptys_xy;
- Type
list of string
- k_pts_bin¶
the index values defining the segments along the path;
- Type
ndarray of int
- scan_type¶
Acquisition method.
- Type
str
- dataprocessing(norm_mode, sigma, order, curvature)¶
Use data post-processing procedure
- Parameters
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal.
- export_as_itx(file_path_itx, yname='auto', wave_name='NavARP_isok')¶
Save the isomap as Igor Text file
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
wave_name (string, optiona) – name of the wave.
- export_as_nxs(file_path_nxs, yname='auto', title='NavARP_isok')¶
Save the isomap as NXdata nexus class
- Parameters
yname (string, optional, auto/eef/ekin) – Select the y variable;
title (string, optiona) – data title.
- get_yax(yname='auto')¶
Return the selected y axis
- Parameters
yname (string, optional, auto/eef/ekin) – Select the y variable.
- Returns
yax, yname
- path_show(ax=None, lc='k', textcolor='r', textsize=14, xytext=(8, 5))¶
Plot the path
- Parameters
ax (matplotlib.axes, optional) – Axes, if None it is created inside the function;
lc (string, optional) – line color;
textcolor (string, optional) – text color of the labels;
textsize (string, optional) – text size of the labels;
xytext (array, optional) – relative text position of the labels.
- show(yname='auto', cmap='magma_r', ax=None, z_range=None, style=None, print_out=False, cmapscale='linear', vln=True, lc='k', ls='-', lw=1)¶
Plot the isomap
- Parameters
yname (string, optional, auto/eef/ekin) – Select the y variable;
cmap (string, optional) – Colormap;
ax (matplotlib.axes, optional) – Axes, if None it is created inside the function;
z_range (array, optional, [min, max]) – Extreme values for z scale;
style (string, optional) – See navplt.give_style function;
print_out (boolean, optional) – If True, print the axes dimension with them adaptations;
cmapscale (string, optional, linear/log/power) – Select the scale mode.
- Returns
- The returned value is the object matplotlib.collections.QuadMesh
from ax.pcolormesh.
- class isomclass.IsoScan(entry, scan, dscan=0, norm_mode='no', sigma=None, order=2, curvature=None, kbins=None)¶
Bases:
object
Sum of entry.data over the scan axis within [scan-dscan, scan+dscan]
- Parameters
entry (NavEntry class) – The class for the data explored by NavARP;
scan (float) – scan value;
dscan (float) – delta scan value;
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal;
kbins (integer, optional, default=None) – if not None the data are interpolated on a uniform k-array binned with the kbins number.
- angles¶
Angular axis of the analyzer;
- Type
ndarray
- data¶
The matrix composed by the detector images;
- Type
ndarray
- data_init¶
The matrix composed by the detector images without any normalization;
- Type
ndarray
- dscan¶
delta scan value;
- Type
float
- ebins¶
Binding energy axis;
- Type
ndarray
- efermi¶
Fermi level kinetic energy (or energies);
- Type
ndarray
- ekins¶
Kinetic energy axis of the analyzer;
- Type
ndarray
- hv¶
Photon energy without any reshape, it is present only in the case of hv scan;
- Type
ndarray
- scans¶
scan value;
- Type
float
- kx¶
k vector along the slit.
- Type
ndarray
- dataprocessing(norm_mode, sigma, order, curvature, kbins)¶
Use data post-processing procedure
- Parameters
norm_mode (string, optional, 'no' or 'all' or 'each') – if ‘no’, no normalization; if ‘each’, every Slice are normalize by the integral intensity of each Slice over their 90% of axis range; if “all”, the overall z values are normalize to its min and max;
sigma (array, optional, default=None) – Standard deviation for Gaussian kernel. The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case it is equal for all axes;
order (integer, optional, default=2) – The order of the filter along each axis is given as a sequence of integers, or as a single number. An order of 0 corresponds to convolution with a Gaussian kernel. A positive order corresponds to convolution with that derivative of a Gaussian. For example, an order of 2 corresponds to convolution with that second derivative of a Gaussian;
curvature (integer, optional, default=None) – if not None the data are the curvature of the signal;
kbins (integer, optional, default=None) – if not None the data are interpolated on a uniform k-array binned with the kbins number.
- export_as_itx(file_path_itx, xname='auto', yname='auto', wave_name='NavARP_isoscan')¶
Save the isomap as Igor Text file
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
wave_name (string, optiona) – name of the wave.
- export_as_nxs(file_path_nxs, xname='auto', yname='auto', title='NavARP_isoscan')¶
Save the isomap as NXdata nexus class
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
title (string, optiona) – data title.
- get_axs_and_data(xname='auto', yname='auto')¶
Return the data and relative axes
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable.
- Returns
xax, yax, data, xname, yname
- show(xname='auto', yname='auto', cmap='magma_r', ax=None, z_range=None, style=None, print_out=False, cmapscale='linear')¶
Plot the isomap
- Parameters
xname (string, optional, auto/tht/kx) – Select the x variable;
yname (string, optional, auto/eef/ekin) – Select the y variable;
cmap (string, optional) – Colormap;
ax (matplotlib.axes, optional) – Axes, if None it is created inside the function;
z_range (array, optional, [min, max]) – Extreme values for z scale;
style (string, optional) – See navplt.give_style function;
print_out (boolean, optional) – If True, print the axes dimension with them adaptations;
cmapscale (string, optional, linear/log/power) – Select the scale mode.
- Returns
- The returned value is the object matplotlib.collections.QuadMesh
from ax.pcolormesh.
kinterp¶
This module is part of the Python NavARP library. It defines the functions for the interpolation the entry.data into uniform gridded k-space.
- kinterp.get_isoen(kxbins, kybins, kx, ky, isoen)¶
Interpolate isoen on the generated uniform binned 2D-grid
- Parameters
kxbins (int) – defines the number of equal-width bins in the given kx
kybins (int) – defines the number of equal-width bins in the given ky
kx (ndarray) – The kx vector where the isoen is defined;
ky (ndarray) – The ky vector where the isoen is defined;
isoen (ndarray) – The isoen map related to kx and ky.
- Returns
kx_interp (ndarray): The kx vector where the isoen is sampled;
ky_interp (ndarray): The ky vector where the isoen is sampled;
isoen_interp (ndarray): The interpolated data at the uniform grid.
- Return type
(tuple)
- kinterp.get_isoen_from_kx_ky_interp(kx_interp, ky_interp, kx, ky, isoen)¶
Interpolate isoen on the grid formed from kx_interp and ky_interp arrays
- Parameters
kx_interp (ndarray) – The kx vector to sample the isoen at;
ky_interp (ndarray) – The ky vector to sample the isoen at;
kx (ndarray) – The kx vector where the isoen is defined;
ky (ndarray) – The ky vector where the isoen is defined;
isoen (ndarray) – The isoen map related to kx and ky.
- Returns
- The interpolated data at the grid formed
from kx_interp and ky_interp.
- Return type
isoen_interp (ndarray)
- kinterp.get_isoen_from_kxy_interp(kxy_interp, kx, ky, isoen, mask=array([], dtype=float64))¶
Interpolate isoen defined in (kx, ky) into kxy_interp points
- Parameters
kxy_interp (ndarray) – The (kx, ky) points to sample the isoen at;
kx (ndarray) – The kx vector where the isoen is defined;
ky (ndarray) – The ky vector where the isoen is defined;
isoen (ndarray) – The isoen map related to kx and ky;
mask (ndarray of booleans, optional) – It is the region where the interpolation function is going to be defined (the smaller the faster is the interpolation procedure).
- Returns
The interpolated data at kxy_interp points.
- Return type
isoen_interp (ndarray)
- kinterp.get_isok(entry, kx_pts, ky_pts, ebins_interp=None, kbins=None, mask_once=True)¶
Interpolate entry.data along the k_pts_xy points path for ebins_interp
- Parameters
entry (NavEntry class) – the class for the data explored by NavARP;
kx_pts (ndarray) – kx coordinate of the points defining the path;
ky_pts (ndarray) – ky coordinate of the points defining the path;
ebins_interp (ndarray) – The binding energies vector to sample the entry.data at;
kbins (int) – defines the number of equal-width bins in the given path;
mask_once (boolean, optional) – If True, the region (mask), where the interpolation function is going to be defined (the smaller the faster is the interpolation procedure), is generated once and used in all the ebins_interp range.
- Returns
krho (ndarray): the distance vector from the first point;
kxy_interp (ndarray): the (kx, ky) points along the path;
ebins_interp (ndarray): The interpolated data along the path;
isok_interp (ndarray): The interpolated data along the path;
k_pts_bin (ndarray of int): the index values defining the segments along the path.
- Return type
(tuple)
- kinterp.get_isok_kxy_interp(k_pts_xy, kbins)¶
Generate uniform binned 1D path passing througt the k_pts
- Parameters
k_pts_xy (ndarray) – list of (kx, ky) points defining the path;
kbins (int) – defines the number of equal-width bins in the given path.
- Returns
krho (ndarray): the distance vector from the first point;
kxy_all_interp (ndarray): the (kx, ky) points along the path;
k_pts_bin (ndarray of int): the index values defining the segments along the path.
- Return type
(tuple)
- kinterp.get_isok_mask(k_pts_xy, kx, ky)¶
Generate the mask (boolean matrix) where to define the interp. function
The mask is generated by defining a rectangle surrounding the each segment of the path. The points inside are inside the rectangles if the solution of the following linear system give the solution within 0 and 1:
ax = b with the condition of being 0<x<1
The matrix “a” is composed by the two side of the rectangle (defined as the two points minus the origin) and b is point to be checked (minus the origin).
- Parameters
k_pts_xy (ndarray) – list of (kx, ky) points defining the path:
kx (ndarray) – The kx vector where the isoen is defined;
ky (ndarray) – The ky vector where the isoen is defined.
- Returns
- mask, it is the mask region where the
interpolation function is going to be defined, the smaller the faster is the interpolation procedure.
- Return type
(ndarray of booleans)
- kinterp.get_isoscan(kx, energies, isoscan, kbins, kind='cubic', fill_value='extrapolate', assume_sorted=True)¶
Interpolate isoscan on the generated uniform binned k vector
- Parameters
kx (ndarray) – The k vector where the isoscan is defined
energies (ndarray) – The energy vector where the isoscan is defined
isoscan (ndarray) – The isoscan map related to kx and energies
kbins (int) – defines the number of equal-width bins in the given vector
kind (str or int, optional) – Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’, where ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point) or as an integer specifying the order of the spline interpolator to use.
fill_value (array-like or “extrapolate”, optional) – if a ndarray (or float), this value will be used to fill in for requested points outside of the data range. If not provided, then the default is NaN. The array-like must broadcast properly to the dimensions of the non-interpolation axes. If a two-element tuple, then the first element is used as a fill value for x_new < x[0] and the second element is used for x_new > x[-1]. Anything that is not a 2-element tuple (e.g., list or ndarray, regardless of shape) is taken to be a single array-like argument meant to be used for both bounds as below, above = fill_value, fill_value. If “extrapolate”, then points outside the data range will be extrapolated.
assume_sorted (bool, optional) – If False, values of x can be in any order and they are sorted first. If True, x has to be an array of monotonically increasing values.
- Returns
kx_interp (ndarray): The kx vector where the isoen is sampled;
isoen_interp (ndarray): The interpolated data at the uniform binned kx_interp vector.
- Return type
(tuple)
- kinterp.get_isoscan_from_kx_interp(kx_interp, kx, energies, isoscan, kind='nearest', fill_value='extrapolate', assume_sorted=True)¶
Interpolate isoscan on the k vector
- Parameters
kx_interp (ndarray) – The k vector to sample the isoscan at
kx (ndarray) – The k vector where the isoscan is defined
energies (ndarray) – The energy vector where the isoscan is defined
isoscan (ndarray) – The isoscan map related to kx and energies
kind (str or int, optional) – Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’, where ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point) or as an integer specifying the order of the spline interpolator to use.
fill_value (array-like or “extrapolate”, optional) – if a ndarray (or float), this value will be used to fill in for requested points outside of the data range. If not provided, then the default is NaN. The array-like must broadcast properly to the dimensions of the non-interpolation axes. If a two-element tuple, then the first element is used as a fill value for x_new < x[0] and the second element is used for x_new > x[-1]. Anything that is not a 2-element tuple (e.g., list or ndarray, regardless of shape) is taken to be a single array-like argument meant to be used for both bounds as below, above = fill_value, fill_value. If “extrapolate”, then points outside the data range will be extrapolated.
assume_sorted (bool, optional) – If False, values of x can be in any order and they are sorted first. If True, x has to be an array of monotonically increasing values.
- Returns
- The interpolated data at kx_interp and
energies.
- Return type
isoen_interp (ndarray)
- kinterp.get_unique_isok_mask(ebins_interp, k_pts_xy, entry)¶
Generate a unique mask (boolean matrix) for all the ebins_interp range
- Parameters
ebins_interp (ndarray) – The binding energies vector to sample the entry.data at;
k_pts_xy (ndarray) – list of (kx, ky) points defining the path;
entry (NavEntry class) – the class for the data explored by NavARP.
- Returns
- It is the region where the
interpolation function is going to be defined (the smaller the faster is the interpolation procedure), for every energy.
- Return type
mask_final (ndarray of booleans)
ktransf¶
This module is part of the Python NavARP library. It defines the functions for transforming the angular coordinates into the k-space.
- ktransf.asarray(variable)¶
Transform variable as ndarray
- Parameters
variable (float, int, list, ndarray) – variable to transform
- Returns
variable transformed
- Return type
variable (ndarray)
- ktransf.get_hv_from_kxyz(e_bin_p, work_fun, inn_pot, k_along_slit_p, k_perp_slit_p, k_perp_sample_p, hv_p_init=30, p_hv=False, tht_ap=0, phi_ap=0, tht_an=None, phi_an=None)¶
Calculates photon energy of a point from k-space coordinates
- Parameters
e_bin_p (float) – Binding energy value of the point;
work_fun (float) – analyzer work function;
inn_pot (float) – Inner potential, corresponding to the energy of the bottom of the valence band referenced to vacuum level;
k_along_slit_p (float) – k vector value of the reference point, along the slit direction;
k_perp_slit_p (float) – k vector value of the reference point, perpendicular to the slit;
k_perp_sample_p (float) – k vector perpendicular to sample surface
hv_p_init (float) – Initial guess for the photon energy of the reference point;
p_hv (boolean, optional) – If True, add photon momentum;
tht_ap (float, optional) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”), requested if p_hv==True;
phi_ap (float) – angle between analyzer axis (a) and photons (p) along the plane perpendicular to the slit (phi, so the name “phi_ap”);
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
phi_an (float) – angle between analyzer axis (a) and normal (n) along the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation.
- Returns
Photon energy of the point;
- Return type
hv_p (float)
- ktransf.get_inn_pot_from_kxyz(e_kin_p, k_along_slit_p, k_perp_slit_p, k_perp_sample_p, inn_pot_init=10, p_hv=False, hv_p=None, tht_ap=0, phi_ap=0, tht_an=None, phi_an=None)¶
Calculates photon energy of a point from k-space coordinates
- Parameters
e_kin_p (float) – Kinetic energy value of the reference point;
inn_pot_init (float) – Initial guess for the inner potential, corresponding to the energy of the bottom of the valence band referenced to vacuum level;
k_along_slit_p (float) – k vector value of the reference point, along the slit direction;
k_perp_slit_p (float) – k vector value of the reference point, perpendicular to the slit;
k_perp_sample_p (float) – k vector perpendicular to sample surface
hv (ndarray) – Photon energies;
p_hv (boolean, optional) – If True, add photon momentum;
hv_p (float, optional) – Photon energy for the reference point, requested if p_hv==True;
tht_ap (float, optional) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”), requested if p_hv==True;
phi_ap (float) – angle between analyzer axis (a) and photons (p) along the plane perpendicular to the slit (phi, so the name “phi_ap”);
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
phi_an (float) – angle between analyzer axis (a) and normal (n) along the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation.
- Returns
- Inner potential, corresponding to the energy of the
bottom of the valence band referenced to vacuum level.
- Return type
inn_pot (float)
- ktransf.get_k_along_slit(e_kins, tht, tht_an, p_hv=False, hv=None, tht_ap=None)¶
- Calculates k vector along the slit, i.e. the intersection between the
plane of analyzer axis and slit, and the plane of the sample surface.
- Parameters
e_kins (ndarray) – Kinetic energies (usually it is the energy axis of the analyzer data);
tht (ndarray) – Angular axis of the analyzer data;
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
p_hv (boolean, optional) – If True, add photon momentum;
hv (ndarray) – Photon energies;
tht_ap (float) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”).
- Returns
k vector along the slit
- Return type
kx (ndarray)
- ktransf.get_k_isoen(entry, e_kin_val)¶
Calculates k vectors of the iso-energy cut.
- Parameters
entry (NavEntry class) – the class for the data explored by NavARP;
e_kin_val (float or ndarray) – Kinetic energy/ies of iso-energy cut.
- ktransf.get_k_perp_sample(e_kins, inn_pot, k_along_slit, k_perp_slit, p_hv=False, hv=None, tht_ap=None, phi_ap=None, tht_an=None, phi_an=None)¶
Calculates k vector perpendicular to sample surface.
- Parameters
e_kins (ndarray) – Kinetic energies (usually it is the energy axis of the analyzer data);
inn_pot (float) – Inner potential, corresponding to the energy of the bottom of the valence band referenced to vacuum level;
k_along_slit (ndarray) – k vector along the slit
k_perp_slit (ndarray) – k vector perpendicular to the slit
p_hv (boolean, optional) – If True, add photon momentum.
hv (ndarray) – Photon energies;
tht_ap (float) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”);
phi_ap (float) – angle between analyzer axis (a) and photons (p) along the plane perpendicular to the slit (phi, so the name “phi_ap”);
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
phi_an (float) – angle between analyzer axis (a) and normal (n) along the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation.
- Returns
k vector perpendicular to sample surface.
- Return type
kz (ndarray)
- ktransf.get_k_perp_slit(e_kins, tht, tht_an, phi, phi_an, p_hv=False, hv=None, tht_ap=None, phi_ap=None)¶
- Calculates k vector perpendicular to the slit, i.e. the intersection
between plane of analyzer axis and the perpendicular to the slit, and the plane of the sample surface.
- Parameters
e_kins (ndarray) – Kinetic energies (usually it is the energy axis of the analyzer data);
tht (ndarray) – Angular axis of the analyzer data;
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
phi (ndarray) – angle perpendicular to the slit, this is the axis of the scan in the case of the deflector;
phi_an (float) – angle between analyzer axis (a) and normal (n) along the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation;
p_hv (boolean, optional) – If True, add photon momentum.
hv (ndarray) – Photon energies;
tht_ap (float) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”);
phi_ap (float) – angle between analyzer axis (a) and photons (p) along the plane perpendicular to the slit (phi, so the name “phi_ap”);
- Returns
k vector perpendicular to the slit
- Return type
ky (ndarray)
- ktransf.get_p_hv_along_slit(hv, tht_ph)¶
- Calculates photon momentum along the slit,
i.e. the intersection between the plane of analyzer axis and slit, and the plane of the sample surface.
- Parameters
hv (ndarray) – Photon energy;
tht_ph (ndarray) – tht angle between surface normal and photons.
- Returns
Photon momentum in plane along theta.
- Return type
p_hv_along_slit (ndarray)
- ktransf.get_p_hv_perp_sample(hv, tht_ph, phi_ph)¶
Calculates photon momentum perpendicular to the sample surface
- Parameters
hv (ndarray) – Photon energy;
tht_ph (ndarray) – tht angle between surface normal and photons.
phi_ph (ndarray) – phi angle between surface normal and photons.
- Returns
Photon momentum in plane along theta.
- Return type
p_hv_perp_sample (ndarray)
- ktransf.get_p_hv_perp_slit(hv, tht_ph, phi_ph)¶
- Calculates photon momentum perpendicular to the slit,
i.e. the intersection between plane of analyzer axis and the perpendicular to the slit, and the plane of the sample surface.
- Parameters
hv (ndarray) – Photon energy;
tht_ph (ndarray) – tht angle between surface normal and photons.
phi_ph (ndarray) – phi angle between surface normal and photons.
- Returns
Photon momentum in plane along phi.
- Return type
p_hv_along_slit (ndarray)
- ktransf.get_phi_an(e_kin_p, tht_p, tht_an, phi_p, k_perp_slit_p, phi_an_init=0, p_hv=False, hv_p=None, tht_ap=None, phi_ap=None)¶
- Calculates angle between analyzer axis (a) and normal (n) along
the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation;
- Parameters
e_kin_p (float) – Kinetic energy value of the reference point;
tht_p (float) – Angular value of the reference point along the angular axis of the analyzer data;
tht_an (float) – angle between analyzer axis (a) and normal (n) to the surface along the plane of the slit (theta, so the name “tht_an”);
phi_p (float) – Angular value of the reference point along the angle perpendicular to the slit;
k_perp_slit_p (float) – k vector value of the reference point, perpendicular to the slit;
phi_an_init (float, optional) – Initial guess for the phi_an;
p_hv (boolean, optional) – If True, add photon momentum;
hv_p (float, optional) – Photon energy for the reference point, requested if p_hv==True;
tht_ap (float, optional) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”), requested if p_hv==True;
phi_ap (float) – angle between analyzer axis (a) and photons (p) along the plane perpendicular to the slit (phi, so the name “phi_ap”);
- Returns
- angle between analyzer axis (a) and normal (n) along
the plane perpendicular to the slit (phi, so the name “phi_an”), this is the axis of the scan in the case of tilt rotation.
- Return type
phi_an (float)
- ktransf.get_surface_normal(entry, refs_p)¶
Calculates tht_an, phi_an, scans_0 and phi.
- Parameters
entry (NavEntry class) – the class for the data explored by NavARP;
refs_p (dict) – dictionary of the reference point in angle and k space.
- Returns
Photon energy of the point;
- Return type
hv_p (float)
- ktransf.get_tht_an(e_kin_p, tht_p, k_along_slit_p, tht_an_init=0, p_hv=False, hv_p=None, tht_ap=None)¶
- Calculates angle between analyzer axis (a) and normal (n) to the
surface along the plane of the slit (theta, so the name “tht_an”).
- Parameters
e_kin_p (float) – Kinetic energy value of the reference point;
tht_p (float) – Angular value of the reference point along the angular axis of the analyzer data;
k_along_slit_p (float) – k vector value of the reference point, along the slit direction;
tht_an_init (float, optional) – Initial guess for the tht_an;
p_hv (boolean, optional) – If True, add photon momentum;
hv_p (float, optional) – Photon energy for the reference point, requested if p_hv==True;
tht_ap (float, optional) – angle between analyzer axis (a) and photons (p) along the plane of the slit (theta, so the name “tht_ap”), requested if p_hv==True.
- Returns
- angle between analyzer axis (a) and normal (n) to the
surface along the plane of the slit (theta, so the name “tht_an”).
- Return type
tht_an (float)