Beispiel #1
0
main_dir = io.config_dir_path()

exp_settings = io.exp_in(main_dir)
print(f'Experiment Settings:\n{exp_settings}\n')

dp.processing_parameters(main_dir=main_dir,
                         exp_settings=exp_settings,
                         image_save=False)

for hs_img in exp_settings['hs_imgs']:
    img_dir = os.path.join(main_dir, hs_img)
    if not os.path.isdir(img_dir):
        continue

    step, wl, f, power, norm_power = io.get_pwr_spectrum(dir_name=img_dir,
                                                         plot_show=False,
                                                         plot_save=True)

    io.create_all_dirs(dir_name=img_dir)

    data_files = io.extract_files(dir_name=img_dir, file_string='img_')

    print('\nNormalising csvs...')
    for index, file in enumerate(data_files):
        file_path = os.path.join(img_dir, file)
        img, file_name = io.csv_in(file_path=file_path)

        _, img_no = file_name.split('_')
        io.png_out(image_data=img,
                   file_name=file_name,
                   dir_name=img_dir,
Beispiel #2
0
    print(f'Experiment Settings:')
    pprint(exp_settings)
    print('=' * 40)

    dp.processing_parameters(main_dir=main_dir,
                             exp_settings=exp_settings,
                             image_save=False)

    save_imgs = True if 'True' in experiment["save_imgs"] else False

    for hs_img in exp_settings['hs_imgs']:
        img_dir = os.path.join(main_dir, hs_img)
        if not os.path.isdir(img_dir):
            continue

        step, wl, f, power, norm_power = io.get_pwr_spectrum(
            dir_name=main_dir, plot_show=False, plot_save=save_imgs)

        io.create_all_dirs(dir_name=img_dir)

        data_files = io.extract_files(dir_name=img_dir, file_string='img_')

        print('Normalising data...')
        for index, file in enumerate(data_files):
            file_path = os.path.join(img_dir, file)
            img, file_name = io.csv_in(file_path=file_path)

            if 'Power Meter' in experiment["normalise"]:
                norm_img = dp.pwr_norm(image_data=img,
                                       file_name=file_name,
                                       norm_power=norm_power,
                                       dir_name=img_dir)