Commit b0f0f4d7 authored by Médéric Boquien's avatar Médéric Boquien

Remove the TOLERANCE constant and replace it with 0. There is no good reason...

Remove the TOLERANCE constant and replace it with 0. There is no good reason to have a tolerance and its value is quite arbitrary anyway.
parent 421fb3bf
...@@ -44,10 +44,6 @@ from .workers import analysis as worker_analysis ...@@ -44,10 +44,6 @@ from .workers import analysis as worker_analysis
from ...managers.parameters import ParametersManager from ...managers.parameters import ParametersManager
# Tolerance threshold under which any flux or error is considered as 0.
TOLERANCE = 1e-12
class PdfAnalysis(AnalysisModule): class PdfAnalysis(AnalysisModule):
"""PDF analysis module""" """PDF analysis module"""
...@@ -136,8 +132,7 @@ class PdfAnalysis(AnalysisModule): ...@@ -136,8 +132,7 @@ class PdfAnalysis(AnalysisModule):
# Read the observation table and complete it by adding error where # Read the observation table and complete it by adding error where
# none is provided and by adding the systematic deviation. # none is provided and by adding the systematic deviation.
obs_table = complete_obs_table(read_table(conf['data_file']), obs_table = complete_obs_table(read_table(conf['data_file']),
conf['bands'], filters, TOLERANCE, conf['bands'], filters, 0., lim_flag)
lim_flag)
n_obs = len(obs_table) n_obs = len(obs_table)
z = np.array(conf['sed_modules_params']['redshifting']['redshift']) z = np.array(conf['sed_modules_params']['redshifting']['redshift'])
...@@ -234,8 +229,7 @@ class PdfAnalysis(AnalysisModule): ...@@ -234,8 +229,7 @@ class PdfAnalysis(AnalysisModule):
mock_fluxes = obs_fluxes.copy() mock_fluxes = obs_fluxes.copy()
bestmod_fluxes = np.ctypeslib.as_array(best_fluxes[0]) bestmod_fluxes = np.ctypeslib.as_array(best_fluxes[0])
bestmod_fluxes = bestmod_fluxes.reshape(best_fluxes[1]) bestmod_fluxes = bestmod_fluxes.reshape(best_fluxes[1])
wdata = np.where((obs_fluxes > TOLERANCE) & wdata = np.where((obs_fluxes > 0.) & (obs_errors > 0.))
(obs_errors > TOLERANCE))
mock_fluxes[wdata] = np.random.normal(bestmod_fluxes[wdata], mock_fluxes[wdata] = np.random.normal(bestmod_fluxes[wdata],
obs_errors[wdata]) obs_errors[wdata])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment