From 9787e99d2e0c70e771e988986a21e08ac2bee0a9 Mon Sep 17 00:00:00 2001 From: Sylvain Tricot Date: Tue, 15 Feb 2022 15:37:28 +0100 Subject: [PATCH] Added the binding for polarization keyword. The polarization keyword may be None, 'linear_qOz', 'linear_xOy' or 'circular'. The IPOL parameter in spec.dat is set accordingly to 0, 1, -1 or 2 respectively. --- src/msspec/parameters.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/msspec/parameters.py b/src/msspec/parameters.py index 8a682f4..3b4b40c 100644 --- a/src/msspec/parameters.py +++ b/src/msspec/parameters.py @@ -19,8 +19,8 @@ # along with this msspec. If not, see . # # Source file : src/msspec/parameters.py -# Last modified: Mon, 27 Sep 2021 17:49:48 +0200 -# Committed by : sylvain tricot +# Last modified: Tue, 15 Feb 2022 15:37:28 +0100 +# Committed by : Sylvain Tricot """ @@ -839,6 +839,17 @@ class GlobalParameters(BaseParameters): self.phagen_parameters.calctype = phagen_calctype self.spec_parameters.calctype_spectro = spec_calctype + def bind_polarization(self, p): + if p.value is None: + ipol = 0 + elif p.value == 'linear_qOz': + ipol = 1 + elif p.value == 'linear_xOy': + ipol = -1 + elif p.value == 'circular': + ipol = 2 + self.spec_parameters.calctype_ipol = ipol + def bind_spinpol(self, p): if p.value == True: LOGGER.error('Spin polarization is not yet enabled in the Python version.')