ideasrule / platon

Fast exoplanet transmission spectrum calculator
GNU General Public License v3.0
23 stars 21 forks source link

Explore varying g as we go up the atmosphere #5

Closed ideasrule closed 6 years ago

ideasrule commented 6 years ago

Yayaati will compare

y-chachan commented 6 years ago

How often do we need to use the get_above_cloud_r_and_dr function? Is it a significant impediment if there's a for loop inside this function?

ideasrule commented 6 years ago

We call it once every time compute_depths() is called. I don't know how much a for loop will slow it down. You could profile the code before and after your change to see if get_above_cloud_r_and_dr is significantly slower after the change.

y-chachan commented 6 years ago

I have implemented a proper solution to the hydrostatic equation to obtain the radius as a function of pressure and this calculation works well for most planets. It introduces small differences in the case of giant planets, appreciable differences in the case of Neptune-sized planet but does not work well for Earth-like planets. The atmosphere in this case extends beyond the expected Hill radius of the planet and the scale height becomes comparable to planetary radius as the pressure goes down. All of these observations, of course, apply only to Hydrogen-Helium dominated atmospheres. The implementation of this method in the final version of the code therefore needs further review and decision-making.

ideasrule commented 6 years ago

Interesting results. For Earth-like planets, what happens if we arbitrarily limit the height of the atmosphere, say to the radius of the planet? How much does this affect the results?

y-chachan commented 6 years ago

The next steps worth considering are a more accurate calculation for the hill radius (need semi-major axis and the stellar mass) or choosing a criterion that is better than the one I have chosen.

ideasrule commented 6 years ago

The code doesn't seem to run :( I committed transit_depth_example.py, which just calls compute_depths. Can you see what's wrong?

y-chachan commented 6 years ago

Sorry about that and thanks for catching this. I made sure that all the changes I made gave the same output in the function but something must have slipped my attention. I’ll take a look at this and fix it.

On May 27, 2018, at 10:07 PM, ideasrule notifications@github.com wrote:

The code doesn't seem to run :( I committed transit_depth_example.py, which just calls compute_depths. Can you see what's wrong?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ideasrule/PyExoTransmit/issues/5#issuecomment-392420260, or mute the thread https://github.com/notifications/unsubscribe-auth/ATlecz2NsLnuHs7k2zjCMQD98z4-1yHoks5t24YUgaJpZM4UCCyi.

ideasrule commented 6 years ago

I think the problem is in how tau is calculated. The calculation isn't exactly correct--it takes the differences between adjacent radii and matches them to the atmospheric profile points. That's how ExoTransmit does it, but it means that the number of radii must be one greater than the number of atmospheric profile points.

Here's one possible hack--just append a fake point to the top of the atmosphere, which hopefully doesn't matter because the atmosphere is very tenous up there anyhow. If you think of a better solution, feel free to make the change.

possible_patch.txt

y-chachan commented 6 years ago

Yup, it’s because of the imperfect way of calculating tau. I have fixed it just as you did by adding the K_BT[0]/(mu[0] AMU * self.g) term in dr and this will sort out the problem. However, before I push any changes, I wanted to share the plot that shows how different our spectrum is from ExoTransmit’s so that we can be sure we want varying g in our calculations. The effect here seems so large because of how small the planet in our test case is. The effect on Jupiter like planets' spectra should not be as large as the one shown here.

On May 27, 2018, at 10:32 PM, ideasrule notifications@github.com wrote:

I think the problem is in how tau is calculated. The calculation isn't exactly correct--it takes the differences between adjacent radii and matches them to the atmospheric profile points. That's how ExoTransmit does it, but it means that the number of radii must be one greater than the number of atmospheric profile points.

Here's one possible hack--just append a fake point to the top of the atmosphere, which hopefully doesn't matter because the atmosphere is very tenous up there anyhow. If you think of a better solution, feel free to make the change.

possible_patch.txt https://github.com/ideasrule/PyExoTransmit/files/2043706/possible_patch.txt — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ideasrule/PyExoTransmit/issues/5#issuecomment-392423497, or mute the thread https://github.com/notifications/unsubscribe-auth/ATlec2LhVvNXM99uxncP0raO9tIyHbQ6ks5t24vxgaJpZM4UCCyi.

ideasrule commented 6 years ago

Yeah, I saw how drastic the differences are, and how the differences are negligible with a hot Jupiter. It's a bit concerning, but I think there's no question that variable g is more realistic. We'll just need to adjust test_transit_depth_calculator to use a hot Jupiter as a test case, since the existing Earth-sized test case will definitely fail.