Skip to content

Commit

Permalink
Correct inversion example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed Jul 11, 2024
1 parent 091a942 commit bed2fb4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
Binary file modified docs/examples/inversion/AllEpsilonRegress.pdf
Binary file not shown.
Binary file modified docs/examples/inversion/EpsilonRegression.xlsx
Binary file not shown.
33 changes: 22 additions & 11 deletions docs/examples/inversion/PyIRoGlass_Inversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,23 @@
"\n",
"mest_5200, covm_est_5200, covepsilon_5200 = pig.inversion(tau_5200, epsilon_5200, sigma_tau_5200, sigma_epsilon_5200, intercept_zero=False)\n",
"mls_5200, covls_5200 = pig.least_squares(tau_5200, epsilon_5200, sigma_epsilon_5200)\n",
"E_calib_5200, see_5200, r2_5200, rmse_5200, rrmse_5200, ccc_5200 = pig.inversion_fit_errors(tau_5200, epsilon_5200, mest_5200, covm_est_5200, covepsilon_5200)\n",
"E_calib_5200, see_5200, r2_5200, rmse_5200, rrmse_5200, ccc_5200 = pig.inversion_fit_errors(tau_5200, epsilon_5200, mest_5200, covepsilon_5200)\n",
"\n",
"mest_4500, covm_est_4500, covepsilon_4500 = pig.inversion(tau_4500, epsilon_4500, sigma_tau_4500, sigma_epsilon_4500, intercept_zero=False)\n",
"mls_4500, covls_4500 = pig.least_squares(tau_4500, sigma_tau_4500, sigma_epsilon_4500)\n",
"E_calib_4500, see_4500, r2_4500, rmse_4500, rrmse_4500, ccc_4500 = pig.inversion_fit_errors(tau_4500, epsilon_4500, mest_4500, covm_est_4500, covepsilon_4500)\n",
"E_calib_4500, see_4500, r2_4500, rmse_4500, rrmse_4500, ccc_4500 = pig.inversion_fit_errors(tau_4500, epsilon_4500, mest_4500, covepsilon_4500)\n",
"\n",
"mest_3550, covm_est_3550, covepsilon_3550 = pig.inversion(tau_3550, epsilon_3550, sigma_tau_3550, sigma_epsilon_3550, intercept_zero=False)\n",
"mls_3550, covls_3550 = pig.least_squares(tau_3550, epsilon_3550, sigma_epsilon_3550)\n",
"E_calib_3550, see_3550, r2_3550, rmse_3550, rrmse_3550, ccc_3550 = pig.inversion_fit_errors(tau_3550, epsilon_3550, mest_3550, covm_est_3550, covepsilon_3550)\n",
"E_calib_3550, see_3550, r2_3550, rmse_3550, rrmse_3550, ccc_3550 = pig.inversion_fit_errors(tau_3550, epsilon_3550, mest_3550, covepsilon_3550)\n",
"\n",
"mest_1635, covm_est_1635, covepsilon_1635 = pig.inversion(tau_1635, epsilon_1635, sigma_tau_1635, sigma_epsilon_1635, intercept_zero=False)\n",
"mls_1635, covls_1635 = pig.least_squares(tau_1635, epsilon_1635, sigma_tau_1635, sigma_epsilon_1635)\n",
"E_calib_1635, see_1635, r2_1635, rmse_1635, rrmse_1635, ccc_1635 = pig.inversion_fit_errors(tau_1635, epsilon_1635, mest_1635, covm_est_1635, covepsilon_1635)\n",
"mls_1635, covls_1635 = pig.least_squares(tau_1635, epsilon_1635, sigma_epsilon_1635)\n",
"E_calib_1635, see_1635, r2_1635, rmse_1635, rrmse_1635, ccc_1635 = pig.inversion_fit_errors(tau_1635, epsilon_1635, mest_1635, covepsilon_1635)\n",
"\n",
"mest_carbonate, covm_est_carbonate, covepsilon_carbonate = pig.inversion(eta, epsilon_carbonate, sigma_eta, sigma_epsilon_carbonate, intercept_zero=False)\n",
"mls_carbonate, covls_carbonate = pig.least_squares(eta, epsilon_carbonate, sigma_epsilon_carbonate)\n",
"E_calib_carbonate, see_carbonate, r2_carbonate, rmse_carbonate, rrmse_carbonate, ccc_carbonate = pig.inversion_fit_errors(eta, epsilon_carbonate, mls_carbonate, covls_carbonate, covepsilon_carbonate)\n"
"E_calib_carbonate, see_carbonate, r2_carbonate, rmse_carbonate, rrmse_carbonate, ccc_carbonate = pig.inversion_fit_errors(eta, epsilon_carbonate, mls_carbonate, covepsilon_carbonate)\n"
]
},
{
Expand Down Expand Up @@ -349,7 +349,7 @@
"ax[2].legend(loc = 'upper left', labelspacing = 0.4, handletextpad = 0.5, handlelength = 1.50, prop={'size': 12}, frameon=False)\n",
"ax[2].tick_params(axis=\"x\", direction='in', length=5, pad = 6.5)\n",
"ax[2].tick_params(axis=\"y\", direction='in', length=5, pad = 6.5)\n",
"\n",
"ax[2].scatter(tau_3550[epsilon_3550==63.027], epsilon_3550[epsilon_3550==63.027], s=sz, c='#0C7BDC', edgecolors='black', linewidth=2, zorder=15)\n",
"\n",
"epsilon_1635_mandeville = -57.813+131.94*tau_arr_1635\n",
"fuego_idx = np.where((tau_arr_1635 > 0.653) & (tau_arr_1635 < 0.715))\n",
Expand Down Expand Up @@ -380,12 +380,14 @@
"df_carbonate = pd.read_excel('./EpsilonRegression.xlsx', sheet_name='CarbonateRegress')\n",
"low_df = df_carbonate[df_carbonate.Epsilon_Location == 'Low']\n",
"high_df = df_carbonate[df_carbonate.Epsilon_Location == 'High']\n",
"shi_low = low_df[low_df.Compilation=='Shi']\n",
"shi_high = low_df[low_df.Compilation=='Shi']\n",
"\n",
"ax[4].errorbar(low_df['Na/Na+Ca'], low_df['Epsilon_Carbonate'], yerr = low_df['Epsilon_Carbonate']*0.1, xerr = low_df['Na/Na+Ca']*0.025, ls = 'none', elinewidth = 0.5, ecolor = 'k')\n",
"ax[4].scatter(low_df['Na/Na+Ca'], low_df['Epsilon_Carbonate'], s = sz, c = '#0C7BDC', edgecolors='black', linewidth = 0.5, zorder = 15, label = '$\\mathregular{CO_{3, 1430}^{2-}}$, N='+str(len(low_df)))\n",
"ax[4].errorbar(low_df['Eta'], low_df['Epsilon_Carbonate'], yerr = low_df['Epsilon_Carbonate']*0.1, xerr = low_df['Eta']*0.025, ls = 'none', elinewidth = 0.5, ecolor = 'k')\n",
"ax[4].scatter(low_df['Eta'], low_df['Epsilon_Carbonate'], s = sz, c = '#0C7BDC', edgecolors='black', linewidth = 0.5, zorder = 15, label = '$\\mathregular{CO_{3, 1430}^{2-}}$, N='+str(len(low_df)))\n",
"\n",
"ax[4].errorbar(high_df['Na/Na+Ca'], high_df['Epsilon_Carbonate'], yerr = high_df['Epsilon_Carbonate']*0.10, xerr = high_df['Na/Na+Ca']*0.025, ls = 'none', elinewidth = 0.5, ecolor = 'k')\n",
"ax[4].scatter(high_df['Na/Na+Ca'], high_df['Epsilon_Carbonate'], s = sz, c = '#E42211', marker = 's', edgecolors='black', linewidth = 0.5, zorder = 15, label = '$\\mathregular{CO_{3, 1515}^{2-}}$, N='+str(len(high_df)))\n",
"ax[4].errorbar(high_df['Eta'], high_df['Epsilon_Carbonate'], yerr = high_df['Epsilon_Carbonate']*0.10, xerr = high_df['Eta']*0.025, ls = 'none', elinewidth = 0.5, ecolor = 'k')\n",
"ax[4].scatter(high_df['Eta'], high_df['Epsilon_Carbonate'], s = sz, c = '#E42211', marker = 's', edgecolors='black', linewidth = 0.5, zorder = 15, label = '$\\mathregular{CO_{3, 1515}^{2-}}$, N='+str(len(high_df)))\n",
"\n",
"dixonpan, = ax[4].plot(eta_arr, epsilon_carbonate_dixonpan, 'k-.', lw = 1.5, zorder = 0, label = 'Dixon and Pan, 1995')\n",
"dixonpan.set_dashes([1.5, 1, 3, 1])\n",
Expand All @@ -404,6 +406,8 @@
"ax[4].legend(loc = 'lower left', labelspacing = 0.4, handletextpad = 0.5, handlelength = 1.50, prop={'size': 12}, frameon=False)\n",
"ax[4].tick_params(axis=\"x\", direction='in', length=5, pad = 6.5)\n",
"ax[4].tick_params(axis=\"y\", direction='in', length=5, pad = 6.5)\n",
"ax[4].scatter(shi_high['Eta'], shi_high['Epsilon_Carbonate'], s=sz, c='#E42211', marker = 's', edgecolors='black', linewidth=2, zorder=15)\n",
"ax[4].scatter(shi_low['Eta'], shi_low['Epsilon_Carbonate'], s=sz, c='#0C7BDC', edgecolors='black', linewidth=2, zorder=15)#\n",
"\n",
"fig.delaxes(ax[5])\n",
"\n",
Expand Down Expand Up @@ -458,6 +462,13 @@
"EPS_DF = pig.calculate_epsilon(chemistry, T_ROOM, P_ROOM)\n",
"EPS_DF"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit bed2fb4

Please sign in to comment.