Skip to content

Commit

Permalink
Fix notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
msorvoja committed Dec 19, 2024
1 parent d117ce4 commit ffa84e6
Showing 1 changed file with 12 additions and 33 deletions.
45 changes: 12 additions & 33 deletions notebooks/testing_logratio_transformations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -680,21 +680,6 @@
"## Testing with example data"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "f49926c2-f1dd-47e8-a484-f78ce6821904",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Define some constants\n",
"\n",
"ppm = 1e-6\n",
"million = 1e6"
]
},
{
"cell_type": "code",
"execution_count": 19,
Expand Down Expand Up @@ -822,7 +807,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 26,
"id": "75728aa4-5b2e-46b6-9511-1250bf4b13ae",
"metadata": {
"tags": []
Expand All @@ -838,21 +823,23 @@
"df_clr = df.copy()\n",
"df_plr = df.copy()\n",
"\n",
"# As real world geochemical data will often not satisfy sum to a constant, for example 100, a closure needs to be performed\n",
"# As real world geochemical data will often not satisfy sum to a constant, a closure needs to be performed by providing the \"scale\" parameter.\n",
"# In this example, as the example data are in ppm, let's define a scaling factor 1e6\n",
"million = 1e6\n",
"\n",
"df_alr = alr_transform(df_alr, closure_target=100)\n",
"df_alr_Mg = alr_transform(df_alr_Mg, denominator_column=\"Mg_ppm_511\", closure_target=100)\n",
"df_clr = clr_transform(df_clr, closure_target=100)\n",
"df_plr = plr_transform(df_plr, closure_target=100)\n",
"df_alr = alr_transform(df_alr, scale=million)\n",
"df_alr_Mg = alr_transform(df_alr_Mg, denominator_column=\"Mg_ppm_511\", scale=million)\n",
"df_clr = clr_transform(df_clr, scale=million)\n",
"df_plr = plr_transform(df_plr, scale=million)\n",
"\n",
"df_clr_inv = inverse_clr(df_clr, scale=million)\n",
"df_alr_inv = inverse_alr(df_alr, \"c\", scale=million)\n",
"\n",
"df_ilr_Al_Ca = df.copy()\n",
"df_ilr_AlCa_FeMg = df.copy()\n",
"\n",
"df_ilr_Al_Ca = single_ilr_transform(df_ilr_Al_Ca, [\"Al_ppm_511\"], [\"Ca_ppm_511\"], closure_target=100)\n",
"df_ilr_AlCa_FeMg = single_ilr_transform(df_ilr_AlCa_FeMg, [\"Al_ppm_511\", \"Ca_ppm_511\"], [\"Fe_ppm_511\", \"Mg_ppm_511\"], closure_target=100)"
"df_ilr_Al_Ca = single_ilr_transform(df_ilr_Al_Ca, [\"Al_ppm_511\"], [\"Ca_ppm_511\"], scale=million)\n",
"df_ilr_AlCa_FeMg = single_ilr_transform(df_ilr_AlCa_FeMg, [\"Al_ppm_511\", \"Ca_ppm_511\"], [\"Fe_ppm_511\", \"Mg_ppm_511\"], scale=million)"
]
},
{
Expand Down Expand Up @@ -969,19 +956,11 @@
"source": [
"df_alr_Mg.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8b6a1929-51ef-4b7a-8621-f46bbe337e31",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "eis-toolkit-l5cKD1lZ-py3.10",
"language": "python",
"name": "python3"
},
Expand All @@ -995,7 +974,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down

0 comments on commit ffa84e6

Please sign in to comment.