piel.experimental.measurements.data.electro_optic
=================================================

.. py:module:: piel.experimental.measurements.data.electro_optic


Functions
---------

.. autoapisummary::

   piel.experimental.measurements.data.electro_optic.fill_missing_pm_out
   piel.experimental.measurements.data.electro_optic.extract_electro_optic_dc_path_transmission_from_csv
   piel.experimental.measurements.data.electro_optic.extract_electro_optic_dc_network_from_measurement_collection


Module Contents
---------------

.. py:function:: fill_missing_pm_out(path_transmission: piel.types.ElectroOpticDCPathTransmission, method: str = 'linear') -> piel.types.ElectroOpticDCPathTransmission

   Fills in missing `pm_out` (transmission) data in an ElectroOpticDCPathTransmission instance.

   Parameters:
   - path_transmission (ElectroOpticDCPathTransmission): The path transmission instance with potential missing transmission data.
   - method (str): The interpolation method to use. Default is 'linear'.
                   Other options include 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', etc.,
                   as supported by pandas' interpolate method.

   Returns:
   - ElectroOpticDCPathTransmission: A new instance with filled transmission data.

   Raises:
   - ValueError: If there are insufficient data points to perform interpolation.


.. py:function:: extract_electro_optic_dc_path_transmission_from_csv(file: str, port_map: piel.types.ConnectionTypes, dc_voltage_column: str = 'bias_v', dc_current_column: str = 'bias_current', optical_power_column: str = 'pm_out') -> piel.types.ElectroOpticDCPathTransmission

   Converts a CSV file into an ElectroOpticDCPathTransmission instance.

   This function ensures that the output power (`pm_out`) aligns with the DC voltage (`bias_v`) and
   current (`bias_current`) data by inserting `np.nan` where `pm_out` data is missing.

   Parameters:
   - file (str): Path to the CSV file.
   - connection (ConnectionTypes): The port mapping information.
   - dc_voltage_column (str): The name of the DC voltage column in the CSV.
   - dc_current_column (str): The name of the DC current column in the CSV.
   - optical_power_column (str): The name of the optical power column in the CSV.

   Returns:
   - ElectroOpticDCPathTransmission: The mapped ElectroOpticDCPathTransmission instance.


.. py:function:: extract_electro_optic_dc_network_from_measurement_collection(measurement_collection: piel.types.ElectroOpticDCMeasurementCollection, dc_voltage_column: str = 'bias_v', dc_current_column: str = 'bias_current', optical_power_column: str = 'pm_out') -> piel.types.ElectroOpticDCNetworkTransmission

   Converts an ElectroOpticDCMeasurementCollection into an ElectroOpticDCNetworkTransmission instance.

   Parameters:
   - measurement_collection (ElectroOpticDCMeasurementCollection): The collection of measurements.
   - dc_voltage_column (str): Column name for DC voltage in the CSV files.
   - dc_current_column (str): Column name for DC current in the CSV files.
   - optical_power_column (str): Column name for optical power in the CSV files.

   Returns:
   - ElectroOpticDCNetworkTransmission: The compiled network transmission instance.


