// file: $USFS/eval/exp_13/code/sbe_eval.cc
//

// isip include files
//
#include "sbe_eval.h"
#include <string.h>

#include "sbe_eval_constants.h"
#include <integral_constants.h>

// program to find the mean value
//
logical_1 Sbe_eval::mean_cc(FILE** fp_a) {

  // declare local variables
  //

  // reading the data from the input file
  //
  for (int_4 i=0; i < no_of_images_d; i++) {
    fscanf(fp_a[0], "%s%f", name_d[i], &sbe_value_d[i]);
  }
  
  // summing all the sbe values
  //
  for (int_4 m=0; m < no_of_images_d; m++) {
    sbe_mean_d += sbe_value_d[m];
  }

  // finding the mean
  //
  sbe_mean_d /= no_of_images_d;
  
  // exit gracefully
  //
  return ISIP_TRUE;

}



