Documentation

Tutorials

With the goal of illustrating the utilization of the software, two example scripts are provided along with the source code of the module (see “examples” folder):

  • linearArrayExample.py

  • rectangularPlanarArrayExample.py

Each of these examples makes use of different features of the software, and can be used as a starting point to create a new file to work with a different problem.

The arrayElement class

class afanc.arrayElement(position: ndarray, excitationMag: float, excitationPha: float)

Bases: object

Radiating element of an antenna array.

This class represent an element of an antenna array. Contains its position and excitation coefficient, and calculates its contribution to the array factor.

This class must not be accessed directly by the user. It should only be employed by the Array class.

position

Indicates the position of the element in a tridimensional cartesian system (X,Y,Z). Must present shape (3,) and be of dtype np.float64.

Type:

np.ndarray

excitationMag

Magnitude of the excitation coefficient. Must be greater than 0.

Type:

float

excitationPha

Phase (in rad) of the excitation coefficient.

Type:

float

__init__(position: ndarray, excitationMag: float, excitationPha: float)

Initializes a new arrayElement object.

Gives values to the attributes of the class.

Parameters:
  • position (np.ndarray) – Position of the element in a tridimensional cartesian system (X,Y,Z). Must present shape (3,) and be of dtype np.float64.

  • excitationMag (float) – Magnitude of the excitation coefficient. Must be greater or equal than 0.

  • excitationPha (float) – Phase (in degrees) of the excitation coefficient.

calculateContributionToAF(theta: ndarray, phi: ndarray, f: int | float) ndarray

Computes and returns the contribution of the element to the array factor.

The array factor is evaluated over the grid of spherical coordinates defined by the theta and phi arrays.

IMPORTANT: theta and phi must present the same shape (the numpy shape).

Parameters:
  • theta (np.ndarray) – Theta coordinate values of the set of points over which the array factor must be evaluated.

  • phi (np.ndarray) – Phi coordinate values of the set of points over which the array factor must be evaluated.

  • f (int or float) – Frequency (in hertz) at which the contribution to the array factor must be evaluated.

Returns:

Values of the array factor. This array presents the same shape (the numpy shape) as the theta and phi input parameters.

Return type:

np.ndarray

getExcitation() tuple[float, float]

Return the value of the excitationMag and excitationPha attributes.

Returns:

  • excitationMag (float) – Magnitude of the excitation coefficient.

  • excitationPha (float) – Phase of the excitation coefficient.

getPosition() ndarray

Returns the value of the position attribute.

Returns:

Cartesian (X,Y,Z) coordinates indicating the position of the element.

Return type:

np.ndarray

setExcitation(excitationMag: float, excitationPha: float)

Modifies the values of the excitationMag and excitationPha attributes.

Parameters:
  • excitationMag (float) – Value to be assigned to the excitationMag attribute. Must be greater or equal than 0.

  • excitationPha (float) – Value (in degrees) to be assigned to the excitationPha attribute.

setPosition(position: ndarray)

Modifies the value of the position attribute.

Parameters:

position (np.ndarray) – Value to be assigned to the position attribute. Must present shape (3,) and be of dtype np.float64.

The antennaArray class

class afanc.antennaArray(positions: ndarray | None = None, excitationMags: ndarray | None = None, excitationPhas: ndarray | None = None)

Bases: object

Representation of an antenna array.

This class is used to model an array of antennas. It contains several arrayElements objects which represent the different radiating elements of the array. For each arrayElement, it is possible to adjust its position and excitation coefficient.

Once that all elements of the array have been defined, the class can evaluate the array factor.

arrayElements

A list containing instances of the arrayElement class. Each item of the list describes one of the radiating elements of the array.

Type:

list of arrayElement

__init__(positions: ndarray | None = None, excitationMags: ndarray | None = None, excitationPhas: ndarray | None = None)

Initializes and object on the array class.

If no values are given to the input parameters, the created array will be empty.

Otherwise, if values are given for the positions and excitation coefficients, then several arrayElement objects will be added to the array, with positions and excitation coefficients as specified. IMPORTANT: The three input parameters must contain data for the same number of array elements.

Parameters:
  • positions (np.ndarray, optional) – Contains the (X,Y,Z) coordinates of the array elements. Must present a shape (N,3), where N is the number of array elements, by default None

  • excitationMags (np.ndarray, optional) – Contains the magnitude of the excitation coefficients for each array element. Must present a shape (N,), where N is the number of array elements, by default None

  • excitationPhas (np.ndarray, optional) – Contains the phase (in degrees) of the excitation coefficients for each array element. Must present a shape (N,), where N is the number of array elements, by default None

Raises:
  • ValueError – If only some of the input parameters have been given a value.

  • TypeError – If the input parameters are not array-like.

  • ValueError – If the number of elements in each input parameter is not the same. i.e. The length of excitationMags, excitationPhas and the first dimension of positions are not the same.

  • TypeError – If addElement() method raises a TypeError exception.

addElement(position: ndarray, excitationMag: float, excitationPha: float) int

Adds new radiating element to the array.

The new element will present the position and excitation coefficients specified by the input parameters.

The position must be specified using an array-like object with three values, corresponding to the (X,Y,Z) coordinates. Values must be in meters.

The value for the magnitude of the excitation coefficient must be greater than 0, and the phase must be specified in degrees.

Parameters:
  • position (np.ndarray) – Position of the new element. in meters.

  • excitationMag (float) – Magnitude of the excitation coefficient of the new element.

  • excitationPha (float) – Phase of the excitation coefficient of the new element. in degrees.

Raises:
  • TypeError – If the received position is not of type np.ndarray and cannot be converted to it.

  • TypeError – If the received excitationMag is not of type float and cannot be converted to it.

  • TypeError – If the received excitationPha is not of type float and cannot be converted to it.

  • ValueError – If excitationMag is smaller than zero.

csvExportConfig(filePath: str)

Export an array configuration to a CSV file.

The file will contain the x, y and z coordinates of each array element, along with the magnitude and phase of its excitation coefficient.

Parameters:

filePath (str) – Absolute path of the csv file to be created.

Raises:
  • TypeError – If filePath is not of type str

  • ValueError – If the directory specified by filePath does not exist.

csvImportConfig(filePath: str)

Import an array configuration from a CSV file.

Each line of the file shall contain the information relative to one array element. The CSV file must present 5 columns. Columns 1 to 3 must contain the x, y and z coordinates (in meters) of the array element, while columns 4 and 5 contain the magnitude and phase (in degrees) of the element excitation.

The CSV must fulfill the following requirement. The columns must be separated by a comma (without a trailing space). The first line of the file must contain a header with the names of the parameter associated to each column. These names must be x, y, z, mag, pha. There must be no blank line between this header and the first data line.

Parameters:

filePath (str) – Absolute path of the csv file where the data is contained.

Raises:

TypeError – If filePath is not a string.

deleteElement(elementID: int)

Deletes the specified element from the array.

The IDs of the other elements are reorganized so that there are no discontinuities in the list of IDs.

Parameters:

elementID (int) – ID of the element to be deleted.

Raises:

RuntimeError – It the received elementID is not valid.

evaluateAF(theta: ndarray, phi: ndarray, f: int | float) ndarray

Evaluates the array factor over the grid of points defined by the input parameters theta and phi.

Theta and phi must present the same shape. The output will be a np.ndarray with the same shape as theta and phi.

Parameters:
  • theta (np.ndarray) – Theta coordinate values of the set of points over which the array factor must be evaluated.

  • phi (np.ndarray) – Phi coordinate values of the set of points over which the array factor must be evaluated.

  • f (Union[int, float]) – f is the frequency to what the array factor is gonna be evaluated

Returns:

Values of the array factor. This array presents the same shape as the theta and phi input parameters.

Return type:

np.ndarray

Raises:
  • TypeError – If theta is not of type np.ndarray and cannot be converted to it.

  • TypeError – If phi is not of type np.ndarray and cannot be converted to it.

  • TypeError – If f is not of type float and cannot be converted to it.

  • ValueError – If shapes of theta and phi are not the same.

  • ValueError – If f is smaller or equal than 0.

  • RuntimeError – If the array is empty.

getElementExcitation(elementID: int) tuple[float, float]

Returns the excitation coefficient of the specified element.

Parameters:

elementID (int) – ID of the array element for which the excitation coefficient must be retrieved.

Returns:

  • excitationMag (float) – Magnitude of the excitation coefficient.

  • excitationPha (float) – Phase (in rad) of the excitation coefficient.

Raises:

RuntimeError – If the received elementID is not valid.

getElementPosition(elementID: int) ndarray

Returns the position of the specified element.

The position is specified as a np.ndarray of dim=3, where each item of the array corresponds to a cartesian coordinate in the (X,Y,Z) form.

Parameters:

elementID (int) – ID of the array element for which the position must be retrieved.

Returns:

Position of the array element.

Return type:

np.ndarray

Raises:

RuntimeError – If the received elementID is not valid.

getNumberElements() int

Returns the number of elements in the array.

Returns:

Number of elements in the array.

Return type:

int

setElementExcitation(elementID: int, excitationMag: float, excitationPha: float)

Modifies the excitation coefficient of the specified element.

The value for the magnitude must be greater than 0, and the phase must be specified in degrees.

Parameters:
  • elementID (int) – ID of the array element for which the excitation coefficient must be modified.

  • excitationMag (float) – Magnitude of the new excitation coefficient.

  • excitationPha (float) – Phase (in rad) of the new excitation coefficient.

Raises:
  • RuntimeError – It the received elementID is not valid.

  • TypeError – If the received excitationMag is not of type float and cannot be converted to it.

  • TypeError – If the received excitationPha is not of type float and cannot be converted to it.

  • ValueError – If excitationMag is smaller than zero.

setElementPosition(elementID: int, position: ndarray)

Modifies the position of the specified element.

The position must be specified using an array-like object with three values, corresponding to the (X,Y,Z) coordinates. Values must be in meters.

Parameters:
  • elementID (int) – ID of the array element for which the position must be modified.

  • position (np.ndarray) – Value to be assigned to the position attribute.

Raises:
  • RuntimeError – It the received elementID is not valid.

  • TypeError – If the received position is not of type np.ndarray and cannot be converted to it.

The linearArray class

class afanc.linearArray(n: int, pos0: ndarray, dirVect: ndarray, d: float | int, excitationMag: float | int | list, excitationPha: float | int | list, excitationPha0: int | float = 0)

Bases: antennaArray

This class is a child of antennaArray and inherits all of its methods. The only purpose of linearArray is to provide an easier way to create a linear array thanks to a specialized __init__ method.

__init__(n: int, pos0: ndarray, dirVect: ndarray, d: float | int, excitationMag: float | int | list, excitationPha: float | int | list, excitationPha0: int | float = 0)

Initializes an antenna array whose elements are distributed linearly and uniformly (distance between consecutive elements defined by d input parameter) along the direction indicated by dirVect.

The position of the first element is defined by the input parameter pos0. Subsequent elements (up until a maximum of n elements) will be placed in pos0+ii*d*dirVect, where ii is a positive real index.

The magnitude and phase of the excitation coefficients can be indicated either as a list or as single number. When a list is specified, its length must be equal to n, and each item of the list will correspond to the value (either of the magnitude or phase) for one of the elements in the array.

If a single value is specified for the magnitude, then this value will be applied to all the array elements (hence producing an uniformly illuminated array). If a single phase value is provided, then a progressive phase array will be implemented, using this value as the phase difference between consecutive array elements.

When creating a progressive phased array, it is possible to specify the phase value of the first element of the array by using the parameter excitationPha0.

The pos0 and vect must be specified using an array-like object with three values, corresponding to the (X,Y,Z) coordinates. Values must be in meters.

Parameters:
  • n (int) – Number of elements in the array. Must be greater than 0.

  • pos0 (np.ndarray) – (x,y,z) coordinates of the first element.

  • dirVect (np.ndarray) – Three-dimensional vector indicating the direction of the array.

  • d (Union[int,float]) – Distance between adjacent elements.

  • excitationMag (Union[int,float,list]) – Magnitude of the excitation coefficients.

  • excitationPha (float) – Phase of the excitation coefficients. In degrees.

  • excitationPha0 (Union[int,float], optional) – Phase of the excitation coefficient of the first element. In degrees. By default, 0

Raises:
  • TypeError – If is not of type int.

  • ValueError – If n is smaller than 1.

  • TypeError – If pos0 is not of type np.ndarray.

  • ValueError – If pos0 does not contain exactly three elements.

  • TypeError – If dirVect is not of type np.ndarray.

  • TypeError – If dirVect elements are not of type int or float.

  • ValueError – If dirVect does not contain exactly three elements.

  • TypeError – If d is not of type int or float.

  • ValueError – If d is not greater than 0.

  • TypeError – If excitationMag is not of type int, float or list.

  • ValueError – If excitationMag is of type list but is length is different of n.

  • TypeError – If excitationPha is not of type int, float or list.

  • ValueError – If excitationPha is of type list but is length is different of n.

  • TypeError – If excitationPha0 is not of type int or float.

The rectangularPlanarArray class

class afanc.rectangularPlanarArray(n1: int, n2: int, pos0: ndarray, dirVect1: ndarray, dirVect2: ndarray, d1: float | int, d2: float | int, excitationMag: int | float | ndarray = 1, excitationPha: ndarray = array([0, 0]), excitationPha0: int | float = 0)

Bases: antennaArray

This class is a child og antennaArray and inherits all of its methods. The only purpose of rectangularPlanarArray is to provide an easier way to create a rectangular array thanks to a specialized __init__ method.

__init__(n1: int, n2: int, pos0: ndarray, dirVect1: ndarray, dirVect2: ndarray, d1: float | int, d2: float | int, excitationMag: int | float | ndarray = 1, excitationPha: ndarray = array([0, 0]), excitationPha0: int | float = 0)

Initializes an antenna array whose elements are distributed linearly and uniformly along the rectangle defined by dirVect1 and dirVect2. The array presents n1 elements along its first dimension, and n2 along the second (the total number of elements is therefore n1*n2). The distance between consecutive elements along each of the dimensions is defined by parameters d1 and d2.

The position of the first element is defined by the input parameter pos0.Subsequent elements will be placed in pos0 + ii*d1*dirVect1 + jj*d2*dirVect2, where ii and jj are positive real indexes.

The magnitude of the excitation coefficients can be indicated either as an array or as single number. When an array is specified, its shape must be equal to (n1,n2), and each item of the array will correspond to the value for one of the elements in the array. If a single value is specified, it is applied to all the elements in the array.

The phase of the excitation coefficients is always specified by means of an array. Nevertheless, there are two possible options. If a progressive phase array is desired, it is enough to provide a excitationPha of shape (2,), where the first element corresponds to the phase increment along dirVect1, and the second element to the phase along the dirVect2. Alternatively, it is also possible to specify an arbitrary phase value for each element by providing a excitationPha of shape (n1,n2).

When creating a progressive phased array, it is possible to specify the phase value of the first element of the array by using the parameter excitationPha0. If an excitationPha array of shape (n1,n2), then the value of excitationPha0 will be ignored.

Parameters:
  • n1 (int) – Number of elements along direction indicated by dirVect1.

  • n2 (int) – Number of elements along direction indicated by dirVect2.

  • pos0 (np.ndarray) – (x,y,z) coordinates of the first element. Values in meters.

  • dirVect1 (np.ndarray) – First direction vector for the array. Units are irrelevant since it will be normalized.

  • dirVect2 (np.ndarray) – First direction vector for the array. Units are irrelevant since it will be normalized.

  • d1 (Union[float,int]) – Distance between adjacent elements along the direction indicated by dirVect1. Value must be in meters.

  • d2 (Union[float,int]) – Distance between adjacent elements along the direction indicated by dirVect2. Value must be in meters.

  • excitationMag (Union[int, float, np.ndarray], optional) – Magnitude of the excitation coefficients. If a single number is specified (int or float), then it will be used for all the array elements. Alternatively, an array of shape (n1,n2) can be used, in which case the magnitude of the excitation coefficient will be specified individually for each element, by default 1

  • excitationPha (np.ndarray, optional) – Phase (in degrees) of the excitation coefficients. It can be an array of shape (2,) in which case it will be assumed that the array presents a progressive illumination phase. In this case, the first element of excitationPha indicated the progressive phase value along dirVect1 and the second value indicated the phase along dirVect2. Alternatively, the phase of each element can be specified individually by making excitationPha a (n1,n2) array, by default np.array((0,0))

  • excitationPha0 (Union[int, float], optional) – Phase (in degrees) value of the initial element of the array (that in the position (0,0)). Used only when a progressive phase array is defined, by default 0

Raises:
  • TypeError – If n1 is not of type int.

  • TypeError – If n2 is not of type int.

  • ValueError – If either n1 or n2 are smaller than 1.

  • TypeError – If pos0 is not of type np.ndarray.

  • TypeError – If elements of pos0 are not of type int or float.

  • ValueError – If pos0 is not of shape (3,).

  • TypeError – If dirVect1 is not of type np.ndarray.

  • TypeError – If dirVect2 is not of type np.ndarray.

  • TypeError – If elements of dirVect1 are not of type int or float.

  • TypeError – If elements of dirVect2 are not of type int or float.

  • ValueError – If either dirVect1 or dirVect2 is not of shape (3,).

  • ValueError – If dirVect1 and dirVect2 are not orthogonal.

  • TypeError – If d1 is not of type int or float.

  • TypeError – If d2 is not of type int or float.

  • ValueError – If either d1 or d2 are smaller than 0.

  • TypeError – If excitationMag is not of type int, float or np.ndarray.

  • ValueError – If excitationMag is of type np.ndarray but does not present a shape (n1,n2).

  • TypeError – If excitationPha is not of type np.ndarray.

  • ValueError – If the shape of excitationPha is not (n1,n2) or (2,).

  • ValueError – If elements of excitationPha are not of type int or float.

  • TypeError – If excitationPha0 is not of type int or float.

The arrayPlot class

class afanc.arrayPlot

Bases: object

Generation of plots depicting the array factor of an antenna array.

This class receives an antennaArray object, and generates different types of plots of its array factor. For each plot type, the class contains a figure and an axis.

figPhiCut

Figure containing the plot of the radiation pattern cut in a precise angle phi.

Type:

matplotlib figure

axPhiCut

Current active axis associated to figCutPhi. It can get assigned either axPhiCutCarte or axPhiCutPolar, depending on which type of plot is requested. By default, contains axPhiCutCarte.

Type:

matplotlib axis

axPhiCutCarte

Axis made for the Cartesian PhiCut representation of the radiation pattern.

Type:

matplotlib axis

axPhiCutPolar

Axis made for the Polar PhiCut representation of the radiation pattern.

Type:

matplotlib axis

figUV

Figure containing the plot of upper half sphere of the radiation pattern in the UV format.

Type:

matplotlib figure

axUV

Axis made for the UV representation of the radiation pattern.

Type:

matplotlib axis

fig3D

Figure containing the plot of the 3D radiation pattern.

Type:

matplotlib figure

ax3D

axes made for the 3D representation of the radiation pattern.

Type:

3D axes

validMode

Accepted values for the mode input parameter used by several methods of the class.

Type:

list[str]

validMode3D

Accepted values for the mode3D input parameter used by several methods of the class.

Type:

list[str]

validProjection

Accepted values for the projection input parameter used by several methods of the class.

Type:

list[str]

__init__()

Constructor of the arrayPlot object

Creates the three types of figures and their associated five axes.

It must be noted that figPhiCut has three axes because it allows plotting both in cartesian and polar. Therefore, one axes is used for each kind of plot. These two axes (axPhiCutCarte and axPhiCutPolar) set to hidden or visible mode, depending on the type of plot requested by the user. The axes corresponding to the requested projection type are copied to the third axes of the figure (axPhiCut). The use of this third axes allows for a more compact code, since many operations can be described just one over this general axes, instead of having to define them two time, once for axPhiCarte and later for axPhiCutPolar.

The other two axes are used for the UV and 3D figures.

The __init__ also uses the _styleInit() to apply the default style to all the figures.

plot3D(aa: antennaArray, f: float, n: int = 10000, /, *, mode: str = 'dB', mode3D: str = 'simple')

Plot a 3D representation of the radiation pattern.

the mode describe the format of the array factor : ‘F’ or ‘dB’. and mode3D describe the algorithm used to generate the points onto the sphere.

Parameters:
  • aa (antennaArray) – The antenna array used to calculate the radiation diagram

  • f (float or int) – frequency of the antenna array

  • n (int, optional) – number of points the surface will approximately have. By default, 10000.

  • mode (str, optional) – format of the array factor : ‘F’ or ‘dB’. By default, ‘dB’.

  • mode3D (str, optional) – string name of the algorithm used to generate the points onto the sphere : ‘simple’ or ‘even’. By default, ‘simple’.

Raises:
  • TypeError – If aa is not a antennaArray object.

  • TypeError – If f is not a float or int.

  • TypeError – If n is not an int.

  • TypeError – If mode is not a string.

  • ValueError – If mode is not a valid mode.

  • TypeError – If mode3D is not a string.

  • ValueError – If mode3D is not a valid mode3D.

plotPhiCut(aa: antennaArray, f: float, phiCut: float = 0.0, *, thetaLimit: tuple = (-180.0, 180.0), afLimit: tuple = (-30, 30), natThreshold=None, dbThreshold=None, n: int = 10000, projection: str = 'cartesian', scale: str = 'dB', fmt: str = '-b', lineWidth: float = 1.0)

Plot a phi cut of the radiation pattern.

Parameters:
  • aa (antennaArray) – The antenna array for which the radiation pattern must be plotted.

  • f (float) – Frequency of the antenna array.

  • phiCut (float, optional) – Angle of phi (in degrees) where the radiation diagram is going to be cut. By default, 0.0.

  • thetaLimit (tuple, optional) – (theta minimum, theta maximum) range (in degrees) over which the radiation pattern is evaluated. By default, (-180.0, 180.0).

  • afLimit (tuple, optional) – (af minimum, af maximum) range for the axis of the figure corresponding to the radiation pattern. By default, None.

  • n (int, optional) – Number of samples to be used for tracing the radiation pattern. By default, 10000.

  • projection (str, optional) – Type of projection to be used when plotting: “cartesian” or “polar”. By default, “cartesian”.

  • scale (str, optional) – Format of the array factor: ‘F’ or ‘dB’. By default, ‘dB’.

  • fmt (str, optional) – Matplotlib style of the line. See matplotlib.pyplot.plot documentation for details. By default, “-b”.

  • lineWidth (float, optional) – Line width in points. By default, 1.0.

Raises:
  • TypeError – If aa is not an antennaArray object.

  • TypeError – If f cannot be converted to float.

  • TypeError – If phiCut cannot be converted to float.

  • TypeError – If thetaLimit is not a tuple.

  • TypeError – If the contents of thetaLimit cannot be converted to float.

  • ValueError – If both values of thetaLimit are equal.

  • ValueError – If the first value of thetaLimit is greater than the second one.

  • TypeError – If afLimit is not a tuple.

  • TypeError – If the contents of afLimit cannot be converted to float.

  • ValueError – If both values of afLimit are equal.

  • ValueError – If the first value of afLimit is greater than the second one.

  • TypeError – If n is not an int.

  • TypeError – If scale is not a string.

  • ValueError – If scale does not present a valid value.

  • TypeError – If lineWidth is not a float or int.

  • TypeError – If projection is not a string.

  • ValueError – If projection does not present a valid value.

plotUV(aa: antennaArray, f: float, n: int = 10000, mode: str = 'dB', mode3D: str = 'simple', shading: str = 'gouraud')

Plot a 2D representation of the radiation pattern using a UV projection.

This method plots the UV figure using the tripcolor() plot from matplotlib. the recommend parameters for mode, mode3D and shading are the default ones. In addition, the number of samples (n) must be chosen in accordance to the complexity of the radiation pattern to obtain an accurate representation.

Parameters:
  • aa (antennaArray) – The antenna array used to calculate the radiation diagram

  • f (float or int) – frequency of the antenna array

  • n (int) – number of point to be plot

  • mode (str, optional) – format of the array factor : ‘F’ or ‘dB’. By default, ‘F’.

  • mode3D (str, optional) – string name of the algorithm used to generate the points onto the sphere : ‘simple’ or ‘even’. By default, ‘simple’.

  • shading (str, optional) – method of shading for the tripcolor plot : for hard -> ‘flat’, for smooth -> ‘gouraud’. By default, ‘gouraud’.

Raises:
  • TypeError – If aa is not an antennaArray object.

  • TypeError – If f cannot be converted to float.

  • TypeError – If n is not an int.

  • TypeError – If mode is not a string.

  • ValueError – If mode does not present a valid value.

  • TypeError – If mode3D is not a string.

  • ValueError – If mode3D does not present a valid value.

  • TypeError – If shading is not a string.

  • ValueError – If shading does not present a valid value.

save(figType: str, filePath: str, format='png')

Save the figure indicated by figType as fileName using the format specified by the format parameter.

Parameters:
  • figType (str) – Name of the figure to be saved. Possible values: ‘PhiCut’, ‘UV’ or ‘3D’.

  • filePath (str) – Absolute path of the file to be created. It must be noted that the extension must match the requested format.

  • format (png, optional) – Image file type used to store the figure. Possible values: ‘png’, ‘gif’, ‘jpeg’, ‘tiff’, ‘pdf’, ‘eps’ and ‘svg’. By default, ‘png’.

Raises:
  • TypeError – If figType is not a string.

  • ValueError – If figType does not correspond to a valid figure type.

  • TypeError – If filePath is not a string.

  • ValueError – If the directory specified by filePath does not exist.

  • TypeError – If format is not a string.

  • ValueError – If the extension in filePath does not match the requested format.

  • ValueError – If the requested format is not supported.

setLimitPlotPhiCut(limitTheta: tuple[float | int], limitAf: tuple[float | int] | None = None)

Adjust the limits for theta and AF axes of the PhiCut plot.

Parameters:
  • limitTheta (tuple) – Limits for the theta axis in the form (minimum theta, maximum theta)

  • limitAf (tuple, optional) – Limits for the AF axis in the form (minimum AF, maximum AF), by default None

Raises:
  • TypeError – If limitTheta is not a tuple.

  • TypeError – If the contents of limitTheta cannot be converted to float.

  • ValueError – If both values of limitTheta are the same.

  • ValueError – If the the first value of limitTheta is greater than the second one.

  • TypeError – If limitAf is given and it is not a tuple.

  • TypeError – If limitAf is given and its contents cannot be converted to float.

  • ValueError – If the min == max in limitAf

  • ValueError – If the min > max in limitAf

show()

Show the generated plots.

If must be noted that, in order to avoid generating empty figure windows, this method closes all the figure objects for which plots have not been generated yet. This renders these objects unusable, so it is important to call all the desired plotting methods before calling this one.