Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"gas" planets with low boa pressure raise ValueError #8

Open
teald opened this issue Dec 15, 2022 · 0 comments
Open

"gas" planets with low boa pressure raise ValueError #8

teald opened this issue Dec 15, 2022 · 0 comments

Comments

@teald
Copy link

teald commented Dec 15, 2022

Summary

If the surface pressure is set to be < 1e7 Baryes, but gas is still set as the planetary type option, then a cryptic ValueError is produced.

I've fixed this in my version by changing host_functions.py line 679 to:

i_white_light_radius = max([0] + [i for i in range(quant.nlayer) if quant.p_lay[i] >= 1e7])

which ensures a while light radius is placed a the bottom of an atmosphere if there are no particularly high pressures. I'm not sure if this is the best way to solve it, but it seems to be working for me.

How to reproduce

python helios.py -boa_layer 1e6

Output

Traceback (most recent call last):
  File "/.../HELIOS_latest/helios.py", line 147, in <module>
    main()
  File "/.../HELIOS_latest/helios.py", line 145, in main
    run_helios()
  File "/.../HELIOS_latest/helios.py", line 85, in run_helios
    computer.radiation_loop(keeper, writer, reader, plotter)
  File "/.../HELIOS_latest/source/computation.py", line 877, in radiation_loop
    hsfunc.calculate_height_z(quant)
  File "/.../HELIOS_latest/source/host_functions.py", line 679, in calculate_height_z
    i_white_light_radius = max([i for i in range(quant.nlayer) if quant.p_lay[i] >= 1e7])
ValueError: max() arg is an empty sequence

Code of interest

i_white_light_radius = max([i for i in range(quant.nlayer) if quant.p_lay[i] >= 1e7])

@teald teald changed the title Tenuous "gas" atmospheres raises ValueError "gas" planets with low surface pressure raise ValueError Dec 15, 2022
@teald teald changed the title "gas" planets with low surface pressure raise ValueError "gas" planets with low boa pressure raise ValueError Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant