def main(args): logger.info('Reading data from %s', args.fname) with fitsio.FITS(args.fname) as infile: ccdx = infile['ccdx'].read() ccdy = infile['ccdy'].read() mjd = infile['imagelist']['tmid'].read() mjd0 = int(mjd.min()) mjd -= mjd0 fn = np.median logger.info('Plotting') fig, axis = plt.subplots() mappable_x = axis.plot(mjd, fn(ccdx, axis=0), 'b.')[0] axis2 = axis.twinx() mappable_y = axis2.plot(mjd, fn(ccdy, axis=0), 'g.')[0] axis2.legend([mappable_x, mappable_y], ['X', 'Y'], loc='best') axis.set_ylabel(r'X') axis2.set_ylabel(r'Y') axis.set_xlabel('MJD - {}'.format(mjd0)) plot_night_breaks(axis, mjd) fig.tight_layout() if args.output is not None: logger.info('Rendering to %s', args.output) fig.savefig(args.output, bbox_inches='tight') else: plt.show()
def main(args): logger.info('Reading data') with fitsio.FITS(args.filename) as infile: imagelist_hdu = infile['imagelist'] mjd = imagelist_hdu['tmid'].read() seeing = imagelist_hdu['seeing'].read() frame_sn = imagelist_hdu['frame_sn'].read() mjd0 = int(mjd.min()) mjd -= mjd0 logger.info('Plotting') fig, axes = plt.subplots(2, 1, sharex=True) labels = ['"Seeing"', 'Frame S/N'] for ax, data, label in zip(axes, [seeing, frame_sn], labels): ax.plot(mjd, data, marker='.', ls='None') ax.set_ylabel(label) ax.grid(True, axis='y') plot_night_breaks(ax, mjd) axes[-1].set_xlabel('MJD - {}'.format(mjd0)) fig.tight_layout() if args.output is not None: logger.info('Rendering to %s', args.output) fig.savefig(args.output, bbox_inches='tight') else: plt.show()
def main(args): data = qa_common.CSVContainer(args.extracted) mjd0 = int(data.mjd.min()) data['mjd'] = data.mjd - mjd0 fig, axes = plt.subplots(6, 1, figsize=(11, 20), sharex=True) axes[0].plot(data['mjd'], data.dark, 'k.') axes[0].set_ylabel(r'Dark current / $\mathrm{e}^- s^{-1}$') axes[0].set_ylim(1, 7) axes[1].plot(data['mjd'], data.right - data.left, 'k.') axes[1].set_ylabel(r'Left - Right') axes[2].plot(data['mjd'], data.left, 'r.', label='left') axes[2].plot(data['mjd'], data.right, 'g.', label='right') axes[2].set_ylabel(r'Overscan level / counts') axes[3].plot(data['mjd'], data.chstemp, 'r.') axes[3].set_ylabel(r'Chassis temp') axes[4].plot(data['mjd'], data.ccdtemp, 'r.') axes[4].set_ylabel(r'CCD temp') axes[5].plot(data['mjd'], data.airmass, 'r.') axes[5].set_ylabel(r'Airmass') axes[-1].set_xlabel('MJD - {}'.format(mjd0)) for ax in axes: ax.grid(True, axis='y') plot_night_breaks(ax, data.mjd) fig.tight_layout() if args.output is not None: logger.info('Rendering to %s', args.output) fig.savefig(args.output, bbox_inches='tight') else: plt.show()