Home > scans > generate > scangen.m

scangen

PURPOSE ^

Scan file generator %Charles Copley 26 Jan 2010

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Scan file generator %Charles Copley 26 Jan 2010
This file generates various raster scan files for the OVRO c-bass antenna

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Scan file generator %Charles Copley 26 Jan 2010
0002 %This file generates various raster scan files for the OVRO c-bass antenna
0003 
0004 file = fopen('scanfile.scan','wt') %open the file for writing
0005 msecond = 1000; %define the time resolution of the steps in ms
0006 lengthscansec=100; %define the scan length in seconds
0007 lengthscan=lengthscansec/(msecond*1e-3); %calculate total number of points
0008 delta_az = 0.25 %define the delta_az per step
0009 delta_el= 0.25 %define the delta el per step
0010 
0011 az_start = -3; %define the start azimuth offset
0012 az_end = +3; %define the end azimuth offset
0013 el_start=-2;%define the star elevatio offset
0014 el_end = +2%define the end elevation offset
0015 
0016 el_steps = (el_end-el_start)/delta_el; %number of elevation steps
0017 az_steps = (az_end-az_start) / (delta_az) %number of azimuth steps
0018 
0019 %%%%CREATE THE ARRAY TO PRINT TO FILE
0020 el=[el_start:delta_el:el_end;]
0021 together=[];
0022 ieven=1;
0023 i=1;
0024 iodd=1;
0025 ieven=2
0026 for i=1:(length(el)-1)/2
0027     azpos = [az_start:delta_az:az_end];
0028     meld = [azpos;repmat(el(iodd),1,length(azpos))];
0029     azneg=  [az_end:-delta_az:az_start];
0030     meld2 = [azneg;repmat(el(ieven),1,length(azneg))];
0031     together = [together meld meld2];
0032     i=i+1;
0033     ieven = 2*i;
0034     iodd = 2*i-1;
0035 end
0036 
0037 if mod(length(el),2)~=0
0038     %number is odd
0039      azpos = [az_start:delta_az:az_end];
0040      meld = [azpos;repmat(el(iodd),1,length(azpos))];
0041      together = [together meld];
0042 end
0043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
0044 
0045 t=[0:length(together)-1];
0046 
0047 together = [t;together];
0048      
0049 az=[azpos azneg];
0050 ticks=[0:1:length(azpos)*length(el)]; %calculate totla number of point
0051 azmat=repmat(az,1,length(el)); %produce appropriate azimuth positions
0052 
0053 
0054 fprintf(file,'MSPERSAMPLE %d\n',msecond);
0055 fprintf(file,'%6d %9.5f %9.5f 0\n',together);
0056 %step
0057 
0058 
0059 
0060 fclose(file) %close the file

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