Skip to content

Commit

Permalink
update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoalopez committed May 30, 2024
1 parent b81adee commit 6caf7a0
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 118 deletions.
76 changes: 43 additions & 33 deletions grain_size_tools/grain_size_analysis_template.ipynb

Large diffs are not rendered by default.

151 changes: 91 additions & 60 deletions grain_size_tools/paleopizometry_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,70 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "957dcb9f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"module averages imported\n"
]
}
],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import averages"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "013a329a-5942-42e9-9131-ea82de57766d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"module plot imported\n",
"module averages imported\n",
"module stereology imported\n",
"module piezometers imported\n",
"module template imported\n",
"\n",
"======================================================================================\n",
"Welcome to GrainSizeTools script\n",
"======================================================================================\n",
"A free open-source cross-platform script to visualize and characterize grain size\n",
"population and estimate differential stress via paleopizometers.\n",
"===================================================\n",
"Welcome to the GrainSizetool piezometers module\n",
"===================================================\n",
"Piezometric database v2024.05.21 loaded.\n",
"To get the pizometric properties use:\n",
">>> piezometers.<mineral>.<piezometer>\n",
"\n",
"Version: 2024.03.RC\n",
"Documentation: https://github.com/marcoalopez/GrainSizeTools/wiki\n",
"\n",
"Type get.functions_list() to get a list of the main methods\n",
"\n"
"Available piezometric relationships:\n",
"quartz:\n",
" Stipp_Tullis\n",
" Stipp_Tullis_BLG\n",
" Holyoke\n",
" Holyoke_BLG\n",
" Cross\n",
" Cross_HR\n",
" Shimizu\n",
" Twiss\n",
"olivine:\n",
" VanderWal_wet\n",
" Jung_Karato\n",
"calcite:\n",
" Rutter_SGR\n",
" Rutter_GBM\n",
" Barnhoorn\n",
" Platt_Bresser\n",
" Valcke\n",
"feldspar:\n",
" Post_Tullis_BLG\n",
"===================================================\n"
]
}
],
"source": [
"# Load the script. Ensure the notebook is in the same folder as the\n",
"# GrainSizeTools.py file, if not specify the full path to the file.\n",
"# e.g. %run filepath...\\GrainSizeTools_script.py\n",
"%run C:/Users/marco/Documents/GitHub/GrainSizeTools/grain_size_tools/GrainSizeTools_script.py"
"%run piezometers2.py"
]
},
{
Expand All @@ -58,16 +90,14 @@
"source": [
"GrainSizeTools script includes a function for estimating differential stress based on \"average\" recrystallized grain sizes named ``calc_diffstress()``. This function requires\n",
"\n",
"- defining the mineral phase and the piezometer relation to use,\n",
"\n",
"- entering the (apparent) grain size as the **equivalent circular diameter in microns**,\n",
"- measured with a specific type of \"average\" with **no stereological correction**,\n",
"- defining the mpiezometric relation to use\n",
"- entering the (apparent) grain size as the **equivalent circular diameter in microns**, measured with a specific type of \"average\" with **no stereological correction**,\n",
"- and set the type of stress, either uniaxial compression/extension or plane stress, for proper stress correction."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "76712a37",
"metadata": {},
"outputs": [],
Expand All @@ -86,53 +116,54 @@
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6e6ea4eb",
"execution_count": 4,
"id": "3a20ec96",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Available piezometers:\n",
"'Cross'\n",
"'Cross_hr'\n",
"'Holyoke'\n",
"'Holyoke_BLG'\n",
"'Shimizu'\n",
"'Stipp_Tullis'\n",
"'Stipp_Tullis_BLG'\n",
"'Twiss'\n"
"year: 1993\n",
"reference: https://doi.org/10.1029/93GL01382\n",
"B: 1355.4\n",
"m: 0.75\n",
"warn: Ensure that you entered the apparent grain size as the arithmetic mean in linear scale\n",
"linear_intercepts: True\n",
"correction_factor: 1.5\n",
"notes: The Van der Wal (1993) piezometer was calibrated using the linear intercept (LI) grain size\n",
"multiplied by 1.5 (correction factor). ECDs without stereological correction will be converted\n",
"to LIs using the empirical equation of De Hoff and Rhines (1968) LI = (1.5 / sqrt(4/pi)) * ECD\n",
"\n"
]
}
],
"source": [
"# get information on available piezometric relations\n",
"piezometers.quartz()"
"# display the properties of the piezometric relation to use\n",
"summary(piezometers.olivine.VanderWal_wet)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "c2466fa2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"============================================================================\n",
"differential stress = 83.65 MPa\n",
"Calculated differential stress = 31.06 MPa\n",
"\n",
"INFO:\n",
"Ensure that you entered the apparent grain size as the arithmetic mean grain size\n",
"ECD was converted to linear intercepts using de Hoff and Rhines (1968) correction\n",
"============================================================================\n"
"Ensure that you entered the apparent grain size as the arithmetic mean in linear scale\n",
"Diameters were converted to linear intercepts using de Hoff and Rhines (1968) correction.\n",
"Differential stress corrected for plane stress using Paterson and Olgaard (2000)\n"
]
}
],
"source": [
"calc_diffstress(grain_size=12, phase='quartz', piezometer='Twiss')"
"calc_diffstress(piezometers.olivine.VanderWal_wet, grain_size=140, correction=True)"
]
},
{
Expand All @@ -142,48 +173,48 @@
"tags": []
},
"source": [
"## Differential stress estimation from various grain size averages"
"### Using an array of grain sizes grain size averages"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "8427ed68",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"============================================================================\n",
"Differential stresses in MPa\n",
"\n",
"INFO:\n",
"Ensure that you entered the apparent grain size as the arithmetic mean in linear scale\n",
"ECD was converted to linear intercepts using de Hoff and Rhines (1968) correction\n",
"Differential stresses in MPa\n"
"Diameters were converted to linear intercepts using de Hoff and Rhines (1968) correction.\n"
]
}
],
"source": [
"# store a set of average grain size values\n",
"ameans = np.array([12.23, 13.71, 12.76, 11.73, 12.69, 10.67])\n",
"# define a set of average grain size values\n",
"ameans = np.array([112.23, 113.71, 112.76, 111.73, 112.69, 110.67])\n",
"\n",
"# estimate the differential stress and store the results\n",
"estimates = calc_diffstress(ameans, phase='olivine', piezometer='VanderWal_wet', correction=True)"
"estimates = calc_diffstress(piezometers.olivine.VanderWal_wet, grain_size=ameans)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "46fe8ecd",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([193.3 , 177.43, 187.25, 199.45, 188.02, 214.13])"
"array([31.75, 31.44, 31.64, 31.86, 31.65, 32.09])"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -203,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "045f32ec",
"metadata": {},
"outputs": [
Expand All @@ -212,28 +243,28 @@
"output_type": "stream",
"text": [
" \n",
"Mean = 193.26 ± 13.17\n",
"Mean = 31.74 ± 0.23\n",
"Confidence set at 95.0 %\n",
"Max / min = 206.44 / 180.09\n",
"Coefficient of variation = ±6.8 %\n"
"Max / min = 31.97 / 31.51\n",
"Coefficient of variation = ±0.7 %\n"
]
}
],
"source": [
"_ = conf_interval(estimates)"
"_ = averages.conf_interval(estimates)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"id": "e5f174dc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Notebook last run in 2024-05-20 using:\n",
"Notebook last run in 2024-05-30 using:\n",
"Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)]\n"
]
}
Expand Down
Loading

0 comments on commit 6caf7a0

Please sign in to comment.