xboa
Public Member Functions | Public Attributes | List of all members
EllipseClosedOrbitFinderIteration Class Reference

Data following a single pass of the closed orbit finder. More...

Inherits object.

Public Member Functions

def __init__
 Initialisation. More...
 
def calculate_ellipse
 Calculate the beam ellipse and noise list based on points. More...
 
def get_mean_noise
 Return the mean of the noise list. More...
 
def get_sigma_noise
 Return the standard deviation of the noise list. More...
 
def plot_ellipse
 Plot the beam ellipse for a set of points. More...
 
def json_repr
 Represent the iteration as a json object. More...
 

Public Attributes

 keys
 
 points
 
 eps_max
 
 centre
 
 ellipse
 
 noise
 

Detailed Description

Data following a single pass of the closed orbit finder.

Handle a single iteration of the CO finder. Few utility functions to find the ellipse, look for convergence and return outputs to the user.

Definition at line 196 of file _ellipse_closed_orbit_finder.py.

Constructor & Destructor Documentation

def __init__ (   self,
  keys,
  points,
  eps_max,
  calculate_ellipse = False 
)

Initialisation.

  • keys keys that tell us what the variables mean
  • points list of points. Each point is a list that represents a vector in the space defined by keys
  • eps_max when fitting the ellipse, ignore points with amplitude greater than eps_max
  • calculate_ellipse set to true to calculate the ellipse. Otherwise, the ellipse can be calculated by a call to calculate_ellipse()

Requires numpy

Definition at line 210 of file _ellipse_closed_orbit_finder.py.

Member Function Documentation

def calculate_ellipse (   self)
def get_mean_noise (   self)

Return the mean of the noise list.

If noise is None, will attempt to calculate noise by calling calculate_ellipse. Raises a ValueError if noise cannot be calculated.

Definition at line 252 of file _ellipse_closed_orbit_finder.py.

References EllipseClosedOrbitFinderIteration.calculate_ellipse(), and EllipseClosedOrbitFinderIteration.noise.

Referenced by EllipseClosedOrbitFinderIteration.get_sigma_noise(), and EllipseClosedOrbitFinderIteration.plot_ellipse().

def get_sigma_noise (   self)

Return the standard deviation of the noise list.

If noise is None, will attempt to calculate noise by calling calculate_ellipse. Raises a ValueError if noise cannot be calculated.

Definition at line 269 of file _ellipse_closed_orbit_finder.py.

References EllipseClosedOrbitFinderIteration.calculate_ellipse(), EllipseClosedOrbitFinderIteration.get_mean_noise(), EllipseClosedOrbitFinderIteration.noise, and EllipseClosedOrbitFinderIteration.plot_ellipse().

def plot_ellipse (   self,
  x_axis_string,
  y_axis_string,
  x_axis_units,
  y_axis_units,
  marker_style = 4,
  title_string = 'fit',
  canvas = None 
)

Plot the beam ellipse for a set of points.

  • x_axis_string: string name of the variable to go on the x_axis
  • y_axis_string: string name of the variable to go on the y_axis
  • x_axis_units: string units on the x axis
  • y_axis_units: string units on the y axis
  • title_string: title of the histogram

Return value is a tuple of (canvas, histogram, ellipse, graph) where canvas is an object of type ROOT.TCanvas, histogram is an object of type ROOT.TH2D, ellipse is an object of type ROOT.TF2 and graph is an object of type ROOT.TGraph

Definition at line 298 of file _ellipse_closed_orbit_finder.py.

References EllipseClosedOrbitFinderIteration.centre, EllipseClosedOrbitFinderIteration.ellipse, EllipseClosedOrbitFinderIteration.get_mean_noise(), and EllipseClosedOrbitFinderIteration.points.

Referenced by EllipseClosedOrbitFinderIteration.get_sigma_noise().

def json_repr (   self)

Represent the iteration as a json object.

  • points: list of float points in the iteration
  • keys: list of keys that defines the points
  • eps_max: maximum error on the ellipse fit

(To get the noise, etc call init against this data)

Definition at line 340 of file _ellipse_closed_orbit_finder.py.

References EllipseClosedOrbitFinder.eps_max, EllipseClosedOrbitFinderIteration.eps_max, EllipseClosedOrbitFinderIteration.keys, and EllipseClosedOrbitFinderIteration.points.

Member Data Documentation

keys
points
eps_max
centre
ellipse
noise

The documentation for this class was generated from the following file: