pyrokinetics.diagnostics.Diagnostics#
- class pyrokinetics.diagnostics.Diagnostics(pyro)[source]#
Bases:
object
Contains all the diagnistics that can be applied to simulation output data.
Currently, this class contains only the function to generate a Poincare map, but new diagnostics will be available in future.
Please call “load_gk_output” before attempting to use any diagnostic
- Parameters:
pyro (
Pyro object containing simulation output data (and geometry)
)
Methods
__init__
(pyro)gs2_geometry_terms
([ntheta_multiplier])ideal_ballooning_solver
([theta0])Adapted from ideal-ballooning-solver rahulgaur104/ideal-ballooning-solver
poincare
(xarray, yarray, nturns, time, rhostar)Generates a poincare map.
- ideal_ballooning_solver(theta0=0.0)[source]#
Adapted from ideal-ballooning-solver rahulgaur104/ideal-ballooning-solver
- Parameters:
theta0 (
float
) – Ballooning angle- Returns:
gamma – Ideal ballooning growth rate
- Return type:
Float
- poincare(xarray, yarray, nturns, time, rhostar, use_invfft=False)[source]#
Generates a poincare map. It returns the (x, y) coordinates of the Poincare Map.
This routine may take a while depending on
nturns
and on the number of magnetic field lines. The parameter rhostar is required by the flux-tube boundary condition. Available for CGYRO, GENE and GS2 nonlinear simulationsYou need to load the output files of a simulation berore calling this function.
- Parameters:
xarray (
numpy.ndarray
,array containing x coordinate
ofinitial
) – field line positionsyarray (
numpy.ndarray
,array containing y coordinate
ofinitial
) – field line positionsnturns (
int
,number
ofintersection points
)time (
float
,time reference
)rhostar (
float
,rhostar is needed
toset the boundary condition
) – on the magnetic field lineuse_invfft (
bool
,if True
,the inverse Fourier transform is computed
) – every (x, y) points along the magnetic field line. It is much more accurate but very slow.
- Returns:
coordinates – containing the x and y coordinates shaped according to the initial field line position. See
example_poincare.py
for a simple example.- Return type:
numpy.ndarray
,4D array
ofshape (2
,nturns
,len(yarray)
,len(xarray))
- Raises: