function outputPng = PlotTimeSeries(ncfile,ncVariable, startDay, startTime, stopDay, stopTime,varargin)
% function outputPng = PlotTimeSeries(ncfile,ncVariable, startDay, startTime, stopDay, stopTime,varargin)
%
% Convert to datenum
% start = datenum([startDay ' ' startTime]); %convert to string with datestr(t1,31)
%

outputPng = generateoutputpngname(varargin{:});

%% Plot time series
f = figure();
startTime = datenum([startDay ' ' startTime]);
stopTime = datenum([stopDay ' ' stopTime]);
try
    nc_cf_stationTimeSeries(ncfile,'varname',ncVariable,'period',[startTime stopTime]);
catch me
    error(['Could not read opendap file: ', me.getReport]);
end

%% Print to file
print(f,'-dpng','-r120',outputPng);
close(f);