diff --git a/src/msspec/calculator.py b/src/msspec/calculator.py index d5ba42c..6234094 100644 --- a/src/msspec/calculator.py +++ b/src/msspec/calculator.py @@ -615,7 +615,7 @@ class _PED(_MSCALCULATOR): def _get_scan(self, scan_type='theta', phi=0, theta=np.linspace(-70, 70, 141), level=None, kinetic_energy=None, data=None, - malloc={}): + malloc={}, other_parameters={}): LOGGER.info("Computting the %s scan...", scan_type) if data: self.iodata = data @@ -650,6 +650,13 @@ class _PED(_MSCALCULATOR): 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.run_spec(malloc) @@ -851,7 +858,7 @@ class _PED(_MSCALCULATOR): return self.iodata 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 cluster. @@ -870,11 +877,11 @@ class _PED(_MSCALCULATOR): """ data = self._get_scan(scan_type='scatf', level=level, data=data, - kinetic_energy=kinetic_energy) + kinetic_energy=kinetic_energy, **kwargs) return data 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. :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, - phi=phi, kinetic_energy=kinetic_energy, data=data) + phi=phi, kinetic_energy=kinetic_energy, + data=data, **kwargs) return data 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. :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, - phi=phi, kinetic_energy=kinetic_energy, data=data) + phi=phi, kinetic_energy=kinetic_energy, + data=data, **kwargs) return data def get_theta_phi_scan(self, phi=np.linspace(0, 360), 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. 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, phi=phi, kinetic_energy=kinetic_energy, data=data, - malloc={'NPH_M': 8000}) + malloc={'NPH_M': 8000}, **kwargs) return data 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. :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, - phi=phi, kinetic_energy=kinetic_energy, data=data) + phi=phi, kinetic_energy=kinetic_energy, + data=data, **kwargs) return data