function m_lookEMeter(id, NumOfDays)

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

% Get list of available files
files = getfname(fullfile(getOasisPath, id, 'emeter', '2*')); % Get list of files
if (isempty(files))
    % No files were found - create an empty graph?
    fprintf(1, 'No emeter data files were found');
    return;
end
fileDates = yd2sdn(str2num(files));


% find the files within the last NumOfDays
currentDate = now;
earliestAcceptableDate = currentDate - NumOfDays;
good = find(fileDates >= earliestAcceptableDate);
if (isempty(good))
    % No acceptable files - create an empty graph?
    fprintf(1, 'No emeter data files were found for data after %s\n', datestr(earliestAcceptableDate));
    return;
end
goodFiles = files(good, :);


% Get some mooring specific information
prop = readProperties(fullfile(getOasisPath, 'cfg', 'mooring.properties'));
lat = sscanf(getProperty(prop, [id '.latitude']), '%f');
lon = sscanf(getProperty(prop, [id '.longitude']), '%f');
if isempty(lat) | isempty(lon)
    loc = [];
else
    loc = getLocationString(lat, lon);
end

XLim = [now-NumOfDays now];

% Read the emeter data files
data = [];
sdn = [];
for i = 1:length(good)
    try
        [year month day hour minute second] = datevec(fileDates(good(i)));
        filename = fullfile(getOasisPath, id, 'emeter', deblank(goodFiles(i, :)));
        dataBuf = readfmtfile(filename, ...
            '%f %f,%f,%f,%f,%f');
        sdnBuf = jul2date(dataBuf(:,1), year);
    catch
        fprintf(1, 'Failed reading %s', filename);
        dataBuf = [];
        sdnBuf = [];
    end
    data = [data; dataBuf];
    sdn = [sdn; sdnBuf];
end

figure(1)
Color1 = [0 0 1];
plot(sdn, data(:, 5), 'Color', Color1);
set(gca, 'YColor', Color1, 'Xgrid', 'on', 'XLim', XLim)
daytick('x');
title(['\bf{EMETER data at ' upper(id) ' (' loc{1} ')}'])
ylabel('\bf{Volts}', 'Color', Color1)
xlabel('\bf{Date}')
setfontsize(7)
set(gcf, 'PaperPosition', [0 0 3.75 3.25])

figure(2)
Color2 = [1 0 0];
plot(sdn, data(:,4), 'Color', Color2)
set(gca, 'YColor', Color2, 'Xgrid', 'on', 'XLim', XLim)
daytick('x');
title(['\bf{EMETER data at ' upper(id) ' (' loc{1} ')}'])
ylabel('\bf{Amps}', 'Color', Color2)
xlabel('\bf{Date}')
setfontsize(7)
set(gcf, 'PaperPosition', [0 0 3.75 3.25])

figure(3)
Color3 = [1 0 1];
plot(sdn, data(:,6), 'Color', Color3)
set(gca, 'YColor', Color3, 'Xgrid', 'on', 'XLim', XLim)
daytick('x');
title(['\bf{EMETER data at ' upper(id) ' (' loc{1} ')}'])
ylabel('\bf{Amps Hours}', 'Color', Color3)
xlabel('\bf{Date}')
setfontsize(7)
set(gcf, 'PaperPosition', [0 0 3.75 3.25])
