From d5217f22246ad3aa81f4bfd0c6fed77d59172b92 Mon Sep 17 00:00:00 2001 From: Philipp Oleynik <pholey@utu.fi> Date: Thu, 28 Apr 2022 11:36:38 +0300 Subject: [PATCH] removed usage of the geometric_mean function native to Python 3.9 to run on clusters with old Python. --- bowtie.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bowtie.py b/bowtie.py index 3081e75..582ceb0 100644 --- a/bowtie.py +++ b/bowtie.py @@ -15,7 +15,6 @@ import matplotlib.colors as clr import matplotlib.pyplot as plt import numpy as np import plotutil as plu -from statistics import geometric_mean def make_energy_grid(*, channels_per_decade=256, min_energy=0.01, max_energy=1.0E5): @@ -292,10 +291,8 @@ def calculate_bowtie_gf(response_data, except ValueError: channel_energy_high = 0 - # gf = np.mean(multi_geometric_factors_usable, axis = 0) # Average geometric factor for all model spectra - # gf_cross = gf[bowtie_cross_index] # The mean geometric factor for the bowtie crossing point + gf = np.mean(multi_geometric_factors_usable, axis = 0) # Average geometric factor for all model spectra + gf_cross = gf[bowtie_cross_index] # The mean geometric factor for the bowtie crossing point - gf_cross = geometric_mean(multi_geometric_factors_usable[:, bowtie_cross_index]) energy_cross = energy_grid_local[bowtie_cross_index] - return gf_cross, energy_cross, channel_energy_low, channel_energy_high -- GitLab