Class 9

  • Let's replot the pair diff maps marking the A grid angle in the title of each panel:
    % replot the pol maps marking grid angle in title
    for i=1:length(map)/2
      subplot(6,6,i)
      m=i*2;
      imagesc(map(m).x_tic,map(m).y_tic,map(m).map);
      axis xy; axis square; set(gca,'XDir','reverse');
      title(p.grid_phi(m-1)); nanmean(map(m).map(:))
    end
    

    Click here to see the result. We see that the source appears strongly in all -57 degree pairs and hardly at all in the -102 degree pairs. Why is this?

  • Next we want to "co-add" the maps - to stack them up while accounting for their differing feed offset angles to make a single map with the lowest possible noise. We write the following function:
    function mapca=make_coadd_map(ra,dec,dat,p,ind)
    % mapca=make_coadd_map(ra,dec,dat,p,ind)
    %
    % Make coadd map
    
    % define region to map
    ral=min(ra)-1; rah=max(ra)+1;
    decl=min(dec)-1; dech=max(dec)+1;
    n=round((dech-decl)/0.02);
    
    mapca.nhit=zeros(n);
    mapca.tot=zeros(n);
    
    for i=ind
      
      % find ra/dec trajectory on sky for this feed
      y=dec+p.dec_off(i);
      x=ra+p.ra_off_dos(i)./cosd(y);
      
      % make map for this feed
      [mapca.x_tic,mapca.y_tic,nhit]=hfill2(x,y,n,ral,rah,n,decl,dech);
      [mapca.x_tic,mapca.y_tic,tot] =hfill2(x,y,n,ral,rah,n,decl,dech,dat(:,i));
    
      % accumulate into coadd map
      mapca.nhit=mapca.nhit+nhit;
      mapca.tot =mapca.tot+tot;
    end
    
    % map final map
    mapca.map=mapca.tot./mapca.nhit;
    
    return
    

    For the pair sum (unpol) maps we can just add them up, but for the pair diff (pol) maps we need to be careful. We need to coadd the like aligned groups - which we can call Q' and U':

    % pull out data for clarity
    x=d.ra(mapind);
    y=d.dec(mapind);
    v=d.lockin.adcData(mapind,:);
    
    % make map for 100GHz unpol
    mapt=make_coadd_map(x,y,v,p,ind.rgl100a);
    
    % make maps for 100GHz like aligned pair groups
    mapqp=make_coadd_map(x,y,v,p,ind.rgl100q+1);
    mapup=make_coadd_map(x,y,v,p,ind.rgl100u+1);
    
    % same for 150GHz
    mapt(2)=make_coadd_map(x,y,v,p,ind.rgl150a);
    mapqp(2)=make_coadd_map(x,y,v,p,ind.rgl150q+1);
    mapup(2)=make_coadd_map(x,y,v,p,ind.rgl150u+1);
    
    Note that the structure ind is a convenience structure constructed using the information in p structure to hold lists of all groups of channels which we might ever want to reference. Now we make a little function to plot a map:
    function plot_map(map,t,z)
    % function plot_map(map,t)
    %
    % plot a map astronomy style
    
    imagesc(map.x_tic,map.y_tic,map.map);
    axis xy; axis square; set(gca,'XDir','reverse'); colorbar
    title(t)
    zoom(z)
    
    return
    
    % plot coadd maps
    clf
    z=1
    subplot(2,3,1); plot_map(mapt(1),'T 100GHz',z);
    subplot(2,3,2); plot_map(mapqp(1),'Q 100GHz',z);
    subplot(2,3,3); plot_map(mapup(1),'U 100GHz',z);
    subplot(2,3,4); plot_map(mapt(2),'T 150GHz',z);
    subplot(2,3,5); plot_map(mapqp(2),'Q 150GHz',z);
    subplot(2,3,6); plot_map(mapup(2),'U 150GHz',z);
    

    Try making the plot with different zoom levels. Here it is at zoom 1 and at zoom 3.

  • When we measure with perpendicular A/B grids and take the pair difference we are measuring how many more photons there are aligned in the A direction then the B direction. We call the direction with the most photons the polarization direction. Therefore if the polarization direction lies midway between the A and B grid directions we will see equal response in A and B and therefore nothing in the pair difference map. This appears to be what is happening with the U' group above - the pair difference maps are empty.

    We want to make a proper map of polarization direction - we want to rotate from the instrument defined Q'/U' frame to the absolute horizon aligned Q/U frame. Then we can use the fact that polarization angle = 0.5*atan2(U,Q) to construct polarization "vectors". I put vectors in inverted commas because polarization is a "headless vector". We can use the p.grid_phi angle to make the necessary rotation.

    A further complication is astronomical convention. Normally we work in x - horizontal to right, y - up frame, and measure angles from x towards y. In astronomy x is E and y is north. We always reverse the direction of x for plots but we do that by telling Matlab to mirror the display - +x is still east. However astromomers like to measure angles from north. For the purposes of this exercise we will measure pol angle from north towards west (although note that IAU convention is actually north towards east). This is summarized in the following figure:

    The following code makes a plot with gray scale map with pol "vectors" overplotted:

    % take Q'/U' and rotate to Q/U
    [t,r]=cart2pol(mapqp(1).map,mapup(1).map);
    t=t+2*(-57)*pi/180;
    [mapq.map,mapu.map]=pol2cart(t,r);
    
    % now take pol angle
    pa=0.5*atan2(mapu.map,mapq.map);
    pr=sqrt(mapu(1).map.^2+mapq(1).map.^2);
    
    % plot the maq
    plot_map(mapt(1),'T 100GHz',4);
    colormap gray
    
    % plot the "vectors"
    % pi/2 because pol measured from +y to -x but we plot in Matlab +x to
    % +y world
    [u,v]=pol2cart(pa+pi/2,pr);
    [x,y]=meshgrid(mapt(1).x_tic,mapt(1).y_tic);
    hold on;
    quiver(x,y,+u,+v,0.7,'r.');
    quiver(x,y,-u,-v,0.7,'r.');
    hold off;
    

    Here is the result compared to a published map of Cen A at 5GHz: