-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore compatibility with tiled branch of silx
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,14 @@ | |
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
import os | ||
import sys | ||
import posixpath | ||
import h5py | ||
import logging | ||
from PyMca5.PyMcaGui import PyMcaQt as qt | ||
from PyMca5.PyMcaCore import DataObject | ||
from PyMca5.PyMcaCore.NexusDataSource import silxh5open | ||
from PyMca5.PyMcaGui.io.hdf5 import QNexusWidget | ||
from PyMca5.PyMcaGui.pymca import QStackWidget | ||
from PyMca5.PyMcaIO import HDF5Stack1D | ||
|
@@ -160,7 +162,16 @@ def _stackSignal(self, index=-1, load=False): | |
stack = phynxFile[name] | ||
else: | ||
#create a new instance | ||
phynxFile = h5py.File(filename, 'r') | ||
if os.path.exists(filename): | ||
# this already tries silx | ||
phynxFile = h5py.File(filename, "r") | ||
elif '%' in name: | ||
try: | ||
phynxFile = h5py.File(name, 'r', driver='family') | ||
except Exception: | ||
phynxFile = silxh5open(filename) | ||
else: | ||
phynxFile = silxh5open(filename) | ||
stack = phynxFile[name] | ||
|
||
# try to find out the "energy" axis | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters