umbmid/loadsave.py
def load_fd_data(data_path):
    """Load raw .txt file into array of complex freq-domain s-params

    Loads a raw data .txt file and returns the measured complex
    S-parameters in the frequency domain.

    Parameters
    ----------
    data_path : str
        Path to the data file to load

    Returns
    -------
    fd_data : array_like
        The measured complex S-parameters in the frequency domain
    """

    # Load the .txt file into an array
    raw_data = np.genfromtxt(data_path, dtype=float, delimiter='')

    # Find the number of freqs and twice the number of scan positions
    num_freqs, num_scan_positions = raw_data.shape

    # Find the number of scan positions (typically 72)
    num_scan_positions //= 2

    # Init array to return
    fd_data = np.zeros([num_freqs, num_scan_positions], dtype=complex)

    # For each scan position
    for scan_position in range(num_scan_positions):

        # Combine the real and imag parts from the .txt file
        fd_data[:, scan_position] = (raw_data[:, 2 * scan_position]
                                     + 1j * raw_data[:, 2 * scan_position + 1])

    return fd_data
Load raw .txt file into array of complex freq-domain s-params

    Loads a raw data .txt file and returns the measured complex
    S-parameters in the frequency domain.

    Parameters
    ----------
    data_path : str
        Path to the data file to load

    Returns
    -------
    fd_data : array_like
        The measured complex S-parameters in the frequency domain
    
Load raw .txt file into array of complex freq-domain s-params
Loads a raw data .txt file and returns the measured complex
S-parameters in the frequency domain.
Load raw . txt file into array of complex freq - domain s - params Loads a raw data . txt file and returns the measured complex S - parameters in the frequency domain .
def load_fd_data(data_path):
    raw_data = np.genfromtxt(data_path, dtype=float, delimiter='')
    num_freqs, num_scan_positions = raw_data.shape
    num_scan_positions //= 2
    fd_data = np.zeros([num_freqs, num_scan_positions], dtype=complex)
    for scan_position in range(num_scan_positions):
        fd_data[:, scan_position] = (raw_data[:, 2 * scan_position]
                                     + 1j * raw_data[:, 2 * scan_position + 1])
    return fd_data
def load_fd_data ( data_path ) : raw_data = np . genfromtxt ( data_path , dtype = float , delimiter = '' ) num_freqs , num_scan_positions = raw_data . shape num_scan_positions //= 2 fd_data = np . zeros ( [ num_freqs , num_scan_positions ] , dtype = complex ) for scan_position in range ( num_scan_positions ) : fd_data [ : , scan_position ] = ( raw_data [ : , 2 * scan_position ] + 1j * raw_data [ : , 2 * scan_position + 1 ] ) return fd_data
Load raw .txt file into array of complex freq-domain s-params
Loads a raw data .txt file and returns the measured complex
S-parameters in the frequency domain.
Load raw . txt file into array of complex freq - domain s - params Loads a raw data . txt file and returns the measured complex S - parameters in the frequency domain .
"""Load raw .txt file into array of complex freq-domain s-params

    Loads a raw data .txt file and returns the measured complex
    S-parameters in the frequency domain.

    Parameters
    ----------
    data_path : str
        Path to the data file to load

    Returns
    -------
    fd_data : array_like
        The measured complex S-parameters in the frequency domain
    """ # Load the .txt file into an array
 # Find the number of freqs and twice the number of scan positions
 # Find the number of scan positions (typically 72)
 # Init array to return
 # For each scan position
 # Combine the real and imag parts from the .txt file

The measured complex S-parameters in the frequency domain
The measured complex S - parameters in the frequency domain
array_like

data_path
Path to the data file to load
Path to the data file to load