-
Notifications
You must be signed in to change notification settings - Fork 37
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
Picciotto et al. 1960 isotopic temperature inference formula (journal club paper) #1498
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1498 +/- ##
=======================================
Coverage 85.22% 85.23%
=======================================
Files 376 378 +2
Lines 9266 9277 +11
=======================================
+ Hits 7897 7907 +10
- Misses 1369 1370 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slayoo
I tested fig_2 with changing delta_180 with delta_deuterium. For me it looks similar but need to add actual tests.
I can easily add it as a new commit if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New test for fig_2 that is just for plotting and need some assert.
def test_fig_2(plot=True):
# arrange
formulae = Formulae(isotope_temperature_inference="PicciottoEtAl1960")
delta_18O = np.linspace(-35, -13) * PER_MILLE
# act
delta_deuterium = formulae.isotope_temperature_inference.temperature_from_delta_deuterium(
in_unit(delta_18O, PER_MILLE)
)
# plot
pyplot.figure(figsize=(5, 6))
for side in ("top", "right"):
pyplot.gca().spines[side].set_visible(False)
pyplot.plot(in_unit(delta_deuterium, PER_CENT), in_unit(delta_18O, PER_MILLE), color="k")
pyplot.xlabel("$\Delta$ D [%]")
pyplot.xlim(-35, -10)
pyplot.xticks(range(-35, -10, 5))
pyplot.ylabel("δ$^{18}$O [‰]")
pyplot.ylim(in_unit(delta_18O[0], PER_MILLE), in_unit(delta_18O[-1], PER_MILLE))
pyplot.yticks(range(-35, -10, 5))
pyplot.grid(color="k")
pyplot.savefig("pysdm_fig2.pdf")
if plot:
pyplot.show()
else:
pyplot.clf()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staticmethod
def temperature_from_delta_deuterium(const, delta_180):
return const.PICCIOTTO_180_TO_DEUTERIUM_A * delta_180 - const.PICCIOTTO_180_TO_DEUTERIUM_B
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that I change it to minus B. Hmmm I need to add tests to properly check it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PICCIOTTO_180_TO_DEUTERIUM_A = 0.8 * PER_CENT
PICCIOTTO_180_TO_DEUTERIUM_B = 1.8 * PER_CENT
No description provided.