Skip to content

Commit 4203a4a

Browse files
committed
typo fixes
1 parent 06282b9 commit 4203a4a

File tree

1 file changed

+36
-47
lines changed

1 file changed

+36
-47
lines changed

docs/how-tos/validate-nexus-file.md

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Validate NeXus files
1+
# Validating NeXus files
2+
3+
Note: This is a how-to guide for using different tools to validate NeXus files. If you want to learn more about how validation is done in `pynxtools`, please visit the [explanation page](../learn/nexus-validation.md).
24

35
# The goal
46

@@ -9,25 +11,21 @@ Use a tool to validate NeXus files to a given set of NeXus definitions:
911
2. [NIAC](https://manual.nexusformat.org/)
1012

1113

12-
1314
# Validation of a .nxs file
1415

15-
The validity of NeXus file is fundamental, to ensure FAIR data. Without specific requirements, it is not possible to understand the data. What type of experiment? What Laser Wavelength? Which voltage? What data is represented at all in the table? What is the unit of the value? Which ISO norm does this refer to? Where was this measured? Which year was this measured?
16+
The validity of NeXus files is fundamental to ensure FAIR data. Without specific requirements, it is not possible to understand the data. What type of experiment? What Laser Wavelength? Which voltage? What data is represented at all in the table? What is the unit of the value? Which ISO norm does this refer to? Where was this measured? Which year was this measured?
1617

1718
Therefore you have enter all required fields in the NeXus definition. The requirements are set by the community via workshops or at conferences. You can as well comment the NeXus definitions, to initiate or propose changes/additions. Go to the NeXus definition, and sign-up/log-in and give us some feedback (Red boxes in the image. Expand this panel on the left by clicking on the arrow symbol).
1819
![image.png](<./attachments/9d748230d54a8059-image.png>)
1920

20-
ftentimes, there will be errors in a generated NeXus file (be it by hand or automatically): Typos, missing required concepts, missing attributes, using the incorrect datatype or format (e.g., array instad of list, float instead of integer, etc.). Therefore, a validation is required, to ensure that the data you want to share, is FAIR.
21+
Oftentimes, there will be errors in a generated NeXus file (be it by hand or automatically): Typos, missing required concepts, missing attributes, using the incorrect datatype or format (e.g., array instad of list, float instead of integer, etc.). Therefore, a validation is required, to ensure that the data you want to share, is FAIR.
2122

22-
The NeXus file is valid, if it complies with the respective NeXus application definition.
23+
The NeXus file is valid if it complies with the respective NeXus application definition.
2324

2425
This validation is done by software.
2526

2627

27-
28-
29-
30-
# 1. Validation software
28+
# Validation software
3129

3230
There are right now three tools, which can be used for validation of NeXus files. All are different and have individual advantages or disadvantages:
3331

@@ -37,41 +35,34 @@ There are right now three tools, which can be used for validation of NeXus files
3735

3836
3. punx
3937

40-
4138
Open software is usually shared on Github - There you find usually the most accurate information, as documentation sometimes lags behind. There you see a box with folders and files. Below is the content of the README.md file displayed. This usually shows instructions for installation and handling of the software.
4239

4340
Here are the GitHub links for the thee software packages:
4441

42+
[pynxtools](<https://github.com/FAIRmat-NFDI/pynxtools>)
43+
4544
[cnxvalidate](<https://github.com/nexusformat/cnxvalidate>)
4645

4746
[punx](<https://github.com/prjemian/punx>)
4847

49-
[pynxtools](<https://github.com/FAIRmat-NFDI/pynxtools>)
50-
5148
In the following, each package and its capabilities is presented.
5249

5350
### Operating systems
5451

5552
Almost all PC users are used to Windows as operating system.
5653

57-
A lot of Software development is done on Linux as operating system.
54+
A lot of software development is done on Linux as operating system.
5855

59-
This is not a problem for big company, but for smaller open software projects, which ared often developed without funding, this is a problem.
56+
This is not a problem for big companies, but for smaller open software projects, which are often developed without funding, this is a problem.
6057

6158
If you are used to Windows, consider setting up a Linux operating system to eliminate problems in the installation process and ensure compatibility.
6259

6360

61+
# 1. pynxtools - Python Nexus Tools
6462

63+
This is a python package which is developed by the FAIRmat consortium.
6564

66-
67-
68-
69-
70-
# 2 pynxtools - Python Nexus Tools
71-
72-
This is python package which is developed by the FAIRmat consortium.
73-
74-
As python package, this can be used on Linux and Windows systems.
65+
As a python package, this can be used on Linux and Windows systems.
7566

7667
The package can be installed via pip. Therefore you need to have installed:
7768

@@ -92,7 +83,7 @@ This tool has 3 command line functions:
9283

9384
For validation purposes, we will use the "read\_nexus" and "verify\_nexus" function.
9485

95-
# 2.1 verify_nexus
86+
# 1.1 verify_nexus
9687

9788
This tool is currently in development. It enables a command like:
9889

@@ -101,16 +92,16 @@ verify_nexus C:\nexusvalidation\Raman.nxs
10192
```
10293

10394

104-
The outpu warning looks like this:
95+
The output warning looks like this:
10596
```
10697
...
10798
WARNING: Field /entry/instrument/beam_incident/wavelength/@units written without documentation.
10899
...
109100
```
110101

111-
# 2.1.1 Installation verfiy_nexus
102+
# 1.1.1 Installation of verify_nexus
112103

113-
Aside of read_nexus, there is a second functionality from pynxtools. This method is currently in development (Aug 2024). This function is called: verify\_nexus. Therefore, you have to use the development install, until this function is published.
104+
Aside from read_nexus, there is a second functionality from pynxtools. This method is currently in development (Aug 2024). This function is called: verify\_nexus. Therefore, you have to use the development install, until this function is published.
114105

115106
Do this to install pynxtools with verify\_nexus
116107

@@ -143,7 +134,7 @@ Options:
143134
```
144135

145136

146-
# 2.1.2 Using verify\_nexus
137+
# 1.1.2 Using verify_nexus
147138

148139
Open your terminal. Assuming there is a folder at:
149140

@@ -159,9 +150,9 @@ For Windows:
159150
C:\nexusvalidation
160151
```
161152

162-
Put into this folder your NeXus file, for example the [Raman.nxs file](https://zenodo.org/records/13373909/files/Raman.nxs?download=1).
153+
Put into this folder your NeXus file, for example this [Raman.nxs file](https://zenodo.org/records/13373909/files/Raman.nxs?download=1).
163154

164-
Use verify nexus with the command:
155+
Use verify_nexus with the command:
165156

166157
```
167158
verify_nexus C:\nexusvalidation\Raman.nxs
@@ -179,9 +170,7 @@ Invalid: The entry `entry` in file `Raman.nxs` is NOT a valid file according to
179170
```
180171

181172

182-
183-
184-
# 2.2 read_nexus
173+
# 1.2 read_nexus
185174

186175
The command used is:
187176

@@ -230,7 +219,7 @@ The second example was for the "software\_TYPE" attribute @URL entry in the "NXo
230219

231220

232221

233-
# 2.2.1 Installation read_nexus
222+
# 1.2.1 Installation of read_nexus
234223

235224
This is installed with pip:
236225

@@ -239,7 +228,7 @@ pip install pynxtools
239228
```
240229

241230

242-
# 2.2.2 Using the read\_nexus function
231+
# 1.2.2 Using the read_nexus function
243232

244233
Open your terminal. Assuming there is a folder at:
245234

@@ -288,7 +277,7 @@ For Axis #0, 1 axes have been identified: [<HDF5 dataset "spectrum_data_x_Raman"
288277
DEBUG: For Axis #0, 1 axes have been identified: [<HDF5 dataset "spectrum_data_x_Raman": shape (1600,), type "<f8">]
289278
```
290279

291-
Search for filed which are not found in the NeXus definiton by searching for the line: "DEBUG: NOT IN SCHEMA". Recheck the used NeXus definition to eliminate the problem. Be careful with upper and lower case notation and correct spelling.
280+
Search for fields which are not found in the NeXus definition by searching for the line: "DEBUG: NOT IN SCHEMA". Recheck the used NeXus definition to eliminate the problem. Be careful with upper and lower case notation and correct spelling.
292281

293282
Keep in mind, that the output provides quite some information. This is useful for software development, but may be a bit too much for validation purposes.
294283

@@ -303,7 +292,7 @@ Similar features as the tables and messages provided from punx and cnxvalidate f
303292

304293

305294

306-
# 3. cnxvalidate
295+
# 2. cnxvalidate
307296

308297
This package is written in C. It is allows a command line evocation like:
309298

@@ -325,7 +314,7 @@ definition=NXoptical_spectroscopy.nxdl.xml message="Required attribute URL missi
325314

326315
and indicates the entry of the .nxs file, which is incorrect and what the respective problem is. It also points to the NeXus definition (.nxdl.xml file), in which this conflict was found.
327316

328-
# 3.1. Installation (Linux only)
317+
# 2.1. Installation (Linux only)
329318

330319
This [did not work for me on windows](/installation_notes_nxvalidate.md) (The problem was the software cmake couldn't fine the libxml2 library. Though, if you solve this, this maybe work on windows).
331320

@@ -335,7 +324,7 @@ The installation process has to be build from source. This is eased significantl
335324

336325
### Install cmake, github, hdf5 & xml2 library, etc:
337326

338-
open the terminal and install all parts required to install cnxvalidate via cmake:
327+
Open the terminal and install all parts required to install cnxvalidate via cmake:
339328

340329
```
341330
sudo apt-get update
@@ -425,7 +414,7 @@ Now the above mentioned commands should be avaialble. The programm/executable is
425414
/home/USER/nexusvalidation/cnxvalidate/build/nxvalidate
426415
```
427416

428-
# 3.2. Using cnxvalidate
417+
# 2.2. Using cnxvalidate
429418

430419
Now you can start to validate your created [NeXus file](https://zenodo.org/records/13373909). But before the validation, we need to get a set of NeXus definitions, which we want to use as reference. This is done again by using git:
431420

@@ -510,7 +499,7 @@ Now adjust the file creation, and add the respective fields to make your NeXus f
510499

511500

512501

513-
# 4. Punx - Python Utilities for NeXus HDF5 files
502+
# 3. Punx - Python Utilities for NeXus HDF5 files
514503

515504
This is python package, and can therefore be used on Linux and Windows systems.
516505

@@ -535,7 +524,7 @@ This is done by replacing REPORT with ={COMMENT,ERROR,NOTE,OK,TODO,UNUSED,WARN}
535524

536525
[Official docs](<https://punx.readthedocs.io/en/latest/validate.html#validate>)
537526

538-
# 4.1 Installation
527+
# 3.1 Installation
539528

540529
Open the terminal and install punx via pip:
541530

@@ -650,7 +639,7 @@ Then you should be able to use this package.
650639

651640
Official docs for [punx installation](<https://punx.readthedocs.io/en/latest/install.html>)
652641

653-
# 4.2. Using punx
642+
# 3.2. Using punx
654643

655644
Open your terminal. Assuming there is a folder at:
656645

@@ -682,7 +671,7 @@ punx validate C:\nexusvalidation\SiO2onSi.ellips.nxs
682671

683672
The output tables "findings" and "summary statistics" can be used to find error present in the NeXus file.
684673

685-
# 4.3. Example
674+
# 3.3. Example
686675

687676
### Which NeXus definition?
688677

@@ -756,7 +745,7 @@ The last error message:
756745

757746
can be ignored and is a bug right now. If this is the only Error message, then your NeXus file is compliant with the NeXus definitions and you can share and publish your data.
758747

759-
# 4.4. Further Notes
748+
# 3.4. Further Notes
760749

761750
1. Punx only uses the NeXus definiton from the NIAC [NeXus definiton from the NIAC](<https://manual.nexusformat.org/>). The use of the [FAIRmat NeXus definition](<https://fairmat-nfdi.github.io/nexus_definitions/index.html#>) is not possible right now.
762751

@@ -781,11 +770,11 @@ This tutorial showed:
781770

782771
### Recommended methods:
783772

784-
As pynxtools verify_nexus method is right now in development, [not all situations are covered right now](/testing-validation-tools.md). Therefore, the most reliable method right now is a combination of _Human Manual Validation_ + _1-2 Software solutions_.
773+
As pynxtools verify_nexus method is right now in development, [not all situations are covered right now](/testing-validation-tools.md). Therefore, the most reliable method right now is a combination of _Human Manual Validation_ + _Software solutions_.
785774

786775
### Pynxtools Parsers:
787776

788-
For a specifically structured set of data, a parser can be written, which uses the meta data and a pre-structured meta data file, to create a NeXus file. Tough, the parser depends on: Experimental Technique and Setup and has therefore to be written invidiually. This is another functionallity of [pynxtools with plugins for the techniques](https://fairmat-nfdi.github.io/pynxtools/reference/plugins.html):
777+
For a specifically structured set of data, a parser can be written, which uses the meta data and a pre-structured meta data file, to create a NeXus file. Tough, the parser depends on: Experimental Technique and Setup and has therefore to be written individually. This is another functionallity of [pynxtools with plugins for the techniques](https://fairmat-nfdi.github.io/pynxtools/reference/plugins.html):
789778

790779
[electron microscopy (EM)](<https://github.com/FAIRmat-NFDI/pynxtools-em>)
791780

0 commit comments

Comments
 (0)