hyperion-rt / hyperion

Hyperion Radiative Transfer Code
http://www.hyperion-rt.org
BSD 2-Clause "Simplified" License
52 stars 26 forks source link

Refactor reading in/writing out of monochromatic option. #77

Open astrofrog opened 10 years ago

astrofrog commented 10 years ago

At the moment, one can end up with cryptic messages such as

Traceback (most recent call last):
  File "do_2.py", line 12, in <module>
    m.write('sed.rtin')
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/hyperion/model/model.py", line 564, in write
    peel.write(g_peeled.create_group('group_%05i' % (i + 1)))
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/hyperion/conf/conf_files.py", line 887, in write
    self._write_main_info(group)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/hyperion/conf/conf_files.py", line 917, in _write_main_info
    self._write_wavelength_range(group)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/hyperion/conf/conf_files.py", line 791, in _write_wavelength_range
    raise Exception("In monochromatic mode, wavelength range should be given as integers")
Exception: In monochromatic mode, wavelength range should be given as integers

and

ERROR: Exception: Peeled images need to be set to monochromatic mode [hyperion.model.model]
Traceback (most recent call last):
  File "do_2.py", line 12, in <module>
    m.write('sed.rtin')
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/hyperion/model/model.py", line 561, in write
    raise Exception("Peeled images need to be set to monochromatic mode")
Exception: Peeled images need to be set to monochromatic mode