ColwynGulliford / distgen

Particle distribution generator
https://colwyngulliford.github.io/distgen/
Apache License 2.0
12 stars 8 forks source link

Cannot read particle distribution with gpt.easygdf #17

Closed petr-lanl closed 3 months ago

petr-lanl commented 4 months ago

I am trying to load distgen generated initial distribution, gpt.particles.gdf , with lume-gpt version of easygdf. I am getting a wrong GDF Magic number (544809080). Using distgen v2.0.2 and lume-gpt v0.7.9. Any idea why that would be?

Here is my distgen.yaml:

species: electron
n_particle: 2000
random_type: hammersley

total_charge:
  units: pC
  value: 250

r_dist:
  n_sigma_cutoff:
    units: dimensionless
    value: 1.2
  sigma_xy:
    units: mm
    value: 1
  type: rg

t_dist:
  type: sg
  p:
    units: dimensionless
    value: 10
  sigma_t: 
    units: ps
    value: 1

output:
  file: gpt.particles.gdf
  type: gpt

start:
  MTE:
    units: meV
    value: 5
  type: cathode

transforms:
  order:
  - t2
  - t3
  - t4
  t2:
    sigma_xy:
      units: mm
      value: 0.260
    type: set_stdxy x:y
  t3:
    sigma_t:
      units: ps
      value: 2.36 
    type: set_std t
  t4:
    avg_x:
      units: mm
      value: 0.0
    type: set_avg x
ColwynGulliford commented 4 months ago

I will test today and see if I can reproduce the issue!

ColwynGulliford commented 4 months ago

I am not able to reproduce the issue at the moment, here's tracking your beam made by Distgen through a 500 kV DC gun + solenoid:

Screenshot 2024-05-08 at 11 06 32 AM Screenshot 2024-05-08 at 11 03 16 AM

Can you show the python code that you use to generate the beam and track? Also, easygdf is code from lume-GPT, so it is likely that whatever issue there is, it is not because of Distgen.