shutil.copy("%s/ts_quantities.cfg" % jobDir, os.getcwd()) shutil.copy("%s/ts8_quantities.cfg" % jobDir, os.getcwd()) ccsProducer('RTM_thermo', 'ccsthermal.py') #ccsProducer('RTM_thermo', 'ts7_stats.py') raft_id = siteUtils.getLSSTId() run_number = siteUtils.getRunNumber() host = 'localhost' ccs_subsystem = 'ts' tm = time.time() start = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime(tm - 300)) end = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime(tm)) milestones = ('2017-10-06T00:00:00', '2017-10-06T23:59:59') config_file = 'ts_quantities.cfg' time_axis = ccs_trending.TimeAxis(start=start, end=end, nbins=1000) config = ccs_trending.ccs_trending_config(config_file) for section in config.sections(): plotter = ccs_trending.TrendingPlotter(ccs_subsystem, host, time_axis=time_axis) plotter.read_config(config, section) title = "%s, %s, %s" % (raft_id, run_number, section) plotter.plot(title=title) plt.savefig('%s_%s_%s.png' % (section, raft_id, run_number)) plotter.save_file('%s_%s_%s.txt' % (section, raft_id, run_number))
import os import glob import shutil import socket import datetime import matplotlib.pyplot as plt import lcatr.schema import siteUtils import ccsTools import ccs_trending job_dir = siteUtils.getJobDir() ts8 = ccsTools.ccs_subsystem_mapping()['ts8'] host = os.getenv('LCATR_CCS_HOST', 'lsst-mcm') time_axis = ccs_trending.TimeAxis(dt=0.5, nbins=200) config_file = os.path.join(os.environ['CRJOBSDIR'], 'harnessed_jobs', 'rtm_aliveness_power_on', 'v0', 'rtm_aliveness_power_plots.cfg') config = ccs_trending.ccs_trending_config(config_file) print("Making trending plots") local_time = datetime.datetime.now().isoformat()[:len('2017-01-24T10:44:00')] for section in config.sections(): print(" processing", section) try: plotter = ccs_trending.TrendingPlotter(ts8, host, time_axis=time_axis) plotter.read_config(config, section) plotter.plot() plt.savefig('%s_%s_%s.png' % (section, local_time, siteUtils.getUnitId())) except StandardError as eobj: