# OpticalTool4mass2absorptionBrC

## Getting Started

**OpticalTool4mass2absorptionBrC** is a tool designed to calculate optical parameters for aerosols. It is based on the work of @Vincenzo Obiso. Currently, this tool computes the following parameters:

- **Absorption coefficient**
- **Aerosol Optical Depth (AOD)**
- **Total absorption (AAOD)**

## Files Description

### `physics.py`
This script defines aerosol properties, including:
- **Geometric radius**
- **Density**
- **Real and imaginary refractive index**
- **Relative humidity**

### `aerosol_optics.py`
This script handles the optical calculations of aerosols. The output is a dictionary containing:
- `qext`: Extinction efficiency (unitless)
- `qsca`: Scattering efficiency (unitless)
- `asym`: Asymmetry factor (unitless)
- `dens`: Mass density (dry species) [g/cm³]
- `reff`: Effective radius (wet species) [µm]
- `vphi`: Wet-to-dry volume ratio (unitless)

### `aerosol_absorption_calc.py`
This script defines functions to compute:
- **AAOD (Absorption Aerosol Optical Depth)**
- **Absorption coefficient**
- **AOD (Aerosol Optical Depth)** for various aerosols

### `absorption_brc_by_layer.py`
This script defines functions to process BrC mass model data, as well as other aerosol mass data, to compute:
- **Absorption coefficient**
- **Total absorption by layer**

## Usage

To use this tool, you need the following:
- **Relative humidity (RH)** in percentage (%)
- **Layer thickness** in meters (m)
- **Aerosol concentrations** in micrograms per cubic meter (µg/m³), provided in a dataframe for each layer (e.g., `layer_1`, `layer_2`, ...)

### Calculating Total Absorption by Layer for BrC (Single Component)
```python
from src.absorption_brc_by_layer import calculate_total_absorption_by_layer

absorption_results = calculate_total_absorption_by_layer(
    rh, layer_thickness, brc_conc, layers, wavelenght=wavelenght, ri_brc=ri_brc
)
```
- `wavelenght` should be specified in nanometers (nm).

### Calculating Total Absorption for BC or Other Aerosols
```python
from src.absorption_brc_by_layer import aerosol_total_abs

absorption_results = aerosol_total_abs(
    rh, layer_thickness, aero_conc, layers, aero_name=aero_name, wavelenght=440
)
```

## Notes
- Ensure all input values are correctly formatted and units are consistent.
- The tool supports various aerosol types by specifying the `aero_name` parameter.

## License
This project is open-source and available for use and modification under the appropriate licensing terms.

## Acknowledgments
Special thanks to @Vincenzo Obiso for foundational work on aerosol optical calculations.