Ejemplo n.º 1
0
print(
    '\n\n\n\n\n\n\n\n   **************************************************************'
)
print('   *    ', Software_name, '  v.', Software_version,
      '     *      (c) YeS 2019')
print('   ************************************************************** \n\n')

startTime = time.time()
currentTime = time.strftime("%H:%M:%S")
currentDate = time.strftime("%d.%m.%Y")
print('  Today is ', currentDate, ' time is ', currentTime, '\n')

#      *** Making a list of folders with ADR files ***

# Search needed files in the directory and subdirectories
file_path_list, file_name_list = find_all_files_in_folder_and_subfolders(
    path_to_data, '.adr', 0)

# Making all slashes in paths of the same type
for i in range(len(file_path_list)):
    file_path_list[i] = file_path_list[i].replace('\\', '/')

# Taking only paths without
for i in range(len(file_path_list)):
    file_path_list[i] = file_path_list[i][:-len(file_name_list[i])]

list_of_folder_names = find_unique_strings_in_list(file_path_list)

print('\n  Number of ADR files found: ', len(file_name_list))
print('\n  List of folders to be analyzed: \n')
for i in range(len(list_of_folder_names)):
    print('         ', i + 1, ') ', list_of_folder_names[i])
Ejemplo n.º 2
0
#*******************************************************************************
print(
    '\n\n\n\n\n\n\n\n   ********************************************************************'
)
print('   *  ', Software_name, ' v.', Software_version,
      '    *      (c) YeS 2019')
print(
    '   ********************************************************************      \n\n\n'
)

startTime = time.time()
currentTime = time.strftime("%H:%M:%S")
currentDate = time.strftime("%d.%m.%Y")
print('  Today is ', currentDate, ' time is ', currentTime, '\n')

file_path_list, file_name_list = find_all_files_in_folder_and_subfolders(
    common_path, extension, 1)

for file_no in range(len(file_name_list)):
    out = file_name_list[file_no].replace(extension, '.png')
    img = Image.open(file_path_list[file_no])
    img.load(scale=4)
    #img.rotate(90).show()
    img.show()
    img.save(out)

endTime = time.time()
print('\n\n\n  The program execution lasted for ',
      round((endTime - startTime), 2), 'seconds (',
      round((endTime - startTime) / 60, 2), 'min. ) \n')
print('\n           *** Program TXT reader has finished! *** \n\n\n')
Ejemplo n.º 3
0
print('   **************************************************** \n\n\n')

startTime = time.time()
currentTime = time.strftime("%H:%M:%S")
currentDate = time.strftime("%d.%m.%Y")
print('  Today is ', currentDate, ' time is ', currentTime)
print(' ')

# *** Creating a folder where all pictures and results will be stored (if it doen't exist) ***
newpath = 'ADR_for_ML_Results/'
if not os.path.exists(newpath):
    os.makedirs(newpath)

# *** Search ADR files in the directory ***

fileList, file_name_list = find_all_files_in_folder_and_subfolders(
    directory, '.adr', 1)

for fileNo in range(len(fileList)):  # loop by files
    print('\n\n\n')
    print('  *  File ', str(fileNo + 1), ' of', str(len(fileList)))
    print('  *  File path: ', str(fileList[fileNo]))

    #*********************************************************************************

    # *** Opening datafile ***
    fname = fileList[fileNo]

    # Reading the file header
    [
        df_filename, df_filesize, df_system_name, df_obs_place, df_description,
        F_ADC, df_creation_timeUTC, ReceiverMode, ADRmode, sumDifMode, NAvr,