// file: $USFS/eval/exp_13/code/sbe_output_0.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::output_cc(FILE** fp_out) {
  
  // declare local variables
  //
  for (int_4 i=0; i < no_of_images_d; i++) {

    // if it is a lsbe file, write into the file corresponding to lsbe
    //
    if (sbe_value_d[i] < (sbe_mean_d - sbe_std_d)) {
      fprintf(fp_out[0], "%s\t%5.2f\n", name_d[i], sbe_value_d[i]);
    }

    // if it is a hsbe file, write into the file corresponding to hsbe
    //
    else if (sbe_value_d[i] > (sbe_mean_d + sbe_std_d)) {
      fprintf(fp_out[2], "%s\t%5.2f\n", name_d[i], sbe_value_d[i]);
    }

    // if it is a msbe file, write into the file corresponding to msbe
    //
    else {
      fprintf(fp_out[1], "%s\t%5.2f\n", name_d[i], sbe_value_d[i]);
    }
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;

}



