piel.analysis.signals.dc
========================

.. py:module:: piel.analysis.signals.dc


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/piel/analysis/signals/dc/metrics/index
   /autoapi/piel/analysis/signals/dc/transfer/index
   /autoapi/piel/analysis/signals/dc/utils/index


Functions
---------

.. autoapisummary::

   piel.analysis.signals.dc.get_out_min_max
   piel.analysis.signals.dc.get_out_response_in_transition_range
   piel.analysis.signals.dc.get_power_metrics
   piel.analysis.signals.dc.calculate_power_signal_from_collection
   piel.analysis.signals.dc.get_power_map_vin_metrics
   piel.analysis.signals.dc.get_trace_values_by_datum
   piel.analysis.signals.dc.get_trace_values_by_unit
   piel.analysis.signals.dc.compile_dc_min_max_metrics_from_dc_collection
   piel.analysis.signals.dc.compile_dc_transition_metrics_from_dc_collection


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

.. py:function:: get_out_min_max(collection: piel.types.SignalDCCollection, lower_threshold_ratio: float = 0.1, upper_threshold_ratio: float = 0.9, **kwargs) -> piel.types.ScalarMetric

   Retrieves the minimum and maximum output voltage values within a specified input voltage range.

   :param collection: The collection of input and output DC signals.
   :type collection: SignalDCCollection
   :param lower_threshold_ratio: The lower threshold as a fraction of V_in range (0-1). Defaults to 0.1.
   :type lower_threshold_ratio: float, optional
   :param upper_threshold_ratio: The upper threshold as a fraction of V_in range (0-1). Defaults to 0.9.
   :type upper_threshold_ratio: float, optional

   :returns: Metrics including min and max values of the output voltage in the specified input voltage range.
   :rtype: ScalarMetric


.. py:function:: get_out_response_in_transition_range(collection: piel.types.SignalDCCollection, lower_threshold_ratio: float = 0.1, upper_threshold_ratio: float = 0.9, transition_type: Literal['analogue', 'digital'] = 'analogue', transition_direction: Literal['positive', 'negative'] = 'positive', **kwargs) -> piel.types.ScalarMetric

   Calculates the equivalent input voltage range (V_in) corresponding to specified thresholds of output voltage (V_out).

   :param collection: The collection of input and output DC signals.
   :type collection: SignalDCCollection
   :param lower_threshold_ratio: The lower threshold as a fraction of V_out's final value (0-1). Defaults to 0.1.
   :type lower_threshold_ratio: float, optional
   :param upper_threshold_ratio: The upper threshold as a fraction of V_out's final value (0-1). Defaults to 0.9.
   :type upper_threshold_ratio: float, optional
   :param transition_type: Type of transition. Defaults to "analogue".
   :type transition_type: Literal["analogue", "digital"], optional
   :param transition_direction: Direction of transition. Defaults to "positive".
   :type transition_direction: Literal["positive", "negative"], optional
   :param \*\*kwargs: Additional keyword arguments.

   :returns: Metrics including min and max V_in values corresponding to the specified V_out threshold range.
   :rtype: ScalarMetric


.. py:function:: get_power_metrics(collection: piel.types.SignalDCCollection, lower_threshold_ratio: float = 0, upper_threshold_ratio: float = 1, **kwargs) -> piel.types.ScalarMetric

   Retrieves the minimum and maximum power values within a specified input voltage range,
   along with the corresponding V_in values where these extrema occur.

   :param collection: The collection of input, output, and power DC signals.
   :type collection: SignalDCCollection
   :param lower_threshold_ratio: The lower threshold as a fraction of V_in range (0-1). Defaults to 0.1.
   :type lower_threshold_ratio: float, optional
   :param upper_threshold_ratio: The upper threshold as a fraction of V_in range (0-1). Defaults to 0.9.
   :type upper_threshold_ratio: float, optional

   :returns:

             ScalarMetric
                 - ScalarMetric containing min and max power.


.. py:function:: calculate_power_signal_from_collection(collection: piel.types.SignalDCCollection, lower_threshold_ratio: float = 0, upper_threshold_ratio: float = 1, **kwargs) -> piel.types.ScalarMetric

   Retrieves the minimum and maximum power values within a specified input voltage range,
   along with the corresponding V_in values where these extrema occur.

   :param collection: The collection of input, output, and power DC signals.
   :type collection: SignalDCCollection
   :param lower_threshold_ratio: The lower threshold as a fraction of V_in range (0-1). Defaults to 0.1.
   :type lower_threshold_ratio: float, optional
   :param upper_threshold_ratio: The upper threshold as a fraction of V_in range (0-1). Defaults to 0.9.
   :type upper_threshold_ratio: float, optional

   :returns:

             ScalarMetric
                 - ScalarMetric containing min and max power.


.. py:function:: get_power_map_vin_metrics(collection: piel.types.SignalDCCollection, lower_threshold_ratio: float = 0, upper_threshold_ratio: float = 1, **kwargs) -> piel.types.ScalarMetric

   Retrieves the mapped V_IN minimum and maximum power values within a specified input voltage range. Represents
   along with the corresponding V_in values where these power extrema occur.

   :param collection: The collection of input, output, and power DC signals.
   :type collection: SignalDCCollection
   :param lower_threshold_ratio: The lower threshold as a fraction of V_in range (0-1). Defaults to 0.1.
   :type lower_threshold_ratio: float, optional
   :param upper_threshold_ratio: The upper threshold as a fraction of V_in range (0-1). Defaults to 0.9.
   :type upper_threshold_ratio: float, optional

   :returns:

             ScalarMetric
                 - ScalarMetric containing min and max power.


.. py:function:: get_trace_values_by_datum(signal_dc: piel.types.SignalDC, desired_datum: str) -> Optional[numpy.ndarray]

   Retrieves the values of a trace from a SignalDC instance based on the unit's datum.

   :param signal_dc: The SignalDC instance containing the traces.
   :type signal_dc: SignalDC
   :param desired_datum: The datum type to filter traces (e.g., 'voltage', 'ampere') See unit definitions.
   :type desired_datum: str

   :returns: The numpy array of trace values if found, else None.
   :rtype: Optional[np.ndarray]


.. py:function:: get_trace_values_by_unit(signal_dc: piel.types.SignalDC, desired_unit: piel.types.Unit) -> Optional[numpy.ndarray]

   Retrieves the values of a trace from a SignalDC instance based on the exact unit.

   :param signal_dc: The SignalDC instance containing the traces.
   :type signal_dc: SignalDC
   :param desired_unit: The Unit instance to filter traces.
   :type desired_unit: Unit

   :returns: The numpy array of trace values if found, else None.
   :rtype: Optional[np.ndarray]


.. py:function:: compile_dc_min_max_metrics_from_dc_collection(collections: list[piel.types.SignalDCCollection], label_list: list[str], label_column_name: str = 'label', threshold_kwargs: dict = None, debug: bool = False, **kwargs) -> pandas.DataFrame

   Compiles DC analysis metrics from a list of SignalDCCollection instances into a final DataFrame.

   :param collections: List of SignalDCCollection instances to analyze.
   :type collections: List[SignalDCCollection]
   :param label_list: List of labels corresponding to each SignalDCCollection.
   :type label_list: List[str]
   :param threshold_kwargs: Threshold kwargs for the transition transmission. Defaults to None.
   :type threshold_kwargs: dict, optional
   :param label_column_name: How the label column should be called. Defaults to "label".
   :type label_column_name: str, optional
   :param debug: If True, raises exceptions during processing. Defaults to False.
   :type debug: bool, optional
   :param \*\*kwargs: Additional keyword arguments for pd.DataFrame.

   :returns: A DataFrame containing the compiled metrics with combined min-max columns.
   :rtype: pd.DataFrame


.. py:function:: compile_dc_transition_metrics_from_dc_collection(collections: list[piel.types.SignalDCCollection], label_list: list[str], label_column_name: str = 'label', threshold_kwargs: dict = None, debug: bool = False, **kwargs) -> pandas.DataFrame

   Compiles DC analysis metrics from a list of SignalDCCollection instances into a final DataFrame.

   :param collections: List of SignalDCCollection instances to analyze.
   :type collections: List[SignalDCCollection]
   :param label_list: List of labels corresponding to each SignalDCCollection.
   :type label_list: List[str]
   :param threshold_kwargs: Threshold kwargs for the transition transmission. Defaults to None.
   :type threshold_kwargs: dict, optional
   :param label_column_name: How the label column should be called. Defaults to "label".
   :type label_column_name: str, optional
   :param debug: If True, raises exceptions during processing. Defaults to False.
   :type debug: bool, optional
   :param \*\*kwargs: Additional keyword arguments for pd.DataFrame.

   :returns: A DataFrame containing the compiled metrics with combined min-max columns.
   :rtype: pd.DataFrame


