Skip to main content

FTIR OMNIC Map Reader

Read Thermo OMNIC .map files (FTIR maps, line scans and point lists) into Python as NumPy arrays or xarray datasets. It returns the spectra, the spectral axis, the stage position of every spectrum, the background spectra, the video or mosaic images with their stage coordinates, and the collection metadata that could be decoded.

Documentation: https://ftir-omnic-map-reader.readthedocs.io/

Install

pip install ftir-OMNIC-map-reader
pip install "ftir-OMNIC-map-reader[yaml,parquet,netcdf]"   # optional: YAML metadata, Parquet points, netCDF export

With uv: uv add ftir-OMNIC-map-reader. Python 3.10 or newer.

Quick start

from ftir_map import read_omnic

m = read_omnic("my_map.map")
m.map_kind  # "grid", "line", "points" or "array"
m.spectra.shape  # (n_points, n_axis), in file order; NaN is kept as stored
m.axis  # wavenumbers in cm-1 (m.axis_unit == "cm-1")
m.x, m.y  # stage position of each spectrum in um
ds = m.to_xarray()  # spectra on (y, x, wavenumber) for a grid, (point, wavenumber) otherwise

read_omnic raises OmnicFormatError (a ValueError) for a file that is not an OMNIC map or holds no spectra.

Map kinds

map_kind What it is xarray layout of spectra
grid rectangular area map (y, x, wavenumber)
array array-detector map; its pixels fill a grid (y, x, wavenumber)
line profile along a line (point, wavenumber)
points point-to-point map or irregular positions (point, wavenumber)

Interferogram maps (m.data_kind == "interferogram") have axis_unit == "points", and the last dimension is named axis. m.wavenumber is the same as m.axis for spectra and raises an error for interferograms.

Exports

Each export is described, with example output, in docs/site/exports.md.

ds = m.to_xarray()  # xarray.Dataset, attrs hold the metadata
spectra, axes, positions, metadata = m.to_numpy()  # arrays and plain dicts
everything = m.to_dict()  # spectra, axes, positions, titles, times, backgrounds, images
m.to_zarr("my_map.zarr")  # refuses to overwrite by default
images = m.to_images()  # video images or mosaic tiles with stage extents

Writing files

m.save_metadata("meta.json")  # or .yaml, .csv
m.save_points("points.csv")  # one row per spectrum: x, y, z, row, column, title, time, background
m.save_spectra("spectra.npz")  # or .csv, .zarr; .nc is opt-in ([netcdf] extra)
m.save_images("images/", format="png")  # PNG or TIFF or the original files, plus world files and an index
m.export_all("my_map_export/")  # all of the above in one folder with a README.txt

The same from the command line:

ftir-map info my_map.map
ftir-map export my_map.map --out my_map_export --spectra npz --metadata yaml --images tiff

Showing a video image with the map positions:

import matplotlib.pyplot as plt

for image in m.to_images():
    plt.imshow(image.array, extent=image.extent)  # extent = (xmin, xmax, ymin, ymax) in um; no flip needed
plt.plot(m.x, m.y, "r.")

Unpack maps into an open project folder

ftir-map unpack turns proprietary .map files into a folder of open files: spectra in Zarr (spectra.zarr, readable with xarray.open_zarr or zarr.open in Python, and with the Zarr packages of R and Julia; use --spectra csv for MATLAB or Excel), points.csv, map.json with all metadata, and the embedded images with world files. Give it files and/or folders; it finds .map files recursively, lists unreadable ones in the catalog, and skips maps that are already unpacked. The format is in docs/site/unpacked_format.md.

ftir-map unpack "Bristol 2017/" other_map.map --out my_project [--spectra zarr|csv|nc] [--png] [--copy-source]
# --spectra nc is an opt-in export and needs the [netcdf] extra
ftir-map catalog my_project
import ftir_map

project = ftir_map.unpack(["Bristol 2017/"], "my_project")  # or ftir_map.open_project("my_project")
project.catalog  # pandas DataFrame, one row per source file
m = project.load(project.names[0])  # an OmnicMap, rebuilt from the open files
ds = project.to_xarray(project.names[0])
ftir_map.load("my_project/maps/my_map")  # also reads one unpacked map, a project, or a .map file

Metadata

m.collection (number of points, first and last X, scans, laser frequency, mirror velocity and more), m.map_definition (kind, ranges, step, title, original file name), m.title, m.file_time, m.history, the per-spectrum m.titles, m.times_s and m.background_index, and m.backgrounds (spectrum, title and time of each background). m.block_bytes(key) returns the raw bytes of any block this reader does not decode. The same metadata, as JSON-serializable values, is in ds.attrs and in the last item of to_numpy(). Which fields are verified against OMNIC's own exports, and which are inferred, is in docs/site/file_format.md.

Older interface

Load_Omnic_Map from version 1.0 still works and returns the same output for grid maps. It also reads line scans and point maps now. A file it cannot read gives a warning and None.

from ftir_map.LoadOmnicMAP import Load_Omnic_Map

ds = Load_Omnic_Map("my_map.map")  # xarray.Dataset on (y, x, wn)
d = Load_Omnic_Map("my_map.map", format="Dictionary")  # keys data, x, y, wn, metadata

It replaces NaN by 0, as PyMca did; read_omnic does not. The PyMca-derived modules PyMca_OmnicMap, PyMca_Array_OmnicMap and LoadOmnicArrayMAP are deprecated and will be removed in 2.0.

Credits and license

The format knowledge behind the first versions comes from the OMNIC reader in PyMca (V.A. Sole, European Synchrotron Radiation Facility, MIT license). See NOTICE. The rest of the format was worked out by comparing 81 files with OMNIC's own exports. MIT license, see LICENSE.txt. Changes are listed in CHANGELOG.md; release steps in docs/RELEASING.md.

Metadata

Release files for ftir-OMNIC-map-reader 1.1.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 ftir-OMNIC-map-reader 1.1.0
File Size Uploaded Provenance Actions
ftir_omnic_map_reader-1.1.0.tar.gz 290.7 kB With provenance Details for ftir_omnic_map_reader-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ftir-OMNIC-map-reader 1.1.0
File Interpreter ABI Platform Actions
ftir_omnic_map_reader-1.1.0-py3-none-any.whl Python 3 none any Details for ftir_omnic_map_reader-1.1.0-py3-none-any.whl

Total release size: 349.7 kB

Release files / ftir_omnic_map_reader-1.1.0.tar.gz

Download URL ftir_omnic_map_reader-1.1.0.tar.gz
Size 290.7 kB
Tags Source
SHA-256 checksum
How to use checksums
34449f56ae8ad3f7677fb861adb459e7ef28a8e42f7edf5735d73696f5128e36
BLAKE2b-256 checksum
How to use checksums
957f11283ee92251fc989df1a877a5fa6bab33bf0679cacf82aa2d081232781f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / ftir_omnic_map_reader-1.1.0-py3-none-any.whl

Download URL ftir_omnic_map_reader-1.1.0-py3-none-any.whl
Size 59.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c34a15b658ffdce98bf379a50931516b7be404f2e4e05675bfc821c626ad2b23
BLAKE2b-256 checksum
How to use checksums
fe7902b17f24994f57b12110a1d443a1d7ca22480842a46f060bcee027cf88e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for ftir-OMNIC-map-reader 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ftir_omnic_map_reader-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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