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

Charged Particle Radiography: Detector Stacks #1274

Merged
merged 208 commits into from Dec 14, 2022

Conversation

pheuer
Copy link
Member

@pheuer pheuer commented Sep 22, 2021

Charged particle radiography detectors are usually comprised of multiple layers of active medium, each of which detects different energies of particles based on their Bragg peak. This PR adds a couple objects that represent these detector stacks and calculates the energies deposited in each layer using stopping power data from NIST.

This is Step 1 of adding support for detector stacks. Step 2, in a future PR, will create a new synthetic_radiograph function that takes a film stack object and produces a synthetic radiograph in each layer.

This PR depends on #1486 and should be merged after that PR Done

pheuer and others added 30 commits May 8, 2021 10:14
proton_radiography -> charged_particle_radiography
SyntheticProtonRadiograph -> Tracker
This information will be used later in more sophisticated synthetic radiograph functions that calculate deposition of particles in various layers of film.
Co-authored-by: Erik Everson <eteverson@gmail.com>
…diography.py

Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
@pheuer
Copy link
Member Author

pheuer commented Dec 13, 2022

@namurphy Something appears to not quite be working with the substitution for Layer?

Maybe it can't go in that parameters section?

image

@pheuer
Copy link
Member Author

pheuer commented Dec 13, 2022

I think I fixed the issue with the substitution by moving it earlier before the parameters block.

Here are the remaining doc errors, broadly in two categories

A number of this first set relate to things like nenergies being marked like markdown but not corresponding to any actual variable?

/home/runner/work/PlasmaPy/PlasmaPy/plasmapy/diagnostics/charged_particle_radiography/detector_stacks.py:docstring of plasmapy.diagnostics.charged_particle_radiography.detector_stacks.Stack.deposition_curves:2: WARNING: py:obj reference target not found: nenergies
/home/runner/work/PlasmaPy/PlasmaPy/plasmapy/diagnostics/charged_particle_radiography/detector_stacks.py:docstring of plasmapy.diagnostics.charged_particle_radiography.detector_stacks.Stack.deposition_curves:17: WARNING: py:obj reference target not found: nlayers
/home/runner/work/PlasmaPy/PlasmaPy/plasmapy/diagnostics/charged_particle_radiography/detector_stacks.py:docstring of plasmapy.diagnostics.charged_particle_radiography.detector_stacks.Stack.deposition_curves:17: WARNING: py:obj reference target not found: nenergies
/home/runner/work/PlasmaPy/PlasmaPy/plasmapy/diagnostics/charged_particle_radiography/detector_stacks.py:docstring of plasmapy.diagnostics.charged_particle_radiography.detector_stacks.Stack.energy_bands:17: WARNING: py:obj reference target not found: nlayers

The rest are related to broken links in the What's New sections. I would suggest just removing this folder from the space that CI checks? Otherwise links will of course break every time we refactor anything.

/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:42: WARNING: py:func reference target not found: plasmapy.diagnostics.charged_particle_radiography.synthetic_radiograph
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:42: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:42: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker.results_dict
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:49: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:53: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:53: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:116: WARNING: py:meth reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker.save_results
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:116: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.Tracker
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:153: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.synthetic_radiograph
/home/runner/work/PlasmaPy/PlasmaPy/docs/whatsnew/0.7.0.rst:[28](https://github.com/PlasmaPy/PlasmaPy/actions/runs/3682075943/jobs/6229365410#step:6:29)9: WARNING: py:obj reference target not found: plasmapy.diagnostics.charged_particle_radiography.synthetic_radiograph

@StanczakDominik
Copy link
Member

StanczakDominik commented Dec 13, 2022

Wow, pretty obvious in retrospect! The thing is, this is the actual sphinx build we're checking for the warnings. Obviously it's not enough anymore. I guess instead of running sphinx-build -W we could do sphinx-build -w output.log, then grep (well, regex) for PlasmaPy/docs/whatsnew/.*\.rst:.* WARNING: py:obj reference target not found .* and raise (or rather sys.exit(1) if any other warnings are found. Can't be that hard. Will do.

On the nenergies stuff... @namurphy, @rocco8773?

@pheuer
Copy link
Member Author

pheuer commented Dec 13, 2022

On the nenergies stuff... @namurphy, @rocco8773?

These lines look like this:

energies : (`nenergies`,) `~astropy.units.Quantity` array
            Energies axis over which to calculate the deposition. Units
            convertible to J.

There is no variable nenergies. I could just remove the `` which would be the easiest solution?

@StanczakDominik
Copy link
Member

Let's try it!

@StanczakDominik
Copy link
Member

Actually, wisdom by @namurphy: do ``nenergies``, and it should work!

- Moved Layer link to common links
@namurphy
Copy link
Member

Still getting a doc build error, seemingly due to a reST formatting problem.

WARNING: :40: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.
WARNING: :47: (WARNING/2) Definition list ends without a blank line; unexpected unindent.

It would have been helpful if it had said the file that the issue is occurring in...sigh!

pheuer and others added 3 commits December 14, 2022 08:53
Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
…diography.py

Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
@pheuer
Copy link
Member Author

pheuer commented Dec 14, 2022

It would have been helpful if it had said the file that the issue is occurring in...sigh!

Indeed...let's see if this works!

@pheuer pheuer merged commit bbd012e into PlasmaPy:main Dec 14, 2022
@pheuer
Copy link
Member Author

pheuer commented Dec 14, 2022

@namurphy that worked! Merging before the linters change their mind :)

@namurphy
Copy link
Member

namurphy commented Dec 14, 2022

@namurphy that worked! Merging before the linters change their mind :)

Congratulations on getting it merged! 🎈🎂🎆

It's strange that my suggestion actually worked. 👀🤔

@namurphy namurphy removed the status: ready for review PRs that are ready for code review label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebooks Related to example Jupyter notebooks in docs/examples/ plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage
Projects
HEDP Diagnostics
Awaiting Review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants