From 2f09873717a12b947b0927ed097e97cdca98001b Mon Sep 17 00:00:00 2001 From: Giovanni La Mura <giovanni.lamura@inaf.it> Date: Fri, 2 Feb 2024 16:31:47 +0100 Subject: [PATCH] Write HDF5 binaries from SPHERE and CLUSTER --- src/cluster/cluster.cpp | 23 ----------------------- src/sphere/sphere.cpp | 3 +-- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index c0b4a64c..89aca339 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -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 diff --git a/src/sphere/sphere.cpp b/src/sphere/sphere.cpp index f7135caa..8183ef54 100644 --- a/src/sphere/sphere.cpp +++ b/src/sphere/sphere.cpp @@ -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); -- GitLab