Commit 73df193e authored by Savici, Andrei T's avatar Savici, Andrei T
Browse files

Merge branch '1dheadertitle-0209' into 'next'

change default value in save_iqmod

See merge request sns-hfir-scse/sans/sans-backend!944
parents 18f852fa 78f06e8c
Pipeline #201556 failed with stages
in 27 minutes and 15 seconds
......@@ -555,7 +555,7 @@ def save_iqmod(
sep=" ",
float_format="%.6E",
skip_nan=True,
header_type=HeaderType.PANDAS.value,
header_type=HeaderType.MANTID_ASCII.value,
):
r"""
Write the ~drtsans.dataobjects.IQmod object into an ASCII file.
......@@ -577,6 +577,11 @@ def save_iqmod(
Format string for floating point numbers.
skip_nan: bool
If true, any data point where intensity is NAN will not be written to file
header: text
Determine the header type to make 1D data compatible with panda or Mantid
possible values:
HeaderType.MANTID_ASCII.value
HeaderType.PANDAS.value
"""
if header_type == HeaderType.MANTID_ASCII.value:
from drtsans.save_ascii import save_ascii_binned_1D
......
......@@ -132,7 +132,7 @@ def test_save_load_iqmod_pandas():
iq = IQmod([1, 2, 3, np.nan], [4, 5, 6, 0], [7, 8, 9, 0])
filename = tempfile.NamedTemporaryFile("wb", suffix=".dat").name
# Save
save_iqmod(iq, filename)
save_iqmod(iq, filename, header_type="Pandas")
# Load
iq_other = load_iqmod(filename)
# Verify
......@@ -283,7 +283,7 @@ def test_save_load_iqmod_dq():
filename = tempfile.NamedTemporaryFile("wb", suffix=".dat").name
# Save
save_iqmod(iq, filename)
save_iqmod(iq, filename, header_type="Pandas")
# Load
iq_other = load_iqmod(filename)
# Verify
......
Supports Markdown
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