fargonaut package

Subpackages

Submodules

fargonaut.field module

A field handler.

class fargonaut.field.DerivedField(base: Field)

Bases: object

A derived field.

set_symbol(symbol: str) None

Set the symbol representing the field’s quantity.

Parameters:

symbol (str) – The symbol to represent the quantity.

class fargonaut.field.Field

Bases: ABC

An abstract base field.

property data: ndarray[Any, dtype[float64]]

The field values.

Returns:

A shaped numpy array containing the field values

Return type:

NDArray

plot(csys: str = 'polar', dims: str = 'xy', idx: int = 0) tuple[figure, subplot, colorbar] | tuple[figure, subplot]

Plot the field.

dims can be “xy”, “xz”, “yz”, “yx”, “zx”, “zy”, taking a 2D slice of 3D data idx is the index at which to slice in the third dimension

Parameters:
  • csys (str) – The coordinate system on which to plot the field

  • dims (str) – The dimensions of the field to plot

  • idx (int) – The index of the slice to plot

Returns:

The figure containing the plot axis: The axes containing the plot colorbar: The colorbar for the field (conditional)

Return type:

figure

Raises:

NotImplementedError – If unknown coordinate system requested

property raw: ndarray[Any, dtype[float64]]

The field values.

Returns:

A 1D numpy array containing the field values

Return type:

NDArray

property x: ndarray[Any, dtype[float64]]

The x-coordinates at which the field is defined.

Returns:

A numpy array containing the x-coordinates

Return type:

NDArray

property y: ndarray[Any, dtype[float64]]

The y-coordinates at which the field is defined.

Returns:

A numpy array containing the y-coordinates

Return type:

NDArray

property z: ndarray[Any, dtype[float64]]

The z-coordinates at which the field is defined.

Returns:

A numpy array containing the z-coordinates

Return type:

NDArray

fargonaut.output module

A FARGO3D simulation output reader.

class fargonaut.output.Output(directory: str)

Bases: object

A FARGO3D simulation output.

directory

The path to the directory containing the output files

domain_x

The x domain over which the output data are defined

domain_y

The y domain over which the output data are defined

domain_z

The z domain over which the output data are defined

nghx

The number of ghost cells in the x dimension

nghy

The number of ghost cells in the y dimension

nghz

The number of ghost cells in the z dimension

opts

The options used in the simulation

vars

The variables defined for the simulation

property coordinate_system: str

The coordinate system used in the simulation.

Returns:

The coordinate system used in the simulation

Return type:

str

Raises:

Exception – If _read_opts has not been executed

get_field(name: str, num: int) Field

Load the field at a given output time.

Parameters:
  • name (str) – The name of the field to get

  • num (str) – The number of the field output time to get

Returns:

The field

Return type:

Field

Raises:

NotImplementedError – An invalid field was requested

get_opt(opt_name: str) bool

Get whether an option was set.

Parameters:

opt_name (str) – The name of the option to query

Returns:

Whether the option was used

Return type:

bool

get_var(var_name: str) str

Get the value of a variable.

Parameters:

var_name (str) – The name of the variable to query

Returns:

The value of the variable

Return type:

str

property includes_ghosts: bool

Whether field outputs contain ghost cell values.

Returns:

Whether ghost cells are included in the field data files

Return type:

bool

Raises:

Exception – If _read_opts has not been executed

property nghx: int

Number of ghost cells used in the x dimension.

Returns:

The number of ghost cells used in the x dimension.

Return type:

int

Raises:

Exception – If _read_domains has not been executed

property nghy: int

Number of ghost cells used in the y dimension.

Returns:

The number of ghost cells used in the y dimension.

Return type:

int

Raises:

Exception – If _read_domains has not been executed

property nghz: int

Number of ghost cells used in the z dimension.

Returns:

The number of ghost cells used in the z dimension.

Return type:

int

Raises:

Exception – If _read_domains has not been executed

property nx: int

Number of cells used in the x dimension.

Returns:

The number of cells used in the x dimension.

Return type:

int

Raises:

Exception – If _read_vars has not been executed

property ny: int

Number of cells used in the y dimension.

Returns:

The number of cells used in the y dimension.

Return type:

int

Raises:

Exception – If _read_vars has not been executed

property nz: int

Number of cells used in the z dimension.

Returns:

The number of cells used in the z dimension.

Return type:

int

Raises:

Exception – If _read_vars has not been executed

property xdomain: ndarray[Any, dtype[float64]]

Domain of the output in the x dimension.

Returns:

A numpy array containing the x-coordinates

Return type:

NDArray

Raises:

Exception – If _read_domains has not been executed

property ydomain: ndarray[Any, dtype[float64]]

Domain of the output in the y dimension.

Returns:

A numpy array containing the y-coordinates

Return type:

NDArray

Raises:

Exception – If _read_domains has not been executed

property zdomain: ndarray[Any, dtype[float64]]

Domain of the output in the z dimension.

Returns:

A numpy array containing the z-coordinates

Return type:

NDArray

Raises:

Exception – If _read_domains has not been executed

Module contents

The main module for Fargonaut.