function [MeanResults] = ComputeMeans(path,base_filename)

load([path base_filename '.mat']);
idx = find(~isnan(Time_DateNum)); 
if(~isempty(idx)) 
	MeanResults.Time_DateNum = mean(Time_DateNum(idx)); 
else 
	MeanResults.Time_DateNum = NaN; 
end


[TC_StatusFields] = ParseTC_Status(TC_Status);
idx = find(~isnan(TC_StatusFields.ActualPos)); 
if(~isempty(idx)) 
	MeanResults.TC_DoorPosition = mean(TC_StatusFields.ActualPos);
else 
	MeanResults.TC_DoorPosition = NaN; 
end


idx = find(~isnan(BC_Voltage)); 
if(~isempty(idx)) 
	MeanResults.BC_Voltage = mean(BC_Voltage(idx)); 
else 
	MeanResults.BC_Voltage = NaN; 
end


idx = find(~isnan(BC_GroundFault) & (BC_GroundFault > 0.0)); 
if(~isempty(idx)) 
	MeanResults.BC_GroundFault = mean(BC_GroundFault(idx)); 
else 
	MeanResults.BC_GroundFault = NaN; 
end

idx = find(~isnan(BC_Hydrogen) & (BC_Hydrogen > 0.0)); 
if(~isempty(idx)) 
	MeanResults.BC_Hydrogen = mean(BC_Hydrogen(idx)); 
else 
	MeanResults.BC_Hydrogen = NaN; 
end

%idx = find(~isnan(SC_OffSet)); 
%if(~isempty(idx)) 
%	MeanResults.SC_OffSet = mean(SC_OffSet(idx)); 
%else 
	MeanResults.SC_OffSet = NaN; 
%end

%idx = find(~isnan(SC_Slope)); 
%if(~isempty(idx)) 
%`	MeanResults.SC_Slope = mean(SC_Slope(idx)); 
%else 
	MeanResults.SC_Slope = NaN; 
%end

idx = find(~isnan(SC_Range)); 
  if(~isempty(idx)) 
	MeanResults.SC_Range = mean(SC_Range(idx)); 
	MeanResults.SC_Range_max = max(SC_Range(idx));
	MeanResults.SC_Range_min = min(SC_Range(idx));
  else 
	MeanResults.SC_Range = NaN; 
	MeanResults.SC_Range_max = NaN; 
	MeanResults.SC_Range_min = NaN; 
  end

PC_Power = PC_Voltage.*(PC_BattCurr+PC_LoadCurr);
idx = find(~isnan(PC_Power)); 
   if(~isempty(idx)) 
        MeanResults.PC_Power = mean(PC_Power(idx)); 
        MeanResults.PC_Power_min = min(PC_Power(idx)); 
        MeanResults.PC_Power_max = max(PC_Power(idx)); 
   else 
	MeanResults.PC_Power = NaN; 
	MeanResults.PC_Power_min = NaN;   
	MeanResults.PC_Power_max = NaN;   
   end

idx = find(~isnan(SC_LoadCell));
   if(~isempty(idx))
        MeanResults.SC_LoadCell = mean(SC_LoadCell(idx));
        MeanResults.SC_LoadCell_min = min(SC_LoadCell(idx));
        MeanResults.SC_LoadCell_max = max(SC_LoadCell(idx));
   else
        MeanResults.SC_LoadCell = NaN;
        MeanResults.SC_LoadCell_min = NaN;
        MeanResults.SC_LoadCell_max = NaN;
   end

idx = find(~isnan(BC_VBalance));
   if(~isempty(idx))
        MeanResults.BC_VBalance = mean(BC_VBalance(idx));
        MeanResults.BC_VBalance_min = min(BC_VBalance(idx));
        MeanResults.BC_VBalance_max = max(BC_VBalance(idx));
   else
        MeanResults.BC_VBalance = NaN;
        MeanResults.BC_VBalance_min = NaN;
        MeanResults.BC_VBalance_max = NaN;
   end

idx = find(~isnan(BC_VStopCharge));
   if(~isempty(idx))
        MeanResults.BC_VStopCharge = mean(BC_VStopCharge(idx));
        MeanResults.BC_VStopCharge_min = min(BC_VStopCharge(idx));
        MeanResults.BC_VStopCharge_max = max(BC_VStopCharge(idx));
   else
        MeanResults.BC_VStopCharge = NaN;
        MeanResults.BC_VStopCharge_min = NaN;
        MeanResults.BC_VStopCharge_max = NaN;
   end


idx = find(~isnan(PC_DiffPress)); 
if(~isempty(idx))  
	MeanResults.PC_DiffPress = mean(PC_DiffPress(idx)); 
else 
	MeanResults.PC_DiffPress = NaN; 
end

idx = find(~isnan(PC_Scale)); 
if(~isempty(idx))  
	MeanResults.PC_Scale = mean(PC_Scale(idx)); 
else 
	MeanResults.PC_Scale = NaN; 
end

idx = find(~isnan(PC_Retract)); 
if(~isempty(idx))  
	MeanResults.PC_Retract = mean(PC_Retract(idx)); 
else 
	MeanResults.PC_Retract = NaN; 
end



end


