Exemplo n.º 1
0
cutdatestart = sys.argv[2]
cutdatestop = sys.argv[3]

#s = "01/12/2015"
if cutdatestart !='no':
    cutstart = datetime.datetime.strptime(cutdatestart, "%d/%m/%Y").date()
if cutdatestop !='no':
    cutstop = datetime.datetime.strptime(cutdatestop, "%d/%m/%Y").date()
#print cut.year
#print cutstart

databl = base+ 'monit'+station+ '2.txt'
datatemp = base+ 'monit'+station+ 'temp.txt'

#set the data in a list [time, baseline [adc]]
thedata = utils.readmonit(databl)
thedatatemp = utils.readmonit(datatemp)

#print thedata[0]
if cutdatestart =='no' and cutdatestop !='no'  :
#    print 'no start/ stop'
    newtime = thedata[0][ (thedata[0] < cutstop)]
    newbl = thedata[1][  (thedata[0] < cutstop)]
    newtemp = thedatatemp[1][  (thedata[0] < cutstop)]

if cutdatestart !='no' and cutdatestop =='no'  :
#    print 'no stop/ start'
    newtime = thedata[0][  (thedata[0] > cutstart) ]
    newbl = thedata[1][  (thedata[0] > cutstart) ]
    newtemp = thedatatemp[1][  (thedata[0] > cutstart) ]
    
Exemplo n.º 2
0
import numpy as np
import os
import sys
cwd = os.getcwd()
classpath = cwd + '/../classes/'
utilspath = cwd + '/../utils/'
sys.path.append(utilspath)
import utils

base = cwd + '/../../data/monit/'

station = sys.argv[1]
data = base+ 'monit'+station+ '.txt'

#set the data in a list [time, baseline [adc]]
thedata = utils.readmonit(data)


fig = plt.figure(figsize=(10, 6))
fig.suptitle('monit 300 days for '+ station, fontsize=14, fontweight='bold')

ax1 = fig.add_subplot(121)
#fig.subplots_adjust(top=0.85)

ax1.set_ylabel('<baseline> [adc]')
ax1.plot(thedata[0],thedata[1],'b',lw=2,label=station)

fig.autofmt_xdate()

# use a more precise date string for the x axis locations in the
# toolbar