Home > reduc > support > mapping.m

mapping

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function mapping(d, gen, field)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  function mapping(d, gen, field)


    quick pipeline mapping function
 
   sjcm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mapping(d, gen, field)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function mapping(d, gen, field)
0006 %
0007 %
0008 %    quick pipeline mapping function
0009 %
0010 %   sjcm
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 
0013 % define some variables
0014 beamSize = 0.75; % degrees
0015 pixSize = 0.1; %degrees
0016 
0017 
0018 if(gen)
0019   % get the directory to write to
0020   maindir=getMainDir(d, field);
0021 end
0022 
0023   
0024 % first we cut only the on-source data
0025 dcut = cutObs(d, 'source', 'only');
0026 
0027 if(isfield(d.antenna0.receiver, 'dataT'))
0028   data = dcut.antenna0.receiver.dataT;
0029   useT = 1;
0030 else
0031   data = dcut.antenna0.receiver.data;
0032   useT = 0;
0033 end
0034 
0035 % flag the data we don't want to use
0036 data(dcut.flags.fast) = nan;
0037 
0038 % we want to make a plot for each channel
0039 
0040 figure(1)
0041 setwinsize(gcf, 1000, 750); 
0042 for numChan=1:6
0043   thisRa  = dcut.antenna0.servo.equa(:,1);
0044   thisDec = dcut.antenna0.servo.equa(:,2);
0045   thisData= data(:,numChan);
0046   
0047   flags = isnan(thisData);
0048   
0049   thisRa(flags)  = [];
0050   thisDec(flags) = [];
0051   thisData(flags)= [];
0052   
0053   
0054   centerVector = [median(thisRa)*12/pi median(thisDec)*180/pi]; %degress
0055   raSize       = (max(thisRa) - min(thisRa))*180/pi;  % degrees
0056   decSize      = (max(thisDec) - min(thisDec))*180/pi;  % degrees
0057   sizeVector   = [raSize decSize];
0058   
0059   subplot(3,2,numChan)
0060 
0061   tic
0062   [raRange decRange flux] = cartplot(thisRa, thisDec, thisData, ...
0063       centerVector, sizeVector, pixSize, beamSize);
0064   toc
0065   
0066   imagesc(raRange*12/pi, decRange*180/pi, flux);
0067   axis xy ;
0068   set(gca, 'XDir', 'Rev');
0069   colorbar;
0070   
0071   xlabel('Right Ascension [h]');
0072   ylabel('Declination [deg]');
0073   thisTitle = sprintf('Channel %d', numChan);
0074   title(thisTitle);
0075   
0076   
0077   clear flux, raRange, decRange;
0078   
0079 end
0080 
0081 gtitle('Maps');
0082 
0083 
0084 if(gen)
0085   dbclear if error
0086   set(gcf,'paperposition',[0 0 6.0 9.0])
0087   eval(sprintf('print -dpng -r70 %s/map/fig1.png;', ...
0088       maindir));
0089   dbstop if error
0090 end
0091 
0092 return;
0093

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