public static void convertDataToBinary (int [][] ref_areas, String input_file_name) {
		Workbook wrk1;
		String input_file_short = input_file_name.substring(4,9);

		try {
			wrk1 = Workbook.getWorkbook(new File(input_file_name));
			Sheet sheet1 = wrk1.getSheet(0);
			int rows=sheet1.getRows();

			binary_data = new double [ref_areas.length][rows];

			for (int a = 0; a < ref_areas.length; a++) {
				int x_min = ref_areas[a][1];
				int x_max = x_min + area_size;
				int y_min = ref_areas[a][2];
				int y_max = y_min + area_size;

				for (int i = 1; i < rows; i++) {
					Cell x_cell = sheet1.getCell(1, i);
					Cell y_cell = sheet1.getCell(2, i);

					String x_cell_string = x_cell.getContents();
					String y_cell_string = y_cell.getContents();

					Double x_cell_Double = Double.parseDouble(x_cell_string);
					Double y_cell_Double = Double.parseDouble(y_cell_string);

					int x_int = x_cell_Double.intValue();
					int y_int = y_cell_Double.intValue();

					int x_loc = x_int - 317901;
					int y_loc = y_int - 4367501;

					if (x_loc > x_min && x_loc < x_max && y_loc > y_min && y_loc < y_max) {
						binary_data[a][i] = 1;
					}
					else {
						binary_data[a][i] = 0;
					}
				}
			}
			File exlFile = new File("binary_data/" + input_file_short + "_binary_file"+".xls");
			WritableWorkbook writableWorkbook = Workbook
					.createWorkbook(exlFile);

			WritableSheet writableSheet = writableWorkbook.createSheet("Sheet1", 0);

			for (int a = 0; a < ref_areas.length; a++) {

				Label label = new Label (a, 0, "Ref_Area_"+a);

				writableSheet.addCell(label);

				for (int i = 1; i <= rows; i++){
					Number value = new Number (a, i, binary_data[a][i-1]);

					writableSheet.addCell((WritableCell) value);

				}
			}

			//Write and close the workbook
			writableWorkbook.write();
			writableWorkbook.close();
			// save the file
		} 
		catch (Exception e) {
			e.printStackTrace();
		}
	}