package ipp.imse.fusionOptics.apps.mse;

import ipp.imse.fusionOptics.mse.AugMSESystem;
import ipp.imse.fusionOptics.mse.AugMseFaroData;
import fusionOptics.MinervaOpticsSettings;
import binaryMatrixFile.BinaryMatrixFile;

public class DumpFaroBeamIntersects {
	
	public static void main(String[] args) {
		AugMseFaroData faro = new AugMseFaroData();
		AugMSESystem sys = new AugMSESystem();
		
		double ret[][][] = faro.getBeamClosestApproaches(sys.nbiStart, sys.nbiUnit);
		
		int nChans = ret.length;
		int nFibres = ret[0].length;
		double dOut[][] = new double[nChans*nFibres][7];
		
		int k=0;
		for(int i=0; i < nChans; i++){
			for(int j=0; j < nFibres; j++){
				dOut[k] = new double[]{ 
							i, j, 
							ret[i][j][0], ret[i][j][1], 
							ret[i][j][2], ret[i][j][3], ret[i][j][4] };
				k++;
			}
		}	
			
		BinaryMatrixFile.mustWrite(MinervaOpticsSettings.getAppsOutputPath() + "/faroBeamCross-	nov2013.bin", dOut, false);
	}
}
