scenarioAlbedo

Overview

Demonstrates how to add albedo module to coarse sun sensor. The script is found in the folder basilisk/examples and executed by using:

python3 scenarioAlbedo.py

This script sets up a spacecraft with scenario options (1) and (2) shown in the following illustration. In scenario (1), only earth is considered as a celestial body, and the spacecraft is orbiting around earth. In scenario (2), there are two bodies (earth, moon) and spacecraft close to Earth increases its altitude up to moon without considering the gravity effector. In both scenarios, rotational motion is simulated too.

../_images/test_scenarioAlbedo.svg

Simulation Scenario Setup Details

A simulation process is created which contains both the spacecraft simulation module, as well as one albedo module from Module: albedo module using CSS configuration. The dynamics simulation is setup using Module: spacecraft. The CSS module is created using Module: coarseSunSensor. The input message sunPositionInMsg specifies an input message that contains the sun’s position.

Albedo module calculates the albedo value for any instrument location. The instrument configuration can be set through the variables:

fov
nHat_B
r_IB_B

which specify half field of view angle of the instrument, unit normal vector, and misalignment vector in meters. The instrument configuration is added to the albedo module through:

albModule.addInstrumentConfig(instInMsgName, configMsg)
albModule.addInstrumentConfig(instInMsgName, fov, nHat_B, r_IB_B)

Both method can be used for the same purpose. Note that this commands can be repeated if the albedo should be computed for different instruments.

Every time an instrument is added to the albedo module, an automated output message is created. For albModule is “AlbedoModule_0_data” as the ModelTag string is AlbedoModule and the instrument number is 0. This output is added to the albOutMsgs module vector within the addInstrumentConfig() function.

Multiple planets can be added to the albedo module through:

albModule.addPlanetandAlbedoAverageModel(SpicePlanetStateMsg)
albModule.addPlanetandAlbedoAverageModel(SpicePlanetStateMsg, ALB_avg, numLat, numLon)
albModule.addPlanetandAlbedoDataModel(SpicePlanetStateMsg, dataPath, fileName)

based on the albedo model to be used for the planet. Note that this commands should be repeated for adding multiple planets. However, the albedo module gives a summed albedo value at the instrument not a vector of values corresponding to each planet. The albedo module is created using one of the albedo models, e.g. ALBEDO_DATA which is based on the albedo coefficient data using the specified fileName and dataPath, and ALBEDO_AVG which is a model based on an average albedo value that can be specified with ALB_avg variable, and used for any planet. If ALB_avg is not specified albedo module uses the default value defined for each planet.

An optional input is the solar eclipse case eclipseCase. If it is specified as True, then the shadow factor is calculated by the albedo module automatically.

When the simulation completes, one to three plots are shown depending on the case. First one always show the albedo value at the instrument (instrument’s signal) with or without the instrument’s total signal. In case of using albedo data file, the albedo coefficient data map of the planet is shown. And, for the multiple planets case, the radius of the spacecraft is shown.

albedoData, multipleInstrument, multiplePlanet, useEclipse

Illustration of Simulation Results

show_plots = True, albedoData = True, multipleInstrument = False, multiplePlanet = False, useEclipse = False
../_images/scenarioAlbedo11000.svg ../_images/scenarioAlbedo21000.svg
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = False, useEclipse = False
../_images/scenarioAlbedo10100.svg
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = False, useEclipse = True
../_images/scenarioAlbedo10101.svg
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = True, useEclipse = False
../_images/scenarioAlbedo10110.svg ../_images/scenarioAlbedo20110.svg
scenarioAlbedo.run(show_plots, albedoData, multipleInstrument, multiplePlanet, useEclipse, simTimeStep)[source]

At the end of the python script you can specify the following example parameters.

Parameters:
  • show_plots (bool) – Determines if the script should display plots.

  • albedoData (bool) – Flag indicating if the albedo data based model should be used.

  • multipleInstrument (bool) – Flag indicating if multiple instrument should be used.

  • multiplePlanet (bool) – Flag specifying if multiple planets should be used.

  • useEclipse (bool) – Flag indicating if the partial eclipse at the incremental area is considered.

  • simTimeStep (double) – Flag specifying the simulation time step.