from solar import * from create_views import create_ps, ps_to_jpg import timetable as tt import os TT_FILENAME = "missing_FS.xml" VIEW = "/home/solar/work/PAS_rate_synchro.cl" def make_plot (t1, t2): day = t1.date() view = VIEW ps_filename = create_ps (day, t1, t2, view) print ("Create", ps_filename) jpg_filename = "PAS_rate_synchro.%s_%s.jpg" % (t1.strftime ("%Y%m%d"), t1.strftime ("%H%M%S")) ps_to_jpg (ps_filename, jpg_filename) print ("Create", jpg_filename) os.remove (ps_filename) if __name__ == "__main__": events = tt.TimeTable ("Missing FS").from_file (TT_FILENAME) for t1, t2 in events.get_data (): print (t1, t2) if t1.date() < today(): continue make_plot (t1, t2)