return [ float('%1.4f'%(x/(vMax*1.0)*normalizeTo)) for x in L]

excelfile = sys.argv[1]
_selection_gradient_ = sys.argv[2]
_inducer_gradient_ = sys.argv[3]

expt1 = Experiment(excelfile)

CurveFit_params = {}
Residual_RMSD = {}

#plate_to_excel = ['A1','B2','C3','D4','E5','F6','G7','H8' ]

for keys in plate_to_excel:
    timepoints = []
    well = TimeCourse(keys, expt1.extract_timecourse(keys))
    y = np.array(normList(well.data()))# !!! normalizes to 1
#    y = np.array(well.data())
    for i in range(len(well.data())):
        timepoints.append(i+1)
    x = np.array(timepoints)

    fitdata = ModifiedRichards(x, y)
    fitdata.Plot_CurveFit(keys)
    if not CurveFit_params.has_key(keys):
        CurveFit_params[keys] = []
    CurveFit_params[keys] = fitdata.Get_Coefficients()
    if not Residual_RMSD.has_key(keys):
        Residual_RMSD[keys] = float('%5.4f'%fitdata.Get_Residuals_RMSD())

#print Residual_RMSD
def Help():
    print 'This script generates a plot of differences in mean/median growth rate across adjacent wells for a fixed selection or inducer value'
    print 'Usage: <excel sheet>'
    exit()

excelfile = sys.argv[1]
expt1 = Experiment(excelfile)

plate_row = ['A','B','C','D','E','F','G','H']
diff_data = {}
for items in plate_row:
    junk = []
    for i in range(12):
        if i+2<=12:
            first_well = '%s%s'%(items,i+2)
            second_well = '%s%s'%(items,i+1)
            tmp1 = TimeCourse(first_well,expt1.extract_timecourse(first_well))
            tmp2 = TimeCourse(second_well, expt1.extract_timecourse(second_well))
            diff = tmp2.median() - tmp1.median()
            junk.append(float('%1.4f'%diff))
    if not diff_data.has_key(items):
        diff_data[items] = []
    diff_data[items] = junk

for keys in diff_data:
    outfile = open('%s_outfile'%keys,'w')
    for items in diff_data[keys]:
        outfile.write('%s\n'%items)
    outfile.close()