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

Laser Classes #52

Closed
soerenjalas opened this issue Jun 8, 2017 · 3 comments
Closed

Laser Classes #52

soerenjalas opened this issue Jun 8, 2017 · 3 comments
Assignees
Milestone

Comments

@soerenjalas
Copy link
Member

To have a more flexible way of initializing laser beams in a simulation we could introduce laser classes which are passed to the antenna or the direct initialization.

I would propose something like this:

In profiles.py define classes like

class GenericLaser(object)
def __init__(a0, w0, lambda, boost, ...):
# The class contains all information about the laser.
    self.a0 = a0
    self.w0 = w0
    self.lambda = lambda
def profile(z,r,t):
# A function that only depends on time and space coordinates
    return E

These objects would then be passed to LaserAntenna() or add_laser() as a parameter laser where then laser.profile(z,r,t) would be called.
For a user it would look like this

sim = Simulation(...)
laser = FancyLaserClassIMade(a0=12345)
add_laser(sim, laser=laser)
step(10000)

The benefit of this would be that I think it declutters the code a little since all laser parameters only live in profiles.py and that the user can define a custom laser in his input script. Plus, as all the laser information is stored in an object it could be used for e.g. a simulation preview plot etc.

@MKirchen
Copy link
Contributor

Just a quick comment:

We want to have a function sim.add_laser(LaserObject, method="antenna", boost=BoostConverter),
where "boost" is optional. In the ideal case, the boost object would be attached to sim (e.g. sim.boost = BoostConverter) and sim.add_laser would then use this boost converter by default to boost any laser that is added to the simulation.

@MKirchen MKirchen added the API label Jun 13, 2017
@MKirchen MKirchen added this to the Future milestone Jun 13, 2017
@MKirchen
Copy link
Contributor

MKirchen commented Mar 4, 2018

Should we close this issue? @RemiLehe

@RemiLehe
Copy link
Member

RemiLehe commented Mar 4, 2018

Yes, it is now implemented (in a slightly different form) in the dev branch.

@RemiLehe RemiLehe closed this as completed Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants