Home > Angelas_Raster_Code > plot_caldata2.m

plot_caldata2

PURPOSE ^

Plot each element of the caldata matrix to see how they evolve with time

SYNOPSIS ^

function [all_calmat] = plot_caldata2(save_path,caldata_filename)

DESCRIPTION ^

 Plot each element of the caldata matrix to see how they evolve with time

 Matrix is 3 x 3 Mueller matrix that is the 
 telescope response, ie if the true sky Stokes vector is S and the
 observed vector is S', RS = S'

 (R^I_I1 R^I_I2 R^I_Q1 R^I_Q2 R^I_U1 R^I_U2 )
 (R^Q_I1 R^Q_I2 R^Q_Q1 R^Q_Q2 R^Q_U1 R^Q_U2 )
 (R^U_I1 R^U_I2 R^U_Q1 R^U_Q2 R^U_U1 R^U_U2 )

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [all_calmat] = plot_caldata2(save_path,caldata_filename)
0002 
0003 % Plot each element of the caldata matrix to see how they evolve with time
0004 %
0005 % Matrix is 3 x 3 Mueller matrix that is the
0006 % telescope response, ie if the true sky Stokes vector is S and the
0007 % observed vector is S', RS = S'
0008 %
0009 % (R^I_I1 R^I_I2 R^I_Q1 R^I_Q2 R^I_U1 R^I_U2 )
0010 % (R^Q_I1 R^Q_I2 R^Q_Q1 R^Q_Q2 R^Q_U1 R^Q_U2 )
0011 % (R^U_I1 R^U_I2 R^U_Q1 R^U_Q2 R^U_U1 R^U_U2 )
0012 %
0013 
0014 [home,installeddir] = where_am_i();
0015 maindir= [home,'/',installeddir,'/',save_path,'/'];
0016 
0017 % Read in the list of caldata files to analyse
0018 
0019 if(nargin==2) % read in a file containing a list of cal files
0020     [cal_files] = import_caldatafile(caldata_filename);
0021     
0022 else
0023     % List your files explicitly here
0024 %     cal_files = {'07-Nov-2012:07:22:02_taua_caldata.mat';...
0025 %         '12-Dec-2012:03:05:38_taua_caldata.mat';...
0026 %         '13-Dec-2012:05:50:12_taua_caldata.mat';...
0027 %         '25-Mar-2013:22:55:18_taua_caldata.mat';...
0028 %         '24-Apr-2013:20:32:44_taua_caldata.mat';...
0029 %         '25-Apr-2013:18:28:08_taua_caldata.mat';...
0030 %         '27-Apr-2013:18:20:14_taua_caldata.mat';...
0031 %         '29-Apr-2013:18:12:25_taua_caldata.mat';...
0032 %         '26-Jun-2013:18:30:24_taua_caldata.mat';...
0033 %         '29-Jun-2013:16:57:15_taua_caldata.mat';...
0034 %         '17-Jul-2013:13:53:34_taua_caldata.mat';} % Cal files used to calibrate m42
0035 cal_files={'06-Feb-2014:01:24:02_taua_I_caldata.mat';...
0036 '11-May-2014:21:41:45_taua_I_caldata.mat';...
0037 '13-Dec-2013:04:24:57_taua_I_caldata.mat';...
0038 '13-May-2014:18:49:45_m42_I_caldata.mat';...
0039 '17-May-2014:17:30:00_taua_I_caldata.mat';...
0040 '17-Oct-2013:07:45:40_taua_I_caldata.mat';...
0041 '18-May-2014:18:31:28_m42_I_caldata.mat';...
0042 '21-Sep-2013:08:26:15_taua_I_caldata.mat';...
0043 '22-Sep-2013:10:48:51_m42_I_caldata.mat';...
0044 '28-Apr-2014:18:47:08_taua_I_caldata.mat';...
0045 '29-Apr-2014:20:55:39_m42_I_caldata.mat';...
0046 '29-Mar-2014:21:34:00_taua_I_caldata.mat';}
0047 
0048 end
0049 
0050 % Define some plotting labels for later
0051 %plot_labels = {'II', 'QI', 'UI', 'IQ', 'QQ', 'UQ','IU', 'QU', 'CUU'};
0052 plot_labels = {'I-I1', 'I-I2', 'I-Q1', 'I-Q2', 'I-U1', 'I-U2','Q-I1', 'Q-I2', 'Q-Q1','Q-Q2', 'Q-U1', 'Q-U2', 'U-I1', 'U-I2', 'U-Q1','U-Q2', 'U-U1', 'U-U2'};
0053  for i=1:length(cal_files);
0054     temp_cal_file = char(cal_files(i));
0055     load([maindir,temp_cal_file]);
0056     all_calmat{i}=calmat;
0057     clear caldata calmat;
0058 end
0059   
0060 % Now plot each element of the calmat data
0061 % 9 coefficients in total
0062 figure(1)
0063 
0064 for j=1:18
0065     subplot(3,6,j);
0066     for i=1:length(cal_files);
0067         temp_date = regexp(char(cal_files(i)), ':', 'split');
0068         dates     = datenum(temp_date{1});
0069         k=floor((j-1)/6) + 1;
0070         l = j-(6*(k-1));
0071         %disp([j,k,l])
0072         plot(dates,all_calmat{1,i}(k,l),'+r');
0073         hold on
0074     end
0075     
0076     %set(gca,'XMinorTick','on')
0077     datetick('x','mmm-yy','keeplimits','keepticks');
0078     grid on;
0079     xlabel('Date');
0080     ylabel('Calibration value');
0081     title(plot_labels(j));
0082     gtitle('Calibration factors for TauA');
0083      if(j==1|j==2|j==9|j==10|j==17|j==18)
0084          subplot(3,6,j)
0085          %ylim([0 1.5])
0086      else
0087          subplot(3,6,j)
0088          %ylim([-1 1])
0089      end
0090     
0091 end
0092 print('-f1','-dpng','LongTermCaldata.png')
0093  %keyboard
0094 %%
0095 % Invert each calibration matrix
0096 
0097 for j=1:length(cal_files);
0098     j
0099     inv_caldata{j} = inv(all_calmat{j})
0100 end
0101 
0102 % Now plot each element of the inverted calmat data
0103 % 9 coefficients in total
0104 figure
0105 for j=1:9
0106     subplot(3,3,j);
0107     for i=1:length(cal_files);
0108         temp_date = regexp(char(cal_files(i)), ':', 'split');
0109         dates     = datenum(temp_date{1});
0110         k=floor((j-1)/3) + 1;
0111         l = j-(3*(k-1));
0112         plot(dates,inv_caldata{1,i}(k,l),'o');
0113         hold on
0114     end
0115     
0116     %set(gca,'XMinorTick','on')
0117     datetick('x','mmm-yy','keeplimits','keepticks');
0118     grid on;
0119     xlabel('Date');
0120     ylabel('Calibration value');
0121     title(plot_labels(j));
0122     gtitle('Calibration factors for TauA');
0123     if(j==1)
0124         subplot(3,3,j)
0125         %ylim([0 800])
0126     end
0127     
0128 end
0129 subplot(3,3,1);ylim([0 0.003])
0130 subplot(3,3,5);ylim([0 0.003])
0131 subplot(3,3,9);ylim([0 0.003])
0132 subplot(3,3,2);ylim([0 0.001])
0133 subplot(3,3,2);ylim([-0.001 0.001])
0134 subplot(3,3,3);ylim([-0.001 0.001])
0135 subplot(3,3,4);ylim([-0.001 0.001])
0136 subplot(3,3,6);ylim([-0.001 0.001])
0137 subplot(3,3,7);ylim([-0.001 0.001])
0138 subplot(3,3,8);ylim([-0.001 0.001])
0139 %print('-f2','-dpng','LongTermInvCaldata.png')

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