function RedrawIRcurve()
% redraws ready spectral curve for IR spectrum

% define foldername
modelfolder = getmodel;

% load x0 and IRcurve0 files
filename = strcat(modelfolder,'x0.txt');
load(filename)
filename = strcat(modelfolder,'IRcurve0.txt');
load(filename)

plot(x0,IRcurve0)
grid
xlabel('frequency, inv. cm')
ylabel('optical density')

function modelfolder = getmodel()
% gets model name in LevInfinite

filename = 'C:\LevInfinite\Config\Molecules.ini';
fid = fopen(filename,'rt');
molfolder = fgetl(fid);
fclose(fid);

filename = 'C:\LevInfinite\Config\ToCalculate.ini';
fid = fopen(filename,'rt');
modelname = fgetl(fid);
fclose(fid);

modelfolder = strcat(molfolder,modelname);
modelfolder = strcat(modelfolder,'\');
