function ep_lookPrr600(id, NumOfDays)
% EP_LOOKPRR600 - Opens and graphs the files \oasis\eqpac\ep1\spec.20m,
% spec.20m.1230, spec.20m.dark.
%
% Requires: READEQPAC

% Peter Strutton
% 29 Dec 1998; Brian Schlining

% Prompt for input if no input arguments are specified
if nargin < 2
    NumOfDays = 30;
end

% Set the path to the data file depending on what type of machine this function is run from
switch lower(id)
    case 'ep1'
        loc = '0 155W';
        FileName = 'ep1_specprr_full.nc';
        lon = -155;
    case 'ep2'
        loc = '2S 170W';
        FileName = 'ep2_specprr_full.nc';
        lon = -170;
    otherwise
        loc = [];
        return
end

FileLoc = fullfile(getOasisPath, 'eqpac', 'netcdf', FileName);
PathS = fullfile(getOasisPath, 'eqpac', id);

ep = netcdf(FileLoc);
X  = ep_cmplNc(ep);
ncquit(ep);

if NumOfDays < 45
    Placement = 0;
else
    Placement = 2;
end

% Trim to NumOfDays
DEnd    = max(X.t);                    % Get the last date
i       = find(X.t >= (DEnd - NumOfDays));   % Find all dates within specified period

% Read spec.20m
fig1 = figure;
set(fig1,'Units','normalized','Position',[0,0.4,0.5,0.5],'Name','Ed 20m at noon local')
subplot(2,1,1)
plot(X.t(i),X.Ed(i,:))
legend('Ed412', 'Ed443', 'Ed490', 'Ed510', 'Ed555', 'Ed670', 'PAR',Placement);
ylabel('Irradiance [\muW cm^-^2 nm^-^1]');
xlabel('Date');
title(['Ed[20m] from a PRR-600 at 12:00 and 12:30[local] ' loc])
if NumOfDays < 50
    dtick = 6;
else
    dtick = 3;
end

datetick('x',dtick)
subplot(2,1,2)
plot(X.t(i),X.Lu(i,:))
legend('Lu412', 'Lu443', 'Lu490', 'Lu510', 'Lu555', 'Lu670', 'Lu683',Placement);
ylabel('Radiance [\muW cm^-^2 nm^-^1 sr^-^1]');
xlabel('Date');
title(['Lu[20m] from a PRR-600 at 10:00 and 12:00[local] ' loc])
if NumOfDays < 50
    dtick = 6;
else
    dtick = 3;
end
datetick('x',dtick)
setfontsize(7)
XLim = get(gca, 'XLim');

% Read spec.20m.dark
FileLoc = fullfile(PathS, 'spec.20m.dark');
X       = readeqpac(FileLoc, NumOfDays);

fig5    = figure;
set(fig5,'Units','normalized','Position',[0,0.1,0.5,0.5],'Name','Ed 20m at 0000 local')
subplot(2,1,1)
if ~isempty(X)
    plot(X(:,1),X(:,2:8))
end
legend('Ed412', 'Ed443', 'Ed490', 'Ed510', 'Ed555', 'Ed670', 'PAR',Placement);
ylabel('Irradiance [\muW cm^-^2 nm^-^1]');
xlabel('Date');
title(['Ed[20m] from a PRR-600 at 00:00[local] ' loc])
if NumOfDays < 50
    dtick = 6;
else
    dtick = 3;
end
datetick('x',dtick)
set(gca, 'XLim', XLim)

subplot(2,1,2)
if ~isempty(X)
    plot(X(:,1),X(:,9:15))
end
legend('Lu412', 'Lu443', 'Lu490', 'Lu510', 'Lu555', 'Lu670', 'Lu683',Placement);
ylabel('Radiance [\muW cm^-^2 nm^-^1 sr^-^1]');
xlabel('Date');
title(['Lu[20m] from a PRR-600 at 00:00[local] ' loc])
if NumOfDays < 50
    dtick = 6;
else
    dtick = 3;
end

datetick('x',dtick)
setfontsize(7)
set(gca, 'XLim', XLim)
