Comments (10)
Please provide some more details on how your diagnostics where implemented and post-processed. As the two types of diagnostics process the same particles, they should match.
from smilei.
ParticleBinning diagnostic:
def angles:
return np.arctan2(particles.py, particles.px)
DiagParticleBinning(
name = 'neutron angle',
deposited_quantity = "weight",
every = every,
species = ["neutron"],
axes = [
[angles , -1*math.pi, math.pi, 360],
["ekin", 0., 50, 100, "edge_inclusive"]
]
)
And then to get spectrum I extracted the data and integrated across the appropriate angular bins. With TrackParticles, I output all variables and create a similar histogram with scipy.stats.binned_statistic_dd, something like:
stats_data = stats.binned_statistic_dd([Theta, En], values = wn, statistic = 'sum', bins=[theta_bins, energy_bins])
where Theta and energy were calculated from the tracked Px and Py components, and wn is the macroparticle weights.
from smilei.
My guess is that your method with tracked particles divides by different bin sizes than that done in happi for particle binning. As you are using a custom axis, it cannot know the geometry of your binning. It's just a guess
from smilei.
Bin sizes are the same for both tracking and particlebinning, so all energies would be affected equally when dividing by bin size, not just those <2.5 MeV. I cannot see anything strange with the weights, their values are broadly consistent above and below 2.5MeV, just that there are a significant number of tracked neutrons in that low energy range, perhaps that isn't being counted by the binning diag? Or their weights are calculated differently between the two diagnostics.
from smilei.
I have no clue what is going on here. The particle binning really just does a histogram and divides by the bin size which is indeed constant in your case.
Just in case you may want to check the raw data in the hdf5 file.
from smilei.
Just an idea that crossed my mind. You wrote "Theta and energy were calculated from the tracked Px and Py components". But there should be Pz as well for calculating the energy. Did you take it into account?
Another detail: what is the geometry, and what are boundary conditions?
from smilei.
Geometry is 2D, so I didn't output Pz component. Boundaries are silver-muller.
from smilei.
2d means x and y, but there is definitely a contribution from px.
I meant boundary conditions for particles
from smilei.
Ah ok, I can rerun the simulation outputting Pz components as well and test it out. Boundaries were open.
from smilei.
Hi, including the Pz component has resolved the issue, thanks!
from smilei.
Related Issues (20)
- Adjusting gridGlobalOffset and temporal offset HOT 7
- Keeping track of number of MPI processes and OpenMP threads HOT 3
- Beam current distribution in LWFA through AM HOT 1
- Error with "Collisions" block HOT 2
- Enabling Prescribed Field for AM Geometry HOT 1
- Magnetic field in TrackParticle and ParticleBinning diagnostics HOT 21
- Force final step to be restartable option HOT 2
- 'cannot convert float NaN to integer' error when opening Track Particles Diagnostic HOT 13
- Thermal boundary condition HOT 2
- Deprecated pyplot register_cmap HOT 3
- problems with species creation while using parallelization HOT 4
- ansys fluent
- timestep_over_CFL leads to an index error HOT 4
- AMcylindrical geometry: showing the Field diagnostic on both half planes
- Screen Diagnostic Not Working HOT 5
- PML for magnetized plasmas HOT 3
- Only electron, no ion in Species block
- The particle kinetic energy density HOT 1
- Error building HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smilei.