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

Add illustration of inhomogeneity from absorption #113

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jokasimr
Copy link
Contributor

@celinedurniak mentioned that for #22 it would be good to be able to visualize the effect of absorption on the intensity in the detector.

@jokasimr
Copy link
Contributor Author

Screenshot from 2024-12-10 13-18-01

"id": "15",
"metadata": {},
"source": [
"## Display inhomogeneity from absorption\n",
Copy link
Member

Choose a reason for hiding this comment

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

Nice way of visualizing, but I am not sure this is the right notebook to put it in?
It feels sort of unrelated to the rest?

Would it be better as part of something like a gallery notebook (even though we don't have a gallery yet?).
Or even keep a list of 'recipes' in e.g. our github discussions (and refer to them in the docs)?
This visualization sounds like it is something that the instrument scientist would find useful just for themselves, but isn't a necessary part of a reduction workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, we can put it in a separate notebook.

It's mainly useful for IS to estimate what kind of impact absorption has in some experiment setup.
Celine mentioned that this would be good step towards having an automatic absorption correction.
Making absorption correction part of the workflow is started in #104

Comment on lines 8 to 17
"# DREAM instrument view\n",
"\n",
"This notebook is a simple example of how to use the instrument view for the DREAM instrument.\n",
"\n",
"- The DREAM-specific instrument view is capable of slicing the data with a slider widget along a dimension (e.g. `tof`) by using the `dim` argument.\n",
"- There are also checkboxes to hide/show the different elements that make up the DREAM detectors.\n",
"\n",
"We begin with relevant imports.\n",
"We will be using tutorial data downloaded with `pooch`.\n",
"If you get an error about a missing module `pooch`, you can install it with `!pip install pooch`:"
Copy link
Member

Choose a reason for hiding this comment

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

I think the text in here needs updating? (seems it was copied from the instrument view notebook)

@jokasimr jokasimr requested a review from nvaytet January 20, 2025 10:42
@@ -0,0 +1,171 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

If you want this notebook to appear in the docs, you need to add it to the dream/index.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot that, thanks.

@jokasimr jokasimr requested a review from nvaytet January 23, 2025 08:31
"metadata": {},
"source": [
"As expected the impact of absorption on the inhomgenity of the intensity is not nearly as large for the endcap detector as it is for the mantle detector."
"As expected the impact of absorption on on the intensity in the endcap detector is close to uniform."
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look so uniform when you look at the figure... until you look at the colorbar.
Screenshot_20250123_142736

Should we use some common colorbar limits for all 3 views?

Also, do we really have to use the heavy instrument view, or could we use 2d scatter plots instead?
You could make z-y plots for the mantle, and x-y plot for the end cap?

The 3d views dramatically increase the size of the docs, and thus the repository itself.
It would also mean that you don't need to mess around with Camera settings...

Copy link
Contributor Author

@jokasimr jokasimr Jan 23, 2025

Choose a reason for hiding this comment

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

Should we use some common colorbar limits for all 3 views?

No I don't think that's important. It's better to keep it simple and to make it look like something they might encounter in their own notebook.

The 3d views dramatically increase the size of the docs, and thus the repository itself.

I didn't know that, why does it increase the size of the repo?
I see what you mean.

Did you check how much the repo size is increased?

We could make it 2d, it's not good to make the repo cumbersome to download. Byt the 3d view is nicer to play around with.

Copy link
Contributor Author

@jokasimr jokasimr Jan 24, 2025

Choose a reason for hiding this comment

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

Took a look at the sizes now, after building the docs locally I have the following files:

-rw-rw-r-- 1 johannes johannes  17M jan 23 09:26 dream-instrument-view.html
-rw-rw-r-- 1 johannes johannes  18M jan 23 09:25 dream-instrument-view.ipynb
-rw-rw-r-- 1 johannes johannes 4,5M jan 23 09:26 dream-visualize-absorption.html
-rw-rw-r-- 1 johannes johannes 4,8M jan 23 09:25 dream-visualize-absorption.ipynb

So it seems the absorption visualization notebook is significantly smaller than the instrument view notebook.

I also tried cloning essdiffraction to check how fast it was to download:

~/crap $ git clone https://github.com/scipp/essdiffraction.git
Cloning into 'essdiffraction'...
Receiving objects: 100% (3761/3761), 9.63 MiB | 10.66 MiB/s, done.

Compressed it seems the size (of the current repo) is closer to 10Mb.

Overall I get the impression that it doesn't really matter if we put this file here, it's unlikely to make the repo hard to download for anyone.

Copy link
Member

Choose a reason for hiding this comment

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

10Mb is a lot. Maybe we should really reduce the size of the instrument view notebook?

the 3d view is nicer to play around with.

It might be nice to play with, but I don't think it adds any information to what we are viewing? I think the views might be clearer in 2D. I will have a go at making them and we can compare.

Copy link
Contributor Author

@jokasimr jokasimr Jan 27, 2025

Choose a reason for hiding this comment

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

  1. 10Mb is not a lot, it takes 2s to download.
  2. This change is easily revertible. If we notice slowness we can update the docs and redeploy.

It might be nice to play with, but I don't think it adds any information to what we are viewing?

Let's just ask Celine if this solves her use-case? Then we don't have to guess and re-implement something that already works.

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

Successfully merging this pull request may close these issues.

2 participants