@@ -56,7 +56,7 @@ def __init__(
5656 self ,
5757 data_raw : pd .DataFrame ,
5858 file_name : str ,
59- input_voltage : float ,
59+ excitation_voltage : float ,
6060 resistance : float ,
6161 execution_root : str | None = None ,
6262 ) -> None :
@@ -65,7 +65,7 @@ def __init__(
6565 Args:
6666 data_raw (pd.DataFrame): Raw data containing time and thrust measurements.
6767 file_name (str): File name identifier.
68- input_voltage (float): Input voltage used during measurement.
68+ excitation_voltage (float): Excitation voltage used during measurement.
6969 resistance (float): Resistance value used during measurement.
7070 execution_root (str | None): Base directory for logs/ and results/*.
7171 If None, defaults to current working directory.
@@ -157,7 +157,7 @@ def __init__(
157157 ].copy ()
158158 self ._data_raw .columns = ["time" , "thrust" ]
159159 self ._file_name : str = file_name
160- self ._input_voltage : float = input_voltage
160+ self ._excitation_voltage : float = excitation_voltage
161161 self ._resistance : float = resistance
162162
163163 self ._logger .info ("0. Initialization complete." )
@@ -227,7 +227,7 @@ def _convert_voltage_to_thrust(self, data: pd.DataFrame) -> pd.DataFrame:
227227 data ["thrust" ] = (
228228 data ["thrust" ]
229229 * 1000
230- / (self ._sensitivity_mv_per_v * self ._input_voltage )
230+ / (self ._sensitivity_mv_per_v * self ._excitation_voltage )
231231 * self ._rated_capacity_kgf
232232 * self ._g
233233 / (
@@ -662,10 +662,12 @@ def _thrust_plot(self) -> None:
662662 )
663663
664664 ax .annotate (
665- "Impulse " + str (round (self ._impulse , 2 )) + " Ns\n "
666- "Input Voltage " + str (round (self ._input_voltage , 2 )) + " V\n "
667- "Resistance " + str (round (self ._resistance , 2 )) + r" $\Omega$" ,
668- xy = (0.72 , 0.85 ),
665+ "Impulse " + str (round (self ._impulse , 2 )) + " Ns\n "
666+ "Excitation Voltage " + str (round (self ._excitation_voltage , 2 )) + " V\n "
667+ "Resistance "
668+ + str (round (self ._resistance , 2 ))
669+ + r" $\Omega$" ,
670+ xy = (0.67 , 0.85 ),
669671 xycoords = "axes fraction" ,
670672 size = 20 ,
671673 font = "Arial" ,
@@ -733,7 +735,15 @@ def run(self) -> pd.DataFrame:
733735 config = pd .read_excel (config_path , sheet_name = 0 , header = 0 , index_col = 0 )
734736 idx = len (config ) - 1
735737 expt_file_name = config ["expt_file_name" ][idx ]
736- expt_input_voltage = config ["expt_input_voltage [V]" ][idx ]
738+ # Backward-compatible: read excitation voltage from new or legacy column
739+ if "expt_excitation_voltage [V]" in config .columns :
740+ expt_excitation_voltage = config ["expt_excitation_voltage [V]" ][idx ]
741+ elif "expt_input_voltage [V]" in config .columns :
742+ expt_excitation_voltage = config ["expt_input_voltage [V]" ][idx ]
743+ else :
744+ raise ValueError (
745+ "Missing excitation voltage column: expected 'expt_excitation_voltage [V]' or legacy 'expt_input_voltage [V]'"
746+ )
737747 expt_resistance = config ["expt_resistance [Ohm]" ][idx ]
738748
739749 print (f"Loaded configuration for experiment: { expt_file_name } " )
@@ -764,6 +774,6 @@ def run(self) -> pd.DataFrame:
764774 print ("Successfully loaded input data file." )
765775
766776 process = ThrustPostProcess (
767- thrust_data , expt_file_name , expt_input_voltage , expt_resistance
777+ thrust_data , expt_file_name , expt_excitation_voltage , expt_resistance
768778 )
769779 _ = process .run ()
0 commit comments