Skip to content

Conversation

@carlandreaslindstrom
Copy link
Collaborator

An important use of ABEL beyond the collider application is that of doing simulations for experiments. We specifically wish to implement PWFA experiments (FACET-II and FLASHForward for now) and APL experiments (CLEAR and CLARA for now).

To do:

  • Make sure Experiment works properly
  • Make PWFA and APL layer with useful ready-made scans (like density scans and lens-offset scans, etc.) and plotting functions etc.
  • Make useful presents for FLASHForward, FACET-II, CLEAR and CLARA.

carlandreaslindstrom and others added 30 commits May 2, 2025 20:23
…d some tweaking to allow no separate driver.
…. will likely change it to add g and B as attributes, so I can set Experiment.spectrometer.g/B directly when running a simulation
…ad-field-gradient like experiment.spectrometer.g after creating an instance of the experiment, since it contains an instsance of the spectrometer class as an attribute. Same goes for the dipole field B_dipole
… to main. Kept functionality which allows for no driver
…tom title as input. This is for plot_spectrometer_x
cb.ax.set_ylabel('Charge density (pC/um^2)')


def plot_spectrometer_x(self, range_x=None, range_y=None, vlim=None, title=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved to spectrometer.py.

self.trackable_number = -1 # will increase to 0 after first tracking element
self.stage_number = 0
self.location = 0
self.location = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set these in the argument list as defaults instead.

# ========== Rotate the coordinate system of the beams ==========
# Perform beam rotations before calling on upramp tracking.
if self.parent is None: # Ensures that this is the main stage and not a ramp.
if self.parent is None and self.driver_source is not None: # Ensures that this is the main stage and not a ramp.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in order for Experiment tracking to work, since the stages in Experiment does not have a driver source. I am wondering if this patch can be done more elegantly. In any case, if we use this solution, this needs to be done for the other stages too.


# Will only rotate the beam coordinate system if the driver source of the stage has angular jitter or angular offset
drive_beam_rotated, beam_rotated = self.rotate_beam_coordinate_systems(driver_incoming, beam_incoming)
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in order for Experiment tracking to work, since the stages in Experiment does not have a driver source. I am wondering if this patch can be done more elegantly. In any case, if we use this solution, this needs to be done for the other stages too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants