8000 Apm em sprint14 p2 by mkuehbach · Pull Request #117 · FAIRmat-NFDI/pynxtools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Apm em sprint14 p2 #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9d381f7
Initial commit new em_nion swift project reader
May 22, 2023
f1eb1b6
Added code for parsing nsproj, ndata, and h5 file metadata from nszip…
May 22, 2023
70853d4
Added remaining examples from Benedikts Nion session and image concep…
May 22, 2023
a956b4f
Added code for analyzing which metadata come with specific different …
May 23, 2023
08c8bc0
Added close to jsonmap_reader mapping table exemplarily for concept N…
May 23, 2023
bcf856a
Time zone converting from swift local time to utc and NxImageReaslSpa…
May 24, 2023
0d47849
Parser skeleton carried over from ipynb to reader.py tested working, …
May 24, 2023
dd1957f
Support for NxImageRealSpace implemented, next steps i) parse eln_dat…
May 24, 2023
78001fa
Mapping table for concept eels
May 24, 2023
0eda6ac
Added generic ELN loading
May 25, 2023
04617ac
CI fixes, intentional downgrading of tzlocal to 4.3 as nionswift is n…
May 25, 2023
de34ad1
Generated dev-requirements within py310 to check if one can avoid the…
May 25, 2023
0fab0db
Fixed buges with 3d axes, fixed default plotting, and instance indexi…
May 25, 2023
1bbf8cc
integrated changes from testing with local NOMAD OASIS, removed devel…
May 25, 2023
9143bc0
added standalone ipynb, updated all other standalone ipynb, next step…
May 26, 2023
252ae9c
Feature-development closed and feedback from tests with update-north …
May 30, 2023
d4eebad
Removed nionswift_tool as it seems that this is not called
May 30, 2023
a2a3b66
Removed deprecated distutils for setuputils
May 30, 2023
45f257f
More robust locating of NXtest example app 8000 def
May 30, 2023
cb865a1
fixing linting error toomanylocals
May 30, 2023
907d7a4
Resolve merge conflict
Jun 1, 2023
e355b1d
Fix merge conflict
Jun 1, 2023
bd9606a
Merge branch 'master' into apm-em-sprint14-p2
mkuehbach Jun 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 39 additions & 17 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --extra=dev --output-file=dev-requirements.txt --resolver=backtracking pyproject.toml
Expand Down Expand Up @@ -124,6 +124,7 @@ h5py==3.7.0
# ifes-apt-tc-data-modeling
# jupyterlab-h5web
# kikuchipy
# nionswift
# orix
# pyfai
# pynxtools (pyproject.toml)
Expand All @@ -143,17 +144,12 @@ imageio==2.22.1
# via
# hyperspy
# kikuchipy
# nionswift
# nionswift-io
# nionui
# scikit-image
importlib-metadata==5.0.0
# via
# hyperspy
# jupyterlab-server
# nbconvert
# numba
importlib-resources==5.9.0
# via
# jsonschema
# radioactivedecay
# via hyperspy
iniconfig==1.1.1
# via pytest
ipykernel==6.16.0
Expand Down Expand Up @@ -312,6 +308,22 @@ networkx==2.6.3
# via
# radioactivedecay
# scikit-image
niondata==0.15.3
# via
# nionswift
# nionswift-io
nionswift==0.16.8
# via pynxtools (pyproject.toml)
nionswift-io==0.15.1
# via nionswift
nionui==0.6.10
# via nionswift
nionutils==0.4.6
# via
# niondata
# nionswift
# nionswift-io
# nionui
notebook==6.5.2
# via jupyterlab
notebook-shim==0.2.2
Expand Down Expand Up @@ -344,6 +356,10 @@ numpy==1.21.6
# kikuchipy
# lmfit
# matplotlib
# niondata
# nionswift
# nionswift-io
# nionui
# numba
# numcodecs
# numexpr
Expand Down Expand Up @@ -407,13 +423,12 @@ pillow==9.2.0
# via
# imageio
# matplotlib
# nionswift
# scikit-image
pint==0.18
# via hyperspy
pip-tools==6.13.0
# via pynxtools (pyproject.toml)
pkgutil-resolve-name==1.3.10
# via jsonschema
platformdirs==2.5.2
# via
# jupyter-core
Expand Down Expand Up @@ -487,8 +502,11 @@ python-dateutil==2.8.2
pytz==2022.4
# via
# babel
# nionswift
# pandas
# pynxtools (pyproject.toml)
pytz-deprecation-shim==0.1.0.post0
# via tzlocal
pywavelets==1.3.0
# via scikit-image
pyxem==0.15.0
Expand Down Expand Up @@ -534,6 +552,8 @@ scipy==1.7.3
# hyperspy
# kikuchipy
# lmfit
# niondata
# nionswift
# orix
# pyfai
# pynxtools (pyproject.toml)
Expand Down Expand Up @@ -647,10 +667,14 @@ types-urllib3==1.26.25.5
# via types-requests
typing-extensions==4.3.0
# via
# astroid
# mypy
# numcodecs
# pylint
tzdata==2023.3
# via pytz-deprecation-shim
tzlocal==4.3
# via
# nionswift
# pynxtools (pyproject.toml)
uncertainties==3.1.7
# via lmfit
url-normalize==1.4.3
Expand Down Expand Up @@ -682,9 +706,7 @@ zarr==2.12.0
zipfile37==0.1.3
# via pynxtools (pyproject.toml)
zipp==3.8.1
# via
# importlib-metadata
# importlib-resources
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
57 changes: 41 additions & 16 deletions examples/apm/Write.NXapm.Example.1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Using dataconverter/apm for mapping atom probe microscopy data to NeXus/NXapm"
"## Using dataconverter/apm for mapping atom probe microscopy data to NeXus/HDF5/NXapm"
]
},
{
Expand Down Expand Up @@ -68,7 +68,7 @@
"tags": []
},
"source": [
"Example data can be found on Zenodo http://dx.doi.org/10.5281/zenodo.6808516."
"Example data can be found on Zenodo https://www.zenodo.org/record/7908429."
]
},
{
Expand All @@ -79,7 +79,7 @@
},
"outputs": [],
"source": [
"import shutil # unpacks in current path unless an additional path argument is provided"
"import zipfile as zp"
]
},
{
Expand All @@ -88,8 +88,16 @@
"metadata": {},
"outputs": [],
"source": [
"! curl --output APM.LEAP.Datasets.1.zip https://zenodo.org/record/6808516/files/APM.LEAP.Datasets.1.zip\n",
"shutil.unpack_archive(\"APM.LEAP.Datasets.1.zip\")"
"! curl --output usa_denton_smith_apav_si.zip https://zenodo.org/record/7908429/files/usa_denton_smith_apav_si.zip"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"zp.ZipFile(\"usa_denton_smith_apav_si.zip\").extractall(path=\"\", members=None, pwd=None)"
]
},
{
Expand All @@ -101,7 +109,7 @@
" The eln_data_apm.yaml file in the example can be edited with a text editor.<br>\n",
"* A file with **reconstructed ion positions** in community, technology partner format with<br>\n",
" the ion positions and mass-to-charge state ratio values for the tomographic reconstruction.<br>\n",
" POS, ePOS, or APT are allowed.<br>\n",
" POS, ePOS, or APT are allowed. Inspect some of the above-mentioned examples on Zenodo.<br>\n",
"* A file with **ranging definitions** in community, technology partner format with<br>\n",
" the definitions how mass-to-charge-state-ratio values map on ion species.<br>\n",
" RNG, RRNG and is possible. A MatLab script can be used to inject other representations<br>\n",
Expand Down Expand Up @@ -197,26 +205,34 @@
"source": [
"#parser-nexus/tests/data/tools/dataconverter/readers/em_om/\n",
"eln_data_file_name = [\"eln_data_apm.yaml\"]\n",
"input_recon_file_name = [\"R31_06365-v02.pos\",\n",
"input_recon_file_name = [\"Si.apt\",\n",
" \"Si.epos\",\n",
" \"Si.pos\",\n",
" \"R31_06365-v02.pos\",\n",
" \"R18_58152-v02.epos\",\n",
" \"70_50_50.apt\"]\n",
"# \"R56_01769-v01.pos\"]\n",
"input_range_file_name = [\"R31_06365-v02.rrng\",\n",
"input_range_file_name = [\"Si.RRNG\",\n",
" \"Si.RNG\",\n",
" \"Si.RNG\",\n",
" \"R31_06365-v02.rrng\",\n",
" \"R31_06365-v02.rrng\",\n",
" \"R31_06365-v02.rrng\"]\n",
"# \"R56_01769.rng.fig.txt\"]\n",
"output_file_name = [\"apm.case1.nxs\",\n",
" \"apm.case2.nxs\",\n",
" \"apm.case3.nxs\",\n",
" \"apm.case4.nxs\"]\n",
"for case_id in [0]: # , 1, 2, 3]:\n",
" \"apm.case4.nxs\",\n",
" \"apm.case5.nxs\",\n",
" \"apm.case6.nxs\"]\n",
"for case_id in [0]:\n",
" ELN = eln_data_file_name[0]\n",
" INPUT_RECON = input_recon_file_name[case_id]\n",
" INPUT_RANGE = input_range_file_name[case_id]\n",
" OUTPUT = output_file_name[case_id]\n",
"\n",
" ! dataconverter --reader apm --nxdl NXapm --input-file $ELN --input-file \\\n",
" $INPUT_RECON --input-file $INPUT_RANGE --output $OUTPUT --output $OUTPUT"
" $INPUT_RECON --input-file $INPUT_RANGE --output $OUTPUT"
]
},
{
Expand All @@ -242,10 +258,7 @@
"outputs": [],
"source": [
"# H5Web(OUTPUT)\n",
"H5Web(\"apm.case1.nxs\")\n",
"# H5Web(\"apm.case2.nxs\")\n",
"# H5Web(\"apm.case3.nxs\")\n",
"# H5Web(\"apm.case4.nxs\")"
"H5Web(\"apm.case1.nxs\")"
]
},
{
Expand All @@ -258,7 +271,6 @@
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down Expand Up @@ -432,6 +444,19 @@
"The apm reader has a functionality to generate synthetic dataset which are meant for pursuing code development."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-danger\">\n",
"This functionality uses recent features of ase which demands an environment that is currently not supported<br>\n",
"by NOMAD OASIS. As the here exemplified settings for this example are configured to represent an environment<br>\n",
"matching close to NOMAD users who are interested in this developer functionality should do the following:<br>\n",
"Run this example in a standalone environment where ase is upgraded to the latest version and then use<br>\n",
"the generated NeXus files either as is or upload them to NOMAD OASIS.<br>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
24 changes: 24 additions & 0 deletions examples/em_nion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## em_nion reader

This is an example how the em_nion parser/reader/data extractor can be used as a standalone
tool to convert data and metadata from a compressed nionswift project into an NXem-formatted
NeXus/HDF5 file. Further details to the functionalities of the parser are documented
in the parsers sub-directory:

```
pynxtools/pynxtools/dataconverter/readers/em_nion
```

**Write.NXem_nion.Example.1.ipynb** is the Jupyter notebook which exemplies
how the parser can be used as a standalone version, i.e. without NOMAD.

**eln_data_em_nion.yaml** is a YAML/text file which contains relevant data which are not
contained typically in files from technology partners. These data have been collected
either by editing the file manually or by using an electronic lab notebook (ELN),
such as the NOMAD ELN.
A few example files from real atom probe reconstructions and ranging definitions are
offered as downloads to run the example with the above-mentioned Juypter notebook.

Every other ELN can be used with this parser provided that this ELN writes its data
into a YAML file with the same keywords and structure as is exemplified in the
above-mentioned YAML file.
Loading
0