Commit 097ace21 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Change the vague column_list keyword in pcigale.ini to bands. This will...

Change the vague column_list keyword in pcigale.ini to bands. This will require the user to rebuild their pcigale.ini but that is necessary for the validation anyway so that is the right moment to do so.
parent 0d883320
...@@ -126,14 +126,14 @@ class PdfAnalysis(AnalysisModule): ...@@ -126,14 +126,14 @@ class PdfAnalysis(AnalysisModule):
lim_flag = conf['analysis_params']["lim_flag"] lim_flag = conf['analysis_params']["lim_flag"]
mock_flag = conf['analysis_params']["mock_flag"] mock_flag = conf['analysis_params']["mock_flag"]
filters = [name for name in conf['column_list'] if not filters = [name for name in conf['bands'] if not
name.endswith('_err')] name.endswith('_err')]
n_filters = len(filters) n_filters = len(filters)
# 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['column_list'], filters, TOLERANCE, conf['bands'], filters, TOLERANCE,
lim_flag) lim_flag)
n_obs = len(obs_table) n_obs = len(obs_table)
......
...@@ -70,7 +70,7 @@ class SaveFluxes(AnalysisModule): ...@@ -70,7 +70,7 @@ class SaveFluxes(AnalysisModule):
"""Process with the savedfluxes analysis. """Process with the savedfluxes analysis.
All the possible theoretical SED are created and the fluxes in the All the possible theoretical SED are created and the fluxes in the
filters from the column_list are computed and saved to a table, filters from the list of bands are computed and saved to a table,
alongside the parameter values. alongside the parameter values.
Parameters Parameters
...@@ -85,7 +85,7 @@ class SaveFluxes(AnalysisModule): ...@@ -85,7 +85,7 @@ class SaveFluxes(AnalysisModule):
out_format = conf['analysis_params']['output_format'] out_format = conf['analysis_params']['output_format']
save_sed = conf['analysis_params']['save_sed'] save_sed = conf['analysis_params']['save_sed']
filters = [name for name in conf['column_list'] if not filters = [name for name in conf['bands'] if not
name.endswith('_err')] name.endswith('_err')]
n_filters = len(filters) n_filters = len(filters)
......
...@@ -139,28 +139,27 @@ class Configuration(object): ...@@ -139,28 +139,27 @@ class Configuration(object):
raise Exception("Column redshift not present in input file") raise Exception("Column redshift not present in input file")
# Finding the known filters in the data table # Finding the known filters in the data table
column_list = [] bands = []
for column in obs_table.columns: for band in obs_table.columns:
filter_name = column[:-4] if column.endswith('_err') else column filter_name = band[:-4] if band.endswith('_err') else band
if filter_name in filter_list: if filter_name in filter_list:
column_list.append(column) bands.append(band)
# Check that we don't have an error column without the associated # Check that we don't have an band error without the associated
# flux # band
for column in column_list: for band in bands:
if column.endswith('_err') and (column[:-4] if band.endswith('_err') and (band[:-4] not in bands):
not in column_list):
raise Exception("The observation table as a {} column " raise Exception("The observation table as a {} column "
"but no {} column.".format(column, "but no {} column.".format(band,
column[:-4])) band[:-4]))
self.config['column_list'] = column_list self.config['bands'] = bands
else: else:
self.config['column_list'] = '' self.config['bands'] = ''
self.config.comments['column_list'] = [""] + wrap( self.config.comments['bands'] = [""] + wrap("Bands to consider. To "
"List of the columns in the observation data file to use for " "consider uncertainties too, the name of the band must be "
"the fitting.") "indicated with the _err suffix. For instance: FUV, FUV_err.")
self.spec['column_list'] = "cigale_string_list()" self.spec['bands'] = "cigale_string_list()"
# SED creation modules configurations. For each module, we generate # SED creation modules configurations. For each module, we generate
# the configuration section from its parameter list. # the configuration section from its parameter list.
......
Supports Markdown
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