0001 function plot_gfit_data(nchan,plot_labels,save_path,start_date,source_name,IntensityType)
0002
0003
0004
0005
0006
0007
0008 [home,installeddir] = where_am_i();
0009 addpath([home,'/',installeddir,'/Angelas_Raster_Code/']);
0010
0011
0012
0013
0014
0015 maindir= [home,'/',installeddir,'/',save_path,'/'];
0016
0017 load([maindir,start_date,'_',source_name,'_',IntensityType,'_PA_IQUV.mat'])
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 c = good_rasters;
0028 if(nchan==9)
0029 chantofit=[1,2,3,4,5,8]
0030 else
0031 chantofit=[1,2]
0032 end
0033
0034 for chan=chantofit;
0035 for i=good_rasters
0036 x0(i,chan)=gfit{i,chan}.x0;
0037 y0(i,chan)=gfit{i,chan}.y0;
0038 a0(i,chan)=gfit{i,chan}.a1;
0039 sigmax(i,chan)=gfit{i,chan}.sigma_x;
0040 sigmay(i,chan)=gfit{i,chan}.sigma_y;
0041 theta(i,chan)=gfit{i,chan}.theta;
0042
0043 end
0044 end
0045 fwhm_x = 2*sqrt(2*log(2)).*sigmax;
0046 fwhm_y = 2*sqrt(2*log(2)).*sigmay;
0047
0048 close all
0049 cell_size=0.05;
0050 figure
0051 subplot(2,2,1)
0052 for chan=chantofit
0053
0054 plot(x0(c,chan)*cell_size,'.')
0055 hold all
0056 end
0057 ylabel('x-offset,deg')
0058 xlabel('Raster number')
0059 legend(plot_labels(chantofit))
0060
0061 xlim([0 size(gfit,1)])
0062 ylim([-0.1 0.1])
0063 grid on
0064
0065
0066 subplot(2,2,2)
0067 for chan=chantofit
0068
0069 plot(y0(c,chan)*cell_size,'.')
0070 hold all
0071 end
0072 ylabel('y-offset,deg')
0073 xlabel('Raster number')
0074 legend(plot_labels(chantofit))
0075
0076 xlim([0 size(gfit,1)])
0077 ylim([-0.01 0.01])
0078 grid on
0079
0080
0081 subplot(2,2,3)
0082 for chan=chantofit
0083 plot(a0(c,chan),'.')
0084 hold all
0085 end
0086 ylabel('Amplitude')
0087 xlabel('Raster number')
0088 legend(plot_labels(chantofit))
0089
0090 ylim([0 4])
0091 xlim([0 size(gfit,1)])
0092
0093 subplot(2,2,4)
0094 for chan=chantofit
0095
0096 plot(fwhm_x(c,chan)./fwhm_y(c,chan),'.')
0097 hold all
0098 end
0099
0100 xlabel('FWHM y')
0101 legend(plot_labels(chantofit))
0102
0103 ylim([0 2])
0104 xlim([0 size(gfit,1)])
0105
0106
0107 gtitle('Gaussian fits to each raster')
0108 plot_name = [maindir,start_date,'_',source_name,'_',IntensityType,'_gfit.png']
0109
0110 print('-f1','-dpng',plot_name)
0111 close all
0112