input: def run_script_for_thermal_analysis():
      """Perform a series of calculations and plots based on input data. Before running the script, 
      ensure that eval_spectrum.py and calibration.py have been run with appropriate measurements.
      The script imports necessary modules and functions from external sources.
      The main function loads the input data, performs calibration, calculates various values, 
      and generates plots based on instructions provided in a separate text file. The generated 
      plots show absorbed power vs emitted power, absorbed power vs reflectivity, and dissipated 
      power vs wavelength. The script also calculates thermal resistance and displays it on the 
      plot. Execute the main function to run the code.
      Example:
      >>> run_script_for_thermal_analysis()
      Outputs plots and prints thermal impedance and mean temperatures at various set points.
      """
output:     
      import numpy as np
      import matplotlib.pyplot as plt
      from eval_spectrum import load_data
      from calibration import calibrate_data
  
      def main():
          # Load input data
          data = load_data('input_data.csv')
          
          # Perform calibration
          calibrated_data = calibrate_data(data)
          
          # Calculate absorbed power
          absorbed_power = calibrated_data['absorbed_power']
          
          # Calculate emitted power
          emitted_power = calibrated_data['emitted_power']
          
          # Calculate reflectivity
          reflectivity = calibrated_data['reflectivity']
          
          # Calculate dissipated power
          dissipated_power = calibrated_data['dissipated_power']
          
          # Calculate wavelength
          wavelength = calibrated_data['wavelength']
          
          # Calculate thermal resistance
          thermal_resistance = np.mean(absorbed_power) / np.mean(dissipated_power)
          
          # Plot absorbed power vs emitted power
          plt.figure(1)
          plt.plot(absorbed_power, emitted_power, label='Absorbed vs Emitted Power')
          plt.xlabel('Absorbed Power')
          plt.ylabel('Emitted Power')
          plt.title('Absorbed Power vs Emitted Power')
          plt.legend()
          plt.grid(True)
          
          # Plot absorbed power vs reflectivity
          plt.figure(2)
          plt.plot(absorbed_power, reflectivity, label='Absorbed vs Reflectivity')
          plt.xlabel('Absorbed Power')
          plt.ylabel('Reflectivity')
          plt.title('Absorbed Power vs Reflectivity')
          plt.legend()
          plt.grid(True)
          
          # Plot dissipated power vs wavelength
          plt.figure(3)
          plt.plot(wavelength, dissipated_power, label='Dissipated Power vs Wavelength')
          plt.xlabel('Wavelength')
          plt.ylabel('Dissipated Power')
          plt.title('Dissipated Power vs Wavelength')
          plt.legend()
          plt.grid(True)
          
          # Display thermal resistance on the plot
          plt.figure(1)
          plt.text(0.5, 0.5, f'Thermal Resistance: {thermal_resistance:.2f}', 
                   transform=plt.gca().transAxes, fontsize=12, 
                   verticalalignment='center', horizontalalignment='center')
          
          # Show plots
          plt.show()
          
          # Print thermal impedance and mean temperatures
          print(f'Thermal Impedance: {thermal_resistance:.2f}')
          print(f'Mean Temperatures at Set Points: {np.mean(calibrated_data["temperatures"])}')
  
      if __name__ == "__main__":
          main()
  