Demonstrates how to add albedo module to coarse sun sensor. The script is found in the folder
executed by using:
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.
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.
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
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.
which is based on the albedo coefficient data using the specified fileName and dataPath, and
which is a model based on an average albedo value that can be specified with
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
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
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = False, useEclipse = False
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = False, useEclipse = True
show_plots = True, albedoData = False, multipleInstrument = True, multiplePlanet = True, useEclipse = False
- scenarioAlbedo.run(show_plots, albedoData, multipleInstrument, multiplePlanet, useEclipse, simTimeStep)¶
At the end of the python script you can specify the following example 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.