Beispiel #1
0
import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import mdtraj
import parmed.unit as u
import pdb
import permeability_functions.misc as misc
import plot_ay
plot_ay.setDefaults()
#matplotlib.rcParams['axes.labelsize']=24
#matplotlib.rcParams['ytick.labelsize']=20
#matplotlib.rcParams['xtick.labelsize']=20


def _fill_array(myarray, rxn_coordinates):
    """ Because of the way equilibration protocol and how lammps handles fixes,
    some tracers are constraied to windows outside the box, causing lmp to fail.
    The solution is generaly to exclude that tracer/window in that particular
    sweep. However, this means some sweeps will include extreme windows,
    and others will not. This code attempts to 'filll in' the non-sampled windows
    by just putting np.nan in their place. 
    This helps align the arrays such that they all have the same windows, 
    and then all the statistics are done by excluding the np.nan values"""

    threshold = 0.1
    for i, coord in enumerate(rxn_coordinates):
        if i < myarray.shape[0]:
            if abs(myarray[i, 0] - coord) > threshold:
                myarray = np.insert(myarray, i, [coord, np.nan], axis=0)
Beispiel #2
0
def test_defaults():
    plot_ay.setDefaults()