Skip to content

Commit

Permalink
update the condition in the function of perpendicular_momentum
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiemin-Li committed Oct 9, 2024
1 parent ca101bf commit 9de7998
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/test_data/arpes.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,24 @@ def perpendicular_momentum(photon_energy, parallel_momentum,
$\k_{perpendicular}$ are the surface parallel and perpendicular momentum,
$E_{ph}$ is the photon energy, $E_{b}$ is the electron binding energy and
$\Phi$ is the work function.
Parameters
----------
photon_energy : float or 1D numpy.ndarray,
The photon energy (or energies) in eV.
parallel_momentum : float or 1D numpy.ndarray,
The parallel momentum in the unit of the inverse of angstrom.
binding_energy : float or 1D numpy.ndarray,
The binding energy (or energies) in eV.
inner_potential: float or 1D numpy.ndarray
The inner potential in eV.
work_function: float or 1D numpy.ndarray
The work function in eV.
Returns
-------
$k_z$ : float or 1D numpy.ndarray,
The perpendicular momentum in the unit of the inverse of angstrom.
"""
check_data_len = [len(value)
if (isinstance(value, (np.ndarray)) and
Expand All @@ -378,11 +395,10 @@ def perpendicular_momentum(photon_energy, parallel_momentum,
if not np.all(check_data_len):
raise ValueError(f'The input must be an int, float or 1D numpy array!')
else:
check_data_size = [x for x in check_data_len if (x!=1)]
if len(check_data_size)>1:
if check_data_size[1:] != check_data_size[:-1]:
raise ValueError(f'The length of inputs must be the same if '
f'their length is larger than 1!')
check_data_len = list(filter(lambda a: a!=1,check_data_len))
if check_data_len[1:] != check_data_len[:-1]:
raise ValueError(f'The length of inputs must be the same if '
f'their length is larger than 1!')

# h_bar = sci_const.hbar # in J.s
# m_e = sci_const.m_e # in Kg or J.s^2/m^2 (E=mc^2)
Expand Down

0 comments on commit 9de7998

Please sign in to comment.