[NeXus-committee] NeXus data file inspection tool. NeXus at ILL. We need to be more flexible.

Joachim Wuttke j.wuttke at fz-juelich.de
Tue Sep 2 13:42:30 BST 2014


Dear colleagues,

enclosed I submit a short piece of software to your kind consideration:
A script that reads a NeXus data file and writes a complete tree
representation of the structure, plus contents, except for arrays
(which are abbreviated to fit in one line) and repeating structures
(which are replaced by links).

I also enclose exemplary output, representing data from the
time-of-flight spectrometer IN5 of the ILL.

In the last few years, ILL has converted most of its instrument
to NeXus. Well, something that looks like NeXus - but is invalid
because they add keywords of their own invention. For instance,
in the NXdisc_chopper group they use 4 valid keywords and
5 invalid ones (guide_height, .., slotwidth).

There is only way to avoid such violations of the specifications.
We cannot change our users. We must change the specs. We must make
them more liberal. Why do we try to prescribe an exclusive list of
keywords when users need the freedom to invent keywords ad hoc?

- Joachim



-------------- next part --------------
/G/i/tof/formats+datasamples/IN5/110927.nxs
    @file_name = /users/data/110927.nxs
    @HDF5_Version = 1.8.3
    @file_time = 2013-08-01T22:31:47+01:00
    @NeXus_version = 4.3.0
    entry0:NXentry
        data:NXdata
            data
                @signal = 1
                int32[384,256,1024] 
        duration
            float32[1] 30.0
        end_time
            01-Aug-13 22:57:00
        experiment_identifier
            D2O + NAD 12A 278.5K
        instrument:NXinstrument
            BS:NXbeam_stop
                distance_to_detector
                    @units = cm
                    float32[1] 177.3
                size
                    @units = cm
                    float32[1] 177.0
                status
                    OUT
                type
                    rectangular
                x
                    @units = cm
                    float32[1] 177.1
                y
                    @units = cm
                    float32[1] 177.2
            CO:NXdisk_chopper
                distance
                    @units = meter
                    float32[1] 777.777
                guide_height
                    @units = meter
                    float32[1] 777.777
                phase
                    @units = degree
                    float32[1] 44.659
                radius
                    @units = meter
                    float32[1] 12.9
                reference_pickUp
                    int32[1] 0
                rotation_speed
                    @units = rpm
                    float32[1] 11999.0
                setpoint_phase
                    @units = degree
                    float32[1] 44.6626
                setpoint_rotation_speed
                    @units = rpm
                    float32[1] 12000.0
                slotwidth
                    @units = degree
                    float32[1] 777.777
            Detector:NXdetector
                azimuthal_angle
                    @axis = 1
                    @units = degree
                    float32[384] 134.817 134.445 .. -11.9175
                description
                    ILL PSD
                detrate
                    float32[1] 304.656
                detsum
                    float32[1] 548381.0
                distance
                    float32[98304] 0.0 1.0 .. 98303.0
                efficiency
                    float32[98304] 0.0 1.0 .. 98303.0
                elasticpeak
                    int32[1] 664
                gas_pressureDET
                    float32[12] 4.75 4.75 .. 4.75
                polar_angle
                    float32[98304] 0.0 1.0 .. 98303.0
            FO:NXdisk_chopper
                same struct as /entry0/instrument/CO
            M1:NXdisk_chopper
                same struct as /entry0/instrument/CO
            M2:NXdisk_chopper
                same struct as /entry0/instrument/CO
            ORC:NXcollimator
                amplitude
                    float32[1] 25.2
                inner_radius
                    float32[1] 25.3
                mode
                    continuous
                outer_radius
                    float32[1] 25.4
                rotation_speed
                    float32[1] 25.1
                type
                    radial
            P1:NXdisk_chopper
                same struct as /entry0/instrument/CO
            P2:NXdisk_chopper
                same struct as /entry0/instrument/CO
            SRot:NXpositioner
                offset_value
                    @units = degree
                    float32[1] 0.0
                target_value
                    @units = degree
                    float32[1] 125.6
                value
                    @units = degree
                    float32[1] 125.61
            SlitBottom:NXpositioner
                same struct as /entry0/instrument/SRot
            SlitLeft:NXpositioner
                same struct as /entry0/instrument/SRot
            SlitRight:NXpositioner
                same struct as /entry0/instrument/SRot
            SlitTop:NXpositioner
                same struct as /entry0/instrument/SRot
            name
                IN5
        mode
            time
        monitor:NXmonitor
            data
                @signal = 1
                int32[1,1,1024] 
            elasticpeak
                int32[1] 664
            integral
                float32[1] 0.0
            mode
                monitor
            monrate
                float32[1] 14.1483
            monsum
                float32[1] 25467.0
            preset
                float32[1] 10.0
            time_of_flight
                float32[3] 17.0892 1024.0 8612.96
        preset
            float32[1] 30.0
        run_number
            int32[1] 110927
        sample:NXsample
            chemical_formula
                Ba3NbFe3Si2O14
            date_of_preparation
                10/11/2001
            density
                float32[1] 1.0
            description
                User specific
            mass
                float32[1] 1000.0
            path_length_windows
                float32[1] 0.0
            regulation_temperature
                float32[1] 279.503
            scattering_length_density
                float32[1] 1.0
            setpoint_temperature
                float32[1] 279.5
            temperature
                float32[1] 278.622
            type_install
                sample
            unit_cell_class
                hexagonal
            volume_unit_cell
                float32[1] 1.0
        start_time
            01-Aug-13 22:26:15
        title
            internal use
        user:NXuser
            name
                internal
            namelocalcontact
                internal
            proposal
                internal use
        wavelength
            float32[1] 12.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nxdeconstruct.py
Type: text/x-python
Size: 3700 bytes
Desc: not available
URL: <http://lists.nexusformat.org/pipermail/nexus-committee/attachments/20140902/cc468ece/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5013 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.nexusformat.org/pipermail/nexus-committee/attachments/20140902/cc468ece/attachment.p7s>


More information about the NeXus-committee mailing list