Commit 2f098737 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Write HDF5 binaries from SPHERE and CLUSTER

parent 95bf911b
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -341,29 +341,6 @@ void cluster(string config_file, string data_file, string output_path) {
	    ttms.write_binary(ttms_name, "HDF5");
	    ttms_name = output_path + "/c_TTMS";
	    ttms.write_binary(ttms_name);
	    /*
	    int is = 1;
	    ttms_file.open(ttms_name.c_str(), ios::out | ios::binary);
	    if (ttms_file.is_open()) {
	      ttms_file.write(reinterpret_cast<char *>(&is), sizeof(int));
	      ttms_file.write(reinterpret_cast<char *>(&lm), sizeof(int));
	      ttms_file.write(reinterpret_cast<char *>(&vk), sizeof(double));
	      ttms_file.write(reinterpret_cast<char *>(&exri), sizeof(double));
	      for (int ami = 0; ami < nlemt; ami++) {
		for (int amj = 0; amj < nlemt; amj++) {
		  complex<double> value = c1ao->am0m[ami][amj];
		  double rval = value.real();
		  double ival = value.imag();
		  ttms_file.write(reinterpret_cast<char *>(&rval), sizeof(double));
		  ttms_file.write(reinterpret_cast<char *>(&ival), sizeof(double));
		}
	      }
	      ttms_file.close();
	    } else { // Could not open TM file. Should never occur.
	      printf("\nERROR: failed to open TTMS file.\n");
	      break;
	    }
	    */
	  }
	}
	// label 156: continue from here
+1 −2
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ void sphere(string config_file, string data_file, string output_path) {
  }
  sconf->write_formatted(output_path + "/c_OEDFB");
  sconf->write_binary(output_path + "/c_TEDF");
  sconf->write_binary(output_path + "/c_TEDF.hd5", "HDF5");
  GeometryConfiguration *gconf = NULL;
  try {
    gconf = GeometryConfiguration::from_legacy(data_file);
@@ -299,9 +300,7 @@ void sphere(string config_file, string data_file, string output_path) {
	  ttms.write_binary(ttms_name);
	}
	double cs0 = 0.25 * vk * vk * vk / half_pi;
	//printf("DEBUG: cs0 = %lE\n", cs0);
	sscr0(tfsas, nsph, gconf->l_max, vk, exri, c1);
	//printf("DEBUG: TFSAS = (%lE,%lE)\n", tfsas.real(), tfsas.imag());
	double sqk = vk * vk * sconf->exdc;
	aps(zpv, gconf->l_max, nsph, c1, sqk, gaps);
	rabas(gconf->in_pol, gconf->l_max, nsph, c1, tqse, tqspe, tqss, tqsps);