ftir-OMNIC-map-reader 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ftir_omnic_map_reader-1.0.0/LICENSE.txt +9 -0
- ftir_omnic_map_reader-1.0.0/PKG-INFO +93 -0
- ftir_omnic_map_reader-1.0.0/README.md +77 -0
- ftir_omnic_map_reader-1.0.0/pyproject.toml +26 -0
- ftir_omnic_map_reader-1.0.0/setup.cfg +4 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_OMNIC_map_reader.egg-info/PKG-INFO +93 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_OMNIC_map_reader.egg-info/SOURCES.txt +15 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_OMNIC_map_reader.egg-info/dependency_links.txt +1 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_OMNIC_map_reader.egg-info/requires.txt +3 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_OMNIC_map_reader.egg-info/top_level.txt +1 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/LoadOmnicArrayMAP.py +409 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/LoadOmnicMAP.py +97 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/PyMca_Array_OmnicMap.py +419 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/PyMca_OmnicMap.py +357 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/__about__.py +4 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/__init__.py +3 -0
- ftir_omnic_map_reader-1.0.0/src/ftir_map/testpoint.py +45 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-present Henry Towbin <24940778+whtowbin@users.noreply.github.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ftir-OMNIC-map-reader
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Author-email: Henry Towbin <24940778+whtowbin@users.noreply.github.com>
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Documentation, https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader#readme
|
|
7
|
+
Project-URL: Source, https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader
|
|
8
|
+
Keywords: FTIR,Hyperspectral
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE.txt
|
|
12
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
13
|
+
Requires-Dist: numpy>=1.26
|
|
14
|
+
Requires-Dist: xarray>=2024.6
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# FTIR OMNIC Map Reader
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
- [Description](#description)
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Directions](#directions)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
The underlying code for reading OMINC .MAP files was part of the python package [PyMca](https://github.com/vasole/pymca?tab=readme-ov-file) X-Ray Fluorescence Toolkit. Developed by the European Synchrotron Radiation Facility.
|
|
29
|
+
|
|
30
|
+
If there is interest in adding particular features please let me know in the issues or make a pull request with the change.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
You will already need to have a python environment installed on your computer to install this software.
|
|
34
|
+
If you do not have a python environment installed you can use [UV](https://docs.astral.sh/uv/) to install one.
|
|
35
|
+
|
|
36
|
+
To install this package you can use pip.
|
|
37
|
+
|
|
38
|
+
```console
|
|
39
|
+
pip install ftir-OMNIC-map-reader
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you are using [UV](https://docs.astral.sh/uv/) to manage your python environment you can install the package by running the command:
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
uv add ftir-OMNIC-map-reader
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
if you are
|
|
49
|
+
If you would like to install the package from source you can do so by following these steps:
|
|
50
|
+
1) Download or clone this repository to your computer and save it in a location where it can remain on your computer.
|
|
51
|
+
2) In the terminal navigate to the directory of the package.
|
|
52
|
+
3) run the command:
|
|
53
|
+
- python -m pip install .
|
|
54
|
+
- if you have windows you might need to run: python3 -m pip install .
|
|
55
|
+
|
|
56
|
+
## Directions
|
|
57
|
+
|
|
58
|
+
### Xarray Dataset
|
|
59
|
+
To load a map follow this example:
|
|
60
|
+
``` python
|
|
61
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
62
|
+
|
|
63
|
+
map_path = "greatest_map_ever.map"
|
|
64
|
+
map = omnic.Load_Omnic_Map(map_path)
|
|
65
|
+
spectra = map['spectra'] # This is the spectra data
|
|
66
|
+
coordinates = map.coords # This contains the spatial and spectral coordinates
|
|
67
|
+
metadata = map.attrs # This contains the metadata from the .MAP file
|
|
68
|
+
```
|
|
69
|
+
The map is an xarray [dataset](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html) object. It should contain the three main attributes
|
|
70
|
+
- data_vars: This is all of the spectra in the map
|
|
71
|
+
- coords: These are the spatial and spectral coordinates of the map
|
|
72
|
+
- attrs: this is all of the meta data reported in the .MAP file
|
|
73
|
+
|
|
74
|
+
If you are unfamiliar with recommend looking at the xarray [tutorial](https://tutorial.xarray.dev/overview/xarray-in-45-min)
|
|
75
|
+
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
I eventually hope to provide further guidance for processing the map files efficiently using xarray.
|
|
79
|
+
|
|
80
|
+
### Data as a Dictionary
|
|
81
|
+
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:
|
|
82
|
+
``` python
|
|
83
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
84
|
+
map_path = "greatest_map_ever.map"
|
|
85
|
+
map_dict = omnic.Load_Omnic_Map_as_dict(map_path)
|
|
86
|
+
spectra = map_dict['data'] # This is the spectra data
|
|
87
|
+
x_coordinates = map_dict['x'] # This contains the x spatial coordinates
|
|
88
|
+
y_coordinates = map_dict['y'] # This contains the y spatial coordinates
|
|
89
|
+
wn_coordinates = map_dict['wn'] # This contains the spectral coordinates
|
|
90
|
+
metadata = map_dict['metadata'] # This contains the metadata from the .MAP file
|
|
91
|
+
```
|
|
92
|
+
## License
|
|
93
|
+
`FTIR OMNIC Map Reader` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# FTIR OMNIC Map Reader
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
- [Description](#description)
|
|
5
|
+
- [Installation](#installation)
|
|
6
|
+
- [Directions](#directions)
|
|
7
|
+
- [License](#license)
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
The underlying code for reading OMINC .MAP files was part of the python package [PyMca](https://github.com/vasole/pymca?tab=readme-ov-file) X-Ray Fluorescence Toolkit. Developed by the European Synchrotron Radiation Facility.
|
|
13
|
+
|
|
14
|
+
If there is interest in adding particular features please let me know in the issues or make a pull request with the change.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
You will already need to have a python environment installed on your computer to install this software.
|
|
18
|
+
If you do not have a python environment installed you can use [UV](https://docs.astral.sh/uv/) to install one.
|
|
19
|
+
|
|
20
|
+
To install this package you can use pip.
|
|
21
|
+
|
|
22
|
+
```console
|
|
23
|
+
pip install ftir-OMNIC-map-reader
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you are using [UV](https://docs.astral.sh/uv/) to manage your python environment you can install the package by running the command:
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
uv add ftir-OMNIC-map-reader
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
if you are
|
|
33
|
+
If you would like to install the package from source you can do so by following these steps:
|
|
34
|
+
1) Download or clone this repository to your computer and save it in a location where it can remain on your computer.
|
|
35
|
+
2) In the terminal navigate to the directory of the package.
|
|
36
|
+
3) run the command:
|
|
37
|
+
- python -m pip install .
|
|
38
|
+
- if you have windows you might need to run: python3 -m pip install .
|
|
39
|
+
|
|
40
|
+
## Directions
|
|
41
|
+
|
|
42
|
+
### Xarray Dataset
|
|
43
|
+
To load a map follow this example:
|
|
44
|
+
``` python
|
|
45
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
46
|
+
|
|
47
|
+
map_path = "greatest_map_ever.map"
|
|
48
|
+
map = omnic.Load_Omnic_Map(map_path)
|
|
49
|
+
spectra = map['spectra'] # This is the spectra data
|
|
50
|
+
coordinates = map.coords # This contains the spatial and spectral coordinates
|
|
51
|
+
metadata = map.attrs # This contains the metadata from the .MAP file
|
|
52
|
+
```
|
|
53
|
+
The map is an xarray [dataset](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html) object. It should contain the three main attributes
|
|
54
|
+
- data_vars: This is all of the spectra in the map
|
|
55
|
+
- coords: These are the spatial and spectral coordinates of the map
|
|
56
|
+
- attrs: this is all of the meta data reported in the .MAP file
|
|
57
|
+
|
|
58
|
+
If you are unfamiliar with recommend looking at the xarray [tutorial](https://tutorial.xarray.dev/overview/xarray-in-45-min)
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
I eventually hope to provide further guidance for processing the map files efficiently using xarray.
|
|
63
|
+
|
|
64
|
+
### Data as a Dictionary
|
|
65
|
+
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:
|
|
66
|
+
``` python
|
|
67
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
68
|
+
map_path = "greatest_map_ever.map"
|
|
69
|
+
map_dict = omnic.Load_Omnic_Map_as_dict(map_path)
|
|
70
|
+
spectra = map_dict['data'] # This is the spectra data
|
|
71
|
+
x_coordinates = map_dict['x'] # This contains the x spatial coordinates
|
|
72
|
+
y_coordinates = map_dict['y'] # This contains the y spatial coordinates
|
|
73
|
+
wn_coordinates = map_dict['wn'] # This contains the spectral coordinates
|
|
74
|
+
metadata = map_dict['metadata'] # This contains the metadata from the .MAP file
|
|
75
|
+
```
|
|
76
|
+
## License
|
|
77
|
+
`FTIR OMNIC Map Reader` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
[project]
|
|
5
|
+
name = "ftir-OMNIC-map-reader"
|
|
6
|
+
version = "1.0.0"
|
|
7
|
+
#dynamic = ["version"]
|
|
8
|
+
description = ''
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
keywords = ["FTIR", "Hyperspectral"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Henry Towbin", email = "24940778+whtowbin@users.noreply.github.com" },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
dependencies = [
|
|
18
|
+
"matplotlib>=3.10.1",
|
|
19
|
+
"numpy >= 1.26",
|
|
20
|
+
"xarray>=2024.6",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Documentation = "https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader#readme"
|
|
25
|
+
Source = "https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader"
|
|
26
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ftir-OMNIC-map-reader
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Author-email: Henry Towbin <24940778+whtowbin@users.noreply.github.com>
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Documentation, https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader#readme
|
|
7
|
+
Project-URL: Source, https://github.com/whtowbin/FTIR_OMNIC_MAP_Reader
|
|
8
|
+
Keywords: FTIR,Hyperspectral
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE.txt
|
|
12
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
13
|
+
Requires-Dist: numpy>=1.26
|
|
14
|
+
Requires-Dist: xarray>=2024.6
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# FTIR OMNIC Map Reader
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
- [Description](#description)
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Directions](#directions)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
## Description
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
The underlying code for reading OMINC .MAP files was part of the python package [PyMca](https://github.com/vasole/pymca?tab=readme-ov-file) X-Ray Fluorescence Toolkit. Developed by the European Synchrotron Radiation Facility.
|
|
29
|
+
|
|
30
|
+
If there is interest in adding particular features please let me know in the issues or make a pull request with the change.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
You will already need to have a python environment installed on your computer to install this software.
|
|
34
|
+
If you do not have a python environment installed you can use [UV](https://docs.astral.sh/uv/) to install one.
|
|
35
|
+
|
|
36
|
+
To install this package you can use pip.
|
|
37
|
+
|
|
38
|
+
```console
|
|
39
|
+
pip install ftir-OMNIC-map-reader
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you are using [UV](https://docs.astral.sh/uv/) to manage your python environment you can install the package by running the command:
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
uv add ftir-OMNIC-map-reader
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
if you are
|
|
49
|
+
If you would like to install the package from source you can do so by following these steps:
|
|
50
|
+
1) Download or clone this repository to your computer and save it in a location where it can remain on your computer.
|
|
51
|
+
2) In the terminal navigate to the directory of the package.
|
|
52
|
+
3) run the command:
|
|
53
|
+
- python -m pip install .
|
|
54
|
+
- if you have windows you might need to run: python3 -m pip install .
|
|
55
|
+
|
|
56
|
+
## Directions
|
|
57
|
+
|
|
58
|
+
### Xarray Dataset
|
|
59
|
+
To load a map follow this example:
|
|
60
|
+
``` python
|
|
61
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
62
|
+
|
|
63
|
+
map_path = "greatest_map_ever.map"
|
|
64
|
+
map = omnic.Load_Omnic_Map(map_path)
|
|
65
|
+
spectra = map['spectra'] # This is the spectra data
|
|
66
|
+
coordinates = map.coords # This contains the spatial and spectral coordinates
|
|
67
|
+
metadata = map.attrs # This contains the metadata from the .MAP file
|
|
68
|
+
```
|
|
69
|
+
The map is an xarray [dataset](https://docs.xarray.dev/en/stable/generated/xarray.Dataset.html) object. It should contain the three main attributes
|
|
70
|
+
- data_vars: This is all of the spectra in the map
|
|
71
|
+
- coords: These are the spatial and spectral coordinates of the map
|
|
72
|
+
- attrs: this is all of the meta data reported in the .MAP file
|
|
73
|
+
|
|
74
|
+
If you are unfamiliar with recommend looking at the xarray [tutorial](https://tutorial.xarray.dev/overview/xarray-in-45-min)
|
|
75
|
+
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
I eventually hope to provide further guidance for processing the map files efficiently using xarray.
|
|
79
|
+
|
|
80
|
+
### Data as a Dictionary
|
|
81
|
+
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:
|
|
82
|
+
``` python
|
|
83
|
+
from ftir_map import LoadOmnicMAP as omnic
|
|
84
|
+
map_path = "greatest_map_ever.map"
|
|
85
|
+
map_dict = omnic.Load_Omnic_Map_as_dict(map_path)
|
|
86
|
+
spectra = map_dict['data'] # This is the spectra data
|
|
87
|
+
x_coordinates = map_dict['x'] # This contains the x spatial coordinates
|
|
88
|
+
y_coordinates = map_dict['y'] # This contains the y spatial coordinates
|
|
89
|
+
wn_coordinates = map_dict['wn'] # This contains the spectral coordinates
|
|
90
|
+
metadata = map_dict['metadata'] # This contains the metadata from the .MAP file
|
|
91
|
+
```
|
|
92
|
+
## License
|
|
93
|
+
`FTIR OMNIC Map Reader` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/ftir_OMNIC_map_reader.egg-info/PKG-INFO
|
|
5
|
+
src/ftir_OMNIC_map_reader.egg-info/SOURCES.txt
|
|
6
|
+
src/ftir_OMNIC_map_reader.egg-info/dependency_links.txt
|
|
7
|
+
src/ftir_OMNIC_map_reader.egg-info/requires.txt
|
|
8
|
+
src/ftir_OMNIC_map_reader.egg-info/top_level.txt
|
|
9
|
+
src/ftir_map/LoadOmnicArrayMAP.py
|
|
10
|
+
src/ftir_map/LoadOmnicMAP.py
|
|
11
|
+
src/ftir_map/PyMca_Array_OmnicMap.py
|
|
12
|
+
src/ftir_map/PyMca_OmnicMap.py
|
|
13
|
+
src/ftir_map/__about__.py
|
|
14
|
+
src/ftir_map/__init__.py
|
|
15
|
+
src/ftir_map/testpoint.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ftir_map
|