コード例 #1
0
def rectilinear(parent=None,
                element_count_x=16,
                element_count_y=16,
                element_pitch_x=7e-3,
                element_pitch_y=7e-3):
    '''
    ---------------------------------------------
    rectilinear(parent,element_count_x,element_count_y,element_pitch_x, element_pitch_y)
    ---------------------------------------------
        
    DESCRIPTION HERE

    Parameters
    ----------

    parent : handybeam world
            DESCRIPTION HERE
    element_count_x : int
            DESCRIPTION HERE
    element_count_y : int
            DESCRIPTION HERE
    element_pitch_x : float
            DESCRIPTION HERE
    element_pitch_y : float
            DESCRIPTION HERE
        
    '''
    this = TxArray(parent)

    total_element_count = element_count_x * element_count_y

    this.tx_array_element_descriptor = np.zeros((total_element_count, 16),
                                                dtype=np.float32)

    for array_element_iy in range(element_count_y):
        for array_element_ix in range(element_count_x):
            # add an element at that indexed location
            element_idx = array_element_iy * element_count_x + array_element_ix

            loc_x = (array_element_ix -
                     (element_count_x / 2) + 0.5) * element_pitch_x
            loc_y = (array_element_iy -
                     (element_count_y / 2) + 0.5) * element_pitch_y

            this.tx_array_element_descriptor[element_idx, :] = \
                this.generate_tx_array_element(x=loc_x, y=loc_y, amplitude_ratio_setting=1.0)

            # print('at B,{},{},{}'.format(array_element_iy,array_element_ix,this.tx_array_element_descriptor_a.dtype))

    this.name = 'fully sampled rectilinear, parametrized with element_count={}; '.format(
        element_count_x * element_count_y)

    return this
コード例 #2
0
def single_element(parent=None):
    '''DESCRIPTION HERE

    Parameters
    ----------

    parent : handybeam world
            DESCRIPTION HERE
        
    '''

    this = TxArray(parent)
    this.name = 'most basic single point'
    this.is_frequency_enabled = True
    this.tx_array_element_descriptor = this.generate_tx_array_element(
        amplitude_ratio_setting=1.0)

    return this
コード例 #3
0
def simple_linear(parent=None, element_count=16, element_pitch=7e-3):
    '''
    ---------------------------------------------
    simple_linear(parent, element_count, element_pitch)
    ---------------------------------------------
        
    DESCRIPTION HERE

    Parameters
    ----------

    parent : handybeam world
            DESCRIPTION HERE
    element_count : int 
            DESCRIPTION HERE
    element_pitch : float 
            DESCRIPTION HERE
        
    '''

    this = TxArray(parent)
    this.name = 'a line of elements, starting at xyz=0, along y, spaced by {:0.1f}mm'.format(
        element_pitch * 1e3)

    this.tx_array_element_descriptor = np.zeros((element_count, 16),
                                                dtype=np.float32)

    half_length = (element_count * element_pitch) / 2

    for array_element_iy in range(element_count):

        # add an element at that indexed location
        element_idx = array_element_iy

        loc_x = 0
        loc_y = (array_element_iy -
                 (element_pitch / 2) + 0.5) * element_pitch - half_length

        this.tx_array_element_descriptor[element_idx, :] = \
        this.generate_tx_array_element(x=loc_x, y=loc_y, amplitude_ratio_setting=1.0)

    return this
コード例 #4
0
def simple_linear(parent=None, element_count=16, element_pitch=7e-3):
    """1D line of elements, starting at xyz=0, along y, with given element_pitch

    Parameters
    ----------

    parent : handybeam.world.World
            the world to give to this array as parent
    element_count : int 
            count of elements.
    element_pitch : float 
            distance between elements
        
    """

    this = TxArray(parent)
    this.name = 'a line of elements, starting at xyz=0, along y, spaced by {:0.1f}mm'.format(
        element_pitch * 1e3)

    this.tx_array_element_descriptor = np.zeros((element_count, 16),
                                                dtype=np.float32)

    half_length = (element_count * element_pitch) / 2

    for array_element_iy in range(element_count):

        # add an element at that indexed location
        element_idx = array_element_iy

        loc_x = 0
        loc_y = (array_element_iy -
                 (element_pitch / 2) + 0.5) * element_pitch - half_length

        this.tx_array_element_descriptor[element_idx, :] = \
        this.generate_tx_array_element(x=loc_x, y=loc_y, amplitude_ratio_setting=1.0)

    return this