Diamond NAgg Map
Calculates nitrogen concentration and aggregation state across FTIR maps of diamond plates. Each spectrum in the map gets a baseline correction, a thickness normalization and a least-squares fit to reference spectra, and the results are saved as maps.
How it works
- Reads a Thermo Fisher Nicolet OMNIC
.mapfile with FTIR_OMNIC_MAP_Reader into an xarray dataset. - Removes the baseline of each spectrum with asymmetric least squares (pybaselines).
- Normalizes each spectrum for thickness by comparing it with a type IIa reference spectrum over 1800-2313 and 2390-2670 cm-1.
- Fits the nitrogen region (up to 1400 cm-1) with a bounded least-squares combination of the C, A, X, B and D center reference spectra plus a constant and a linear term. The reference spectra come from the QUIDDIT program.
- Converts the A and B fits to ppm (factors 16.5 and 79.4) and calculates total nitrogen and %B for every point.
- Saves maps of A ppm, B ppm, %B, total N, C and D as PNG and TIFF, plus example plots of the baseline, type IIa and nitrogen fits on a grid of points across the map.
Install and run
Requires Python 3.13 or later.
uv tool install diamond-nagg-map
diamond-nagg-map path/to/sample.map --output Results
pip install diamond-nagg-map also works. Versions before 0.9.0 have a broken diamond-nagg-map command. To install the latest code from GitHub instead, use uv tool install git+https://github.com/whtowbin/Diamond_NAgg_Map.
Options:
--output: folder for the maps and plots (defaultResults).--lam,--p: baseline parameters passed topybaselines.whittaker.asls(defaults 2e7 and 1e-6).--n_examples: grid of points to plot example fits for, eitherNfor an N x N grid orNX NY(default 5). Each point produces three plots.
From Python:
from diamond_nagg_map.DiamondNAggMap import process_map
process_map("sample.map", "Results", baseline_lam=1e7, baseline_p=1e-5, n_examples=(3, 3))
Limitations
- Reads only OMNIC
.mapfiles from Nicolet FTIR microscopes. - Fits type IaA/B diamonds. Type Ib support is not finished.
- Single-spectrum processing lives in diamond-ftir-package.
License
MIT. See LICENSE.
Metadata
Release files for diamond-NAgg-map 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| diamond_nagg_map-0.9.0.tar.gz | 746.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| diamond_nagg_map-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.5 MB
Release files / diamond_nagg_map-0.9.0.tar.gz
| Download URL | diamond_nagg_map-0.9.0.tar.gz |
|---|---|
| Size | 746.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18904b721487a7f809649c16bf5c6f090b7a0080423bb8abf6b095db7ba629cb
|
|
BLAKE2b-256 checksum How to use checksums |
6b302ea1368e7cf8e80f6d49ef63b8ee25c0e29be393d3e0f7786a6b21948837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / diamond_nagg_map-0.9.0-py3-none-any.whl
| Download URL | diamond_nagg_map-0.9.0-py3-none-any.whl |
|---|---|
| Size | 711.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f19baf1e16566fe0cccfb697b5c39bc49bd8fbd9fe7408c75f92a0044cb6ad4
|
|
BLAKE2b-256 checksum How to use checksums |
f1d2a7b86d312d7972d99cee3b0097b38e987aa30ef03f47edc0579ee77867b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|