Skip to content

Commit

Permalink
Create paleopizometry_template.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoalopez committed May 17, 2024
1 parent e748b14 commit a3da2ef
Showing 1 changed file with 245 additions and 0 deletions.
245 changes: 245 additions & 0 deletions grain_size_tools/paleopizometry_template.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "4ff7a692-9472-4360-a326-897003bec04f",
"metadata": {},
"source": [
"# Paleopiezometry analysis template\n",
"\n",
"> **INFO** \n",
"> This is the template for the paleopiezometry module. The specific documentation can be found at the following link: \n",
"> https://github.com/marcoalopez/GrainSizeTools/wiki/4.-Using-the-paleopiezometry-module \n",
">\n",
"> The template shows typical examples of paleopizometrys and different strategies for presenting them. Modify, delete and add as necessary to create your own analysis procedure."
]
},
{
"cell_type": "code",
"execution_count": 1,
"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",
"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"
]
}
],
"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"
]
},
{
"cell_type": "markdown",
"id": "16144a01",
"metadata": {},
"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",
"- and set the type of stress, either uniaxial compression/extension or plane stress, for proper stress correction."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "76712a37",
"metadata": {},
"outputs": [],
"source": [
"# uncomment line below to get help on how to use calc_diffstress\n",
"#calc_diffstress?"
]
},
{
"cell_type": "markdown",
"id": "e60e3a8c-0e26-4d0e-a3c6-0feb72ff7ffc",
"metadata": {},
"source": [
"## Estimate a differential stress"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6e6ea4eb",
"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"
]
}
],
"source": [
"# get information on available piezometric relations\n",
"piezometers.quartz()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "c2466fa2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"============================================================================\n",
"differential stress = 83.65 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"
]
}
],
"source": [
"calc_diffstress(grain_size=12, phase='quartz', piezometer='Twiss')"
]
},
{
"cell_type": "markdown",
"id": "35d51867-30b3-4ad4-a2b6-b31972344922",
"metadata": {
"tags": []
},
"source": [
"## Estimation of differential stress using arrays of values\n",
"\n",
"TODO"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "8427ed68",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"============================================================================\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"
]
}
],
"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",
"\n",
"# estimate the differential stress and store the results\n",
"estimates = calc_diffstress(ameans, phase='olivine', piezometer='VanderWal_wet', correction=True)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "46fe8ecd",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([193.3 , 177.43, 187.25, 199.45, 188.02, 214.13])"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# display the results\n",
"estimates"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e5f174dc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Notebook last run in 2024-05-17 using:\n",
"Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)]\n"
]
}
],
"source": [
"# annotate the date you executed the notebook and the Python version \n",
"import sys\n",
"from datetime import date \n",
"today = date.today().isoformat()\n",
"\n",
"print(f'Notebook last run in {today} using:')\n",
"print('Python', sys.version)"
]
}
],
"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.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit a3da2ef

Please sign in to comment.