Skip to content

Commit

Permalink
Merge pull request #16 from pheuer/prms_edits
Browse files Browse the repository at this point in the history
New features to support PRMs (new PR)
  • Loading branch information
pheuer authored Feb 19, 2025
2 parents 0cc91a8 + ebb182e commit bbd52fa
Show file tree
Hide file tree
Showing 16 changed files with 1,122 additions and 449 deletions.
14 changes: 7 additions & 7 deletions docs/source/notebooks/filtration_stacks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"from cr39py.core.units import u\n",
"from cr39py.filtration.srim import SRIMData\n",
"from cr39py.filtration.stack import Layer, Stack"
"from cr39py import Layer, Stack"
]
},
{
Expand All @@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 2,
"metadata": {
"tags": [
"nbsphinx-thumbnail"
Expand Down Expand Up @@ -105,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -133,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,7 +164,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -199,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down
3 changes: 2 additions & 1 deletion src/cr39py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from cr39py.filtration.stack import Layer, Stack
from cr39py.filtration.layer import Layer
from cr39py.filtration.stack import Stack
from cr39py.scan.base_scan import Scan
from cr39py.scan.cut import Cut
from cr39py.scan.subset import Subset
1 change: 1 addition & 0 deletions src/cr39py/etch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""The `~cr39py.etch` module contains functionality relating to the process of etching CR-39."""
41 changes: 41 additions & 0 deletions src/cr39py/etch/tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""The `~cr39py.etch.tools` module contains tools for calculating etch times."""

import numpy as np


def goal_diameter(fluence, desired_F2=0.05, max_goal=10):
"""Calculates the ideal track diameter in um to achieve a given overlap parameter F2.
Parameters
----------
fluence : float
The fluence on the CR-39 in 1/cm^2
desired_F2 : float, optional
The desired track overlap parameter F2. The default
value is 0.05, meaning that ~5% of tracks will suffer overlap with
a neighbor.
max_goal : float, optional
A maximum at which the goal track diameter will be clipped, in um.
Prevents extremely large goal diameters being suggested at low fluences.
Returns
-------
goal_diameter: float
The goal track diameter in um.
"""

def chi(F2):
"""
Zylstra Eq. 9 inverted to solve for chi given F2
Works up to F2=0.375, then the sqrt becomes imaginary.
"""
return 3 / 4 * (1 - np.sqrt(1 - 8 / 3 * F2))

if desired_F2 > 0.3:
raise ValueError(f"Model breaks down for F2~>0.3, provided F2={desired_F2}")

goal_chi = chi(desired_F2)
goal_d = np.sqrt(goal_chi / np.pi / (fluence * 1e-8))
return np.clip(goal_d, a_min=0, a_max=max_goal)
Loading

0 comments on commit bbd52fa

Please sign in to comment.