Metadata-Version: 2.1
Name: particleShield
Version: 0.0.4
Summary: Package for radiation shielding modelling.
Author-email: Pragan Yadav <ypragyan01@gmail.com>
Project-URL: Homepage, https://github.com/ypragyan/ParticleShield
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Healthcare Industry
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENCE.txt

# particleShield

particleShield is a Python library designed to facilitate radiation shielding calculations. It provides a set of functions and utilities to determine the amount of radiation absorbed by different shielding materials for different types of radiation.

## Features

This Python code provides a set of functions to perform various calculations related to radiation physics, including:

- Half-value layer (HVL) calculation
- Buildup factor calculation
- Dose rate calculation
- Radiation attenuation calculation
- Bethe-Bloch equation for energy loss
- Bragg curve generation

## Requirements

- Python 3.7
- NumPy
- Matplotlib

## Installation

1. Make sure you have Python 3.7 installed on your system.

2. Install the required dependencies by running the following command:

   ```shell
   pip numpy as np, matplotlib.pyplot as plt
   ```
   
3. Download the particleShield library and import it in your project.


## Usage

The package can then be imported using:

```python
import particleShield
```
### Ionizing Radiation
particleShield provides multiple functions for calculation of radiation protection and dosimetry for different types of ionizing radiation.

```python
#Calculate the half-value layer
hvl = particleShield.calculate_hvl(initial_intensity, attenuation_factor)

#Calculate the buildup factor
buildup_factor = particleShield.calculate_buildup_factor(penetration_depth, attenuation_factor)

#Calculate the dose rate
dose_rate = particleShield.calculate_dose_rate(intensity, conversion_factor, time, distance)

#Calculate radiation attenuation
attenuated_intensity = particleShield.calculate_attenuation(I0, mu, x)
```
### Beth-Bloch equation
The Bethe-Bloch equation is used to calculate the energy loss of charged particles (e.g., electrons, protons, alpha particles) as they pass through a material. It describes how these particles lose energy through ionization and excitation of atoms in the material.


```python
#Calculate energy loss using the Bethe-Bloch equation for Protons in Air
kinetic_energy = 100  # MeV
charge = 1  # Elementary charge units
atomic_mass = 28.09  # g/mol
atomic_number = 14
ionization_potential = 78  # eV

energy_loss = bethe_bloch(kinetic_energy, charge, atomic_mass, atomic_number, ionization_potential)
print("Energy Loss:", energy_loss, "MeV/cm")
```
Output: Energy Loss: -4.297 MeV/cm

### Bragg Curve
The Bragg curve is a graphical representation that illustrates how the energy deposition of charged particles varies with depth as they traverse a material.

```python
#Generate the Bragg curve for protons in air
alpha = 0.1666  # MeV/(g/cm^2)
p = 1.76        # g/cm^2
shallowest_depth = 10.0  # cm
deepest_depth = 15.0     # cm

generate_bragg_curve(alpha, p, shallowest_depth, deepest_depth)

```
Bragg curve for protons in air:

![](https://github.com/ypragyan/ParticleShield/blob/main/bragcurve.png)
