def sp_bsize(x, y): ''' Make nice plots of the beamsize. ''' import matplotlib.pyplot as plt nfrq, npnt, nant = x['rao'].shape nrow = 2 ncol = (nant + 1) / 2 f, ax = plt.subplots(nrow, ncol, sharex='col', sharey='row') f.set_size_inches(2 * nant, 7, forward=True) t1 = Time(x['ut_mjd'][0], format='mjd') f.suptitle('X-feed Beam Widths for SOLPNT scan at ' + t1.iso[:19] + ' UT', fontsize=18) fout, a, aout = disk_conv() fgood = np.where(x['fghz'] > 2.48)[0] for ant in range(nant): ax[ant % nrow, ant / nrow].set_title('Ant ' + str(ant + 1) + ' [blue=RA, red=Dec]') if ant % ncol == 0: ax[ant / ncol, 0].set_ylabel('Beam FWHM [deg]') if ant >= ncol: ax[1, ant - ncol].set_xlabel('Frequency [GHz]') ax[ant % nrow, ant / nrow].set_ylim(0.5, 5) ax[ant % nrow, ant / nrow].set_xlim(1, 20) ax[ant % nrow, ant / nrow].set_yscale('log') ax[ant % nrow, ant / nrow].set_xscale('log') ax[ant % nrow, ant / nrow].plot( x['fghz'][fgood], x['raparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'b.') ax[ant % nrow, ant / nrow].plot(fout, aout, color='black') ax[ant % nrow, ant / nrow].plot( x['fghz'][fgood], x['decparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'r.') plt.draw() f, ax = plt.subplots(nrow, ncol, sharex='col', sharey='row') f.set_size_inches(2 * nant, 7, forward=True) t1 = Time(x['ut_mjd'][0], format='mjd') f.suptitle('Y-feed Beam Widths for SOLPNT scan at ' + t1.iso[:19] + ' UT', fontsize=18) for ant in range(nant): ax[ant % nrow, ant / nrow].set_title('Ant ' + str(ant + 1) + ' [blue=RA, red=Dec]') if ant % ncol == 0: ax[ant / ncol, 0].set_ylabel('Beam FWHM [deg]') if ant >= ncol: ax[1, ant - ncol].set_xlabel('Frequency [GHz]') ax[ant % nrow, ant / nrow].set_ylim(0.5, 5) ax[ant % nrow, ant / nrow].set_xlim(1, 20) ax[ant % nrow, ant / nrow].set_yscale('log') ax[ant % nrow, ant / nrow].set_xscale('log') ax[ant % nrow, ant / nrow].plot( y['fghz'][fgood], y['raparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'b.') ax[ant % nrow, ant / nrow].plot(fout, aout, color='black') ax[ant % nrow, ant / nrow].plot( y['fghz'][fgood], y['decparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'r.') plt.draw()
def sp_bsize(x, y): ''' Make nice plots of the beamsize, currently only for the first eight antennas. This routine will have to be modified to work with more. ''' import matplotlib.pyplot as plt nfrq, npnt, nant = x['rao'].shape f, ax = plt.subplots(2, nant / 2, sharex='col', sharey='row') f.set_size_inches(2 * nant, 7, forward=True) t1 = Time(x['ut_mjd'][0], format='mjd') f.suptitle('X-feed Beam Widths for SOLPNT scan at ' + t1.iso[:19] + ' UT', fontsize=18) fout, a, aout = disk_conv() fgood = np.where(x['fghz'] > 2.48)[0] for ant in range(nant): ax[ant % 2, ant / 2].set_title('Ant ' + str(ant + 1) + ' [blue=RA, red=Dec]') if ant % 4 == 0: ax[ant / 4, 0].set_ylabel('Beam FWHM [deg]') if ant >= nant / 2: ax[1, ant - nant / 2].set_xlabel('Frequency [GHz]') ax[ant % 2, ant / 2].set_ylim(0.5, 5) ax[ant % 2, ant / 2].set_xlim(1, 20) ax[ant % 2, ant / 2].set_yscale('log') ax[ant % 2, ant / 2].set_xscale('log') ax[ant % 2, ant / 2].plot( x['fghz'][fgood], x['raparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'b.') ax[ant % 2, ant / 2].plot(fout, aout, color='black') ax[ant % 2, ant / 2].plot( x['fghz'][fgood], x['decparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'r.') plt.draw() f, ax = plt.subplots(2, nant / 2, sharex='col', sharey='row') f.set_size_inches(2 * nant, 7, forward=True) t1 = Time(x['ut_mjd'][0], format='mjd') f.suptitle('Y-feed Beam Widths for SOLPNT scan at ' + t1.iso[:19] + ' UT', fontsize=18) for ant in range(nant): ax[ant % 2, ant / 2].set_title('Ant ' + str(ant + 1) + ' [blue=RA, red=Dec]') if ant % 4 == 0: ax[ant / 4, 0].set_ylabel('Beam FWHM [deg]') if ant >= nant / 2: ax[1, ant - nant / 2].set_xlabel('Frequency [GHz]') ax[ant % 2, ant / 2].set_ylim(0.5, 5) ax[ant % 2, ant / 2].set_xlim(1, 20) ax[ant % 2, ant / 2].set_yscale('log') ax[ant % 2, ant / 2].set_xscale('log') ax[ant % 2, ant / 2].plot( y['fghz'][fgood], y['raparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'b.') ax[ant % 2, ant / 2].plot(fout, aout, color='black') ax[ant % 2, ant / 2].plot( y['fghz'][fgood], y['decparms'][2, fgood, ant] * 2 * np.sqrt(np.log(2)) / 10000, 'r.') plt.draw()
def sp_bsize(x,y): ''' Make nice plots of the beamsize. ''' import matplotlib.pyplot as plt nfrq, npnt, nant = x['rao'].shape nrow = 2 ncol = (nant+1)/2 f, ax = plt.subplots(nrow, ncol, sharex='col', sharey='row') f.set_size_inches(2*nant,7,forward=True) t1 = Time(x['ut_mjd'][0],format='mjd') f.suptitle('X-feed Beam Widths for SOLPNT scan at '+t1.iso[:19]+' UT',fontsize=18) fout,a,aout = disk_conv() fgood = np.where(x['fghz'] > 2.48)[0] for ant in range(nant): ax[ant % nrow, ant/nrow].set_title('Ant '+str(ant+1)+' [blue=RA, red=Dec]') if ant % ncol == 0: ax[ant/ncol,0].set_ylabel('Beam FWHM [deg]') if ant >= ncol: ax[1,ant - ncol].set_xlabel('Frequency [GHz]') ax[ant % nrow, ant/nrow].set_ylim(0.5,5) ax[ant % nrow, ant/nrow].set_xlim(1,20) ax[ant % nrow, ant/nrow].set_yscale('log') ax[ant % nrow, ant/nrow].set_xscale('log') ax[ant % nrow, ant/nrow].plot(x['fghz'][fgood],x['raparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'b.') ax[ant % nrow, ant/nrow].plot(fout,aout,color='black') ax[ant % nrow, ant/nrow].plot(x['fghz'][fgood],x['decparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'r.') plt.draw() f, ax = plt.subplots(nrow, ncol, sharex='col', sharey='row') f.set_size_inches(2*nant,7,forward=True) t1 = Time(x['ut_mjd'][0],format='mjd') f.suptitle('Y-feed Beam Widths for SOLPNT scan at '+t1.iso[:19]+' UT',fontsize=18) for ant in range(nant): ax[ant % nrow, ant/nrow].set_title('Ant '+str(ant+1)+' [blue=RA, red=Dec]') if ant % ncol == 0: ax[ant/ncol,0].set_ylabel('Beam FWHM [deg]') if ant >= ncol: ax[1,ant - ncol].set_xlabel('Frequency [GHz]') ax[ant % nrow, ant/nrow].set_ylim(0.5,5) ax[ant % nrow, ant/nrow].set_xlim(1,20) ax[ant % nrow, ant/nrow].set_yscale('log') ax[ant % nrow, ant/nrow].set_xscale('log') ax[ant % nrow, ant/nrow].plot(y['fghz'][fgood],y['raparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'b.') ax[ant % nrow, ant/nrow].plot(fout,aout,color='black') ax[ant % nrow, ant/nrow].plot(y['fghz'][fgood],y['decparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'r.') plt.draw()
def sp_bsize(x,y): ''' Make nice plots of the beamsize, currently only for the first eight antennas. This routine will have to be modified to work with more. ''' import matplotlib.pyplot as plt nfrq, npnt, nant = x['rao'].shape f, ax = plt.subplots(2, nant/2, sharex='col', sharey='row') f.set_size_inches(2*nant,7,forward=True) t1 = Time(x['ut_mjd'][0],format='mjd') f.suptitle('X-feed Beam Widths for SOLPNT scan at '+t1.iso[:19]+' UT',fontsize=18) fout,a,aout = disk_conv() fgood = np.where(x['fghz'] > 2.48)[0] for ant in range(nant): ax[ant % 2, ant/2].set_title('Ant '+str(ant+1)+' [blue=RA, red=Dec]') if ant % 4 == 0: ax[ant/4,0].set_ylabel('Beam FWHM [deg]') if ant >= nant/2: ax[1,ant - nant/2].set_xlabel('Frequency [GHz]') ax[ant % 2, ant/2].set_ylim(0.5,5) ax[ant % 2, ant/2].set_xlim(1,20) ax[ant % 2, ant/2].set_yscale('log') ax[ant % 2, ant/2].set_xscale('log') ax[ant % 2, ant/2].plot(x['fghz'][fgood],x['raparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'b.') ax[ant % 2, ant/2].plot(fout,aout,color='black') ax[ant % 2, ant/2].plot(x['fghz'][fgood],x['decparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'r.') plt.draw() f, ax = plt.subplots(2, nant/2, sharex='col', sharey='row') f.set_size_inches(2*nant,7,forward=True) t1 = Time(x['ut_mjd'][0],format='mjd') f.suptitle('Y-feed Beam Widths for SOLPNT scan at '+t1.iso[:19]+' UT',fontsize=18) for ant in range(nant): ax[ant % 2, ant/2].set_title('Ant '+str(ant+1)+' [blue=RA, red=Dec]') if ant % 4 == 0: ax[ant/4,0].set_ylabel('Beam FWHM [deg]') if ant >= nant/2: ax[1,ant - nant/2].set_xlabel('Frequency [GHz]') ax[ant % 2, ant/2].set_ylim(0.5,5) ax[ant % 2, ant/2].set_xlim(1,20) ax[ant % 2, ant/2].set_yscale('log') ax[ant % 2, ant/2].set_xscale('log') ax[ant % 2, ant/2].plot(y['fghz'][fgood],y['raparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'b.') ax[ant % 2, ant/2].plot(fout,aout,color='black') ax[ant % 2, ant/2].plot(y['fghz'][fgood],y['decparms'][2,fgood,ant]*2*np.sqrt(np.log(2))/10000,'r.') plt.draw()
def sp_check_qual(x, y): ''' Does a sanity check for quality of SOLPNTCAL, based on comparison of measured beamsize with that expected from a 2.1-m dish ''' fghz = x['fghz'] fout, a, aout = disk_conv(fghz) aout = aout * 10000 / (2 * np.sqrt(np.log(2))) nparms, nf, nant = x['raparms'].shape qual = np.zeros((4, nant), 'bool') for i in range(nant): # Beamsize must be within 10 percent of nominal value val = np.median(x['raparms'][2, :, i] / aout) qual[0, i] = val < 1.1 and val > 0.9 val = np.median(x['decparms'][2, :, i] / aout) qual[1, i] = val < 1.1 and val > 0.9 val = np.median(y['raparms'][2, :, i] / aout) qual[2, i] = val < 1.1 and val > 0.9 val = np.median(y['decparms'][2, :, i] / aout) qual[3, i] = val < 1.1 and val > 0.9 return qual
def sp_check_qual(x, y): ''' Does a sanity check for quality of SOLPNTCAL, based on comparison of measured beamsize with that expected from a 2.1-m dish ''' fghz = x['fghz'] fout,a,aout = disk_conv(fghz) aout = aout*10000/(2*np.sqrt(np.log(2))) nparms,nf,nant = x['raparms'].shape qual = np.zeros((4,nant),'bool') for i in range(nant): # Beamsize must be within 10 percent of nominal value val = np.median(x['raparms'][2,:,i]/aout) qual[0,i] = val < 1.1 and val > 0.9 val = np.median(x['decparms'][2,:,i]/aout) qual[1,i] = val < 1.1 and val > 0.9 val = np.median(y['raparms'][2,:,i]/aout) qual[2,i] = val < 1.1 and val > 0.9 val = np.median(y['decparms'][2,:,i]/aout) qual[3,i] = val < 1.1 and val > 0.9 return qual