forceManualFlag = True
        elif o in ('-n', '--negative'):
            includeNegativeGrowthFlag = True
except:
    print 'ERROR: only flags admitted are -f [--force-manual] and -n [--negative].'
    sys.exit()
    
runningFlags=[forceManualFlag,includeNegativeGrowthFlag]

# 1. data reading
data300 = library.dataReader('data/300ppmSetsLight.v2.txt')
data1000 = library.dataReader('data/1000ppmSetsLight.v2.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300, recovery300 = library.characteristicParameterFinder(data300,runningFlags)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000, recovery1000 = library.characteristicParameterFinder(data1000,runningFlags)


# 3. plotting
print
print 'plotting the figure...'
figureFile='results/figureTPT'
if runningFlags[0] == True:
    figureFile=figureFile+'_forcedManual'
if runningFlags[1] == True:
    figureFile=figureFile+'_withNegativeGrowth'
figureFile=figureFile+'.pdf'
Esempio n. 2
0
    else:
        print 'error trying to assign colors. exiting...'
        sys.exit()

    return theColor


### MAIN

# 1. data reading
data300 = library.dataReader('../data/300ppmSet3.txt')
data1000 = library.dataReader('../data/1000ppmSet3.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300 = library.characteristicParameterFinder(
    data300)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000 = library.characteristicParameterFinder(
    data1000)

# 3. plotting
print
print 'plotting the figure...'
figureFile = '../results/figureTPT.pdf'

# 4.1 plotting for 300 ppms
print 'plotting for 300 ppms...'
for i in range(len(maxGrowthRates300)):
    x = growthLag300[i]
            forceManualFlag = True
        elif o in ('-n', '--negative'):
            includeNegativeGrowthFlag = True
except:
    print 'ERROR: only flags admitted are -f [--force-manual] and -n [--negative].'
    sys.exit()

runningFlags = [forceManualFlag, includeNegativeGrowthFlag]

# 1. data reading
data300 = library.dataReader('data/300ppmSetsLight.v2.txt')
data1000 = library.dataReader('data/1000ppmSetsLight.v2.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300, recovery300 = library.characteristicParameterFinder(
    data300, runningFlags)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000, recovery1000 = library.characteristicParameterFinder(
    data1000, runningFlags)

# 3. plotting
print
print 'plotting the figure...'
figureFile = 'results/figureTPT'
if runningFlags[0] == True:
    figureFile = figureFile + '_forcedManual'
if runningFlags[1] == True:
    figureFile = figureFile + '_withNegativeGrowth'
figureFile = figureFile + '.pdf'
### this script plots the niche breadth increase due to max growth and UV

import sys, numpy, scipy, matplotlib
import matplotlib.pyplot
import library

### MAIN

# 1. data reading
data300=library.dataReader('../data/300ppmSet3.txt')
data1000=library.dataReader('../data/1000ppmSet3.txt')

# 2. calculating the max growth rates
print 'fitting data for 300 pppm...'
maxGrowthRates300, uvValues300, growthLag300 = library.characteristicParameterFinder(data300)

print
print 'fitting data for 1,000 pppm...'
maxGrowthRates1000, uvValues1000, growthLag1000 = library.characteristicParameterFinder(data1000)

# 3. plotting
print
print 'plotting the figure...'
figureFile = '../results/figureNB.pdf'

# 300
matplotlib.pyplot.plot(uvValues300, maxGrowthRates300, 'o', color='blue', mec='blue', mfc='None', ms=8, mew=1)

slope, intercept, temp0, temp1, temp2 = scipy.stats.linregress(uvValues300, maxGrowthRates300)
y = slope*numpy.array(uvValues300) + intercept
matplotlib.pyplot.plot(uvValues300, y, color='blue', lw=1, label='300 ppm')