Arbitrary distribution for a user defined source

Dear David,

Thank you for your explanation, it does help a lot.

I have been messing around with your implementation and what I am thinking is if there is way to show multiple times the same distribution, e.g.:

I want to sample from 0 to 20 and the beam is centered at 10. Without rescaling the distribution it should go from (10-π/2) to (10+π/2). Looking again to my x axis I know that from (10+π/2) to (10+3π/2) and from (10-π/2) to (10-3π/2) my distribution would be negative so I want to show this empty. Then I would have 3 “beams” one centered at (10+2π), one centered at (10) and one centered at (10-2π).

Something like this,
basicsource.f (6.6 KB) basicsource.flair (3.2 KB) basicsource.inp (1.2 KB)
But without having to define 3 beams.

Does this make sense?

Thank you for your time.

Best Regards,
Carlos