No project description provided
Project description
FTIR OMNIC Map Reader
Table of Contents
Description
This code aims to provide a convenient interface for reading FTIR Data specifically OMNIC .MAP files. It loads OMNIC .MAP files into python as Xarray dataset objects. This provides access to the coordinates and spectra of each point in the map.
The underlying code for reading OMINC .MAP files was part of the python package PyMca X-Ray Fluorescence Toolkit. Developed by the European Synchrotron Radiation Facility.
If there is interest in adding particular features please let me know in the issues or make a pull request with the change.
Installation
You will already need to have a python environment installed on your computer to install this software. If you do not have a python environment installed you can use UV to install one.
To install this package you can use pip.
pip install ftir-OMNIC-map-reader
If you are using UV to manage your python environment you can install the package by running the command:
uv add ftir-OMNIC-map-reader
if you are If you would like to install the package from source you can do so by following these steps:
- Download or clone this repository to your computer and save it in a location where it can remain on your computer.
- In the terminal navigate to the directory of the package.
- run the command:
- python -m pip install .
- if you have windows you might need to run: python3 -m pip install .
Directions
Xarray Dataset
To load a map follow this example:
from ftir_map import LoadOmnicMAP as omnic
map_path = "greatest_map_ever.map"
map = omnic.Load_Omnic_Map(map_path)
spectra = map['spectra'] # This is the spectra data
coordinates = map.coords # This contains the spatial and spectral coordinates
metadata = map.attrs # This contains the metadata from the .MAP file
The map is an xarray dataset object. It should contain the three main attributes
- data_vars: This is all of the spectra in the map
- coords: These are the spatial and spectral coordinates of the map
- attrs: this is all of the meta data reported in the .MAP file
If you are unfamiliar with recommend looking at the xarray tutorial
The main benefit of xarray is that it is straightforward to reference the data by spatial and spectral coordinates in the appropriate units. If you choose not to use it you should be able to access the underlying data as numpy arrays.
I eventually hope to provide further guidance for processing the map files efficiently using xarray.
Data as a Dictionary
If you would like to access the data as a dictionary containing the spectra data, spatial and spectral coordiantes, and metadata; you can do so by using the following code:
from ftir_map import LoadOmnicMAP as omnic
map_path = "greatest_map_ever.map"
map_dict = omnic.Load_Omnic_Map_as_dict(map_path)
spectra = map_dict['data'] # This is the spectra data
x_coordinates = map_dict['x'] # This contains the x spatial coordinates
y_coordinates = map_dict['y'] # This contains the y spatial coordinates
wn_coordinates = map_dict['wn'] # This contains the spectral coordinates
metadata = map_dict['metadata'] # This contains the metadata from the .MAP file
License
FTIR OMNIC Map Reader is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ftir_omnic_map_reader-1.0.0.tar.gz.
File metadata
- Download URL: ftir_omnic_map_reader-1.0.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c22a9a5a090e0bd57c274e9723611898738cad3ec322e2f94ae92715510c3f7
|
|
| MD5 |
6161c495e1e68b8e4382f7283f7cf3e5
|
|
| BLAKE2b-256 |
82efee4ad8a3992c83f57afe88311cec02d15bb93c69539cdcf5c8bc3e0711c2
|
File details
Details for the file ftir_omnic_map_reader-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ftir_omnic_map_reader-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9d6ae67a62bfaf28aec2b75875e101eb771d3bf395f9a8105ff99f4764f7ff3
|
|
| MD5 |
5a7304d187679fd62ca28bf596f297fa
|
|
| BLAKE2b-256 |
0e197cfbdcb47ace0cd0f3d3cb566aeff846096c3a324aa3a0277d5815e07050
|