Beispiel #1
0
    def _vmd_visualise(self, step):
        """
        Visualises the data. This fills in the variables in the vmd template,
        writes the script and runs it in vmd.
        """
        start_vmd_time = time.time()
        for i in self.all_settings['tcl']['cube_files'].split(' '):

            if not io.path_leads_somewhere(i.strip()):
                msg = "Sorry I couldn't find the following cube file:"
                msg += "\n%s" % i.strip()
                EXC.ERROR(msg)

        self.all_settings['tcl']['pic_filename'][self.PID] = self.tga_filepath
        io.vmd_variable_writer(self.all_settings, self.PID)
        # check if the file exists
        tmp = os.path.isfile(self.all_settings['vmd_script'][self.PID])
        if not tmp:
            msg = "Sorry I can't find the vmd script!"
            msg += "It hasn't been created (or created in the wrong place)."
            EXC.ERROR(msg)

        cond = 'tga' not in self.all_settings['files_to_keep']
        cond *= not all_settings['calibrate']
        if cond:
            self.all_settings['delete_these'].append(self.tga_filepath)

        io.VMD_visualise(self.all_settings, self.PID)

        end_time = time.time() - start_vmd_time
        self.all_settings['times']['VMD Visualisation'][step] += end_time
Beispiel #2
0
            path_done = True
            all_settings['path'] = clean_settings_dict[setting]
            final_orig_settings_dict['path'] = orig_settings_dict[setting]
            continue

        actual_setting = get_act_setting(setting, all_setting_names)
        if type(orig_settings_dict[setting][0]) == str:
            final_orig_settings_dict[actual_setting] = ["'%s'"%orig_settings_dict[setting][0], orig_settings_dict[setting][1]]
        else:
            final_orig_settings_dict[actual_setting] = orig_settings_dict[setting]
    return final_orig_settings_dict

settings_file = io.folder_correct(consts.settings_filepath)
orig_settings_ltxt = io.open_read(settings_file).split('\n')
settings_ltxt = remove_bad_lines(orig_settings_ltxt)
clean_settings_dict = create_clean_settings(settings_ltxt)
orig_settings_dict = create_orig_settings(orig_settings_ltxt)
all_settings = grab_defaults(clean_settings_dict)
final_orig_settings = find_final_orig_settings(orig_settings_dict, all_settings)
io.write_cleaned_orig_settings(final_orig_settings, settings_file)
if 'path' not in all_settings:
    raise SystemExit("""Sorry I can't find the path variable.... Are you sure you set this?

Use path='...' in the settings.inp file.
""")

if not io.path_leads_somewhere(all_settings['path']):
   raise SystemExit("\nThe specified path doesn't lead anywhere:\n%s\n\n\t Where is my data?! "%all_settings['path'])

all_settings['path'] = io.folder_correct(all_settings['path'])