OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ffa_field_mapper.FFAFieldMapper Class Reference

Public Member Functions

def __init__
 
def binner
 
def load_tracks
 
def gen_cmap
 
def field_map_cylindrical
 
def draw_cylindrical_radial_contour
 
def draw_cylindrical_spiral_contour
 
def field_map_cartesian
 
def plot_tracks_cartesian
 
def plot_tracks_cylindrical
 
def oned_field_map
 
def draw_azimuthal_contour
 
def get_derivative
 
def get_derivative_int
 
def get_div_b
 
def get_curl_b
 

Public Attributes

 r_points
 
 phi_points
 
 x_points
 
 y_points
 
 verbose
 
 cmap
 
 radial_contours
 
 spiral_contours
 
 delta_x
 
 delta_t
 
 bmax
 
 plot_dir
 
 valid_track_id_list
 
 track_orbit_dict
 

Static Public Attributes

dictionary default_radial_contour
 
dictionary default_spiral_contour
 
list position_variables = ["x", "y", "z", "t"]
 
list field_variables = ["out_of_bounds", "bx", "by", "bz", "ex", "ey", "ez"]
 

Detailed Description

Class to make field maps, intended for FFAs/ring geometries

Definition at line 32 of file ffa_field_mapper.py.

Constructor & Destructor Documentation

def ffa_field_mapper.FFAFieldMapper.__init__ (   self)

Definition at line 36 of file ffa_field_mapper.py.

Member Function Documentation

def ffa_field_mapper.FFAFieldMapper.binner (   cls,
  a_list 
)
Build a set of bins based on a list of grid coordinates

Definition at line 63 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.field_map_cartesian(), and ffa_field_mapper.FFAFieldMapper.field_map_cylindrical().

def ffa_field_mapper.FFAFieldMapper.draw_azimuthal_contour (   cls,
  radius,
  axes,
  contour 
)
Draw an azimuthal contour (including spiral angle if required)
- radius: r0 for spiral angle calculations
- axes: Axes object to draw on
- contour: contour object

Definition at line 311 of file ffa_field_mapper.py.

def ffa_field_mapper.FFAFieldMapper.draw_cylindrical_radial_contour (   cls,
  axes,
  contour 
)
Draw a purely radial contour on axes
- axes: matplotlib Axes object to draw on.
- contour: dictionary (see default_contour for definitions)

Definition at line 168 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.field_map_cylindrical().

def ffa_field_mapper.FFAFieldMapper.draw_cylindrical_spiral_contour (   self,
  axes,
  contour 
)
Draw a radially spiralling contour on axes
- axes: matplotlib Axes object to draw on.
- contour: dictionary (see default_contour for definitions)

Definition at line 190 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.r_points.

Referenced by ffa_field_mapper.FFAFieldMapper.field_map_cylindrical().

def ffa_field_mapper.FFAFieldMapper.field_map_cartesian (   self,
  axes = None 
)
Plot a field map in cartesian coordinates.

- axes: matplotlib Axes object or None. If defined, plot the field map
on axes as a hist2d; if None make a new figure/axes and plot it there.

Returns the figure, either a new figure or the parent figure to which
axes belongs.

Definition at line 214 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.binner(), ffa_field_mapper.FFAFieldMapper.cmap, ffa_field_mapper.FFAFieldMapper.gen_cmap(), ffa_field_mapper.FFAFieldMapper.plot_dir, ffa_field_mapper.FFAFieldMapper.verbose, ffa_field_mapper.FFAFieldMapper.x_points, and ffa_field_mapper.FFAFieldMapper.y_points.

Here is the call graph for this function:

def ffa_field_mapper.FFAFieldMapper.field_map_cylindrical (   self,
  axes = None 
)
Plot a field map in cylindrical coordinates.

- axes: matplotlib Axes object or None. If defined, plot the field map
on axes as a hist2d; if None make a new figure/axes and plot it there.

Returns the figure, either a new figure or the parent figure to which
axes belongs.

Definition at line 117 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.binner(), ffa_field_mapper.FFAFieldMapper.cmap, ffa_field_mapper.FFAFieldMapper.draw_cylindrical_radial_contour(), ffa_field_mapper.FFAFieldMapper.draw_cylindrical_spiral_contour(), ffa_field_mapper.FFAFieldMapper.gen_cmap(), ffa_field_mapper.FFAFieldMapper.phi_points, ffa_field_mapper.FFAFieldMapper.plot_dir, ffa_field_mapper.FFAFieldMapper.r_points, ffa_field_mapper.FFAFieldMapper.radial_contours, ffa_field_mapper.FFAFieldMapper.spiral_contours, and ffa_field_mapper.FFAFieldMapper.verbose.

Here is the call graph for this function:

def ffa_field_mapper.FFAFieldMapper.gen_cmap (   self,
  bz_grid 
)
Generate the colour mapping for field bz
- bz_grid: set of bz values. Colour mapping will proceed symmetrically
   0 in the positive and negative direction. Maximum value is
   the maximum absolute value in the bz_grid, up to self.bmax.
   If the grid contains a value greater than self.bmax, then
   self.bmax becomes the maximum value. To disable the bmax
   behaviour, set self.bmax to None
Returns a tuple of (min_bz in the grid,
            max_bz in the grid,
            max value of bz to be used in the colormap)

Definition at line 96 of file ffa_field_mapper.py.

References abs(), ffa_field_mapper.FFAFieldMapper.bmax, max(), and min().

Referenced by ffa_field_mapper.FFAFieldMapper.field_map_cartesian(), and ffa_field_mapper.FFAFieldMapper.field_map_cylindrical().

Here is the call graph for this function:

def ffa_field_mapper.FFAFieldMapper.get_curl_b (   self,
  pos_x,
  pos_y,
  pos_z,
  time 
)
Calculate Curl B

Definition at line 367 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.get_derivative().

Here is the call graph for this function:

def ffa_field_mapper.FFAFieldMapper.get_derivative (   self,
  var1,
  var2,
  pos_x,
  pos_y,
  pos_z,
  time 
)
Calculate a numerical derivative of the field in cartesian coordinates
- var1: variable in the numerator, should be one of self.position_variables
- var2: variable in the denominator (range 1 to 4)

Definition at line 334 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.delta_x.

Referenced by ffa_field_mapper.FFAFieldMapper.get_curl_b(), and ffa_field_mapper.FFAFieldMapper.get_div_b().

def ffa_field_mapper.FFAFieldMapper.get_derivative_int (   self,
  var1,
  var2,
  pos_x,
  pos_y,
  pos_z,
  time 
)
Calculate a numerical derivative of the field in cartesian coordinates
- var1: should be an integer range 1 to 6 inclusive for bx, by, bz, ex, ey, ez
- var2: should be an integer range 0 to 3 inclusive for x, y, z, t
- x, y, z, t: position at which the derivative should be calculated

Definition at line 349 of file ffa_field_mapper.py.

def ffa_field_mapper.FFAFieldMapper.get_div_b (   self,
  pos_x,
  pos_y,
  pos_z,
  time 
)
Calculate Div B

Definition at line 358 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.get_derivative().

Here is the call graph for this function:

def ffa_field_mapper.FFAFieldMapper.load_tracks (   self,
  track_orbit 
)
Load tracks from track_orbit file
- track_orbit: string file name

Definition at line 68 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.track_orbit_dict, and ffa_field_mapper.FFAFieldMapper.valid_track_id_list.

def ffa_field_mapper.FFAFieldMapper.oned_field_map (   self,
  radius,
  axes = None 
)
Make a one dimensional field map along a line of constant radius
- radius: line to draw the fields on
- axes: Axes object to draw on

Definition at line 282 of file ffa_field_mapper.py.

References ffa_field_mapper.FFAFieldMapper.phi_points.

def ffa_field_mapper.FFAFieldMapper.plot_tracks_cartesian (   self,
  axes 
)
Plot tracks in cartesian coordinates
- axes: Axes object to draw on

Definition at line 254 of file ffa_field_mapper.py.

def ffa_field_mapper.FFAFieldMapper.plot_tracks_cylindrical (   self,
  axes 
)
Plot tracks in cylindrical coordinates
- axes: Axes object to draw on
If phi changes by more than 180 degrees in a single step, the track is
assumed to have gone through an entire turn (360 <-> 0) and a new plot
is started

Definition at line 264 of file ffa_field_mapper.py.

References abs().

Here is the call graph for this function:

Member Data Documentation

ffa_field_mapper.FFAFieldMapper.bmax

Definition at line 54 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.gen_cmap().

ffa_field_mapper.FFAFieldMapper.cmap
dictionary ffa_field_mapper.FFAFieldMapper.default_radial_contour
static
Initial value:
1 = {"radius":0.0,
2  "linestyle":"-",
3  "colour":"grey",
4  "oned_plot":False}

Definition at line 381 of file ffa_field_mapper.py.

dictionary ffa_field_mapper.FFAFieldMapper.default_spiral_contour
static
Initial value:
1 = {
2  "phi0":0.0, # the contour will pass through a point having cylindrical coordinates phi0, r0
3  "r0":0, # the contour will pass through a point having cylindrical coordinates phi0, r0
4  "spiral_angle":0, # spiral angle parameter in degrees
5  "linestyle":"-", # matplotlib line style
6  "colour":"grey", # matplotlib line colour
7  }

Definition at line 385 of file ffa_field_mapper.py.

ffa_field_mapper.FFAFieldMapper.delta_t

Definition at line 53 of file ffa_field_mapper.py.

ffa_field_mapper.FFAFieldMapper.delta_x

Definition at line 52 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.get_derivative().

list ffa_field_mapper.FFAFieldMapper.field_variables = ["out_of_bounds", "bx", "by", "bz", "ex", "ey", "ez"]
static

Definition at line 393 of file ffa_field_mapper.py.

ffa_field_mapper.FFAFieldMapper.phi_points
ffa_field_mapper.FFAFieldMapper.plot_dir
list ffa_field_mapper.FFAFieldMapper.position_variables = ["x", "y", "z", "t"]
static

Definition at line 392 of file ffa_field_mapper.py.

ffa_field_mapper.FFAFieldMapper.r_points
ffa_field_mapper.FFAFieldMapper.radial_contours
ffa_field_mapper.FFAFieldMapper.spiral_contours
ffa_field_mapper.FFAFieldMapper.track_orbit_dict

Definition at line 60 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.load_tracks().

ffa_field_mapper.FFAFieldMapper.valid_track_id_list

Definition at line 59 of file ffa_field_mapper.py.

Referenced by ffa_field_mapper.FFAFieldMapper.load_tracks().

ffa_field_mapper.FFAFieldMapper.verbose
ffa_field_mapper.FFAFieldMapper.x_points
ffa_field_mapper.FFAFieldMapper.y_points

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