Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jl-wynen
Copy link
Member

No description provided.

Comment on lines +37 to +39
positions=positions,
components=components,
pixel_size=pixel_size,
Copy link
Member

@nvaytet nvaytet Mar 30, 2022

Choose a reason for hiding this comment

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

Why did you list these 3 arguments explicitly? They seem to just be forwarded to the scippneutron instrument_view.
Can they just be part of the kwargs?
Is it because you wanted to have the type-hints? I see they are missing from the scippneutron instrument_view. Maybe we should add them there instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

These are the explicit arguments of instrument_view. Listing them explicitly means that they can be found by help(powgen.instrument_view), autocompletion, etc.

@jl-wynen
Copy link
Member Author

I disabled the failing tests because this is a bug in Mantid. See mantidproject/mantid#33690

Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

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

There seems to be an issue with the filtering by proton charge.
Screenshot at 2022-03-30 16-46-15

@jl-wynen
Copy link
Member Author

I disabled handling of the empty instrument data because I can't seem to get it to work with normalisation by proton charge. See the long comment in load.py. Please let me know if you have a better idea! (@celinedurniak)

@celinedurniak
Copy link
Collaborator

@jl-wynen With the set of POWGEN data files we are using, I think the option you chose after normalisation by proton charge is fine.

"id": "df5f7a70-ac69-47dc-b0c1-1139728d2878",
"metadata": {},
"source": [
"### Focus into $2\\theta$ bins"
Copy link
Member

Choose a reason for hiding this comment

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

We renamed 'focus' to 'group' in the python function. Should we also remove the term Focus here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed all mentions of 'focus'

" start=25.0,\n",
" stop=90.0,\n",
" num=16)\n",
"sample_focussed = diffraction.group_by_two_theta(sample_dspacing,\n",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"sample_focussed = diffraction.group_by_two_theta(sample_dspacing,\n",
"sample_grouped = diffraction.group_by_two_theta(sample_dspacing,\n",

" num=16)\n",
"sample_focussed = diffraction.group_by_two_theta(sample_dspacing,\n",
" edges=two_theta)\n",
"vana_focussed = diffraction.group_by_two_theta(vana_dspacing, edges=two_theta)"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"vana_focussed = diffraction.group_by_two_theta(vana_dspacing, edges=two_theta)"
"vana_grouped = diffraction.group_by_two_theta(vana_dspacing, edges=two_theta)"

},
"outputs": [],
"source": [
"sc.histogram(all_spectra, bins=dspacing_edges).plot()"
Copy link
Member

Choose a reason for hiding this comment

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

Why the strange unit on the y axis?
Screenshot at 2022-04-25 13-51-38

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't know. Must be some strange scaling in the unit from dividing them for normalisation.

Copy link
Member Author

Choose a reason for hiding this comment

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

The sample and vanadium have different units for the proton charge. When dividing them, we get the 2.7e-10 scale in the plot. I changed normalize_by_vanadium to convert to unit='one' to eliminate the scale.

"id": "fb474efb-692f-4f2d-9243-23ff9319dd76",
"metadata": {},
"source": [
"For a better resolution, we now group ('focus') the sample and vanadium data into a number of bins in the scattering angle [$2\\theta$](https://scipp.github.io/scippneutron/user-guide/coordinate-transformations.html)\n",
Copy link
Member

Choose a reason for hiding this comment

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

Something seems to go wrong in sphinx with the rendering of math in a link?
Screenshot at 2022-04-25 13-51-44

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

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

Looking good. Just one more suggestion for hiding the long url.

In addition, I don't see anything in the release notes.
Can you add something?

Thanks

jl-wynen and others added 2 commits April 25, 2022 16:21
@jl-wynen jl-wynen merged commit a91762c into main Apr 25, 2022
@jl-wynen jl-wynen deleted the start-diffraction branch April 25, 2022 14:42
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.

5 participants