Exemple #1
0
if (len(sys.argv) != 1):
    LOGFILE = str(sys.argv[1])

    # Check if the string argument matchs a local file
    if not os.path.isfile(LOGFILE):
        # User specified non-existant file - give up and exit
        logfile_error = True

else:
    # No command line argument - check if default file name exists locally
    LOGFILE = DEFAULT_LOGFILE

    if not os.path.isfile(LOGFILE):
        # No local file specified or found - check for matching sample data file
        try:
            LOGFILE = sample_data_util.get_sample_data_file(DEFAULT_LOGFILE)
            print("Local log file not found - Using sample data file!")
        except IOError as e:
            logfile_error = True

if logfile_error:
    print("ERROR: Logfile {0} not found".format(LOGFILE))
    sys.exit()
else:
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(
        LOGFILE, (os.path.getsize(LOGFILE) / 2**20)))

#-----------------------------------------------------------------------------
# Main script
#-----------------------------------------------------------------------------
Exemple #2
0
#-----------------------------------------------------------------------------
# Top level script variables
#-----------------------------------------------------------------------------

AP_LOGFILE = 'raw_log_dual_flow_ap.hdf5'
STA_LOGFILE = 'raw_log_dual_flow_sta.hdf5'

#-----------------------------------------------------------------------------
# Process filenames
#-----------------------------------------------------------------------------
ap_logfile_error = False
sta_logfile_error = False

# See if the log file name is for a sample data file
try:
    AP_LOGFILE = sample_data_util.get_sample_data_file(AP_LOGFILE)
except:
    ap_logfile_error = True

# Ensure the log file actually exists - quit immediately if not
if ((not os.path.isfile(AP_LOGFILE)) and ap_logfile_error):
    print("ERROR: Logfile {0} not found".format(AP_LOGFILE))
    sys.exit()
else:
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(
        os.path.split(AP_LOGFILE)[1], (os.path.getsize(AP_LOGFILE) / 1E6)))

# See if the log file name is for a sample data file
try:
    STA_LOGFILE = sample_data_util.get_sample_data_file(STA_LOGFILE)
except:
if(len(sys.argv) != 1):
    LOGFILE = str(sys.argv[1])

    # Check if the string argument matchs a local file
    if not os.path.isfile(LOGFILE):
        # User specified non-existant file - give up and exit
        logfile_error = True

else:
    # No command line argument - check if default file name exists locally
    LOGFILE = DEFAULT_LOGFILE

    if not os.path.isfile(LOGFILE):
        # No local file specified or found - check for matching sample data file
        try:
            LOGFILE = sample_data_util.get_sample_data_file(DEFAULT_LOGFILE)
            print("Local log file not found - Using sample data file!")
        except IOError as e:
            logfile_error = True

if logfile_error:
    print("ERROR: Logfile {0} not found".format(LOGFILE))
    sys.exit()
else:
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(LOGFILE, (os.path.getsize(LOGFILE)/2**20)))


#-----------------------------------------------------------------------------
# Main script
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Process command line arguments
#-----------------------------------------------------------------------------

LOGFILE       = 'raw_log_dual_flow_ap.hdf5'
logfile_error = False

# Use log file given as command line argument, if present
if(len(sys.argv) != 1):
    LOGFILE = str(sys.argv[1])

# See if the command line argument was for a sample data file
try:
    LOGFILE = sample_data_util.get_sample_data_file(LOGFILE)
except:
    logfile_error = True

# Ensure the log file actually exists - quit immediately if not
if ((not os.path.isfile(LOGFILE)) and logfile_error):
    print("ERROR: Logfile {0} not found".format(LOGFILE))
    sys.exit()
else:
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(os.path.split(LOGFILE)[1], (os.path.getsize(LOGFILE)/1E6)))


#-----------------------------------------------------------------------------
# Main script 
#-----------------------------------------------------------------------------
Exemple #5
0
    LOGFILE_AP = str(sys.argv[1])
    LOGFILE_STA = str(sys.argv[2])

    # Check if the string argument matchs a local file
    if not (os.path.isfile(LOGFILE_AP) and os.path.isfile(LOGFILE_STA)):
        # User specified non-existant files - give up and exit
        logfile_error = True
else:
    # No command line arguments - check if default files exists locally
    LOGFILE_AP = DEFAULT_AP_LOGFILE
    LOGFILE_STA = DEFAULT_STA_LOGFILE

    if not (os.path.isfile(LOGFILE_AP) and os.path.isfile(LOGFILE_STA)):
        # No local files specified or found - check for matching sample data file
        try:
            LOGFILE_AP = sample_data_util.get_sample_data_file(
                DEFAULT_AP_LOGFILE)
            LOGFILE_STA = sample_data_util.get_sample_data_file(
                DEFAULT_STA_LOGFILE)
            print("Local log files not found - Using sample data files!")

        except IOError as e:
            logfile_error = True

if logfile_error:
    print("ERROR: Log files {0} and {1} not found".format(
        LOGFILE_AP, LOGFILE_STA))
    sys.exit()
else:
    print("Reading log files:")
    print("'{0}' ({1:5.1f} MB)".format(LOGFILE_AP,
                                       (os.path.getsize(LOGFILE_AP) / 2**20)))
    LOGFILE_AP = str(sys.argv[1])
    LOGFILE_STA = str(sys.argv[2])

    # Check if the string argument matchs a local file
    if not (os.path.isfile(LOGFILE_AP) and os.path.isfile(LOGFILE_STA)):
        # User specified non-existant files - give up and exit
        logfile_error = True
else:
    # No command line arguments - check if default files exists locally
    LOGFILE_AP = DEFAULT_AP_LOGFILE
    LOGFILE_STA = DEFAULT_STA_LOGFILE

    if not (os.path.isfile(LOGFILE_AP) and os.path.isfile(LOGFILE_STA)):
        # No local files specified or found - check for matching sample data file
        try:
            LOGFILE_AP = sample_data_util.get_sample_data_file(DEFAULT_AP_LOGFILE)
            LOGFILE_STA = sample_data_util.get_sample_data_file(DEFAULT_STA_LOGFILE)
            print("Local log files not found - Using sample data files!")

        except IOError as e:
            logfile_error = True

if logfile_error:
    print("ERROR: Log files {0} and {1} not found".format(LOGFILE_AP, LOGFILE_STA))
    sys.exit()
else:
    print("Reading log files:")
    print(  "'{0}' ({1:5.1f} MB)".format(LOGFILE_AP, (os.path.getsize(LOGFILE_AP)/2**20)))
    print(  "'{0}' ({1:5.1f} MB)".format(LOGFILE_STA, (os.path.getsize(LOGFILE_STA)/2**20)))

#-----------------------------------------------------------------------------
elif(len(sys.argv) == 2):
    LOGFILE_IN = str(sys.argv[1])
    HDF5_FILE_OUT = 'np_rx_ofdm_entries.hdf5'
elif(len(sys.argv) == 3):
    LOGFILE_IN = str(sys.argv[1])
    HDF5_FILE_OUT = str(sys.argv[2])

print("WLAN Exp Log Example: OFDM Rx Entry Exporter")

#Interpret the supplied file name:
# (1) Try filename as full path to actual file
# (2) If (1) does not exist, try file name as sample data file
# (3) If (1) and (2) don't exist, exit with error
if(not os.path.isfile(LOGFILE_IN)):
    try:
        LOGFILE = sample_data_util.get_sample_data_file(LOGFILE_IN)
        print("Reading sample log file '{0}' ({1:5.1f} MB)\n".format(
            os.path.split(LOGFILE)[1],
            os.path.getsize(LOGFILE)/1E6))
    except:
        print("ERROR: Logfile {0} not found".format(LOGFILE_IN))
        sys.exit()
else:
    LOGFILE = LOGFILE_IN
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(
        os.path.split(LOGFILE)[1],
        os.path.getsize(LOGFILE)/1E6))

#Extract the raw log data and log index from the HDF5 file
log_data      = hdf_util.hdf5_to_log_data(filename=LOGFILE)
raw_log_index = hdf_util.hdf5_to_log_index(filename=LOGFILE)
# Top level script variables
#-----------------------------------------------------------------------------

AP_LOGFILE  = 'raw_log_dual_flow_ap.hdf5'
STA_LOGFILE = 'raw_log_dual_flow_sta.hdf5'


#-----------------------------------------------------------------------------
# Process filenames
#-----------------------------------------------------------------------------
ap_logfile_error  = False
sta_logfile_error = False

# See if the log file name is for a sample data file
try:
    AP_LOGFILE  = sample_data_util.get_sample_data_file(AP_LOGFILE)
except:
    ap_logfile_error = True

# Ensure the log file actually exists - quit immediately if not
if ((not os.path.isfile(AP_LOGFILE)) and ap_logfile_error):
    print("ERROR: Logfile {0} not found".format(AP_LOGFILE))
    sys.exit()
else:
    print("Reading log file '{0}' ({1:5.1f} MB)\n".format(os.path.split(AP_LOGFILE)[1], (os.path.getsize(AP_LOGFILE)/1E6)))


# See if the log file name is for a sample data file
try:
    STA_LOGFILE = sample_data_util.get_sample_data_file(STA_LOGFILE)
except: