Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[curveplot] Improve *.dat export #4178

Closed
vallsv opened this issue Oct 2, 2024 · 4 comments
Closed

[curveplot] Improve *.dat export #4178

vallsv opened this issue Oct 2, 2024 · 4 comments

Comments

@vallsv
Copy link
Contributor

vallsv commented Oct 2, 2024

Feedback from a user. That's not a high priority at all.

Tested with silx 2.1.1.

The dat export with multi curves is like exporting multiple scans instead of multiple curves.

  • Run examples/plotCurveLegendWidget.py
  • Export as dat
  • Import the dat file with pymca

image

  • Notice that there is 3 scans, and 2 counters per scans.

They would expect a single scan, with the 4 counters (3 counters + 1 axes).

BTW during the export we can notice that:

(bliss2.2) valls@lvalls:~/workspace/silx.git(fix-get-display-mode)$ python examples/plotCurveLegendWidget.py 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Qt: Session management error: None of the authentication protocols specified are supported
X ['Y'] %.7g 2 [-3.14159265 -3.14120843 -3.14082421 ...  3.14082421  3.14120843
  3.14159265] [[-0.56797773  0.67579871 -0.03870308 ... -0.52785258 -0.67234882
  -0.98853755]]
X ['Y'] %.7g 2 [-3.14159265 -3.14120843 -3.14082421 ...  3.14082421  3.14120843
  3.14159265] [[-1.22464680e-16 -3.84222170e-04 -7.68444284e-04 ...  7.68444284e-04
   3.84222170e-04  1.22464680e-16]]
X ['Y'] %.7g 2 [-3.14159265 -3.14120843 -3.14082421 ...  3.14082421  3.14120843
  3.14159265] [[-1.         -0.99999993 -0.9999997  ... -0.9999997  -0.99999993
  -1.        ]]

There is an extra print somewhere.

@t20100
Copy link
Member

t20100 commented Oct 7, 2024

This part of the code hasn't changed much in the last 6/7 years, so it's a bit risky to change the behavior now...
The most recent relevant change looks to be "Save error-bars when saving a plot" #3199 (from 2020...)

I guess it was saved with different scans rather than counters because it allows for each curves to have a different number of points.

What could be done is:

  • check that all curves have the same number of points (+ probably no error bars) and then save as a single scan... but that's kind of obscure behavior IMO
  • provide yet another save options that save all curves as one scan eventually clipping the curves that are longer or filling the ones that are too shorts

@t20100
Copy link
Member

t20100 commented Oct 7, 2024

BTW, there is indeed a print:

+++ b/src/silx/io/utils.py
@@ -423,7 +423,6 @@ def savespec(
     ncol = data.shape[0]
     assert len(labels) == ncol
 
-    print(xlabel, ylabel, fmt, ncol, x_array, y_array)
     if isinstance(fmt, str) and fmt.count("%") == 1:
         full_fmt_string = "  ".join([fmt] * ncol)
     elif isinstance(fmt, (list, tuple)) and len(fmt) == ncol:

@vallsv
Copy link
Contributor Author

vallsv commented Oct 18, 2024

In this case maybe you can close this issue, until somebody else request that. As i said, the user will use the HDF5 reader from PyMCA anyway, and will not export anymore to .dat.

Just remove the print.

@t20100
Copy link
Member

t20100 commented Nov 4, 2024

PR #4192 removes the print.
I'm closing this issue then

@t20100 t20100 closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants