# Path: pyJHTDB/dbinfo.py
# def generate_temp_dbinfo(
#         field):


import os
import sys
import numpy as np
import ctypes
import inspect
import h5py
import io
import pyJHTDB
from wurlitzer import pipes, STDOUT
from pyJHTDB.dbinfo import interpolation_code
#            self.hdf5_file_list.append(filename)
#            data = pyJHTDB.h5py.File(filename + '.h5', mode = 'r')
#            self.hdf5_file_desc[filename] = {}
#            for key in ['_contents', '_dataset', '_size', '_start']:
#                self.hdf5_file_desc[filename][key] = data[key][:]
#            data.close()
#            return self.lib.turblibAddLocalSource(ctypes.c_char_p((filename + '.h5').encode('ascii')))
#        else:
#            return 0

    def getData(self,
                time, point_coords,
                sinterp=0, tinterp=0,
                data_set='isotropic1024coarse',
                getFunction='getVelocity',
                make_modulo=False):
        if not self.connection_on:
            print('you didn\'t connect to the database')
            sys.exit()
        if not (point_coords.shape[-1] == 3):
            print ('wrong number of values for coordinates in getData')
            sys.exit()
            return None
        if not (point_coords.dtype == np.float32):
            print('point coordinates in getData must be floats. stopping.')
            sys.exit()
            return None
        if (type(sinterp) == str):
            sinterp = interpolation_code[sinterp]
        if (type(tinterp) == str):

# Path: pyJHTDB/dbinfo.py
# def generate_temp_dbinfo(
#         field):


# Path: pyJHTDB/libJHTDB.py
import os
import sys
import numpy as np
import ctypes
import inspect
import h5py
import io
import pyJHTDB
from wurlitzer import pipes, STDOUT
from pyJHTDB.dbinfo import interpolation_code

#            self.hdf5_file_list.append(filename)
#            data = pyJHTDB.h5py.File(filename + '.h5', mode = 'r')
#            self.hdf5_file_desc[filename] = {}
#            for key in ['_contents', '_dataset', '_size', '_start']:
#                self.hdf5_file_desc[filename][key] = data[key][:]
#            data.close()
#            return self.lib.turblibAddLocalSource(ctypes.c_char_p((filename + '.h5').encode('ascii')))
#        else:
#            return 0

    def getData(self,
                time, point_coords,
                sinterp=0, tinterp=0,
                data_set='isotropic1024coarse',
                getFunction='getVelocity',
                make_modulo=False):
        if not self.connection_on:
            print('you didn\'t connect to the database')
            sys.exit()
        if not (point_coords.shape[-1] == 3):
            print ('wrong number of values for coordinates in getData')
            sys.exit()
            return None
        if not (point_coords.dtype == np.float32):
            print('point coordinates in getData must be floats. stopping.')
            sys.exit()
            return None
        if (type(sinterp) == str):
            sinterp = interpolation_code[sinterp]
        if (type(tinterp) == str):

            tinterp = interpolation_code[tinterp]