Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions pyCHX/Create_Report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1948,10 +1948,10 @@ def export_xpcs_results_to_h5(filename, export_dir, export_dict):
fout = export_dir + filename
dicts = ["md", "qval_dict", "qval_dict_v", "qval_dict_p"]
dict_nest = ["taus_uids", "g2_uids"]
dataframe_keys = ["g2_fit_paras", "g2b_fit_paras", "spec_km_pds", "spec_pds", "qr_1d_pds"]

hf = _open_xpcs_h5(fout)
try:
flag = False
for key in list(export_dict.keys()):
# print( key )
if key in dicts: # =='md' or key == 'qval_dict':
Expand All @@ -1963,19 +1963,18 @@ def export_xpcs_results_to_h5(filename, export_dir, export_dict):
except Exception:
print("Can't export the key: %s in this dataset." % key)

elif key in ["g2_fit_paras", "g2b_fit_paras", "spec_km_pds", "spec_pds", "qr_1d_pds"]:
try:
_write_xpcs_dataframe(export_dict[key], fout, key)
except Exception:
flag = True
elif key in dataframe_keys:
# pandas opens the HDF5 file itself, so write these entries
# after the h5py handle has been closed.
continue
else:
_write_xpcs_array(hf, key, export_dict[key])
finally:
_close_xpcs_h5(hf)
if flag:
for key in list(export_dict.keys()):
if key in ["g2_fit_paras", "g2b_fit_paras", "spec_km_pds", "spec_pds", "qr_1d_pds"]:
_write_xpcs_dataframe(export_dict[key], fout, key)

for key in dataframe_keys:
if key in export_dict:
_write_xpcs_dataframe(export_dict[key], fout, key)

print("The xpcs analysis results are exported to %s with filename as %s" % (export_dir, filename))

Expand Down
3 changes: 2 additions & 1 deletion pyCHX/chx_generic_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ def copy_data(old_path, new_path="/tmp/"):
Copy Eiger file containing master and data files to a new path
old_path: the full path of the Eiger master file
new_path: the new path

Updated default new_path to "/tmp/"
"""
import glob
import shutil
Expand All @@ -1163,6 +1163,7 @@ def delete_data(old_path, new_path="/tmp/"):
Delete copied Eiger file containing master and data in a new path
old_path: the full path of the Eiger master file
new_path: the new path
Updated default new_path to "/tmp/"
"""
import glob

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies = [
"scikit-beam>=0.0.27,<0.1",
"scikit-image>=0.20,<1",
"scipy>=1.9,<2",
"tables>=3.9",
"tifffile>=2022.8",
"threadpoolctl>=3.1",
"tqdm>=4.64",
Expand Down
Loading