function [Eta] = PeakElevation(H,T,A,O)
% [Eta] = PeakElevation(H,T,A,O)
%
% This function determines Mean Surface Elevation Range using the findpeaks
% function.
%
% Inputs: 
% H = Wave Height (cm)
% T = Period (s)
% A = Opening Ratio (%)
% M = Default is Float. M = 1 is fixed.

% Extract Raw Data
VarRos = dataExtract(H,T,A,O);                                                

% Zeroshift and lowpass filter data.
VarRos = zeroshift(VarRos(:,1:23));
% VarRos(:,1:14)  - Wave Gauge Data (m)
% VarRos(:,15)    - Fixed Model Surface Elevation (m)
% VarRos(:,16:17) - Floating Model Pressure (Pa)
% VarRos(:,18:19) - Fixed Model Pressure (Pa)
% VarRos(:,20:23) - Load Cells (N)
% VarRos(:,24)    - Time (s)
% VarRos(:,25:27) - Translational Motion (m)
% VarRos(:,28:30) - Rotational Motion (degrees)

% Define Surface Elevation Variable
Eta1 = VarRos(:,15);                                
Eta2 = -Eta1;                                                               % Negative values used to extract minimums

% Determine Range Values
Eta1 = findpeaks(Eta1,'MinPeakHeight',0);
Eta2 = findpeaks(Eta2,'MinPeakHeight',0);
Eta = mean(Eta1)+mean(Eta2);                                                % Determine range