From f88ad025d4f52271ab01529af42177af5d7c558a Mon Sep 17 00:00:00 2001
From: Giovanni La Mura <giovanni.lamura@inaf.it>
Date: Fri, 19 Apr 2024 15:39:53 +0200
Subject: [PATCH] Use static methods to write transition matrix to file

---
 src/sphere/sphere.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/sphere/sphere.cpp b/src/sphere/sphere.cpp
index c2c9c5e5..c3dbdc02 100644
--- a/src/sphere/sphere.cpp
+++ b/src/sphere/sphere.cpp
@@ -369,11 +369,16 @@ void sphere(string config_file, string data_file, string output_path) {
 	} // i132
 	if (idfc >= 0 and nsph == 1 and jxi == jwtm) {
 	  // This is the condition that writes the transition matrix to output.
-	  TransitionMatrix ttms(l_max, vk, exri, c1->rmi, c1->rei, sconf->get_radius(0));
 	  string ttms_name = output_path + "/c_TTMS.hd5";
-	  ttms.write_binary(ttms_name, "HDF5");
+	  TransitionMatrix::write_binary(
+					 ttms_name, l_max, vk, exri, c1->rmi, c1->rei,
+					 sconf->get_radius(0), "HDF5"
+					 );
 	  ttms_name = output_path + "/c_TTMS";
-	  ttms.write_binary(ttms_name);
+	  TransitionMatrix::write_binary(
+					 ttms_name, l_max, vk, exri, c1->rmi, c1->rei,
+					 sconf->get_radius(0)
+					 );
 	}
 	double cs0 = 0.25 * vk * vk * vk / half_pi;
 	sscr0(tfsas, nsph, l_max, vk, exri, c1);
-- 
GitLab