piel.models.physical.electrical.cables.rf
=========================================

.. py:module:: piel.models.physical.electrical.cables.rf


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/piel/models/physical/electrical/cables/rf/common/index
   /autoapi/piel/models/physical/electrical/cables/rf/generic/index
   /autoapi/piel/models/physical/electrical/cables/rf/geometry/index
   /autoapi/piel/models/physical/electrical/cables/rf/thermal/index


Functions
---------

.. autoapisummary::

   piel.models.physical.electrical.cables.rf.cryo_cable
   piel.models.physical.electrical.cables.rf.generic_sma
   piel.models.physical.electrical.cables.rf.rg164
   piel.models.physical.electrical.cables.rf.create_coaxial_cable
   piel.models.physical.electrical.cables.rf.calculate_coaxial_cable_geometry
   piel.models.physical.electrical.cables.rf.calculate_coaxial_cable_heat_transfer


Package Contents
----------------

.. py:function:: cryo_cable(length_m: float) -> piel.types.CoaxialCable

.. py:function:: generic_sma(name: str, length_m: float, **kwargs) -> piel.types.CoaxialCable

.. py:function:: rg164(length_m: float, name: str = 'RG164', **kwargs) -> piel.types.CoaxialCable

.. py:function:: create_coaxial_cable(material_specification_function: Callable[Ellipsis, piel.types.electrical.cables.CoaxialCableMaterialSpecificationType] | None = None, timing_function: Callable[Ellipsis, piel.types.connectivity.timing.TimeMetricsTypes] | piel.types.connectivity.timing.TimeMetricsTypes = TimeMetric(), geometry_function: Callable[Ellipsis, piel.types.electrical.cables.CoaxialCableGeometryType] = calculate_coaxial_cable_geometry, heat_transfer_function: Callable[Ellipsis, piel.types.electrical.cables.CoaxialCableHeatTransferType] = calculate_coaxial_cable_heat_transfer, parameters: dict = {}, **kwargs) -> piel.types.electrical.cables.CoaxialCable

   Creates a complete model of a CoaxialCable with relevant geometrical, frequency, timing, and heat transfer descriptions.

   This function operates on a collection of functions to create a comprehensive model of a `CoaxialCable`.
   Each function is parametrized through a `parameters` dictionary common to all defined internal functions,
   in order to compose each relevant model accordingly. This is decomposed internally within this method.

   Parameters:
   -----------
   material_specification_function : Callable[..., CoaxialCableMaterialSpecificationType] | None, optional
       A function that returns the material specification for the coaxial cable.
       This function should not take any arguments as it will be called without parameters.
       If None, no material specification will be set. Defaults to None.

   timing_function : Callable[..., TimeMetricsTypes] | TimeMetricsTypes, optional
       Either a function that calculates and returns the timing metrics for the coaxial cable,
       or a TimeMetricsTypes object directly.
       If a function, it will be called with the parameters from the `parameters` dict.
       Defaults to TimeMetrics().

   geometry_function : Callable[..., CoaxialCableGeometryType], optional
       A function that calculates and returns the geometry specification for the coaxial cable.
       Defaults to `calculate_coaxial_cable_geometry`.
       This function will be called with the parameters from the `parameters` dict.

   heat_transfer_function : Callable[..., CoaxialCableHeatTransferType], optional
       A function that calculates and returns the heat transfer characteristics of the coaxial cable.
       Defaults to `calculate_coaxial_cable_heat_transfer`.
       This function will be called with the parameters from the `parameters` dict.

   parameters : dict, optional
       A dictionary of parameters to be passed to the geometry, timing, and heat transfer functions.
       These parameters are used to customize the calculations for each aspect of the coaxial cable.
       Defaults to an empty dictionary.

   **kwargs :
       Additional keyword arguments to be passed to the CoaxialCable constructor.

   Returns:
   --------
   :
   CoaxialCable
       A fully specified CoaxialCable object with all relevant properties set.

   Notes:
   ------
   - The function creates a Connection object with "in" and "out" PhysicalPorts, using the calculated time metrics.
   - A PhysicalConnection is created using the Connection object.
   - The CoaxialCable is constructed using the results from all calculation functions and the created PhysicalConnection.
   - If material_specification_function is None, no material specification will be set for the CoaxialCable.
   - The timing_function parameter can now be either a callable or a TimeMetricsTypes object directly.

   Example:
   --------
   >>> def material_spec():
   ...     return CoaxialCableMaterialSpecification(...)
   >>> def timing_calc(**params):
   ...     return TimeMetric(...)
   >>> cable = create_coaxial_cable(
   ...     material_specification_function=material_spec,
   ...     timing_function=timing_calc,
   ...     parameters={'length': 10, 'diameter': 0.5},
   ...     name='My Coaxial Cable'
   ... )


.. py:function:: calculate_coaxial_cable_geometry(length_m: float = 1, sheath_top_diameter_m: float = 0.001651, sheath_bottom_diameter_m: float = 0.001468, core_diameter_dimension: Literal['awg', 'metric'] = 'metric', core_diameter_awg: Optional[float] = None, core_diameter_m: float = 0.002, **kwargs) -> piel.types.electrical.cables.CoaxialCableGeometryType

   Calculate the geometry of a coaxial cable. Defaults are based on the parameters of a TODO

   :param length_m: Length of the cable in meters.
   :param sheath_top_diameter_m: Diameter of the top of the sheath in meters.
   :param sheath_bottom_diameter_m: Diameter of the bottom of the sheath in meters.
   :param core_diameter_dimension: Dimension of the core diameter.
   :param core_diameter_awg: Core diameter in AWG.
   :param core_diameter_m: Core diameter in meters.
   :param \*\*kwargs:

   :returns: The geometry of the coaxial cable.
   :rtype: CoaxialCableGeometryType


.. py:function:: calculate_coaxial_cable_heat_transfer(temperature_range_K: piel.types.physical.TemperatureRangeTypes = [273, 293], geometry_class: piel.types.electrical.cables.CoaxialCableGeometryType = CoaxialCableGeometryType(), material_class: piel.types.electrical.cables.CoaxialCableMaterialSpecificationType | None = None, core_material: piel.types.materials.MaterialReferenceType | None = None, sheath_material: piel.types.materials.MaterialReferenceType | None = None, dielectric_material: piel.types.materials.MaterialReferenceType | None = None) -> piel.types.electrical.cables.CoaxialCableHeatTransferType

   Calculate the heat transfer of a coaxial cable.

   :param temperature_range_K: The temperature range in Kelvin.
   :param geometry_class: The geometry of the cable.
   :param material_class: The material of the cable.
   :param core_material: The material of the core.
   :param sheath_material: The material of the sheath.
   :param dielectric_material: The material of the dielectric.

   :returns: The heat transfer of the cable.
   :rtype: CoaxialCableHeatTransferType


