<p align="center"><img width="40.0%" src="pics/sah.png"></p>
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](https://pablogila.github.io/sah/).
# Index
| | |
| --- | --- |
| [classes](https://pablogila.github.io/sah/sah/classes.html) | Definition of the `Spectra`, `Plotting` and `Material` classes, instantiated as `sah.Class()` |
| [fit](https://pablogila.github.io/sah/sah/fit.html) | Spectral fitting functions |
| [normalize](https://pablogila.github.io/sah/sah/normalize.html) | Spectra normalisation |
| [deuterium](https://pablogila.github.io/sah/sah/deuterium.html) | Deuteration estimation functions |
| [plot](https://pablogila.github.io/sah/sah/plot.html) | Spectra plotting, as `sah.plot(Spectra)` |
| [samples](https://pablogila.github.io/sah/sah/samples.html) | 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:
```python
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/`](https://github.com/pablogila/sah/tree/main/examples) folder.
---
# Contributing
If you are interested in opening an issue or a pull request, please feel free to do so on [GitHub](https://github.com/pablogila/sah/).
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](#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/`](https://github.com/pablogila/sah/tree/main/tests) folder to check that everything works as intended.
To do so, first install PyTest in your environment,
```bash
pip install pytest
```
And then run PyTest inside the base directory,
```bash
pytest -vv
```
## Compiling the documentation
The documentation can be compiled automatically to `docs/sah.html` with [Pdoc](https://pdoc.dev/) and [ATON](https://pablogila.github.io/aton), by running:
```shell
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "sah",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "Neutron, Research, Science, Spectra, Inelastic Neutron Scattering, INS, Raman, FTIR, Infrared",
"author": "Pablo Gila-Herranz",
"author_email": "pgila001@ikasle.ehu.eus",
"download_url": "https://files.pythonhosted.org/packages/4a/94/a411c37f39b564dde0800bb0dabfd2210f370366a29f33f8b37e7702cf15/sah-2.0.0a3.tar.gz",
"platform": null,
"description": "<p align=\"center\"><img width=\"40.0%\" src=\"pics/sah.png\"></p>\n\n\nThe Spectral Analysis for Hydrogenous samples (SAH) allows researchers to dive into INS, Raman and FTIR spectral data.\n\nNamed after the ancient egyptian god Sah, the personification of the constellation Orion and highly related with Osiris.\n\nCheck the [full documentation online](https://pablogila.github.io/sah/).\n\n\n# Index\n\n| | | \n| --- | --- | \n| [classes](https://pablogila.github.io/sah/sah/classes.html) | Definition of the `Spectra`, `Plotting` and `Material` classes, instantiated as `sah.Class()` | \n| [fit](https://pablogila.github.io/sah/sah/fit.html) | Spectral fitting functions | \n| [normalize](https://pablogila.github.io/sah/sah/normalize.html) | Spectra normalisation | \n| [deuterium](https://pablogila.github.io/sah/sah/deuterium.html) | Deuteration estimation functions | \n| [plot](https://pablogila.github.io/sah/sah/plot.html) | Spectra plotting, as `sah.plot(Spectra)` | \n| [samples](https://pablogila.github.io/sah/sah/samples.html) | Sample materials for testing | \n\n\n# Examples\n\nTo load two INS spectra CSV files with cm$^{-1}$ as input units,\nand plot them in meV units, normalizing their heights over the range from 20 to 50 meV:\n```python\nimport sah\n# Set plotting parameters\nplotting_options = sah.Plotting(\n title = 'Calculated INS',\n )\n# Load the spectral data\nins = sah.Spectra(\n type = 'INS',\n files = ['example_1.csv', 'example_2.csv'],\n units_in = 'cm-1',\n units = 'meV',\n plotting = plotting_options,\n )\n# Normalize the spectra\nsah.normalize.height(spectra=ins, range=[20, 50])\n# Plot the spectra\nsah.plot(ins)\n```\n\nMore examples in the [`examples/`](https://github.com/pablogila/sah/tree/main/examples) folder.\n\n\n---\n\n\n# Contributing\n\nIf you are interested in opening an issue or a pull request, please feel free to do so on [GitHub](https://github.com/pablogila/sah/). \nFor major changes, please get in touch first to discuss the details. \n\n\n## Code style\n\nPlease try to follow some general guidelines: \n- Use a code style consistent with the rest of the project. \n- Include docstrings to document new additions. \n- Include automated tests for new features or modifications, see [automated testing](#automated-testing). \n- Arrange function arguments by order of relevance. Most implemented functions follow something similar to `function(file, key/s, value/s, optional)`. \n\n\n## Automated testing\n\nIf you are modifying the source code, you should run the automated tests of the [`tests/`](https://github.com/pablogila/sah/tree/main/tests) folder to check that everything works as intended.\nTo do so, first install PyTest in your environment,\n```bash\npip install pytest\n```\n\nAnd then run PyTest inside the base directory,\n```bash\npytest -vv\n```\n\n\n## Compiling the documentation\n\nThe documentation can be compiled automatically to `docs/sah.html` with [Pdoc](https://pdoc.dev/) and [ATON](https://pablogila.github.io/aton), by running:\n```shell\npython3 makedocs.py\n```\n\nThis runs Pdoc, updating links and pictures, and using the custom theme CSS template from the `css/` folder.\n\n\n---\n\n\n# License\n\nCopyright (C) 2025 Pablo Gila-Herranz \nThis program is free software: you can redistribute it and/or modify\nit under the terms of the **GNU Affero General Public License** as published\nby the Free Software Foundation, either version **3** of the License, or\n(at your option) any later version. \nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \nSee the attached GNU Affero General Public License for more details. \n\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "The Spectra Analyser for Hydrogenous samples, or SAH, provides comprehensive tools to analyse INS, FTIR and Raman spectra.",
"version": "2.0.0a3",
"project_urls": null,
"split_keywords": [
"neutron",
" research",
" science",
" spectra",
" inelastic neutron scattering",
" ins",
" raman",
" ftir",
" infrared"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "90fa741c66e7187fa193bef500c159e006c78f4c7f2b0919903aed9abfbdb918",
"md5": "0e807e41b38c43ead083a1e17c786393",
"sha256": "96bf8c0a9c0bf6c083db144e463104e57c59d8a985e2ae768a14417c3938f653"
},
"downloads": -1,
"filename": "sah-2.0.0a3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e807e41b38c43ead083a1e17c786393",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 32757,
"upload_time": "2025-08-02T11:34:16",
"upload_time_iso_8601": "2025-08-02T11:34:16.243612Z",
"url": "https://files.pythonhosted.org/packages/90/fa/741c66e7187fa193bef500c159e006c78f4c7f2b0919903aed9abfbdb918/sah-2.0.0a3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4a94a411c37f39b564dde0800bb0dabfd2210f370366a29f33f8b37e7702cf15",
"md5": "882d81c8c03f075ed3f3178db696bbe2",
"sha256": "7c2adcc8bc7c0f4b81b70ef9113f834bca870b729dfd8ef931cd2930da79e61c"
},
"downloads": -1,
"filename": "sah-2.0.0a3.tar.gz",
"has_sig": false,
"md5_digest": "882d81c8c03f075ed3f3178db696bbe2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 31474,
"upload_time": "2025-08-02T11:34:19",
"upload_time_iso_8601": "2025-08-02T11:34:19.109553Z",
"url": "https://files.pythonhosted.org/packages/4a/94/a411c37f39b564dde0800bb0dabfd2210f370366a29f33f8b37e7702cf15/sah-2.0.0a3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-02 11:34:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "sah"
}