Skip to main content

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

  1. Reads a Thermo Fisher Nicolet OMNIC .map file with FTIR_OMNIC_MAP_Reader into an xarray dataset.
  2. Removes the baseline of each spectrum with asymmetric least squares (pybaselines).
  3. Normalizes each spectrum for thickness by comparing it with a type IIa reference spectrum over 1800-2313 and 2390-2670 cm-1.
  4. 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.
  5. Converts the A and B fits to ppm (factors 16.5 and 79.4) and calculates total nitrogen and %B for every point.
  6. 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 (default Results).
  • --lam, --p: baseline parameters passed to pybaselines.whittaker.asls (defaults 2e7 and 1e-6).
  • --n_examples: grid of points to plot example fits for, either N for an N x N grid or NX 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 .map files 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)

Source distribution for diamond-NAgg-map 0.9.0
File Size Uploaded
diamond_nagg_map-0.9.0.tar.gz 746.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diamond-NAgg-map 0.9.0
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page