processing_components/simulation/ionospheric_screen.py
def plot_gaintable_on_screen(vis, gaintables, height=3e5, gaintable_slices=None, plotfile=None):
    """ Plot a gaintable on an ionospheric screen

    :param vis:
    :param sc: Sky components for which pierce points are needed
    :param height: Height (in m) of screen above telescope e.g. 3e5
    :param scale: Multiply the screen by this factor
    :return: gridded screen image, weights image
    """
    
    import matplotlib.pyplot as plt
    
    assert isinstance(vis, BlockVisibility)
    
    station_locations = vis.configuration.xyz
    
    t2r = numpy.pi / 43200.0
    
    # The time in the Visibility is hour angle in seconds!
    plt.clf()
    for gaintable in gaintables:
        for iha, rows in enumerate(gaintable_timeslice_iter(gaintable, gaintable_slices=gaintable_slices)):
            gt = create_gaintable_from_rows(gaintable, rows)
            ha = numpy.average(gt.time)
            
            pp = find_pierce_points(station_locations,
                                    (gt.phasecentre.ra.rad + t2r * ha) * u.rad,
                                    gt.phasecentre.dec,
                                    height=height,
                                    phasecentre=vis.phasecentre)
            phases = numpy.angle(gt.gain[0, :, 0, 0, 0])
            plt.scatter(pp[:,0],pp[:,1], c=phases, cmap='hsv', alpha=0.75, s=0.1)
            
    plt.title('Pierce point phases')
    plt.xlabel('X (m)')
    plt.ylabel('Y (m)')
    
    if plotfile is not None:
        plt.savefig(plotfile)

    plt.show()
 Plot a gaintable on an ionospheric screen

    :param vis:
    :param sc: Sky components for which pierce points are needed
    :param height: Height (in m) of screen above telescope e.g. 3e5
    :param scale: Multiply the screen by this factor
    :return: gridded screen image, weights image
    
Plot a gaintable on an ionospheric screen
Plot a gaintable on an ionospheric screen
def plot_gaintable_on_screen(vis, gaintables, height=3e5, gaintable_slices=None, plotfile=None):
    import matplotlib.pyplot as plt
    assert isinstance(vis, BlockVisibility)
    station_locations = vis.configuration.xyz
    t2r = numpy.pi / 43200.0
    plt.clf()
    for gaintable in gaintables:
        for iha, rows in enumerate(gaintable_timeslice_iter(gaintable, gaintable_slices=gaintable_slices)):
            gt = create_gaintable_from_rows(gaintable, rows)
            ha = numpy.average(gt.time)
            pp = find_pierce_points(station_locations,
                                    (gt.phasecentre.ra.rad + t2r * ha) * u.rad,
                                    gt.phasecentre.dec,
                                    height=height,
                                    phasecentre=vis.phasecentre)
            phases = numpy.angle(gt.gain[0, :, 0, 0, 0])
            plt.scatter(pp[:,0],pp[:,1], c=phases, cmap='hsv', alpha=0.75, s=0.1)
    plt.title('Pierce point phases')
    plt.xlabel('X (m)')
    plt.ylabel('Y (m)')
    if plotfile is not None:
        plt.savefig(plotfile)
    plt.show()
def plot_gaintable_on_screen ( vis , gaintables , height = 3e5 , gaintable_slices = None , plotfile = None ) : import matplotlib . pyplot as plt assert isinstance ( vis , BlockVisibility ) station_locations = vis . configuration . xyz t2r = numpy . pi / 43200.0 plt . clf ( ) for gaintable in gaintables : for iha , rows in enumerate ( gaintable_timeslice_iter ( gaintable , gaintable_slices = gaintable_slices ) ) : gt = create_gaintable_from_rows ( gaintable , rows ) ha = numpy . average ( gt . time ) pp = find_pierce_points ( station_locations , ( gt . phasecentre . ra . rad + t2r * ha ) * u . rad , gt . phasecentre . dec , height = height , phasecentre = vis . phasecentre ) phases = numpy . angle ( gt . gain [ 0 , : , 0 , 0 , 0 ] ) plt . scatter ( pp [ : , 0 ] , pp [ : , 1 ] , c = phases , cmap = 'hsv' , alpha = 0.75 , s = 0.1 ) plt . title ( 'Pierce point phases' ) plt . xlabel ( 'X (m)' ) plt . ylabel ( 'Y (m)' ) if plotfile is not None : plt . savefig ( plotfile ) plt . show ( )
Plot a gaintable on an ionospheric screen
Plot a gaintable on an ionospheric screen
""" Plot a gaintable on an ionospheric screen

    :param vis:
    :param sc: Sky components for which pierce points are needed
    :param height: Height (in m) of screen above telescope e.g. 3e5
    :param scale: Multiply the screen by this factor
    :return: gridded screen image, weights image
    """ # The time in the Visibility is hour angle in seconds!
gridded screen image, weights image
gridded screen image weights image
vis
None
gaintables
height
Height (in m) of screen above telescope e.g. 3e5
Height ( in m ) of screen above telescope e . g . 3e5
gaintable_slices
plotfile
sc
Sky components for which pierce points are needed
Sky components for which pierce points are needed
scale
Multiply the screen by this factor
Multiply the screen by this factor