close all; clear all; clc; long_data = load ('32m-4s.txt', 'ascii'); short_data = load ('8-4m-1s.txt', 'ascii'); t_l = 4; t_s = 1; delta_L = 25.2; N = 3; % polyfitting order wl = long_data(:,1); long_t = long_data(:,2); short_t = short_data(:,2); out_data = ocean_spec_background_removal (wl,long_t, short_t,N); wl_new = out_data(:,1); long_new = out_data(:,2); short_new = out_data(:,3); atten = abs(10*log10(abs((short_new/t_s)./(long_new/t_l)))/delta_L); figure subplot(2,1,1) plot(wl_new,long_new/t_l, wl_new,short_new/t_s); ylabel('equivalent counts'); xlim([200,250]) subplot(2,1,2) plot(wl_new,atten); xlabel ('wavelength [nm]'); ylabel('attenuation [dB/m]'); xlim([200,250])