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.

49 lines
1.7 KiB

  1. %read CSV file
  2. filename = 'C:\Users\Karthik\Documents\Git Repos\ULE Cavity Characterisitics\ReflectivityCurve_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. reflectance = dataset{2};
  11. figure(1);
  12. clf;
  13. xq = 549:1:1100;
  14. vq1 = interp1(wavelengths(30:end),reflectance(30:end),xq);
  15. plot(wavelengths,reflectance,'o',xq, vq1,':.');
  16. %scatter(wavelengths, reflectance, 'LineWidth', 2)
  17. R_626 = vq1(xq==626);
  18. R_842 = vq1(xq==842);
  19. F_626 = pi * sqrt(R_626) / (1 - R_626);
  20. F_842 = pi * sqrt(R_842) / (1 - R_842);
  21. hold on
  22. plot(626, R_626, 'o', 'MarkerSize', 15, 'LineWidth', 3)
  23. line([626 626], [0 2],'Color','red','LineStyle','--')
  24. line([500 1100], [R_626 R_626],'Color','red','LineStyle','--')
  25. text(630, R_626 - 0.1, sprintf('626, %.3f', R_626))
  26. text(630, R_626 - 0.15, sprintf('F = %.3f', F_626))
  27. %annotation('arrow', [0.293 0.293], [0.11 0.3]);
  28. plot(842, R_842, 'o', 'MarkerSize', 15, 'LineWidth', 3)
  29. line([842 842], [0 2],'Color','red','LineStyle','--')
  30. line([500 1100], [R_842 R_842],'Color','red','LineStyle','--')
  31. text(846, R_842 - 0.1, sprintf('842, %.3f', R_842))
  32. text(846, R_842 - 0.15, sprintf('F = %.3f', F_842))
  33. %annotation('arrow', [0.571 0.571], [0.11 0.2]);
  34. hold off
  35. hXLabel = xlabel('Wavelength (nm)');
  36. hYLabel = ylabel('?? Mirror Reflectivity R(%) ??');
  37. hTitle = sgtitle('??Reflectivity Curve of the ULE Cavity Mirrors??');
  38. set([hXLabel, hYLabel] , ...
  39. 'FontSize' , 14 );
  40. set( hTitle , ...
  41. 'FontSize' , 18 );
  42. grid on