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 sigma_x(i,chan)=gfit{i,chan}.sigma_x;
0040 sigma_y(i,chan)=gfit{i,chan}.sigma_y;
0041 theta(i,chan)=gfit{i,chan}.theta;
0042
0043
0044 end
0045 end
0046
0047
0048
0049 close all
0050 cell_size=0.05;
0051 figure
0052 subplot(2,2,1)
0053 for chan=chantofit
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.01 0.01])
0063 grid on
0064
0065
0066 subplot(2,2,2)
0067 for chan=chantofit
0068 plot(y0(c,chan)*cell_size,'.')
0069 hold all
0070 end
0071 ylabel('y-offset,deg')
0072 xlabel('Raster number')
0073 legend(plot_labels(chantofit))
0074
0075 xlim([0 size(gfit,1)])
0076 ylim([-0.01 0.01])
0077 grid on
0078
0079
0080 subplot(2,2,3)
0081 for chan=chantofit
0082 plot(a0(c,chan),'.')
0083 hold all
0084 end
0085 ylabel('Amplitude')
0086 xlabel('Raster number')
0087 legend(plot_labels(chantofit))
0088
0089 ylim([-1 4])
0090 xlim([0 size(gfit,1)])
0091
0092 subplot(2,2,4)
0093 for chan=chantofit
0094 plot(rad2deg(theta(c,chan)),'.')
0095 hold all
0096 end
0097 ylabel('Angle')
0098 xlabel('Raster number')
0099 legend(plot_labels(chantofit))
0100
0101
0102 xlim([0 size(gfit,1)])
0103 grid on
0104 gtitle('Gaussian fits to each raster')
0105 plot_name = [maindir,start_date,'_',source_name,'_',IntensityType,'_gfit.png']
0106
0107 print('-f1','-dpng',plot_name)
0108 close all
0109