Package generic_fns :: Module palmer :: Class Palmer
[hide private]
[frames] | no frames]

Class Palmer

source code

Instance Methods [hide private]
 
__init__(self, relax)
Class used to create and process input and output for the program Modelfree 4.
source code
 
create(self, run, dir, force, binary, diff_search, sims, sim_type, trim, steps, constraints, nucleus, atom1, atom2)
Function for creating the Modelfree4 input files.
source code
 
create_mfdata(self, i, file)
Create the Modelfree4 input file 'mfmodel'.
source code
 
create_mfin(self, file)
Create the Modelfree4 input file 'mfin'.
source code
 
create_mfmodel(self, i, file)
Create the Modelfree4 input file 'mfmodel'.
source code
 
create_mfpar(self, i, file)
Create the Modelfree4 input file 'mfpar'.
source code
 
create_run(self, file)
Create the script 'run.sh' for the execution of Modelfree4.
source code
 
execute(self, run, dir, force, binary)
Function for executing Modelfree4.
source code
 
extract(self, run, dir)
Function for extracting the Modelfree4 results out of the 'mfout' file.
source code
tuple of 2 floats
get_mf_data(self, pos)
Extract the model-free data from the given position of the mfout file.
source code
 
line_positions(self)
Function for getting the section positions (line number) of the mfout file.
source code
 
open_file(self, file_name)
Function for opening a file to write to.
source code
Method Details [hide private]

create(self, run, dir, force, binary, diff_search, sims, sim_type, trim, steps, constraints, nucleus, atom1, atom2)

source code 
Function for creating the Modelfree4 input files.

The following files are created:
    dir/mfin
    dir/mfdata
    dir/mfpar
    dir/mfmodel
    dir/run.sh

execute(self, run, dir, force, binary)

source code 

Function for executing Modelfree4.

BUG: Control-C during execution causes the cwd to stay as dir.

get_mf_data(self, pos)

source code 

Extract the model-free data from the given position of the mfout file.

This method is designed to catch a number of bugs in Modelfree4's mfout file.

The first bug is the presence of a series of '*' characters causing a fusion of two columns. This is handled by splitting by the '*' char and then returning the first element.

The second bug is when the floating point number is too big to fit into Modelfree4's string format limit of 15.3f. This results in a results line such as:

246 10000.00019682363392.000 1 0.000 0.000 0.000 0.000

This is caught by scanning for two '.' characters in the column, and handled by assuming that every floating point number will have three decimal characters.

Parameters:
  • pos (int) - The mfout line position.
Returns: tuple of 2 floats
The value and error.