Home > matutils > interf > samp_vis.m

samp_vis

PURPOSE ^

samp=samp_vis(ad,u,v,vis)

SYNOPSIS ^

function samp=samp_vis(ad,u,v,vis)

DESCRIPTION ^

 samp=samp_vis(ad,u,v,vis)

 Sample visbility surface at a set of u,v points
 If vis is 3D "stack" of different frequencies then the 3rd dimension
 of u,v will be assumed to be freqs also

 When working on szasim power spectrum runs found that using interp
 other than 'linear' can result in serious bias problems in the
 final bandpowers.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function samp=samp_vis(ad,u,v,vis)
0002 % samp=samp_vis(ad,u,v,vis)
0003 %
0004 % Sample visbility surface at a set of u,v points
0005 % If vis is 3D "stack" of different frequencies then the 3rd dimension
0006 % of u,v will be assumed to be freqs also
0007 %
0008 % When working on szasim power spectrum runs found that using interp
0009 % other than 'linear' can result in serious bias problems in the
0010 % final bandpowers.
0011 
0012 if(size(u)~=size(v))
0013   error('u,v must have same size');
0014 end
0015 
0016 if(ndims(vis)==2)
0017   samp=interp2(ad.u_val,ad.u_val',vis,u,v,'linear');
0018 else
0019   
0020   if(size(u,3)~=size(vis,3))
0021     error('u,v and vis must have the same 3rd dimension size (freqs)');
0022   end
0023 
0024   for i=1:size(u,3)
0025     samp(:,:,i)=interp2(ad.u_val,ad.u_val',squeeze(vis(:,:,i)),...
0026     u(:,:,i),v(:,:,i),'linear');
0027   end
0028 end

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005