BaseCylindricalDiskProfile#
- class profiles.base.BaseCylindricalDiskProfile(**kwargs)[source]#
Abstract base class for axisymmetric cylindrical disk profiles.
This class provides standard infrastructure for two-dimensional disk-like profiles expressed in cylindrical coordinates, defining:
Independent variables
r
(cylindrical radius) andz
(vertical coordinate)Automated symbolic setup for both variables
Derived profiles for radial and vertical derivatives, accessible via:
radial_derivative
: \(\frac{\partial f}{\partial r}\)vertical_derivative
: \(\frac{\partial f}{\partial z}\)
Subclasses define specific profile behavior by implementing:
__function__
: Returns the symbolic expression as a SymPy object__function_units__
: Returns the dimensional units of the profile output
Notes
This class is abstract. Concrete subclasses must set
__IS_ABSTRACT__ = False
.Independent variables are: -
r
: Cylindrical radius -z
: Vertical coordinateUnits for
r
andz
are automatically propagated in derived expressions.Radial and vertical derivatives are implemented via
derived_profile()
.
Example
class ExponentialDiskProfile( BaseCylindricalDiskProfile ): __IS_ABSTRACT__ = False __PARAMETERS__ = {"Sigma_0": 1.0, "h": 1.0} @classmethod def __function__(cls, r, z, Sigma_0, h): return ( Sigma_0 * sp.exp(-r / h) * sp.exp(-abs(z) / h) ) @classmethod def __function_units__( cls, r_unit, z_unit, Sigma_0_unit, h_unit ): return Sigma_0_unit disk = ExponentialDiskProfile(Sigma_0=1.0, h=2.0) radial_grad = disk.get_derived_profile( "radial_derivative" ) print(radial_grad(5.0, 0.0))
See also
BaseSphericalRadialProfile
Base class for spherically symmetric profiles
Methods
__init__
(**kwargs)Initialize a profile instance with specific parameter values.
from_dict
(data)Reconstruct a profile instance from a dictionary.
from_hdf5
(h5obj[, name])Reconstruct a profile from HDF5 attributes.
from_json
(filepath)Reconstruct a profile from a JSON file.
from_yaml
(filepath)Reconstruct a profile from a YAML file.
get_derived_profile
(profile_name, **kwargs)Access and instantiate a derived profile by name.
get_expression_latex
([substitute])Return the LaTeX representation of the profile's symbolic expression.
get_output_units
(*argu)Determine the output units of the operation given some set of input units.
Return a LaTeX table of the profile parameters.
lambdify_expression
(expression)Convert a symbolic expression into a callable function.
List all available derived profiles for this instance.
substitute_expression
(expression)Replace symbolic parameters with numerical values in an expression.
to_dict
()Serialize this profile to a minimal dictionary representation.
to_hdf5
(h5obj[, name])Store profile metadata into an HDF5 object as attributes.
to_json
(filepath, **kwargs)Serialize the profile to a JSON file.
to_yaml
(filepath, **kwargs)Serialize the profile to a YAML file.
Attributes
Get the available derived profile classes for this instance.
Get the symbolic representations of the coordinate system parameters.
The parameters of this coordinate system.
The symbols representing each of the coordinate axes in this coordinate system.
The axes names present in this coordinate system.