Skip to content

Commit

Permalink
Merge pull request #34 from prjemian/development
Browse files Browse the repository at this point in the history
h5toText: read variable length strings from HDF5 files and provide
  • Loading branch information
prjemian committed Feb 14, 2015
2 parents a5e9252 + 2519a29 commit 9bf9c5d
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 416 deletions.
11 changes: 6 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ Change History
Production
**********

:2015.0127.0: ignore bad data lines
:2015.0125.0: change handling of #L & #X, refactor detection of scanNum and scanCmd
:2015.0214.0: h5toText: handle HDF5 'O' data type (variable length strings)
:2015.0127.0: spec: ignore bad data lines
:2015.0125.0: spec: change handling of #L & #X, refactor detection of scanNum and scanCmd
:2015.0113.0: dropped requirement of *lxml* package
:2014.1228.1: build mne:name cross-references for counters and positioners
:2014.1228.1: spec: build mne:name cross-references for counters and positioners
:2014.1228.0: show version in documentation
:2014.1028.0: quietly ignore unrecognized scan content *for now*
:2014.1027.1: major changes in SPEC file support: **custom plugins**
:2014.1028.0: spec: quietly ignore unrecognized scan content *for now*
:2014.1027.1: spec: major changes in SPEC file support: **custom plugins**

* **spec** based on plugins for each control line, users can add plugins
* declared **prjPySpec** module as legacy, code is frozen at *2014.0623.0* release
Expand Down
2 changes: 1 addition & 1 deletion src/spec2nexus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------

__version__ = '2015.0127.0'
__version__ = '2015.0214.0'
__release__ = __version__
__author__ = 'Pete R. Jemian'
__email__ = 'prjemian@gmail.com'
Expand Down
Binary file modified src/spec2nexus/data/Data_Q.h5
Binary file not shown.
2 changes: 1 addition & 1 deletion src/spec2nexus/data/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ file type description
APS_spec_data.dat SPEC scans 1-D scans (ascan & uascan), includes lots of metadata and comments
CdSe SPEC scans 1-D scans (ascan), problem with scan abort on lines 5918-9, in scan 92
compression.h5 NeXus HDF5 2-D compressed image, also demonstrates problem to be resolved in code
Data_Q.h5 NeXus HDF5 2-D image at /entry/data/{I,Q}, test file
Data_Q.h5 NeXus HDF5 2-D image at /entry/data/{I,Q}, test file and variable-length strings
lmn40.spe SPEC scans 1-D & 2-D scans (hklmesh), two #E lines, has two header sections
writer_1_3.h5 NeXus HDF5 1-D NeXus User Manual example
YSZ011_ALDITO_Fe2O3_planar_fired_1.spc SPEC scans 1-D scans, text in #V metadata, also has #UIM control lines
Expand Down
75 changes: 38 additions & 37 deletions src/spec2nexus/dev_h5toText.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''developer test for h5toText'''

#-----------------------------------------------------------------------------
# :author: Pete R. Jemian
# :email: prjemian@gmail.com
# :copyright: (c) 2014-2015, Pete R. Jemian
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------


import os
import sys
import h5toText

testpath = os.path.abspath(os.path.split(__file__)[0])

sys.argv = [sys.argv[0],]
# sys.argv.append('-h')
# sys.argv.append('-V')
# sys.argv.append('-a')
# sys.argv.append('-n')
# sys.argv.append('6')
sys.argv.append(os.path.join(testpath, 'data', 'writer_1_3.h5'))
sys.argv.append(os.path.join(testpath, 'data', 'Data_Q.h5'))


# Show how to get the help/usage text
# sys.argv = [sys.argv[0], ]
# sys.argv.append('-h')

h5toText.main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''developer test for h5toText'''

#-----------------------------------------------------------------------------
# :author: Pete R. Jemian
# :email: prjemian@gmail.com
# :copyright: (c) 2014-2015, Pete R. Jemian
#
# Distributed under the terms of the Creative Commons Attribution 4.0 International Public License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------


import os
import sys
import h5toText

testpath = os.path.abspath(os.path.split(__file__)[0])

sys.argv = [sys.argv[0],]
# sys.argv.append('-h')
# sys.argv.append('-V')
# sys.argv.append('-a')
# sys.argv.append('-n')
# sys.argv.append('6')
# sys.argv.append(os.path.join(testpath, 'data', 'writer_1_3.h5'))
sys.argv.append(os.path.join(testpath, 'data', 'Data_Q.h5'))
# sys.argv.append(os.path.join(os.environ['HOMEPATH'], 'Desktop', 'thau_1.nxs.hdf'))


# Show how to get the help/usage text
# sys.argv = [sys.argv[0], ]
# sys.argv.append('-h')

h5toText.main()

0 comments on commit 9bf9c5d

Please sign in to comment.