mboquien / cigale

10 stars 0 forks source link

Format of parameters_file in savefluxes mode #51

Closed tjtakys closed 1 year ago

tjtakys commented 1 year ago

Hi. I'm using CIGALE with savefluxes mode to simulate the SED. I want to input the free parameters through parameters_file instead of directly editing the pcigale.ini file. I made the attached parameters_file and try "pcigale genconf" command, but the following error occurs. Is the format of my parameters_file wrong?

$ pcigale genconf ╭────────────────────────────────────────────────────────────────────────────────╮
│ Code Investigating GALaxy Emission │
│ Boquien et al. (2019) (https://cigale.lam.fr) │
│ CIGALE version: 2023.0.dev0 — Python version: 3.10.10 — Platform: linux-x86_64 │
╰────────────────────────────────────────────────────────────────────────────────╯
[INFO] The configuration file has been updated. Please complete the various module parameters and the data file columns to use in the analysis.

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/tsujita/miniconda3/envs/py310/bin/pcigale:33 in │ │ │ │ 30 │ │ 31 if name == 'main': │ │ 32 │ sys.argv[0] = re.sub(r'(-script.pyw?|.exe)?$', '', sys.argv[0]) │ │ ❱ 33 │ sys.exit(load_entry_point('pcigale', 'console_scripts', 'pcigale')()) │ │ 34 │ │ │ │ /home/tsujita/Research/ALCS/cigale/pcigale/init.py:139 in main │ │ │ │ 136 │ │ if args.parser == "init": │ │ 137 │ │ │ init(config) │ │ 138 │ │ elif args.parser == "genconf": │ │ ❱ 139 │ │ │ genconf(config) │ │ 140 │ │ elif args.parser == "check": │ │ 141 │ │ │ check(config) │ │ 142 │ │ elif args.parser == "run": │ │ │ │ /home/tsujita/Research/ALCS/cigale/pcigale/init.py:50 in genconf │ │ │ │ 47 │ │ │ 48 │ # Pass config rather than configuration as the file cannot be auto-filled. │ │ 49 │ info = Info(config.config) │ │ ❱ 50 │ info.print_tables() │ │ 51 │ │ 52 │ │ 53 def check(config): │ │ │ │ /home/tsujita/Research/ALCS/cigale/pcigale/utils/info.py:50 in print_tables │ │ │ │ 47 │ │ """Print the summary CIGALE info table and the SED modules table.""" │ │ 48 │ │ │ │ 49 │ │ console.print("\n") │ │ ❱ 50 │ │ self.print_summaryinfo_table() │ │ 51 │ │ │ │ 52 │ │ console.print("\n") │ │ 53 │ │ self.print_sedmodules_table() │ │ │ │ /home/tsujita/Research/ALCS/cigale/pcigale/utils/info.py:84 in print_summaryinfo_table │ │ │ │ 81 │ │ if len(self.config["data_file"]) == 0: │ │ 82 │ │ │ fname_data = "[warning]None[/warning]" │ │ 83 │ │ │ ntargets = "[warning]None[/warning]" │ │ ❱ 84 │ │ │ z = self.config["sed_modules_params"]["redshifting"]["redshift"] │ │ 85 │ │ │ if len(z) == 0: │ │ 86 │ │ │ │ z = "Not indicated" │ │ 87 │ │ │ else: │ │ │ │ /home/tsujita/miniconda3/envs/py310/lib/python3.10/site-packages/configobj.py:554 in getitem │ │ │ │ 551 │ │ │ 552 │ def getitem(self, key): │ │ 553 │ │ """Fetch the item and do string interpolation.""" │ │ ❱ 554 │ │ val = dict.getitem(self, key) │ │ 555 │ │ if self.main.interpolation: │ │ 556 │ │ │ if isinstance(val, six.string_types): │ │ 557 │ │ │ │ return self._interpolate(key, val) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyError: 'redshifting'`

pcigale.ini : https://drive.google.com/file/d/1V55waSX-M8HrIeZQGr0wSt7WrSEzJ8hk/view?usp=share_link parameters_file : https://drive.google.com/file/d/15hptf_xwLDoMVr3OU892r7H7Upj2PUYb/view?usp=sharing