// file: $USFS/class/sbe_eval/v1.0/sbe_assign.cc
//

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

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

// program to assign the file to one of the class
//
logical_1 Sbe_eval::assign_cc(FILE** fp_in, FILE** fp_out) {
  
  // declare local variables
  //
  int_4 index;
  
  for (int_4 i=0; i < no_of_images_d; i++) {

    fscanf(fp_in[0], "%s%f", name_d[i], &sbe_value_d[i]);
    
    // if it is a lsbe file, write into the file corresponding to lsbe
    //
    if (sbe_value_d[i] < SBE_STD_LOW) {
      index = 1;
      fprintf(fp_out[0], "%s\t%ld\n", name_d[i], index);
    }
    
    // if it is a hsbe file, write into the file corresponding to hsbe
    //
    else if (sbe_value_d[i] > SBE_STD_HIGH) {
      index = 3;
      fprintf(fp_out[0], "%s\t%ld\n", name_d[i], index);
    }

    // if it is a msbe file, write into the file corresponding to msbe
    //
    else {
      index = 2;
      fprintf(fp_out[0], "%s\t%ld\n", name_d[i], index);
    }
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;

}


