Metadata-Version: 2.1
Name: h3d-tool
Version: 1.0.2
Summary: Radiation spectrum loading, background subtraction, smoothing, and analysis tool
Author: H3D Project Team
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: pandas
Requires-Dist: openpyxl
Requires-Dist: sandiaspecutils

# H3D Spectrum Analysis Library

A Python library for loading radiation spectra (N42), performing background subtraction (1:1, channel-scaled, and area-scaled), applying smoothing filters, plotting results, and exporting data to Excel.


## CLI Usage

Once installed, you can launch the graphical interface directly from any terminal:

```bash
h3d --gui
# or
h3d-tool --gui
```

You can also run batch processing from the command line:

```bash
# Normalize at channel 62, apply filter, plot, and save to Excel:
h3d -bg background.n42 -m measurement.n42 -c 62 --filter --plot -o results.xlsx

# See all options:
h3d --help
```

## Python API Usage

```python
from h3d import H3D, launch_gui

# 1. Launch GUI programmatically:
# launch_gui()

# 2. Process data in Python / Jupyter notebook:
processor = H3D("background.n42", "measurement.n42")

# Normalization options:
# processor.scaleChannel(62)        # Normalize at reference channel
processor.scaleArea()               # Normalize by total spectrum area
# processor.scaleAreaRange(70, 90)  # Normalize area within a channel window
# processor.removeBackground()      # Direct 1:1 subtraction without scaling

# smoothing Filter:
processor.applyFilter(window_length=9, polyorder=2)

# Plot:
processor.plot(xlim=(70, 90))
```

## Requirements

- Python >= 3.8
- `numpy`
- `scipy`
- `matplotlib`
- `pandas`
- `openpyxl`
- `sandiaspecutils`
