{ "cells": [ { "cell_type": "markdown", "id": "ccd708af-e72b-4a39-a2a2-cb1f5f460f14", "metadata": {}, "source": [ "# This file loads different calibration datasets, and saves them as pickles, which are then provided in Thermobar" ] }, { "cell_type": "code", "execution_count": 1, "id": "478013b5-0dfb-4a5c-85c7-811e56cb79f4", "metadata": {}, "outputs": [], "source": [ "import Thermobar as pt\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from pickle import dump\n", "import pickle" ] }, { "cell_type": "markdown", "id": "10f4131a-70a5-47e2-af90-d63c9f2235fd", "metadata": {}, "source": [ "## Shea liquids" ] }, { "cell_type": "code", "execution_count": 2, "id": "dc923f02-e0e6-4cea-87ee-edd82e426b2f", "metadata": {}, "outputs": [], "source": [ "Shea2022_Cali_out=pt.import_excel('Calibration_Datasets.xlsx',\n", " sheet_name='Shea_2022')\n", "Shea2022_Cali_Ol=Shea2022_Cali_out['Ols']\n", "Shea2022_Cali_Liqs=Shea2022_Cali_out['Liqs']\n", "Shea2022_Cali_input=Shea2022_Cali_out['my_input']\n", "\n", "from pickle import dump\n", "import pickle\n", "Shea2022_Cali_input.to_pickle(\"Shea2022_Cali_input.pkl\")" ] }, { "cell_type": "markdown", "id": "1f80e22c-f366-47e2-b635-e4a2a80a575f", "metadata": {}, "source": [ "## Amphiboles" ] }, { "cell_type": "code", "execution_count": 4, "id": "5d4954c4-8e53-49e3-bb4e-f1cd06a0d252", "metadata": {}, "outputs": [], "source": [ "Ridolfi_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Ridolfi21_Cali')\n", "Ridolfi_Cali_Amp=Ridolfi_Cali_out['Amps']\n", "Ridolfi_Cali_input=Ridolfi_Cali_out['my_input']\n", "sites=pt.calculate_sites_ridolfi(amp_comps=Ridolfi_Cali_Amp)\n", "Combo=pd.concat([Ridolfi_Cali_input, sites], axis=1)\n", "\n", "\n", "Combo.to_pickle(\"Ridolfi_Cali_input.pkl\")\n", "Ridolfi_Cali_Amp.to_pickle(\"Ridolfi_Cali_Amp.pkl\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "56e29ccc-fa83-4bf0-ade0-2b60dc2ac12b", "metadata": {}, "outputs": [], "source": [ "Mutch_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Mutch2016_Amp')\n", "Mutch_Cali_Amp=Mutch_Cali_out['Amps']\n", "Mutch_Cali_input=Mutch_Cali_out['my_input']\n", "sites=pt.calculate_sites_ridolfi(amp_comps=Mutch_Cali_Amp)\n", "Combo=pd.concat([Mutch_Cali_input, sites], axis=1)\n", "\n", "\n", "\n", "Combo.to_pickle(\"Mutch_Cali_input.pkl\")\n", "Mutch_Cali_Amp.to_pickle(\"Mutch_Cali_Amp.pkl\")" ] }, { "cell_type": "code", "execution_count": 12, "id": "595d74a0-8fe8-459a-b9b5-291d591c9253", "metadata": {}, "outputs": [], "source": [ "Putirka16_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Putirka16_Cali')\n", "Putirka16_Cali_Amp=Putirka16_Cali_out['Amps']\n", "Putirka16_Cali_input=Putirka16_Cali_out['my_input']\n", "sites=pt.calculate_sites_ridolfi(amp_comps=Putirka16_Cali_Amp)\n", "Combo=pd.concat([Putirka16_Cali_input, sites], axis=1)\n", "\n", "Combo.to_pickle(\"Putirka16_Cali_input.pkl\")\n", "Putirka16_Cali_Amp.to_pickle(\"Putirka16_Cali_Amp.pkl\")" ] }, { "cell_type": "code", "execution_count": 2, "id": "82545f59-9de9-4612-99c1-ea8377c347be", "metadata": {}, "outputs": [], "source": [ "Zhang17_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Zhang2017_Cali')\n", "Zhang17_Cali_Amp=Zhang17_Cali_out['Amps']\n", "Zhang17_Cali_input=Zhang17_Cali_out['my_input']\n", "sites=pt.calculate_sites_ridolfi(amp_comps=Zhang17_Cali_Amp)\n", "Combo=pd.concat([Zhang17_Cali_input, sites], axis=1)\n", "\n", "Combo.to_pickle(\"Zhang17_Cali_input.pkl\")\n", "Zhang17_Cali_Amp.to_pickle(\"Zhang17_Cali_Amp.pkl\")" ] }, { "cell_type": "markdown", "id": "d96375a2-3b14-4be9-9cfa-eb9a6f95461f", "metadata": {}, "source": [ "## Cpx" ] }, { "cell_type": "code", "execution_count": 10, "id": "d3d228a3-b17c-4e07-9cc6-6e908f0406ed", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\penny\\anaconda3\\lib\\site-packages\\pandas\\core\\arraylike.py:364: RuntimeWarning: divide by zero encountered in log\n", " result = getattr(ufunc, method)(*inputs, **kwargs)\n" ] } ], "source": [ "Jorgenson2022_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Jorgenson2022_Cali')\n", "Jorgenson2022_Cali_Cpx=Jorgenson2022_Cali_out['Cpxs']\n", "Jorgenson2022_Cali_Liqs=Jorgenson2022_Cali_out['Liqs']\n", "Jorgenson2022_Cali_input=Jorgenson2022_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Jorgenson2022_Cali_Cpx, liq_comps=Jorgenson2022_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Jorgenson2022_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Jorgenson2022_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Jorgenson2022_Cali_input.pkl\")\n", "Jorgenson2022_Cali_Cpx.to_pickle(\"Jorgenson2022_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "666204b2-1b83-400c-909c-1a345c762cd4", "metadata": {}, "outputs": [], "source": [ "NeavePutirka_2017_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='NeavePutirka_2017_Cali')\n", "NeavePutirka_2017_Cali_Cpx=NeavePutirka_2017_Cali_out['Cpxs']\n", "NeavePutirka_2017_Cali_Liqs=NeavePutirka_2017_Cali_out['Liqs']\n", "NeavePutirka_2017_Cali_input=NeavePutirka_2017_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=NeavePutirka_2017_Cali_Cpx, liq_comps=NeavePutirka_2017_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=NeavePutirka_2017_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=NeavePutirka_2017_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"NeavePutirka_2017_Cali_input.pkl\")\n", "NeavePutirka_2017_Cali_Cpx.to_pickle(\"NeavePutirka_2017_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "fd1761a5-7c4e-4cef-88ce-f0d110dfaeec", "metadata": {}, "outputs": [], "source": [ "Masotta_2013_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Masotta_2013_Cali_Cpx')\n", "Masotta_2013_Cali_Cpx=Masotta_2013_Cali_out['Cpxs']\n", "Masotta_2013_Cali_Liqs=Masotta_2013_Cali_out['Liqs']\n", "Masotta_2013_Cali_input=Masotta_2013_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Masotta_2013_Cali_Cpx, liq_comps=Masotta_2013_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Masotta_2013_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Masotta_2013_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Masotta_2013_Cali_input.pkl\")\n", "Masotta_2013_Cali_Cpx.to_pickle(\"Masotta_2013_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 7, "id": "0c325828-9af0-4f50-9e11-01876ca97627", "metadata": {}, "outputs": [], "source": [ "Wang21_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Wang21_Cali_Cpx')\n", "Wang21_Cali_Cpx=Wang21_Cali_out['Cpxs']\n", "Wang21_Cali_Liqs=Wang21_Cali_out['Liqs']\n", "Wang21_Cali_input=Wang21_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Wang21_Cali_Cpx, liq_comps=Wang21_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Wang21_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Wang21_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Wang21_Cali_input.pkl\")\n", "Wang21_Cali_Cpx.to_pickle(\"Wang21_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 14, "id": "e741b419-1848-46bf-b47c-7385970dcc51", "metadata": {}, "outputs": [], "source": [ "Brugman_2019_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Brugman19_Cali')\n", "Brugman_2019_Cali_Cpx=Brugman_2019_Cali_out['Cpxs']\n", "Brugman_2019_Cali_Liqs=Brugman_2019_Cali_out['Liqs']\n", "Brugman_2019_Cali_input=Brugman_2019_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Brugman_2019_Cali_Cpx, liq_comps=Brugman_2019_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Brugman_2019_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Brugman_2019_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Brugman_2019_Cali_input.pkl\")\n", "Brugman_2019_Cali_Cpx.to_pickle(\"Brugman_2019_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 13, "id": "089c3b0f-eee4-4cef-b84b-729856ded371", "metadata": {}, "outputs": [], "source": [ "Petrelli20_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Petrelli20_Cali')\n", "Petrelli20_Cali_Cpx=Petrelli20_Cali_out['Cpxs']\n", "Petrelli20_Cali_Liqs=Petrelli20_Cali_out['Liqs']\n", "Petrelli20_Cali_input=Petrelli20_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Petrelli20_Cali_Cpx, liq_comps=Petrelli20_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Petrelli20_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Petrelli20_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Petrelli20_Cali_input.pkl\")\n", "Petrelli20_Cali_Cpx.to_pickle(\"Petrelli20_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 17, "id": "f1c526c2-f885-4127-9932-39ab1bf1d891", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\penny\\anaconda3\\lib\\site-packages\\pandas\\core\\arraylike.py:364: RuntimeWarning: divide by zero encountered in log\n", " result = getattr(ufunc, method)(*inputs, **kwargs)\n" ] } ], "source": [ "Putirka2008_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Putirka2008_CpxLiq')\n", "Putirka2008_Cali_Cpx=Putirka2008_Cali_out['Cpxs']\n", "Putirka2008_Cali_Liqs=Putirka2008_Cali_out['Liqs']\n", "Putirka2008_Cali_input=Putirka2008_Cali_out['my_input']\n", "\n", "# Calculating Cpx components to also save. \n", "cpx_comps_Pet=pt.calculate_clinopyroxene_liquid_components(cpx_comps=Putirka2008_Cali_Cpx, liq_comps=Putirka2008_Cali_Liqs)\n", "cpx_comps_Pet['P_kbar']=Putirka2008_Cali_input['P_kbar']\n", "cpx_comps_Pet['T_K']=Putirka2008_Cali_input['T_K']\n", "\n", "from pickle import dump\n", "import pickle\n", "cpx_comps_Pet.to_pickle(\"Putirka2008_Cali_input.pkl\")\n", "Putirka2008_Cali_Cpx.to_pickle(\"Putirka2008_Cali_Cpx.pkl\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "aac2063c-5339-4088-93a7-4f8f3dc32dc6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "e2e02c45-19c8-4b73-8310-3a288b33e5e4", "metadata": {}, "source": [ "## Plagioclase" ] }, { "cell_type": "code", "execution_count": 7, "id": "535116b8-d532-4560-8ff7-3ca7d17c532e", "metadata": {}, "outputs": [], "source": [ "Waters_Lange2015_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Waters_Lange2015_Cali')\n", "Waters_Lange2015_Cali_Amp=Waters_Lange2015_Cali_out['Plags']\n", "Waters_Lange2015_Cali_input=Waters_Lange2015_Cali_out['my_input']\n", "\n", "from pickle import dump\n", "import pickle\n", "Waters_Lange2015_Cali_input.to_pickle(\"Waters_Lange2015_Cali_input.pkl\")\n", "Waters_Lange2015_Cali_Amp.to_pickle(\"Waters_Lange2015_Cali_Amp.pkl\")" ] }, { "cell_type": "code", "execution_count": 20, "id": "23fc9718-45c9-4b32-863d-cf0333de9c06", "metadata": {}, "outputs": [], "source": [ "Masotta2019_Cali_out=pt.import_excel('Calibration_Datasets.xlsx', sheet_name='Masotta2019_PlagLiq_Cali')\n", "Masotta2019_Cali_Amp=Masotta2019_Cali_out['Plags']\n", "Masotta2019_Cali_input=Masotta2019_Cali_out['my_input']\n", "\n", "from pickle import dump\n", "import pickle\n", "Masotta2019_Cali_input.to_pickle(\"Masotta2019_Cali_input.pkl\")\n", "Masotta2019_Cali_Amp.to_pickle(\"Masotta2019_Cali_Amp.pkl\")" ] }, { "cell_type": "code", "execution_count": null, "id": "dc9399d3-4728-497d-afae-843d558b2bec", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }