Commit f7a114cb authored by Carsten Richter's avatar Carsten Richter

Merge branch 'fabio' into 'master'

Replace EdfFile by fabio

Closes #27

See merge request !71
parents a5e92a11 ea7c1217
Pipeline #4441 passed with stages
in 3 minutes and 41 seconds
......@@ -39,7 +39,7 @@ stages:
# TODO use requirements file - pip install -r requirements.txt
# Install numpy first as it is needed to build xrayutilities
- pip install numpy --only-binary numpy
- pip install h5py scipy silx xrayutilities --only-binary scipy,h5py,silx
- pip install h5py fabio scipy silx xrayutilities --only-binary scipy,h5py,silx,fabio
- which python
- python ./ci/info_platform.py
script:
......
......@@ -723,6 +723,7 @@ def get_project_configuration(dry_run):
# for most of the computation
"numpy%s" % numpy_requested_version,
"h5py",
"fabio",
"silx>=0.8.0",
"xrayutilities",
"scipy",
......@@ -732,7 +733,7 @@ def get_project_configuration(dry_run):
setup_requires = ["setuptools", "numpy", "Cython>=0.21.1"]
extras_require = {
"GUI": ["PyOpenGL", "matplotlib", "PyQt5"]
"gui": ["PyOpenGL", "matplotlib", "PyQt5"]
}
package_data = {
......@@ -745,7 +746,7 @@ def get_project_configuration(dry_run):
}
entry_points = {
'console_scripts': ['xsocs = xsocs.__main__:main [GUI]'],
'console_scripts': ['xsocs = xsocs.__main__:main [gui]'],
}
cmdclass = dict(
......
......@@ -42,7 +42,7 @@ from multiprocessing import Pool, cpu_count, Manager
import h5py
import numpy as np
from silx.third_party import EdfFile
import fabio
from ...io import XsocsH5
......@@ -754,7 +754,7 @@ def _add_edf_data(scan_id,
progress[proc_idx] = 1
entry_h5f.copy_group(spec_h5_fn, scan_id, entry)
with h5py.File(spec_h5_fn) as spec_h5:
with h5py.File(spec_h5_fn, mode='r') as spec_h5:
command = spec_h5[scan_id]['title'][()]
command_params = parse_scan_command(command)
......@@ -775,12 +775,12 @@ def _add_edf_data(scan_id,
entry=entry)
progress[proc_idx] = 2
edf_file = EdfFile.EdfFile(img_f, access='r', fastedf=True)
edf_file = fabio.open(img_f)
progress[proc_idx] = 5
n_images = edf_file.GetNumImages()
n_images = edf_file.nframes
image = edf_file.GetData(0)
image = edf_file.data
dtype = image.dtype
img_shape = image.shape
......@@ -821,7 +821,7 @@ def _add_edf_data(scan_id,
raise Exception('Merge of scan {0} aborted.'
''.format(scan_id))
data = edf_file.GetData(i)
data = edf_file.getframe(i).data
image_dset[i, :, :] = data[row:row+img_shape[0],
column:column+img_shape[1]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment