code: def cfloat64_array_to_numpy(cptr, length):
      
      if isinstance(cptr, ctypes.POINTER(ctypes.c_double)):
          return np.fromiter(cptr, dtype=np.float64, count=length)
      else:
          raise RuntimeError('Expected double pointer')
docs: Convert a ctypes double pointer array to a numpy array.