Commit 44af19b4 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Fix binary TM output axis order and write values as double pairs

parent f8e84eb6
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -294,10 +294,17 @@ void sphere(string config_file, string data_file, string output_path) {
	    ttms.write(reinterpret_cast<char *>(&vk), sizeof(double));
	    ttms.write(reinterpret_cast<char *>(&exri), sizeof(double));
	    for (int lmi = 0; lmi < gconf->l_max; lmi++) {
	      complex<double> element1 = -1.0 / c1->rmi[0][lmi];
	      complex<double> element2 = -1.0 / c1->rei[0][lmi];
	      ttms.write(reinterpret_cast<char *>(&element1), sizeof(complex<double>));
	      ttms.write(reinterpret_cast<char *>(&element2), sizeof(complex<double>));
	      complex<double> element1 = -1.0 / c1->rmi[lmi][0];
	      complex<double> element2 = -1.0 / c1->rei[lmi][0];
	      double vreal, vimag;
	      vreal = element1.real();
	      vimag = element1.imag();
	      ttms.write(reinterpret_cast<char *>(&vreal), sizeof(double));
	      ttms.write(reinterpret_cast<char *>(&vimag), sizeof(double));
	      vreal = element2.real();
	      vimag = element2.imag();
	      ttms.write(reinterpret_cast<char *>(&vreal), sizeof(double));
	      ttms.write(reinterpret_cast<char *>(&vimag), sizeof(double));
	    }
	    ttms.write(reinterpret_cast<char *>(&(sconf->radii_of_spheres[0])), sizeof(double));
	    ttms.close();