From 4c7dd1ee610d50724059f43bbe38ddfb00219d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Mon, 9 Dec 2019 20:18:40 +0200 Subject: [PATCH] cytmatrix interpolator: access frequency table from python Former-commit-id: 69a85dba08347f0c0543ecb7913e0b8e2c20473c --- qpms/cytmatrices.pyx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qpms/cytmatrices.pyx b/qpms/cytmatrices.pyx index d8fa27b..29c8d7c 100644 --- a/qpms/cytmatrices.pyx +++ b/qpms/cytmatrices.pyx @@ -57,6 +57,15 @@ cdef class TMatrixInterpolator: property freq_interval: def __get__(self): return [self.freqs[0], self.freqs[self.nfreqs-1]] + property omega_table: + def __get__(self): + cdef size_t i + omegas = np.empty((self.nfreqs,), dtype=float) + cdef double[:] omegas_view = omegas + for i in range(self.nfreqs): + omegas_view[i] = self.freqs[i] + return omegas + cdef class CTMatrix: # N.B. there is another type called TMatrix in tmatrices.py! '''