pyoculus.solvers.poincare_plot
poincare_plot.py
Contains the class for generating the Poincare Plot and computing the winding number profile.
- authors:
Zhisong Qu (zhisong.qu@anu.edu.au)
Ludovic Rais (ludovic.rais@epfl.ch)
- class pyoculus.solvers.poincare_plot.PoincarePlot(map, xs, points_type='custom')
Class for generating the Poincare Plot and computing the winding number profile of a 2D map.
- xs
The initial points, shape (npoints, dimension).
- Type:
np.ndarray
- points_type
The type of points generation.
- Type:
str
- classmethod with_linspace(map, x0, x1, npts)
Creates a Poincare plot with points linearly spaced between x0 and x1.
- Parameters:
map (maps.base_map) – The map to use for the computation.
x0 (np.array) – The starting point.
x1 (np.array) – The ending point.
npts (int) – The number of points.
- Returns:
The PoincarePlot object.
- Return type:
- classmethod with_segments(map, xns, neps, connected=True)
Create a Poincare plot specifying the points to be along multiple segments.
Can be used either to join the points passed as arguments when connected is True. Or, when connected is False, the points are taken to be the two by two extremities of eich segment.
- Parameters:
map (maps.base_map) – The map to use for the computation.
xns (np.ndarray) – The points defining the extremities of the segments.
neps (list) – The number of points per segment. The length of the list should be equal to : the number of segments minus one if connected is True, twice the number of segments otherwise.
connected (bool) – If True, then the segments are connected to each other. Default is True.
- Returns:
The PoincarePlot object.
- Return type:
- classmethod with_horizontal(map, radius, ntraj)
Create a Poincare plot with horizontal points.
- Parameters:
map (maps.base_map) – The map to use for the computation.
radius (float) – The radius of the horizontal points.
ntraj (int) – The number of seeds, starting points for your trajectories.
- Returns:
The PoincarePlot object.
- Return type:
- compute(npts=200, compute_iota=False)
Computes the evolution of the initial points under the map for npts points.
- Parameters:
npts (int) – The number of points to compute for each initial point.
nprocess (int) – The number of processes to use for the computation. Default is 1.
compute_iota (bool) – If True, then it computes the winding number profile. Default is False.
- Returns:
The position of the crossings, shape (npoints, npts+1, dimension)
- Return type:
hits (np.ndarray)
- compute_iota(**kwargs)
Compute the winding number profile.
- Parameters:
**kwargs – Parameters for the poincare hits computation.
- Returns:
The initial points where to calculate the winding number profile, shape (npoints, dimension). winding (np.ndarray): The winding number of the points.
- Return type:
xs (np.ndarray)
- property rho
the rho values, calculated the axis of the map
- property iota
the iota values, calculated from _windings which is calculated with a sucessful compute_iota
- property q
the q values, calculated from _windings which is calculated with a sucessful compute_iota
- plot(plottype='RZ', xlabel=None, ylabel=None, xlim=None, ylim=None, **kwargs)
Plot the Poincare plot.
- Parameters:
plottype (str) – The type of plot to generate. Can be ‘RZ’ for R-Z coordinates or ‘polar’ (including pyoculus s-theta coordinates) or None to directly plot in the coordinates of the map.
xlabel (str) – The label of the x-axis.
ylabel (str) – The label of the y-axis.
xlim (tuple) – The range of the x-axis.
ylim (tuple) – The range of the y-axis.
**kwargs – Additional parameters for the plotting routine “scatter”.
- Returns:
The figure and axis of the plot.
- Return type:
fig, ax
- plot_iota(xlim=None, ylim=None, **kwargs)
Plot the winding number profile.
- Parameters:
xlim (tuple) – The range of the x-axis.
ylim (tuple) – The range of the y-axis.
**kwargs – Additional parameters for the plotting routine “plots”.
- Returns:
The figure and axis of the plot.
- Return type:
fig, ax
- plot_q(xlim=None, ylim=None, **kwargs)
Plot the q-profile.
- Parameters:
xlim (tuple) – The range of the x-axis.
ylim (tuple) – The range of the y-axis.
**kwargs – Additional parameters for the plotting routine “plots”.
- Returns:
The figure and axis of the plot.
- Return type:
fig, ax
- property hits_rz
helper to return the rz coordnates of a call to compute.
- property hits_polar
helper to return the thetazeta or rho, theta coordnates of a call to compute.
- save(filename: str = 'poincare.npy')
- load(map: <module 'pyoculus.maps.base_map' from '/home/runner/work/pyoculus/pyoculus/pyoculus/maps/base_map.py'>)