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

Diffmap enhancements #2394

Merged
merged 27 commits into from
Jan 30, 2025
Merged

Diffmap enhancements #2394

merged 27 commits into from
Jan 30, 2025

Conversation

kif
Copy link
Member

@kif kif commented Jan 24, 2025

Start using WorkerConfig
Update the way polarization works
close #2396
close #2390
close #2383
close #2382

@kif kif requested review from loichuder and EdgarGF93 January 24, 2025 09:01
@kif kif self-assigned this Jan 24, 2025
@EdgarGF93
Copy link
Collaborator

EdgarGF93 commented Jan 24, 2025

Continuing with the conversation from the other PR, I am thinking that the guess_binning should be done in the worker (maybe in the process method: like self.ai.detector.guess_binning(data=data)`) . Because at some point we will face the same issue, the data is binned and this information is missing. But then, the automatic mask for Dectris has to change also (this is not implemented yet)

@kif
Copy link
Member Author

kif commented Jan 24, 2025

To me it is a nonsense to bin pixel-detector data ... so for Dectris I consider it makes little sense.
I processed some files from Dectris and the mask is apparently properly binned.

src/pyFAI/gui/pilx/MainWindow.py Show resolved Hide resolved
if isinstance(axes, Iterable):
radial_path = axes[0]
if size is not None:
for idx in [0, -1, 1, -2]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can check for the size, what about going through all axes elements instead of these specific indices ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intent to make the default view (in the Nexus sense) on the map array, not on the intensity array. This is to try to ensure the different axes have the proper shape while keeping the compatibility with former files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check how pilx reacts with files produced with former version of pyFAI ...

@kif
Copy link
Member Author

kif commented Jan 26, 2025

close #2396

@kif
Copy link
Member Author

kif commented Jan 27, 2025

TODO: check pilx for the opening of diffmap files from v 2024.X

@kif kif added bug Serious issue, to be addressed in priority ! ready to merge Please review and removed work in progress Don't review enhancement labels Jan 27, 2025
@EdgarGF93
Copy link
Collaborator

EdgarGF93 commented Jan 28, 2025

pyfai-diffmap-view from the current branch can handle diffmap files generated with config files v3, v4 and v5.
I tried with these files:

dmap_pyFAI202405_configv3_gui.h5    dmap_pyFAI202409_configv4_gui.h5    dmap_pyFAIdev_configv5_gui.h5
dmap_pyFAI202405_configv3_nogui.h5  dmap_pyFAI202409_configv4_nogui.h5  dmap_pyFAIdev_configv5_nogui.h5

pyFAI 2024.05 uses a configuration file version 3
pyFAI2024.09 uses a configuration file version 4
pyFAIdev (this branch) uses a configuration file version 5

@kif
Copy link
Member Author

kif commented Jan 28, 2025

Yes, but this branch provides the motor position handling in addition.

@kif
Copy link
Member Author

kif commented Jan 28, 2025

image
look at the map, its axes are in motor position, which eases the identification of the sample position.

@EdgarGF93
Copy link
Collaborator

But 2024.x version of pyFAI cannot open the new diffmap files

pyFAI-diffmap-view pyFAI.app.pilx:main
########### IMPORTLIB ###########
Traceback (most recent call last):
  File "/gpfs/jazzy/data/scisoft/edgar/work/pyFAI/bootstrap.py", line 223, in <module>
    run_entry_point(res[1], res[2], argv)
  File "/gpfs/jazzy/data/scisoft/edgar/work/pyFAI/bootstrap.py", line 163, in run_entry_point
    func()
  File "/gpfs/jazzy/data/scisoft/edgar/work/pyFAI/build/lib/python3.12/site-packages/pyFAI/app/pilx.py", line 59, in main
    window.initData(file_name=options.filename,
  File "/gpfs/jazzy/data/scisoft/edgar/work/pyFAI/build/lib/python3.12/site-packages/pyFAI/gui/pilx/MainWindow.py", line 152, in initData
    self.displayPatternAtIndices(initial_indices, legend="INTEGRATE")
  File "/gpfs/jazzy/data/scisoft/edgar/work/pyFAI/build/lib/python3.12/site-packages/pyFAI/gui/pilx/MainWindow.py", line 180, in displayPatternAtIndices
    self._integrated_plot_widget.addCurve(
  File "/gpfs/jazzy/data/scisoft/edgar/work/silx/src/silx/gui/plot/PlotWidget.py", line 1258, in addCurve
    curve.setData(x, y, xerror, yerror, baseline=baseline, copy=copy)
  File "/gpfs/jazzy/data/scisoft/edgar/work/silx/src/silx/gui/plot/items/curve.py", line 347, in setData
    PointsBase.setData(self, x=x, y=y, xerror=xerror, yerror=yerror, copy=copy)
  File "/gpfs/jazzy/data/scisoft/edgar/work/silx/src/silx/gui/plot/items/core.py", line 1756, in setData
    assert len(x) == len(y)
AssertionError

@kif
Copy link
Member Author

kif commented Jan 29, 2025 via email

@kif kif merged commit 54d05d6 into silx-kit:main Jan 30, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Serious issue, to be addressed in priority ! ready to merge Please review
Projects
None yet
3 participants