Home > cbassSouthFunctions > longTermTimeSeries.m

longTermTimeSeries

PURPOSE ^

function to plot a long term time series

SYNOPSIS ^

function longTermTimeSeries(timeStart,timeEnd,scanLength,plotFile,timeStyle)

DESCRIPTION ^

 function to plot a long term time series
timeStart='16-May-2013:10:00:00' ; % time start in C-BASS string
timeEnd = '18-May-2013:10:00:00' ; % time end in C-BASS string
scanLength = 0.5 ; % scan length in hours

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function longTermTimeSeries(timeStart,timeEnd,scanLength,plotFile,timeStyle)
0002 % function to plot a long term time series
0003 %timeStart='16-May-2013:10:00:00' ; % time start in C-BASS string
0004 %timeEnd = '18-May-2013:10:00:00' ; % time end in C-BASS string
0005 %scanLength = 0.5 ; % scan length in hours
0006 
0007 %%% CJC 27 April 2013 %%%%%
0008 
0009 
0010 opengl software
0011 
0012 %%%%%%%%%%%%%%%
0013 dateStart = datenum(timeStart,'dd-mmm-yyyy:HH:MM:SS')
0014 dateEnd = datenum(timeEnd,'dd-mmm-yyyy:HH:MM:SS')
0015 
0016 currentTimeStart = dateStart;
0017 a=figure('visible','off')
0018 b=figure('visible','off')
0019 set(a,'renderer','zbuffer')
0020 set(b,'renderer','zbuffer')
0021 while(currentTimeStart <=dateEnd)
0022     
0023     currentTimeEnd = currentTimeStart+scanLength/24; %calculate end time
0024     
0025     currentTimeStartString = datestr(currentTimeStart,'dd-mmm-yyyy:HH:MM:SS') % convert to C-BASS string
0026     currentTimeEndString = datestr(currentTimeEnd,'dd-mmm-yyyy:HH:MM:SS')% convert to C-BASS string
0027     
0028     % read in the data
0029 try    
0030     d=read_arcSouth(currentTimeStartString,currentTimeEndString) 
0031     %convert to matlab times so we can format the axis
0032     timeRoach1=d.antenna0.roach1.utc; %roach timestamps
0033     timeRoach2=d.antenna0.roach2.utc; %roach timestamps
0034     timeTemps=d.antenna0.thermal.utcFast; %temperature timestamps
0035     timeServo=d.antenna0.servo.utcFast;
0036     [year, month, day, hour, minute, second] = mjd2date(timeRoach1);
0037     dateRoach1=[year, month, day, hour, minute, second];
0038     [year, month, day, hour, minute, second] = mjd2date(timeRoach2);
0039     dateRoach2=[year, month, day, hour, minute, second];
0040     [year, month, day, hour, minute, second] = mjd2date(timeTemps);
0041     dateTemps=[year, month, day, hour, minute, second];
0042     [year, month, day, hour, minute, second] = mjd2date(timeServo);
0043     dateServo=[year, month, day, hour, minute, second];
0044     
0045     Roachtime1=datenum(dateRoach1);
0046     Roachtime2=datenum(dateRoach2);
0047     TempTime=datenum(dateTemps);
0048     
0049     ServoTime=datenum(dateServo);
0050     
0051     % t1=86400*(Roachtime1-dateStart);
0052     %t2=86400*(Roachtime2-dateStart);
0053     t1=Roachtime1;
0054     t2=Roachtime2 ;   % now plot the data making sure that we will just keep incrementing the
0055     % plot with time....
0056     figure(a)
0057     ax(1)=subplot(311)
0058     plot(t1,mean(d.antenna0.roach1.LL(:,7:55),2),'r')
0059     hold on
0060     plot(t1,mean(d.antenna0.roach1.load2(:,7:55),2),'b')
0061     plot(t1,mean(d.antenna0.roach1.RR(:,7:55),2),'c')
0062     plot(t1,mean(d.antenna0.roach1.load1(:,7:55),2),'g')
0063     title('Roach 1 Intensity','Fontsize',16);
0064     xlabel('Time','Fontsize',14)
0065     ylabel('Backend Units','Fontsize',14)
0066     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0067     xlim([dateStart,currentTimeEnd])
0068     h=legend('LCP1','loadL','RCP','LoadR')
0069     ylim('auto')
0070     grid on
0071     
0072     ax(2)=subplot(312)
0073     plot(t2,mean(d.antenna0.roach2.LL(:,7:55),2),'r')
0074     hold on
0075     plot(t2,mean(d.antenna0.roach2.load2(:,7:55),2),'b')
0076     plot(t2,mean(d.antenna0.roach2.RR(:,7:55),2),'c')
0077     plot(t2,mean(d.antenna0.roach2.load1(:,7:55),2),'g')
0078     title('Roach 2 Intensity','Fontsize',16);
0079     xlabel('Time','Fontsize',14)
0080     ylabel('Backend Units','Fontsize',14)
0081     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0082     xlim([dateStart,currentTimeEnd])
0083     h=legend('LCP1','loadL','RCP','LoadR')
0084     grid on
0085     ylim('auto')
0086     
0087     ax(3)=subplot(313)
0088    
0089     plot(t1,mean(d.antenna0.roach1.Q(:,7:55),2),'r')
0090     hold on
0091     plot(t1,mean(d.antenna0.roach1.U(:,7:55),2),'b')
0092     plot(t2,mean(d.antenna0.roach2.Q(:,7:55),2),'c')
0093     plot(t2,mean(d.antenna0.roach2.U(:,7:55),2),'g')
0094     title('Polarization','Fontsize',16);
0095     xlabel('Time','Fontsize',14)
0096     ylabel('Backend Units','Fontsize',14)
0097     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0098     h=legend('Q1','U1','Q2','U2')
0099     xlim([dateStart,currentTimeEnd])
0100     grid on
0101     ylim('auto')
0102     %linkaxes([ax(3) ax(2) ax(1)],'x');
0103     
0104     figure(b)
0105     subplot(311)
0106     plot(TempTime,d.antenna0.thermal.ccTemperatureLoadFast,'.r')
0107     hold on
0108     title('Cold Load','Fontsize',16);
0109     xlabel('Time','Fontsize',14)
0110     ylabel('Temperature [K]','Fontsize',14)
0111     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0112     xlim([dateStart,currentTimeEnd])
0113     grid on
0114     
0115     subplot(312)
0116     plot(ServoTime,d.antenna0.servo.az,'.r')
0117     hold on
0118     title('Azimuth Position','Fontsize',16);
0119     xlabel('Time','Fontsize',14)
0120     ylabel('degrees','Fontsize',14)
0121     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0122     xlim([dateStart,currentTimeEnd])
0123     grid on
0124     
0125     subplot(313)
0126     plot(ServoTime,d.antenna0.servo.el,'.r')
0127     hold on
0128     title('Elevation Position','Fontsize',16);
0129     xlabel('Time','Fontsize',14)
0130     ylabel('degrees','Fontsize',14)
0131     datetick('x','yyyy-mm-dd HH:MM:SS','keeplimits')
0132     xlim([dateStart,currentTimeEnd])
0133     grid on
0134     
0135     
0136     %increment start time by scan length so that the next time will be at a
0137     %later time....
0138     currentTimeStart = currentTimeStart+scanLength/24; 
0139     figure(a)
0140 
0141 catch
0142     disp('Error reading data\n')
0143     currentTimeStart = currentTimeStart+scanLength/24;%increment the time to next period
0144 end
0145 
0146 end
0147 
0148 filename1=strcat(plotFile,'_data.ps')
0149 filename2=strcat(plotFile,'_hous.ps')
0150 print(figure(b),'-dpsc',filename2)
0151 print(figure(a),'-dpsc',filename1)
0152 %figure(b)
0153 close(figure(a))
0154 close(figure(b))
0155 
0156 
0157 
0158 
0159 
0160

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