Use the new qpms_normalisation_t also in cython parts

Former-commit-id: 58eb1c22724d3a94abb88d4c7b9af668a2faf116
This commit is contained in:
Marek Nečada 2019-07-14 10:02:37 +03:00
parent 0610f98854
commit 005bdaa2be
2 changed files with 27 additions and 25 deletions

View File

@ -20,19 +20,15 @@ class VSWFType(enum.IntEnum):
L = QPMS_VSWF_LONGITUDINAL
class VSWFNorm(enum.IntEnum):
#XU = QPMS_NORMALISATION_XU
#XU_CS = QPMS_NORMALISATION_XU_CS
NONE = QPMS_NORMALISATION_NONE
NONE_CS = QPMS_NORMALISATION_NONE_CS
POWER = QPMS_NORMALISATION_POWER
POWER_CS = QPMS_NORMALISATION_POWER_CS
SPHARM = QPMS_NORMALISATION_SPHARM
SPHARM_CS = QPMS_NORMALISATION_SPHARM_CS
# TODO try to make this an enum.IntFlag if supported
# TODO add the other flags from qpms_normalisation_t as well
UNNORM = QPMS_NORMALISATION_NORM_NONE
UNNORM_CS = QPMS_NORMALISATION_NORM_NONE | QPMS_NORMALISATION_CSPHASE
POWERNORM = QPMS_NORMALISATION_NORM_POWER
POWERNORM_CS = QPMS_NORMALISATION_NORM_POWER | QPMS_NORMALISATION_CSPHASE
SPHARMNORM = QPMS_NORMALISATION_NORM_SPHARM
SPHARMNORM_CS = QPMS_NORMALISATION_NORM_SPHARM | QPMS_NORMALISATION_CSPHASE
UNDEF = QPMS_NORMALISATION_UNDEF
KRISTENSSON = QPMS_NORMALISATION_KRISTENSSON
KRISTENSSON_CS = QPMS_NORMALISATION_KRISTENSSON_CS
TAYLOR = QPMS_NORMALISATION_TAYLOR
TAYLOR_CS = QPMS_NORMALISATION_TAYLOR_CS
try:
class DebugFlags(enum.IntFlag): # Should be IntFlag if python version >= 3.6
@ -721,7 +717,7 @@ cdef class BaseSpec:
if 'norm' in kwargs.keys():
self.s.norm = kwargs['norm']
else:
self.s.norm = QPMS_NORMALISATION_POWER_CS
self.s.norm = QPMS_NORMALISATION_NORM_POWER | QPMS_NORMALISATION_CSPHASE
# set the other metadata
cdef qpms_l_t l
self.s.lMax_L = -1

View File

@ -25,18 +25,24 @@ cdef extern from "qpms_types.h":
cart2_t cart2
pol_t pol
ctypedef enum qpms_normalisation_t:
QPMS_NORMALISATION_XU
QPMS_NORMALISATION_XU_CS
QPMS_NORMALISATION_NONE
QPMS_NORMALISATION_NONE_CS
QPMS_NORMALISATION_KRISTENSSON
QPMS_NORMALISATION_KRISTENSSON_CS
QPMS_NORMALISATION_POWER
QPMS_NORMALISATION_POWER_CS
QPMS_NORMALISATION_TAYLOR
QPMS_NORMALISATION_TAYLOR_CS
QPMS_NORMALISATION_SPHARM
QPMS_NORMALISATION_SPHARM_CS
QPMS_NORMALISATION_CONVENTION_KRISTENSSON
QPMS_NORMALISATION_CONVENTION_KRISTENSSON_REAL
QPMS_NORMALISATION_CONVENTION_SCUFF
QPMS_NORMALISATION_CSPHASE
QPMS_NORMALISATION_INVERSE
QPMS_NORMALISATION_L_I
QPMS_NORMALISATION_L_MINUS
QPMS_NORMALISATION_M_I
QPMS_NORMALISATION_M_MINUS
QPMS_NORMALISATION_NORM_BITS
QPMS_NORMALISATION_NORM_BITSTART
QPMS_NORMALISATION_NORM_NONE
QPMS_NORMALISATION_NORM_POWER
QPMS_NORMALISATION_NORM_SPHARM
QPMS_NORMALISATION_N_I
QPMS_NORMALISATION_N_MINUS
QPMS_NORMALISATION_REVERSE_AZIMUTHAL_PHASE
QPMS_NORMALISATION_SPHARM_REAL
QPMS_NORMALISATION_UNDEF
ctypedef enum qpms_bessel_t:
QPMS_BESSEL_REGULAR