We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Baer picker failing with fi_prep_cif_var error
**Description of the Problem**

I recently installed obspy on a new python install. Everything appeared to be working until I ran the tests for a package that made a call to the obspy.signal.trigger.pk_baer, which gives the following error:

```
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [5], in <module>
----> 1 p_pick, phase_info = pk_baer(trace.data, df, 20, 60, 7.0, 12.0, 100, 100)

File ~/Gits/obspy/obspy/signal/trigger.py:406, in pk_baer(reltrc, samp_int, tdownmax, tupevent, thr1, thr2, preset_len, p_dur, return_cf)
    402 # index in pk_mbaer.c starts with 1, 0 index is lost, length must be
    403 # one shorter
    404 args = (len(reltrc) - 1, C.byref(pptime), pfm, samp_int,
    405         tdownmax, tupevent, thr1, thr2, preset_len, p_dur, cf_p)
--> 406 errcode = clibsignal.ppick(reltrc, *args)
    407 if errcode != 0:
    408     raise MemoryError("Error in function ppick of mk_mbaer.c")

RuntimeError: ffi_prep_cif_var failed
```

It seems fairly likely to me that one of the libraries I have installed introduced a problem in this environment compared to my old environment. I'm just not sure how to begin figuring out the issue. I tried it in my old environment just to be sure and it works fine.

**Steps to Reproduce**
Running the tests yields the following failures:
FAILED obspy/signal/tests/test_trigger.py::TriggerTestCase::test_pk_baer
FAILED obspy/signal/tests/test_trigger.py::TriggerTestCase::test_pk_baer_cf
in addition to a third, unrelated error in TauPy

Additionally, going through the trigger/picker tutorial will also reproduce the problem (this is probably what the test code is doing, anyways):
```
from obspy.core import read
from obspy.signal.trigger import pk_baer
trace = read("https://examples.obspy.org/ev0_6.a01.gse2")[0]
df = trace.stats.sampling_rate
p_pick, phase_info = pk_baer(trace.data, df,20, 60, 7.0, 12.0, 100, 100)
```

**Versions**
ObsPy: 1.2.2.post0+547.g221c7ef4a9.obspy.master  (I tried both this and 1.2.2 as downloaded from conda-forge)
Python: 3.8.12
OS: Ubuntu 16

**Obspy Installation**
I tried installing obspy in two different ways and got the same result both ways: `conda install -c conda-forge obspy` (technically I used mamba, but that shouldn't matter) and from the latest master (`pip install -e {path_to_source}').

**Old Environment**
Obspy: 1.2.2 (installed from conda)
Python: 3.8.8
OS: Ubuntu 16

Thank you,
Shawn

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `obspy/signal/headers.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 Defines the libsignal and evalresp structures and blockettes.
4 """
5 import ctypes as C  # NOQA
6 
7 import numpy as np
8 
9 from obspy.core.util.libnames import _load_cdll
10 
11 
12 # Import shared libsignal
13 clibsignal = _load_cdll("signal")
14 # Import shared libevresp
15 clibevresp = _load_cdll("evresp")
16 
17 clibsignal.calcSteer.argtypes = [
18     C.c_int, C.c_int, C.c_int, C.c_int, C.c_int, C.c_float,
19     np.ctypeslib.ndpointer(dtype=np.float32, ndim=3,
20                            flags='C_CONTIGUOUS'),
21     np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,
22                            flags='C_CONTIGUOUS'),
23 ]
24 clibsignal.calcSteer.restype = C.c_void_p
25 
26 clibsignal.generalizedBeamformer.argtypes = [
27     np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,
28                            flags='C_CONTIGUOUS'),
29     np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,
30                            flags='C_CONTIGUOUS'),
31     np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,
32                            flags='C_CONTIGUOUS'),
33     np.ctypeslib.ndpointer(dtype=np.complex128, ndim=3,
34                            flags='C_CONTIGUOUS'),
35     C.c_int, C.c_int, C.c_int, C.c_int, C.c_int,
36     C.c_double,
37     C.c_int,
38 ]
39 clibsignal.generalizedBeamformer.restype = C.c_int
40 
41 clibsignal.X_corr.argtypes = [
42     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
43                            flags='C_CONTIGUOUS'),
44     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
45                            flags='C_CONTIGUOUS'),
46     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
47                            flags='C_CONTIGUOUS'),
48     C.c_int, C.c_int, C.c_int,
49     C.POINTER(C.c_int), C.POINTER(C.c_double)]
50 clibsignal.X_corr.restype = C.c_int
51 
52 clibsignal.recstalta.argtypes = [
53     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
54                            flags='C_CONTIGUOUS'),
55     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
56                            flags='C_CONTIGUOUS'),
57     C.c_int, C.c_int, C.c_int]
58 clibsignal.recstalta.restype = C.c_void_p
59 
60 clibsignal.ppick.argtypes = [
61     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
62                            flags='C_CONTIGUOUS'),
63     C.c_int, C.POINTER(C.c_int), C.c_char_p, C.c_float, C.c_int, C.c_int,
64     C.c_float, C.c_float, C.c_int, C.c_int]
65 clibsignal.ppick.restype = C.c_int
66 
67 clibsignal.ar_picker.argtypes = [
68     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
69                            flags='C_CONTIGUOUS'),
70     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
71                            flags='C_CONTIGUOUS'),
72     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
73                            flags='C_CONTIGUOUS'),
74     C.c_int, C.c_float, C.c_float, C.c_float, C.c_float, C.c_float,
75     C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float),
76     C.POINTER(C.c_float), C.c_double, C.c_double, C.c_int]
77 clibsignal.ar_picker.restypes = C.c_int
78 
79 clibsignal.utl_geo_km.argtypes = [C.c_double, C.c_double, C.c_double,
80                                   C.POINTER(C.c_double),
81                                   C.POINTER(C.c_double)]
82 clibsignal.utl_geo_km.restype = C.c_void_p
83 
84 head_stalta_t = np.dtype([
85     ('N', np.uint32),
86     ('nsta', np.uint32),
87     ('nlta', np.uint32),
88 ], align=True)
89 
90 clibsignal.stalta.argtypes = [
91     np.ctypeslib.ndpointer(dtype=head_stalta_t, ndim=1,
92                            flags='C_CONTIGUOUS'),
93     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
94                            flags='C_CONTIGUOUS'),
95     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
96                            flags='C_CONTIGUOUS'),
97 ]
98 clibsignal.stalta.restype = C.c_int
99 
100 clibsignal.hermite_interpolation.argtypes = [
101     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
102                            flags='C_CONTIGUOUS'),
103     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
104                            flags='C_CONTIGUOUS'),
105     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
106                            flags='C_CONTIGUOUS'),
107     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
108                            flags='C_CONTIGUOUS'),
109     C.c_int, C.c_int, C.c_double, C.c_double]
110 clibsignal.hermite_interpolation.restype = C.c_void_p
111 
112 clibsignal.lanczos_resample.argtypes = [
113     # y_in
114     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
115                            flags='C_CONTIGUOUS'),
116     # y_out
117     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
118                            flags='C_CONTIGUOUS'),
119     # dt
120     C.c_double,
121     # offset
122     C.c_double,
123     # len_in
124     C.c_int,
125     # len_out,
126     C.c_int,
127     # a,
128     C.c_int,
129     # window
130     C.c_int]
131 clibsignal.lanczos_resample.restype = None
132 
133 clibsignal.calculate_kernel.argtypes = [
134     # double *x
135     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
136                            flags='C_CONTIGUOUS'),
137     # double *y
138     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
139                            flags='C_CONTIGUOUS'),
140     # int len
141     C.c_int,
142     # int a,
143     C.c_int,
144     # int return_type,
145     C.c_int,
146     # enum lanczos_window_type window
147     C.c_int]
148 clibsignal.calculate_kernel.restype = None
149 
150 clibsignal.aic_simple.argtypes = [
151     # double *aic, output
152     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
153                            flags='C_CONTIGUOUS'),
154     # double *arr, input
155     np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,
156                            flags='C_CONTIGUOUS'),
157     # arr size
158     C.c_uint32]
159 clibsignal.recstalta.restype = C.c_void_p
160 
161 STALEN = 64
162 NETLEN = 64
163 CHALEN = 64
164 LOCIDLEN = 64
165 
166 
167 class C_COMPLEX(C.Structure):  # noqa
168     _fields_ = [("real", C.c_double),
169                 ("imag", C.c_double)]
170 
171 
172 class RESPONSE(C.Structure):
173     pass
174 
175 
176 RESPONSE._fields_ = [("station", C.c_char * STALEN),
177                      ("network", C.c_char * NETLEN),
178                      ("locid", C.c_char * LOCIDLEN),
179                      ("channel", C.c_char * CHALEN),
180                      ("rvec", C.POINTER(C_COMPLEX)),
181                      ("nfreqs", C.c_int),
182                      ("freqs", C.POINTER(C.c_double)),
183                      ("next", C.POINTER(RESPONSE))]
184 
185 clibevresp.evresp.argtypes = [
186     C.c_char_p,
187     C.c_char_p,
188     C.c_char_p,
189     C.c_char_p,
190     C.c_char_p,
191     C.c_char_p,
192     C.c_char_p,
193     np.ctypeslib.ndpointer(dtype=np.float64,
194                            ndim=1,
195                            flags='C_CONTIGUOUS'),
196     C.c_int,
197     C.c_char_p,
198     C.c_char_p,
199     C.c_int,
200     C.c_int,
201     C.c_int,
202     C.c_int]
203 clibevresp.evresp.restype = C.POINTER(RESPONSE)
204 
205 clibevresp.free_response.argtypes = [C.POINTER(RESPONSE)]
206 clibevresp.free_response.restype = C.c_void_p
207
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/obspy/signal/headers.py b/obspy/signal/headers.py
--- a/obspy/signal/headers.py
+++ b/obspy/signal/headers.py
@@ -61,7 +61,7 @@
     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,
                            flags='C_CONTIGUOUS'),
     C.c_int, C.POINTER(C.c_int), C.c_char_p, C.c_float, C.c_int, C.c_int,
-    C.c_float, C.c_float, C.c_int, C.c_int]
+    C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float)]
 clibsignal.ppick.restype = C.c_int
 
 clibsignal.ar_picker.argtypes = [

{"golden_diff": "diff --git a/obspy/signal/headers.py b/obspy/signal/headers.py\n--- a/obspy/signal/headers.py\n+++ b/obspy/signal/headers.py\n@@ -61,7 +61,7 @@\n     np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                            flags='C_CONTIGUOUS'),\n     C.c_int, C.POINTER(C.c_int), C.c_char_p, C.c_float, C.c_int, C.c_int,\n-    C.c_float, C.c_float, C.c_int, C.c_int]\n+    C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float)]\n clibsignal.ppick.restype = C.c_int\n \n clibsignal.ar_picker.argtypes = [\n", "issue": "Baer picker failing with fi_prep_cif_var error\n**Description of the Problem**\r\n\r\nI recently installed obspy on a new python install. Everything appeared to be working until I ran the tests for a package that made a call to the obspy.signal.trigger.pk_baer, which gives the following error:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nRuntimeError                              Traceback (most recent call last)\r\nInput In [5], in <module>\r\n----> 1 p_pick, phase_info = pk_baer(trace.data, df, 20, 60, 7.0, 12.0, 100, 100)\r\n\r\nFile ~/Gits/obspy/obspy/signal/trigger.py:406, in pk_baer(reltrc, samp_int, tdownmax, tupevent, thr1, thr2, preset_len, p_dur, return_cf)\r\n    402 # index in pk_mbaer.c starts with 1, 0 index is lost, length must be\r\n    403 # one shorter\r\n    404 args = (len(reltrc) - 1, C.byref(pptime), pfm, samp_int,\r\n    405         tdownmax, tupevent, thr1, thr2, preset_len, p_dur, cf_p)\r\n--> 406 errcode = clibsignal.ppick(reltrc, *args)\r\n    407 if errcode != 0:\r\n    408     raise MemoryError(\"Error in function ppick of mk_mbaer.c\")\r\n\r\nRuntimeError: ffi_prep_cif_var failed\r\n```\r\n\r\nIt seems fairly likely to me that one of the libraries I have installed introduced a problem in this environment compared to my old environment. I'm just not sure how to begin figuring out the issue. I tried it in my old environment just to be sure and it works fine.\r\n\r\n**Steps to Reproduce**\r\nRunning the tests yields the following failures:\r\nFAILED obspy/signal/tests/test_trigger.py::TriggerTestCase::test_pk_baer\r\nFAILED obspy/signal/tests/test_trigger.py::TriggerTestCase::test_pk_baer_cf\r\nin addition to a third, unrelated error in TauPy\r\n\r\nAdditionally, going through the trigger/picker tutorial will also reproduce the problem (this is probably what the test code is doing, anyways):\r\n```\r\nfrom obspy.core import read\r\nfrom obspy.signal.trigger import pk_baer\r\ntrace = read(\"https://examples.obspy.org/ev0_6.a01.gse2\")[0]\r\ndf = trace.stats.sampling_rate\r\np_pick, phase_info = pk_baer(trace.data, df,20, 60, 7.0, 12.0, 100, 100)\r\n```\r\n\r\n**Versions**\r\nObsPy: 1.2.2.post0+547.g221c7ef4a9.obspy.master  (I tried both this and 1.2.2 as downloaded from conda-forge)\r\nPython: 3.8.12\r\nOS: Ubuntu 16\r\n\r\n**Obspy Installation**\r\nI tried installing obspy in two different ways and got the same result both ways: `conda install -c conda-forge obspy` (technically I used mamba, but that shouldn't matter) and from the latest master (`pip install -e {path_to_source}').\r\n\r\n**Old Environment**\r\nObspy: 1.2.2 (installed from conda)\r\nPython: 3.8.8\r\nOS: Ubuntu 16\r\n\r\nThank you,\r\nShawn\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDefines the libsignal and evalresp structures and blockettes.\n\"\"\"\nimport ctypes as C  # NOQA\n\nimport numpy as np\n\nfrom obspy.core.util.libnames import _load_cdll\n\n\n# Import shared libsignal\nclibsignal = _load_cdll(\"signal\")\n# Import shared libevresp\nclibevresp = _load_cdll(\"evresp\")\n\nclibsignal.calcSteer.argtypes = [\n    C.c_int, C.c_int, C.c_int, C.c_int, C.c_int, C.c_float,\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=3,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,\n                           flags='C_CONTIGUOUS'),\n]\nclibsignal.calcSteer.restype = C.c_void_p\n\nclibsignal.generalizedBeamformer.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=3,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int, C.c_int, C.c_int,\n    C.c_double,\n    C.c_int,\n]\nclibsignal.generalizedBeamformer.restype = C.c_int\n\nclibsignal.X_corr.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int,\n    C.POINTER(C.c_int), C.POINTER(C.c_double)]\nclibsignal.X_corr.restype = C.c_int\n\nclibsignal.recstalta.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int]\nclibsignal.recstalta.restype = C.c_void_p\n\nclibsignal.ppick.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.POINTER(C.c_int), C.c_char_p, C.c_float, C.c_int, C.c_int,\n    C.c_float, C.c_float, C.c_int, C.c_int]\nclibsignal.ppick.restype = C.c_int\n\nclibsignal.ar_picker.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_float, C.c_float, C.c_float, C.c_float, C.c_float,\n    C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float),\n    C.POINTER(C.c_float), C.c_double, C.c_double, C.c_int]\nclibsignal.ar_picker.restypes = C.c_int\n\nclibsignal.utl_geo_km.argtypes = [C.c_double, C.c_double, C.c_double,\n                                  C.POINTER(C.c_double),\n                                  C.POINTER(C.c_double)]\nclibsignal.utl_geo_km.restype = C.c_void_p\n\nhead_stalta_t = np.dtype([\n    ('N', np.uint32),\n    ('nsta', np.uint32),\n    ('nlta', np.uint32),\n], align=True)\n\nclibsignal.stalta.argtypes = [\n    np.ctypeslib.ndpointer(dtype=head_stalta_t, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n]\nclibsignal.stalta.restype = C.c_int\n\nclibsignal.hermite_interpolation.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_double, C.c_double]\nclibsignal.hermite_interpolation.restype = C.c_void_p\n\nclibsignal.lanczos_resample.argtypes = [\n    # y_in\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # y_out\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # dt\n    C.c_double,\n    # offset\n    C.c_double,\n    # len_in\n    C.c_int,\n    # len_out,\n    C.c_int,\n    # a,\n    C.c_int,\n    # window\n    C.c_int]\nclibsignal.lanczos_resample.restype = None\n\nclibsignal.calculate_kernel.argtypes = [\n    # double *x\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # double *y\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # int len\n    C.c_int,\n    # int a,\n    C.c_int,\n    # int return_type,\n    C.c_int,\n    # enum lanczos_window_type window\n    C.c_int]\nclibsignal.calculate_kernel.restype = None\n\nclibsignal.aic_simple.argtypes = [\n    # double *aic, output\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # double *arr, input\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # arr size\n    C.c_uint32]\nclibsignal.recstalta.restype = C.c_void_p\n\nSTALEN = 64\nNETLEN = 64\nCHALEN = 64\nLOCIDLEN = 64\n\n\nclass C_COMPLEX(C.Structure):  # noqa\n    _fields_ = [(\"real\", C.c_double),\n                (\"imag\", C.c_double)]\n\n\nclass RESPONSE(C.Structure):\n    pass\n\n\nRESPONSE._fields_ = [(\"station\", C.c_char * STALEN),\n                     (\"network\", C.c_char * NETLEN),\n                     (\"locid\", C.c_char * LOCIDLEN),\n                     (\"channel\", C.c_char * CHALEN),\n                     (\"rvec\", C.POINTER(C_COMPLEX)),\n                     (\"nfreqs\", C.c_int),\n                     (\"freqs\", C.POINTER(C.c_double)),\n                     (\"next\", C.POINTER(RESPONSE))]\n\nclibevresp.evresp.argtypes = [\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    np.ctypeslib.ndpointer(dtype=np.float64,\n                           ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_int,\n    C.c_int,\n    C.c_int,\n    C.c_int]\nclibevresp.evresp.restype = C.POINTER(RESPONSE)\n\nclibevresp.free_response.argtypes = [C.POINTER(RESPONSE)]\nclibevresp.free_response.restype = C.c_void_p\n", "path": "obspy/signal/headers.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDefines the libsignal and evalresp structures and blockettes.\n\"\"\"\nimport ctypes as C  # NOQA\n\nimport numpy as np\n\nfrom obspy.core.util.libnames import _load_cdll\n\n\n# Import shared libsignal\nclibsignal = _load_cdll(\"signal\")\n# Import shared libevresp\nclibevresp = _load_cdll(\"evresp\")\n\nclibsignal.calcSteer.argtypes = [\n    C.c_int, C.c_int, C.c_int, C.c_int, C.c_int, C.c_float,\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=3,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,\n                           flags='C_CONTIGUOUS'),\n]\nclibsignal.calcSteer.restype = C.c_void_p\n\nclibsignal.generalizedBeamformer.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=2,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=4,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.complex128, ndim=3,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int, C.c_int, C.c_int,\n    C.c_double,\n    C.c_int,\n]\nclibsignal.generalizedBeamformer.restype = C.c_int\n\nclibsignal.X_corr.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int,\n    C.POINTER(C.c_int), C.POINTER(C.c_double)]\nclibsignal.X_corr.restype = C.c_int\n\nclibsignal.recstalta.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_int]\nclibsignal.recstalta.restype = C.c_void_p\n\nclibsignal.ppick.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.POINTER(C.c_int), C.c_char_p, C.c_float, C.c_int, C.c_int,\n    C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float)]\nclibsignal.ppick.restype = C.c_int\n\nclibsignal.ar_picker.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float32, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_float, C.c_float, C.c_float, C.c_float, C.c_float,\n    C.c_float, C.c_float, C.c_int, C.c_int, C.POINTER(C.c_float),\n    C.POINTER(C.c_float), C.c_double, C.c_double, C.c_int]\nclibsignal.ar_picker.restypes = C.c_int\n\nclibsignal.utl_geo_km.argtypes = [C.c_double, C.c_double, C.c_double,\n                                  C.POINTER(C.c_double),\n                                  C.POINTER(C.c_double)]\nclibsignal.utl_geo_km.restype = C.c_void_p\n\nhead_stalta_t = np.dtype([\n    ('N', np.uint32),\n    ('nsta', np.uint32),\n    ('nlta', np.uint32),\n], align=True)\n\nclibsignal.stalta.argtypes = [\n    np.ctypeslib.ndpointer(dtype=head_stalta_t, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n]\nclibsignal.stalta.restype = C.c_int\n\nclibsignal.hermite_interpolation.argtypes = [\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int, C.c_int, C.c_double, C.c_double]\nclibsignal.hermite_interpolation.restype = C.c_void_p\n\nclibsignal.lanczos_resample.argtypes = [\n    # y_in\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # y_out\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # dt\n    C.c_double,\n    # offset\n    C.c_double,\n    # len_in\n    C.c_int,\n    # len_out,\n    C.c_int,\n    # a,\n    C.c_int,\n    # window\n    C.c_int]\nclibsignal.lanczos_resample.restype = None\n\nclibsignal.calculate_kernel.argtypes = [\n    # double *x\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # double *y\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # int len\n    C.c_int,\n    # int a,\n    C.c_int,\n    # int return_type,\n    C.c_int,\n    # enum lanczos_window_type window\n    C.c_int]\nclibsignal.calculate_kernel.restype = None\n\nclibsignal.aic_simple.argtypes = [\n    # double *aic, output\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # double *arr, input\n    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1,\n                           flags='C_CONTIGUOUS'),\n    # arr size\n    C.c_uint32]\nclibsignal.recstalta.restype = C.c_void_p\n\nSTALEN = 64\nNETLEN = 64\nCHALEN = 64\nLOCIDLEN = 64\n\n\nclass C_COMPLEX(C.Structure):  # noqa\n    _fields_ = [(\"real\", C.c_double),\n                (\"imag\", C.c_double)]\n\n\nclass RESPONSE(C.Structure):\n    pass\n\n\nRESPONSE._fields_ = [(\"station\", C.c_char * STALEN),\n                     (\"network\", C.c_char * NETLEN),\n                     (\"locid\", C.c_char * LOCIDLEN),\n                     (\"channel\", C.c_char * CHALEN),\n                     (\"rvec\", C.POINTER(C_COMPLEX)),\n                     (\"nfreqs\", C.c_int),\n                     (\"freqs\", C.POINTER(C.c_double)),\n                     (\"next\", C.POINTER(RESPONSE))]\n\nclibevresp.evresp.argtypes = [\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_char_p,\n    np.ctypeslib.ndpointer(dtype=np.float64,\n                           ndim=1,\n                           flags='C_CONTIGUOUS'),\n    C.c_int,\n    C.c_char_p,\n    C.c_char_p,\n    C.c_int,\n    C.c_int,\n    C.c_int,\n    C.c_int]\nclibevresp.evresp.restype = C.POINTER(RESPONSE)\n\nclibevresp.free_response.argtypes = [C.POINTER(RESPONSE)]\nclibevresp.free_response.restype = C.c_void_p\n", "path": "obspy/signal/headers.py"}]}