Commit 68c2b967 authored by Alberto Cammozzo's avatar Alberto Cammozzo

graph name renaming

parent df78dbf4
FROM python:3.7
ENV MONGO "10.0.0.1:27017"
ENV FLAGS "--verbose"
ENV OPTS "--verbose"
RUN apt-get install libbz2-dev
RUN git clone https://gitlab.com/mmzz/hactargraphing
......
......@@ -7,7 +7,7 @@
M="10.0.0.1:27017" # default mongodb server address, override with $MONGO
D="newsTest" # default database name, overrde with $DATABASE
T="1h"
O="--verbose"
O=""
if [ -z ${DATABASE} ]; then echo "\$DATABASE defaults to $D"; else D=$DATABASE ; echo "\$DATABASE set to $D"; fi
if [ -z ${MONGO} ]; then echo "\$MONGO defaults to $M"; else M=$MONGO ; echo "\$MONGO set to $M"; fi
......
......@@ -68,7 +68,7 @@ def fourierExtrapolation(x, n_predict):
restored_sig += ampli * np.cos(2 * np.pi * f[i] * t + phase)
return (False,restored_sig + p[0] * t)
def plotall(x,days,minart,t,filedir):
def plotall(x,days,minart,t,filedir,filelabel):
# various plots with alerts
import matplotlib.dates as mdates
......@@ -149,7 +149,7 @@ def plotall(x,days,minart,t,filedir):
# plot figure & save
plt.figlegend(loc="upper right")
fig= plt.gcf()
filename=f"timeseries_{t}_since_{dday}.svg"
filename=f"timeseries_{t}_{filelabel}.svg"
path=filedir+"/"+filename
if os.path.exists(path):
os.remove(path)
......@@ -297,7 +297,7 @@ for t in ddf.keys():
index+="<td>N/A</td>"
if args.verbose: print(f"skipping {t}: {e}")
continue
filename=plotall(series,rolling,minart,t,filedir)
filename=plotall(series,rolling,minart,t,filedir,"all")
index+=f"<td>"
index+=f"<a href=\"{filename}\"><img alt=\"{t} [{firstd} {lastd}]\" style=\"width:100%;\" src=\"{filename}\"></a>"
index+=f"</td>"
......@@ -324,7 +324,7 @@ for t in ddf.keys():
if args.verbose: print(f"skipping {t}: {e}")
continue
if args.verbose: print(f"adjusting {t} [{firstd} {lastd}]")
filename=plotall(series,rolling,minart,t,filedir)
filename=plotall(series,rolling,minart,t,filedir,str(years))
index+=f"<td>"
index+=f"<a href=\"{filename}\"><img alt=\"{t} [{firstd} {lastd}]\" style=\"width:100%;\" src=\"{filename}\"></a>"
index+=f"</td>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment