Added 'other_parameters' keyword in _get_scan.
epsi-builds/msspec_python3/pipeline/head This commit looks good Details

This allows to set or modify any option right before runing
Phagen and Spec. Mostly for debug purposes.
This commit is contained in:
Sylvain Tricot 2021-11-30 17:53:47 +01:00
parent e36373a576
commit 75c599de95
1 changed files with 21 additions and 11 deletions

View File

@ -615,7 +615,7 @@ class _PED(_MSCALCULATOR):
def _get_scan(self, scan_type='theta', phi=0, def _get_scan(self, scan_type='theta', phi=0,
theta=np.linspace(-70, 70, 141), level=None, theta=np.linspace(-70, 70, 141), level=None,
kinetic_energy=None, data=None, kinetic_energy=None, data=None,
malloc={}): malloc={}, other_parameters={}):
LOGGER.info("Computting the %s scan...", scan_type) LOGGER.info("Computting the %s scan...", scan_type)
if data: if data:
self.iodata = data self.iodata = data
@ -650,6 +650,13 @@ class _PED(_MSCALCULATOR):
self.spectroscopy_parameters.set_parameter('level', level) self.spectroscopy_parameters.set_parameter('level', level)
# It is still possible to modify any option right before runing phagen
# and spec
for k, v in other_parameters.items():
grp_str, param_str = k.split('.')
grp = getattr(self, grp_str)
grp.set_parameter(param_str, v, force=True)
self.get_tmatrix() self.get_tmatrix()
self.run_spec(malloc) self.run_spec(malloc)
@ -851,7 +858,7 @@ class _PED(_MSCALCULATOR):
return self.iodata return self.iodata
def get_scattering_factors(self, level='1s', kinetic_energy=None, def get_scattering_factors(self, level='1s', kinetic_energy=None,
data=None): data=None, **kwargs):
"""Computes the scattering factors of all prototypical atoms in the """Computes the scattering factors of all prototypical atoms in the
cluster. cluster.
@ -870,11 +877,11 @@ class _PED(_MSCALCULATOR):
""" """
data = self._get_scan(scan_type='scatf', level=level, data=data, data = self._get_scan(scan_type='scatf', level=level, data=data,
kinetic_energy=kinetic_energy) kinetic_energy=kinetic_energy, **kwargs)
return data return data
def get_theta_scan(self, phi=0, theta=np.linspace(-70, 70, 141), def get_theta_scan(self, phi=0, theta=np.linspace(-70, 70, 141),
level=None, kinetic_energy=None, data=None): level=None, kinetic_energy=None, data=None, **kwargs):
"""Computes a polar scan of the emitted photoelectrons. """Computes a polar scan of the emitted photoelectrons.
:param phi: The azimuthal angle in degrees. See :param phi: The azimuthal angle in degrees. See
@ -891,11 +898,12 @@ class _PED(_MSCALCULATOR):
""" """
data = self._get_scan(scan_type='theta', level=level, theta=theta, data = self._get_scan(scan_type='theta', level=level, theta=theta,
phi=phi, kinetic_energy=kinetic_energy, data=data) phi=phi, kinetic_energy=kinetic_energy,
data=data, **kwargs)
return data return data
def get_phi_scan(self, phi=np.linspace(0, 359, 359), theta=0, def get_phi_scan(self, phi=np.linspace(0, 359, 359), theta=0,
level=None, kinetic_energy=None, data=None): level=None, kinetic_energy=None, data=None, **kwargs):
"""Computes an azimuthal scan of the emitted photoelectrons. """Computes an azimuthal scan of the emitted photoelectrons.
:param phi: All the values of the azimuthal angle to be computed. See :param phi: All the values of the azimuthal angle to be computed. See
@ -912,12 +920,13 @@ class _PED(_MSCALCULATOR):
""" """
data = self._get_scan(scan_type='phi', level=level, theta=theta, data = self._get_scan(scan_type='phi', level=level, theta=theta,
phi=phi, kinetic_energy=kinetic_energy, data=data) phi=phi, kinetic_energy=kinetic_energy,
data=data, **kwargs)
return data return data
def get_theta_phi_scan(self, phi=np.linspace(0, 360), def get_theta_phi_scan(self, phi=np.linspace(0, 360),
theta=np.linspace(0, 90, 45), level=None, theta=np.linspace(0, 90, 45), level=None,
kinetic_energy=None, data=None): kinetic_energy=None, data=None, **kwargs):
"""Computes a stereographic scan of the emitted photoelectrons. """Computes a stereographic scan of the emitted photoelectrons.
The azimuth ranges from 0 to 360° and the polar angle ranges from 0 to The azimuth ranges from 0 to 360° and the polar angle ranges from 0 to
@ -934,11 +943,11 @@ class _PED(_MSCALCULATOR):
""" """
data = self._get_scan(scan_type='theta_phi', level=level, theta=theta, data = self._get_scan(scan_type='theta_phi', level=level, theta=theta,
phi=phi, kinetic_energy=kinetic_energy, data=data, phi=phi, kinetic_energy=kinetic_energy, data=data,
malloc={'NPH_M': 8000}) malloc={'NPH_M': 8000}, **kwargs)
return data return data
def get_energy_scan(self, phi=0, theta=0, def get_energy_scan(self, phi=0, theta=0,
level=None, kinetic_energy=None, data=None): level=None, kinetic_energy=None, data=None, **kwargs):
"""Computes an energy scan of the emitted photoelectrons. """Computes an energy scan of the emitted photoelectrons.
:param phi: All the values of the azimuthal angle to be computed. See :param phi: All the values of the azimuthal angle to be computed. See
@ -955,7 +964,8 @@ class _PED(_MSCALCULATOR):
""" """
data = self._get_scan(scan_type='energy', level=level, theta=theta, data = self._get_scan(scan_type='energy', level=level, theta=theta,
phi=phi, kinetic_energy=kinetic_energy, data=data) phi=phi, kinetic_energy=kinetic_energy,
data=data, **kwargs)
return data return data