8000
Skip to content

Added new Examples - #253

Open
Lulus792 wants to merge 51 commits into
LumiSpy:mainfrom
Lulus792:examples
Open

Added new Examples#253
Lulus792 wants to merge 51 commits into
LumiSpy:mainfrom
Lulus792:examples

Conversation

@Lulus792
@Lulus792 Lulus792 commented Feb 5, 2026
Copy link
Copy Markdown
Contributor

Added new example map_function, energie_conversion, ROIs, peak_analysis, basic_model_fitting, custom_model_fitting and restructured the old position of the index example. And changed all the data_cleaning examples to use the build in data module of lumispy

Progress of the PR

  • added new example map_function
  • add a changelog entry in the upcoming_changes folder ,
  • ready for review.

@jlaehne jlaehne mentioned this pull request Feb 9, 2026
Comment thread examples/data_selection/indexing.py
Comment thread examples/data_selection/region_of_interest.py Outdated
Comment thread examples/data_selection/region_of_inter 10BC0 est.py Outdated
ax1 = s2.axes_manager[0]
ax2 = s2.axes_manager[1]

# define start params
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can a units argument be used here to avoid multiplying by scale factors? I think if cx, cy were not defined the default position of the circle should also place within the bounds of the signal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes we could also just leave it out completly the cx, cy and r part but the result then wouldn't be quite as good, this just the only way to show it interactively how you would then choose the area without being able to actually choose. Tho for simple demonstration of the Circle roi i could be left out.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

HyperSpy does have a nice example gallery for ROIs already, in order to not overlap too much I wonder if these examples can be a little more specific to luminescence data analysis. One thing I think could also be included is a computation of calculating the mean of a signal extracted from a ROI - though this is also included in a hyperspy example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These examples are nice but I wonder if they would be more suited to the HyperSpy example gallery? They don't seem specific to luminescence data, one idea would be to keep the Mathematical Expression header but define a exponential convolved with a gaussian (since this is useful for modelling time-resolved luminescence transients)

Comment thread examples/peak_finding/peak_width.py
Comment thread examples/peak_finding/peak_width.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe also better suited as a hyperspy example?

I don't love that the ohaver function returns a structured array instead of hyperspy signals, if this was changed I think it would make this example better as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably push to get this PR done and include a way to return data as signal: hyperspy/hyperspy#3196

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Line2D ROI example also appears under Plotting - Extraction of Linescan example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should i then just leave it out and maybe add a different roi and link to the extraction of linescan example for usage of rois like the Line2D

@Lulus792
Lulus792 force-pushed the examples branch 9 times, most recently from eecb913 to 727dbf1 Compare March 13, 2026 12:22
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably push to get this PR done and include a way to return data as signal: hyperspy/hyperspy#3196

Comment thread examples/data_processing/energy_conversion.py Outdated
Comment thread examples/data_processing/map_function.py Outdated
Comment thread examples/data_processing/energy_conversion.py Outdated
Comment thread examples/data_processing/energy_conversion.py Outdated
Comment thread examples/data_processing/map_function.py Outdated
Comment thread examples/data_processing/map_function.py Outdated
Comment thread examples/data_processing/map_function.py
Comment thread examples/data_selection/README.rst Outdated
# Indexing using Physical units
# -----------------------------
#
# Hyperspy supports indexing with physical units (floating-point) values when the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The explanation here is a bit complicated ... you only need to change the scale in this example, because otherwise the axis values are integers. On the other hand, the example with [0:np.pi] actually does indexing using physical units already - so maybe use that one to explain the concept?

@Lulus792
Lulus792 force-pushed the examples branch 3 times, most recently from 55776bb to beed5d1 Compare May 20, 2026 10:58
@jlaehne jlaehne added the documentation Improvements or additions to documentation label Aug 20, 2026
@jlaehne jlaehne added this to the v0.4 milestone Aug 20, 2026
@codecov
codecov Bot commented Aug 20, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (b574463) to head (beed5d1).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #253   +/-   ##
===========================
===========================

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0