kgullikson88 / Telluric-Fitter

Telluric fitting made easy
http://telfit.readthedocs.org/en/latest/
MIT License
20 stars 17 forks source link

Unclear error if temperature is higher than we should realistically expect #50

Open Kamuish opened 2 years ago

Kamuish commented 2 years ago

Through a mistake I have noticed that by introducing a temperature of 1273.05K in the MakeModel function you get a very unclear error:

 File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/MakeModel.py", line 444, in MakeModel
    MakeTape5.WriteTape5(parameters, output=TelluricModelingDir + "TAPE5", atmosphere=Atmosphere)
    │         │          │                  │                                         └ defaultdict(<class 'list'>, {0.0: [958.0955575231741, 1265.9457905337722, [nan, 385.34, 0.021715347249246716, 325.1, 0.203141...
    │         │          │                  └ '/home/amiguel/.TelFit/rundir3/'
    │         │          └ ['MIPAS Atmosphere', '1', '1', '0', '0', '1', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', 15384.615384615385, 1738...
    │         └ <function WriteTape5 at 0x7f5bfec91dc0>
    └ <module 'MakeTape5' from '/home/amiguel/.conda/envs/lib/python3.8/site-packages/MakeTape5.py'>
  File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/MakeTape5.py", line 204, in WriteTape5
    outfile.write(writer("(%iE15.8)" % (end - start)).write(abundances[start:end]) + '\n')
    │       │     │                     │     │             │          │     └ 8
    │       │     │                     │     │             │          └ 0
    │       │     │                     │     │             └ [nan, 385.34, 0.021715347249246716, 325.1, 0.2031412401522029, 1868.7030911221093, 210000.0, 3.538006769695392e-20, 0.0001, 0...
    │       │     │                     │     └ 0
    │       │     │                     └ 8
    │       │     └ <class 'fortranformat.FortranRecordWriter.FortranRecordWriter'>
    │       └ <method 'write' of '_io.TextIOWrapper' objects>
    └ <_io.TextIOWrapper name='/home/amiguel/.TelFit/rundir3/TAPE5' mode='w' encoding='UTF-8'>
  File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/fortranformat/FortranRecordWriter.py", line 48, in write
    return _output(self._eds, self._rev_eds, values)
           │       │    │     │    │         └ [nan, 385.34, 0.021715347249246716, 325.1, 0.2031412401522029, 1868.7030911221093, 210000.0, 3.538006769695392e-20]
           │       │    │     │    └ [<E repeat=8 width=15 decimal_places=8 exponent=None>]
           │       │    │     └ <fortranformat.FortranRecordWriter.FortranRecordWriter object at 0x7f5b9de7ac10>
           │       │    └ [<E repeat=8 width=15 decimal_places=8 exponent=None>]
           │       └ <fortranformat.FortranRecordWriter.FortranRecordWriter object at 0x7f5b9de7ac10>
           └ <function output at 0x7f5bfebed9d0>
  File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/fortranformat/_output.py", line 118, in output
    sub_string = _compose_float_string(w, e, d, state, val, 'E')
                 │                     │  │  │  │      └ nan
                 │                     │  │  │  └ {'position': 0, 'scale': 0, 'incl_plus': False, 'blanks_as_zeros': False, 'halt_if_no_vals': False}
                 │                     │  │  └ 8
                 │                     │  └ None
                 │                     └ 15
                 └ <function _compose_float_string at 0x7f5bfebedb80>
  File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/fortranformat/_output.py", line 267, in _compose_float_string
    return  _output_float(w, d, e, state, ftype, buff, sign_bit, zero_flag, ndigits, edigits)
            │             │  │  │  │      │      │     │         │          │        └ 4
            │             │  │  │  │      │      │     │         │          └ 8
            │             │  │  │  │      │      │     │         └ False
            │             │  │  │  │      │      │     └ False
            │             │  │  │  │      │      └ '+nan                                          '
            │             │  │  │  │      └ 'E'
            │             │  │  │  └ {'position': 0, 'scale': 0, 'incl_plus': False, 'blanks_as_zeros': False, 'halt_if_no_vals': False}
            │             │  │  └ None
            │             │  └ 8
            │             └ 15
            └ <function _output_float at 0x7f5bfebedc10>
  File "/home/amiguel/.conda/envs/lib/python3.8/site-packages/fortranformat/_output.py", line 343, in _output_float
    assert(buff[2] in ['.', ','])
           └ '+nan                                          '

AssertionError: assert(buff[2] in ['.', ','])