Skip to content

Commit

Permalink
Fixing bba (#31)
Browse files Browse the repository at this point in the history
* Fits and error propagation in data analysis

* Streamlined and sped up the beam reach scan

* Removed unnecessary parameters, typically cuts

* Separated real and simulation-only observables

* Merged pseudoBBA and fake measurement functionality to fake_bba

* Adding BBA to tests

* Still some TODOs for later
    ODR in analysis
    interface of orbit BBA
  • Loading branch information
lmalina authored Sep 27, 2023
1 parent 6a17c71 commit b032216
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 359 deletions.
10 changes: 10 additions & 0 deletions pySC/core/simulated_commissioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def register_magnets(self, ords: ndarray, **kwargs): # TODO docstring is too lo
if ind not in self.SIG.Magnet.keys():
self.SIG.Magnet[ind] = DotDict()
self.SIG.Magnet[ind].update(nvpairs)
# TODO Correctors
for ab in AB:
order = len(getattr(self.RING[ind], f"Polynom{ab}"))
for field in ("NomPolynom", "SetPoint", "CalError"):
Expand Down Expand Up @@ -948,6 +949,15 @@ def _dipole_compensation(self, ord, setpoint):
(setpoint - self.RING[ord].SetPointB[1]) / self.RING[ord].NomPolynomB[1] * self.RING[ord].BendingAngle,
skewness=False, method=SETTING_ADD)

def very_deep_copy(self):
copied_structure = copy.deepcopy(self)
copied_structure.RING = self.RING.deepcopy()
copied_structure.IDEALRING = self.IDEALRING.deepcopy()
for ind, element in enumerate(self.RING):
copied_structure.RING[ind] = element.deepcopy()
copied_structure.IDEALRING[ind] = element.deepcopy()
return copied_structure

def verify_structure(self):
"""
Verifies the integrity of SimilatedCommissionining class instance and warns if things look fishy.
Expand Down
Loading

0 comments on commit b032216

Please sign in to comment.