import numpy as np

from interaction3 import abstract
from interaction3.arrays import matrix
from interaction3.mfield.solvers.transmit_receive_beamplot_2 import TransmitReceiveBeamplot2


array = matrix.create(nelem=[2, 2])

simulation = abstract.MfieldSimulation(sampling_frequency=100e6,
                                       sound_speed=1540,
                                       excitation_center_frequecy=5e6,
                                       excitation_bandwidth=4e6,
                                       field_positions=np.array([[0, 0, 0.05],
                                                                 [0, 0, 0.06],
                                                                 [0, 0, 0.07]])
                                       )

kwargs, meta = TransmitReceiveBeamplot2.connector(simulation, array)
sim = TransmitReceiveBeamplot2(**kwargs)
sim.solve()

rf_data = sim.result['rf_data']
times = sim.result['times']

sim_kwargs = {}
sim_kwargs['transmit_focus'] = [0, 0, 0.05]
sim_kwargs['receive_focus'] = [0, 0, 0.05]
sim_kwargs['delay_quantization'] = 0
sim_kwargs['threads'] = 3
sim_kwargs['sampling_frequency'] = 100e6
sim_kwargs['sound_speed'] = 1540
sim_kwargs['excitation_center_frequecy'] = 7e6
sim_kwargs['excitation_bandwidth'] = 5.6e6
sim_kwargs['mesh_mode'] ='cartesian'
sim_kwargs['mesh_vector1'] = [-0.02, 0.02, 41]
sim_kwargs['mesh_vector2'] = [-0.02, 0.02, 41]
sim_kwargs['mesh_vector3'] = [0.05, 0.06, 1]

arrays = foldable_vernier.create(**array_kwargs)
simulation = abstract.MfieldSimulation(**sim_kwargs)

abstract.dump((simulation,) + arrays, 'test_spec.json', mode='w')

command = '''
          python -m interaction3.mfield.scripts.simulate_transmit_beamplot
          test_database.db
          -s test_spec.json
          '''
subprocess.run(command.split())

import sqlite3 as sql
import pandas as pd
from matplotlib import pyplot as plt

con = sql.connect('test_database.db')
Ejemplo n.º 3
0
import numpy as np

from interaction3 import abstract, util
from interaction3.arrays import foldable_constant_spiral
from interaction3.mfield.solvers import TransmitBeamplot2 as TransmitBeamplot

field_positions = util.meshview(np.linspace(0.001, 0.061, 61),
                                np.linspace(-60, 60, 121),
                                np.linspace(0, 1, 1), mode='sector')


arrays = foldable_constant_spiral.create()

simulation = abstract.MfieldSimulation(sampling_frequency=100e6,
                                       sound_speed=1540,
                                       excitation_center_frequecy=5e6,
                                       excitation_bandwidth=4e6,
                                       field_positions=field_positions)


kwargs, meta = TransmitBeamplot.connector(simulation, *arrays)
sim = TransmitBeamplot(**kwargs)
sim.solve()


# rf_data = sim.result['rf_data']
# times = sim.result['times']