lime_tbx.application.simulation.lime_simulation module

Module containing the class that contains the state of the simulation.

class lime_tbx.application.simulation.lime_simulation.ILimeSimulation[source]

Bases: ABC

Interface for running the main lime-tbx functionality

Should contain the state of the simulation, so it can be implemented efficiently.

abstract are_mpas_inside_mpa_range() bool | List[bool][source]

Returns a list of values indicating if the moon datas contain a valid mpa range.

Returns:

are_valid – True/s if the MoonData/s contains mpa values in the valid range.

Return type:

bool | list of bool

abstract clear_srf()[source]

Dereference the SRF object from the LimeSimulation, allowing the garbage collector to remove it.

abstract get_elis() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

abstract get_elis_asd() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance for the asd spectrum.

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

abstract get_elis_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance for the cimel wavelengths.

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

abstract get_elrefs() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

abstract get_elrefs_asd() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance for the asd spectrum.

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

abstract get_elrefs_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance for the cimel wavelengths.

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

abstract get_moon_datas() MoonData | List[MoonData][source]

Returns the moon datas for the current point

Returns:

mds – MoonData/s of the current point.

Return type:

MoonData | list of MoonData

abstract get_point() Point[source]

Returns the point that is being used in the simulation

Returns:

point – The point used in the simulation.

Return type:

Point

abstract get_polars() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree

Returns:

polars – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

abstract get_polars_asd() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree for the asd spectrum.

Returns:

polars_asd – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

abstract get_polars_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree for the cimel wavelengths

Returns:

polars_cimel – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

abstract get_signals() SpectralData[source]

Returns the stored value for integrated signals

Returns:

signals – Previously calculated integrated signal/s

Return type:

SpectralData

abstract get_surfacepoints() SurfacePoint | List[SurfacePoint] | None[source]

Returns the Satellites points converted to the equivalent of surface points. In case they weren’t Satellite Points, the behaviour is not defined.

Returns:

surface_points – Equivalent surface points

Return type:

SurfacePoint | list of SurfacePoint | None

abstract is_polarisation_updated() bool[source]

Returns if the polarisation has been updated. If not, or nothing has been executed, or the spectrum doesn’t contain polarisation values.

Returns:

pol_uptodate – True if the polarisation is updated

Return type:

bool

abstract is_skipping_uncs() bool[source]

Checks if the current simulation instance is skipping the uncertainties calculation.

Returns:

skip – True if the uncertainties are being skipped.

Return type:

bool

abstract set_observations(lglod: LGLODData, srf: SpectralResponseFunction)[source]

Loads a set of observations and the relative SRF into the lime simulation

Parameters:
abstract set_simulation_changed()[source]

Marks the current data as not valid. It should be updated. If it is marked as valid, it might not be updated even when instructed to.

abstract update_irradiance(srf: SpectralResponseFunction, signals_srf: SpectralResponseFunction, point: Point, cimel_coeff: ReflectanceCoefficients, callback_observation: Callable | None = None, mda_precalculated: MoonData | None = None)[source]

Updates the irradiance values if the stored value are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the reflectance and irradiance will be calculated.

  • srf – SRF for which the integrated signal will be calculated.

  • point (Point) – Point (location) for which the irradiance will be calculated.

  • cimel_coeff (ReflectanceCoefficients) – Cimel Coefficients (and maybe more coeffs) used for the calculation of reflectance (needed for irradiance).

abstract update_polarisation(srf: SpectralResponseFunction, point: Point, polar_coeff: PolarisationCoefficients, callback_observation: Callable | None = None)[source]

Updates the polarisation values if the stored values are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the polarisation will be calculated.

  • point (Point) – Point (location) for which the polarisation will be calculated.

  • polar_coeff (PolarisationCoefficients) – Coefficients used for the calculation of polarisation.

abstract update_reflectance(srf: SpectralResponseFunction, point: Point, cimel_coeff: ReflectanceCoefficients, callback_observation: Callable | None = None)[source]

Updates the reflectance values if the stored values are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the reflectance will be calculated.

  • point (Point) – Point (location) for which the reflectance will be calculated.

  • cimel_coeff (ReflectanceCoefficients) – Cimel Coefficients (and maybe more coeffs) used for the calculation of reflectance.

  • callback_observation (Callable) – Callback that will emit a signal when a simulation is done

abstract will_irradiance_calculate_reflectance_previously(pt: Point) bool[source]

Returns if the irradiance calculation function would perform the reflectance calculation monolitically as a previous step or not given the current state.

Parameters:

pt (Point) – Point for which the information wants to be known.

Returns:

will_calculate – True if the reflectance would be calculated previously.

Return type:

bool

abstract will_irradiance_calculate_reflectance_simultaneously(pt: Point | None = None) bool[source]

Returns if the irradiance calculation function would perform the reflectance calculation simultaneously avoiding storing the error correlation matrices, given the current state.

Parameters:

pt (Point) – Point for which the information wants to be known. If not specified the currently loaded one will be used.

Returns:

will_calculate – True if the reflectance would be calculated simultaneously.

Return type:

bool

class lime_tbx.application.simulation.lime_simulation.LimeSimulation(eocfi_path: EocfiPath, kernels_path: KernelsPath, settings_manager: ISettingsManager, MCsteps: int = 100, verbose: bool = False)[source]

Bases: ILimeSimulation

Class for running the main lime-tbx functionality

Contains the state of the simulation, so it can be implemented efficiently.

are_mpas_inside_mpa_range() bool | List[bool][source]

Returns a list of values indicating if the moon datas contain a valid mpa range.

Returns:

are_valid – True/s if the MoonData/s contains mpa values in the valid range.

Return type:

bool | list of bool

clear_srf()[source]

Dereference the SRF object from the LimeSimulation, allowing the garbage collector to remove it.

get_elis() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

get_elis_asd() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance for the asd spectrum.

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

get_elis_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar irradiance for the cimel wavelengths.

Returns:

elrefs – Previously calculated irradiance/s

Return type:

SpectralData | list of SpectralData

get_elrefs() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

get_elrefs_asd() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance for the asd spectrum.

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

get_elrefs_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for extraterrestrial lunar reflectance for the cimel wavelengths.

Returns:

elrefs – Previously calculated reflectance/s

Return type:

SpectralData | list of SpectralData

get_interp_srf_name() str[source]
get_moon_datas() MoonData | List[MoonData][source]

Returns the moon datas for the current point

Returns:

mds – MoonData/s of the current point.

Return type:

MoonData | list of MoonData

get_point() Point[source]

Returns the point that is being used in the simulation

Returns:

point – The point used in the simulation.

Return type:

Point

get_polars() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree

Returns:

polars – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

get_polars_asd() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree for the asd spectrum.

Returns:

polars_asd – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

get_polars_cimel() SpectralData | List[SpectralData][source]

Returns the stored value for lunar polarisation degree for the cimel wavelengths

Returns:

polars_cimel – Previously calculated polarisation/s

Return type:

SpectralData | list of SpectralData

get_signals() SpectralData[source]

Returns the stored value for integrated signals

Returns:

signals – Previously calculated integrated signal/s

Return type:

SpectralData

get_surfacepoints() SurfacePoint | List[SurfacePoint] | None[source]

Returns the Satellites points converted to the equivalent of surface points. In case they weren’t Satellite Points, the behaviour is not defined.

Returns:

surface_points – Equivalent surface points

Return type:

SurfacePoint | list of SurfacePoint | None

is_polarisation_updated() bool[source]

Returns if the polarisation has been updated. If not, or nothing has been executed, or the spectrum doesn’t contain polarisation values.

Returns:

pol_uptodate – True if the polarisation is updated

Return type:

bool

is_skipping_uncs() bool[source]

Checks if the current simulation instance is skipping the uncertainties calculation.

Returns:

skip – True if the uncertainties are being skipped.

Return type:

bool

set_observations(lglod: LGLODData, srf: SpectralResponseFunction)[source]

Loads a set of observations and the relative SRF into the lime simulation

Parameters:
set_simulation_changed()[source]

Marks the current data as not valid. It should be updated. If it is marked as valid, it might not be updated even when instructed to.

update_irradiance(srf: SpectralResponseFunction, signals_srf: SpectralResponseFunction, point: Point, cimel_coeff: ReflectanceCoefficients, callback_observation: Callable | None = None, mda_precalculated: MoonData | None = None)[source]

Updates the irradiance values if the stored value are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the reflectance and irradiance will be calculated.

  • srf – SRF for which the integrated signal will be calculated.

  • point (Point) – Point (location) for which the irradiance will be calculated.

  • cimel_coeff (ReflectanceCoefficients) – Cimel Coefficients (and maybe more coeffs) used for the calculation of reflectance (needed for irradiance).

update_polarisation(srf: SpectralResponseFunction, point: Point, polar_coeff: PolarisationCoefficients, callback_observation: Callable | None = None)[source]

Updates the polarisation values if the stored values are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the polarisation will be calculated.

  • point (Point) – Point (location) for which the polarisation will be calculated.

  • polar_coeff (PolarisationCoefficients) – Coefficients used for the calculation of polarisation.

update_reflectance(srf: SpectralResponseFunction, point: Point, cimel_coeff: ReflectanceCoefficients, callback_observation: Callable | None = None)[source]

Updates the reflectance values if the stored values are not valid, using the given parameters.

Parameters:
  • srf (SpectralResponseFunction) – SRF for which the reflectance will be calculated.

  • point (Point) – Point (location) for which the reflectance will be calculated.

  • cimel_coeff (ReflectanceCoefficients) – Cimel Coefficients (and maybe more coeffs) used for the calculation of reflectance.

  • callback_observation (Callable) – Callback that will emit a signal when a simulation is done

will_irradiance_calculate_reflectance_previously(pt: Point) bool[source]

Returns if the irradiance calculation function would perform the reflectance calculation monolitically as a previous step or not given the current state.

Parameters:

pt (Point) – Point for which the information wants to be known.

Returns:

will_calculate – True if the reflectance would be calculated previously.

Return type:

bool

will_irradiance_calculate_reflectance_simultaneously(pt: Point | None = None) bool[source]

Returns if the irradiance calculation function would perform the reflectance calculation simultaneously avoiding storing the error correlation matrices, given the current state.

Parameters:

pt (Point) – Point for which the information wants to be known. If not specified the currently loaded one will be used.

Returns:

will_calculate – True if the reflectance would be calculated simultaneously.

Return type:

bool

lime_tbx.application.simulation.lime_simulation.is_ampa_valid_range(ampa: float) bool[source]

Checks if the value of the absolute moon phase angle is inside the valid range for the simulation.

Parameters:

ampa (float) – Absolute moon phase angle in degrees

Returns:

valid_range – True if the angle is inside the valid range for the simulation.

Return type:

bool