Scripts to produce publication-ready figures.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.0 KiB

  1. %read CSV file
  2. filename = 'C:\Users\Karthik\Documents\Git Repos\ULE Cavity Characterisitics\TransmissionCurve_ULECavity.csv';
  3. delimiter = ',';
  4. startRow = 1;
  5. formatSpec = '%f%f';
  6. fileID = fopen(filename,'r');
  7. dataset = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'EmptyValue', NaN, 'ReturnOnError', false, 'EndOfLine', '\r\n');
  8. fclose(fileID);
  9. wavelengths = dataset{1};
  10. transmission = dataset{2};
  11. f_h = Helper.getFigureByTag('CavityCharacteristics');
  12. set(groot,'CurrentFigure',f_h);
  13. a_h = get(f_h, 'CurrentAxes');
  14. if ~isempty(get(a_h, 'Children'))
  15. clf(f_h);
  16. end
  17. f_h.Name = 'Wavelength dependence';
  18. f_h.Units = 'pixels';
  19. set(0,'units','pixels');
  20. screensize = get(0,'ScreenSize');
  21. f_h.Position = [[screensize(3)/30 screensize(4)/4] 1812 429];
  22. clf;
  23. W = 600:1:850;
  24. T = interp1(wavelengths(51:149), transmission(51:149), W);
  25. subplot(1,3,1)
  26. plot(wavelengths,transmission,'o', 'MarkerSize', 5);
  27. hold on
  28. plot(W, T,':.');
  29. FSR = 1.5e+9;
  30. T_626 = T(W==626) * 1e-2;
  31. R_626 = 1 - T_626;
  32. T_842 = T(W==842) * 1e-2;
  33. R_842 = 1 - T_842;
  34. F_626 = pi * sqrt(R_626) / (1 - R_626);
  35. F_842 = pi * sqrt(R_842) / (1 - R_842);
  36. L_626 = FSR / F_626;
  37. L_842 = FSR / F_842;
  38. R = 1 - (T * 1e-2);
  39. F = pi .* sqrt(R) ./ (1 - R);
  40. L = FSR ./ F;
  41. % plot(626, T_626 * 1e2, 'o', 'MarkerSize', 15, 'LineWidth', 3)
  42. % line([626 626], [0 0.06],'Color',[0.9586 0.7372 0.2537],'LineStyle','--')
  43. % line([500 1000], [T_626 T_626] * 1e2,'Color',[0.9586 0.7372 0.2537],'LineStyle','--')
  44. text(630, T_626 * 1e2 - 0.002, sprintf('R @ 626 = %.5f', R_626), 'FontSize' , 10)
  45. % text(630, T_626 * 1e2 - 0.006, sprintf('F = %.3f', F_626), 'FontSize' , 10)
  46. % annotation('arrow', [0.293 0.293], [0.11 0.3]);
  47. % plot(842, T_842 * 1e2, 'o', 'MarkerSize', 15, 'LineWidth', 3)
  48. % line([842 842], [0 0.06],'Color','red','LineStyle','--')
  49. % line([500 1000], [T_842 T_842] * 1e2,'Color','red','LineStyle','--')
  50. text(825, T_842 * 1e2 + 0.006, sprintf('R @ 842 = %.5f', R_842), 'FontSize' , 10)
  51. % text(846, T_842 * 1e2 + 0.002, sprintf('F = %.3f', F_842), 'FontSize' , 10)
  52. % annotation('arrow', [0.571 0.571], [0.11 0.2]);
  53. hold off
  54. hXLabel = xlabel('Wavelength (nm)');
  55. hYLabel = ylabel('Mirror Transmission T(%)');
  56. set([hXLabel, hYLabel] , ...
  57. 'FontSize' , 14 );
  58. grid on
  59. subplot(1,3,2)
  60. plot(W, F * 1e-4)
  61. text(626, F_626 * 1e-4 + 0.2, sprintf('F @ 626 = %1.f', F_626), 'FontSize' , 10)
  62. text(750, F_842 * 1e-4 - 0.5, sprintf('F @ 842 = %1.f', F_842), 'FontSize' , 10)
  63. hXLabel = xlabel('Wavelength (nm)');
  64. hYLabel = ylabel('Finesse (x 10^{4})');
  65. set([hXLabel, hYLabel] , ...
  66. 'FontSize' , 14 );
  67. grid on
  68. subplot(1,3,3)
  69. plot(W, L * 1e-3)
  70. text(626, L_626 * 1e-3 - 5, sprintf('L @ 626 = %1.f kHz', L_626* 1e-3), 'FontSize' , 10)
  71. text(750, L_842 * 1e-3 + 12, sprintf('L @ 842 = %1.f kHz', L_842* 1e-3), 'FontSize' , 10)
  72. hXLabel = xlabel('Wavelength (nm)');
  73. hYLabel = ylabel('Linewidth (kHz)');
  74. set([hXLabel, hYLabel] , ...
  75. 'FontSize' , 14 );
  76. grid on
  77. hTitle = sgtitle('SLS ULE Cavity Characterisitics');
  78. set( hTitle , ...
  79. 'FontSize' , 18 );