Skip to main content

The Spectra Analyser for Hydrogenous samples, or SAH, provides comprehensive tools to analyse INS, FTIR and Raman spectra.

Project description

The Spectral Analysis for Hydrogenous samples (SAH) allows researchers to dive into INS, Raman and FTIR spectral data.

Named after the ancient egyptian god Sah, the personification of the constellation Orion and highly related with Osiris.

Check the full documentation online.

Index

classes Definition of the Spectra, Plotting and Material classes, instantiated as sah.Class()
fit Spectral fitting functions
normalize Spectra normalisation
deuterium Deuteration estimation functions
plot Spectra plotting, as sah.plot(Spectra)
samples Sample materials for testing

Examples

To load two INS spectra CSV files with cm$^{-1}$ as input units, and plot them in meV units, normalizing their heights over the range from 20 to 50 meV:

import sah
# Set plotting parameters
plotting_options = sah.Plotting(
    title     = 'Calculated INS',
    )
# Load the spectral data
ins = sah.Spectra(
    type     = 'INS',
    files    = ['example_1.csv', 'example_2.csv'],
    units_in = 'cm-1',
    units    = 'meV',
    plotting = plotting_options,
    )
# Normalize the spectra
sah.normalize.height(spectra=ins, range=[20, 50])
# Plot the spectra
sah.plot(ins)

More examples in the examples/ folder.


Contributing

If you are interested in opening an issue or a pull request, please feel free to do so on GitHub.
For major changes, please get in touch first to discuss the details.

Code style

Please try to follow some general guidelines:

  • Use a code style consistent with the rest of the project.
  • Include docstrings to document new additions.
  • Include automated tests for new features or modifications, see automated testing.
  • Arrange function arguments by order of relevance. Most implemented functions follow something similar to function(file, key/s, value/s, optional).

Automated testing

If you are modifying the source code, you should run the automated tests of the tests/ folder to check that everything works as intended. To do so, first install PyTest in your environment,

pip install pytest

And then run PyTest inside the base directory,

pytest -vv

Compiling the documentation

The documentation can be compiled automatically to docs/sah.html with Pdoc and ATON, by running:

python3 makedocs.py

This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the css/ folder.


License

Copyright (C) 2025 Pablo Gila-Herranz
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the attached GNU Affero General Public License for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sah-2.0.0a2.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sah-2.0.0a2-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file sah-2.0.0a2.tar.gz.

File metadata

  • Download URL: sah-2.0.0a2.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sah-2.0.0a2.tar.gz
Algorithm Hash digest
SHA256 61d28fff47b03a9d7b60eb330daf2ba365abc3f334f08412280994c8dfeefb10
MD5 52a4aedeb880762a7d7e30c499337fef
BLAKE2b-256 27d98a3e1d0d77eba9179b7825f27f9974a070f0daec59a30d4d9b6e04d30f7d

See more details on using hashes here.

File details

Details for the file sah-2.0.0a2-py3-none-any.whl.

File metadata

  • Download URL: sah-2.0.0a2-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sah-2.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 f200b98444b6e6dae278dcba96679b6a53abb68c9a510000dc130568b2591bc3
MD5 b2bd7bbc67b266ae5f03b5cbaff2af60
BLAKE2b-256 f427b4aa42b5109ed069234f8c31d1d032e19d6e5fbbc8a23b9c241778dd570c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page