input: Write a function to perform a series of calculations and generate plots based on input data. The function should first ensure that eval_spectrum.py and calibration.py are executed with appropriate measurements. It should then load the input data, perform calibration, calculate various values, and generate plots showing absorbed power vs emitted power, absorbed power vs reflectivity, and dissipated power vs wavelength. Additionally, it should calculate thermal resistance and display it on the plot. The function should also be able to read plot instructions from a separate text file and use them for generating the plots. If the function runs successfully, it should return True; otherwise, it should return False.
  
  
  # assert tests
  assert main() == True
  # This assert checks whether the function runs successfully and returns True.
  
output: def main():
      try:
          import eval_spectrum
          import calibration
          import matplotlib.pyplot as plt
          import numpy as np
  
          # Execute eval_spectrum.py and calibration.py with appropriate measurements
          eval_spectrum.execute()
          calibration.execute()
  
          # Load input data
          data = np.loadtxt('input_data.txt')
  
          # Perform calibration
          calibrated_data = calibration.calibrate(data)
  
          # Calculate various values
          absorbed_power = calibrated_data[:, 0]
          emitted_power = calibrated_data[:, 1]
          reflectivity = calibrated_data[:, 2]
          dissipated_power = calibrated_data[:, 3]
          wavelength = calibrated_data[:, 4]
  
          # Calculate thermal resistance
          thermal_resistance = np.mean(dissipated_power / absorbed_power)
  
          # Load plot instructions from a text file
          with open('plot_instructions.txt', 'r') as file:
              plot_instructions = file.read()
  
          # Generate plots
          plt.figure(figsize=(12, 8))
  
          plt.subplot(3, 1, 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.subplot(3, 1, 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.subplot(3, 1, 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()
  
          # Display thermal resistance on the plot
          plt.figtext(0.5, 0.01, f'Thermal Resistance: {thermal_resistance:.2f}', ha='center', fontsize=12)
  
          plt.tight_layout()
          plt.show()
  
          return True
      except Exception as e:
          print(f"An error occurred: {e}")
          return False