photonmap.Energy.CorrectEnergy ============================== .. py:module:: photonmap.Energy.CorrectEnergy Functions --------- .. autoapisummary:: photonmap.Energy.CorrectEnergy.read_spectrum_file photonmap.Energy.CorrectEnergy.get_integral_of_band photonmap.Energy.CorrectEnergy.get_correct_energy_coeff photonmap.Energy.CorrectEnergy.get_points_calibration photonmap.Energy.CorrectEnergy.get_calibaration_coefficient photonmap.Energy.CorrectEnergy.calibrate_captor_energy photonmap.Energy.CorrectEnergy.calibrate_plant_energy Module Contents --------------- .. py:function:: read_spectrum_file(filename: str) -> (collections.OrderedDict, int, int) Parse a spectrum file. Parameters ---------- filename: str The file to parse. Returns ------- content: dict A dictionary with wavelength as key and photon count as value. step: int the step in the dictionary between two entries. start: int the first wavelength in the file. .. py:function:: get_integral_of_band(base_band: range, divided_band: range, spectrum: dict) -> float Returns the integral of the band as a percentage Parameters ---------- base_band: range The base spectral range which includes all the other spectral ranges divided_band: range The section of the base spectral range used to run the simulation spectrum: dict The whole spectrum of the band. .. py:function:: get_correct_energy_coeff(base_spectral_range, divided_spectral_range, spec_file: str) Get the coefficients of energy's correction from the spectrum file Parameters ---------- base_spectral_range: range The base spectral range which includes all the other spectral ranges divided_spectral_range: range The section of the base spectral range used to run the simulation spec_file: str The link to the file which contains the informations of the heterogeneity of the spectrum Returns ------- integrals: array The list of the coefficents of energy's correction .. py:function:: get_points_calibration(list_captor, points_calibration_file, divided_spectral_range) Read the file which contains the points used for the calibration. Parameters ---------- captor_list : array The list of captors points_calibration_file: str The link to the file which contains the informations of the captors used to calibrate the final result divided_spectral_range: array The list of spectral ranges divided from the base spectral range. Returns ------- points_calibration: array The list of the points used for the calibration .. py:function:: get_calibaration_coefficient(energies, correction_ratios, points_calibration) Calculate the coefficients used to calibrate the result of simulation Parameters ---------- energies : array The list of captor's energies correction_ratios: array The list of the coefficents of energy's correction points_calibration: array The list of the points used for the calibration Returns ------- coeff_calibration: array The list of coefficients used for the calibration .. py:function:: calibrate_captor_energy(energies, correction_ratios, points_calibration, coeffs_calibration) Calibrate the captor energy from photons to Mmol / m2 / s Parameters ---------- energies : array The list of captor's energies correction_ratios: array The list of the coefficents of energy's correction points_calibration: array The list of the points used for the calibration coeffs_calibration : array The list of the coefficients used for the calibration Returns ------- N_calibration: array The list of captor's energies after the calibration .. py:function:: calibrate_plant_energy(energies, coeffs_calibration) Calibrate the plant energy from photons to Mmol / m2 / s Parameters ---------- energies : array The list of captor's energies coeffs_calibration : array The list of the coefficients used for the calibration Returns ------- N_calibration: array The list of plant's energies after the calibration