SatAndLight
2.2.2-hubble
Simulation toolkit for space telescopes
|
#include <Satellite.h>
Public Member Functions | |
bool | AddTelescope (Telescope *aTelescope, const ULong64_t aTimePeriodicty) |
Adds a Telescope in the satellite. More... | |
double | GetAlphaFromFlightSequence (const double aTime) |
Returns the satellite \(\alpha\) angle at a given time following the flight sequence. More... | |
double | GetBetaFromFlightSequence (const double aTime) |
Returns the satellite \(\beta\) angle at a given time according the flight sequence. More... | |
double | GetGammaFromFlightSequence (const double aTime) |
Returns the satellite \(\gamma\) angle at a given time according the flight sequence. More... | |
string | GetName (void) |
Returns the satellite name. More... | |
UInt_t | GetTimeResolution (void) |
Returns the satellite time resolution [ms]. More... | |
void | RunSequence (const ULong64_t aTimeStart, const UInt_t aTimeDuration) |
Runs a simulation sequence. More... | |
bool | SetFileDuration (const UInt_t aFileDuration) |
Sets the satellite file duration [ms]. More... | |
void | SetFlightSequence (TGraph *aAlpha, TGraph *aBeta, TGraph *aGamma) |
Sets the satellite flight sequence. More... | |
void | SetName (const string aName) |
Sets the satellite name. More... | |
void | SetOutputDirectory (const string aOutputDirectory) |
Sets the satellite output directory. More... | |
void | SetTimeResolution (const UInt_t aTimeResolution) |
Sets the satellite time resolution [ms]. More... | |
Constructors and destructors | |
Satellite (const UInt_t aTimeResolution) | |
Satellite class constuctor. More... | |
virtual | ~Satellite (void) |
Satellite class destructor. More... | |
Private Attributes | |
TGraph * | sat_alpha_seq |
Satellite flight sequence \(\alpha\). More... | |
TGraph * | sat_beta_seq |
Satellite flight sequence \(\beta\). More... | |
UInt_t | sat_dt |
Satelitte dt [ms]. More... | |
UInt_t | sat_filedt |
Satelitte file duration [ms]. More... | |
TGraph * | sat_gamma_seq |
Satellite flight sequence \(\gamma\). More... | |
string | sat_name |
Satellite name. More... | |
string | sat_outdir |
Satellite output directory. More... | |
vector< Telescope * > | sat_tel |
Vector of telescopes. More... | |
vector< ULong64_t > | sat_tel_T |
Vector of telescope periodicity. More... | |
Satellite control.
This class is designed to generate a satellite observation sequence.
The Satellite object must be given a flight sequence with SetFlightSequence(). The flight sequence programs the angular position as a function of time. The three Euler angles, \((\alpha,\beta,\gamma)\), are used to define the satellite angular position in the Earth reference frame, using celestial coordinates \((x',y',z')\). The \(z'\) axis is the rotation axis of the Earth, the \(x'y'\) plane is the equatorial plane, and the \(x'\) axis points to the vernal equinox.
The satellite reference frame is given by a three-dimensional rotation with respect to Earth-based coordinates. Internally, the satellite orientation is controlled using the Euler angles \((\alpha, \beta, \gamma)\). The satellite reference frame is \((x,y,z)\). The x-axis is used as the main-axis for on-board instruments.
In the following figure, the geometrical definitions are represented. The Earth celestial coordinate system \((x',y',z')\) is represented in black. The satellite reference frame \((x,y,z)\) is represented in blue.
The Satellite object must be given a time resolution with SetTimeResolution() which defines the internal clock. The choice of this parameter is crucial as it drives the satellite telescopes in the sequence. When adding a telescope to a satellite, a time periodicity to take pictures should be given. The satellite time resolution must be chosen such that it is the greatest comon divisor of all telescope time periodicities. For example, if you have two telescopes which are programmed to take pictures every 100 ms and 60 ms respectively, you should use a satellite time resolution of 20 ms. See AddTelescope().
In addition another time scale should be defined to tell when the sequence should be saved in files periodically. Again, the satellite time resolution should be a sub-multiple of this periodicity.
A satellite must be equipped with telescopes. Telescope objects must be created and configured first. They are then mounted on the satellite with AddTelescope(). The telescope and the satellite share the same system of corrdinates: the telescope \(x\)-axis is aligned with the satellite \(x\)-axis.
When running an observation sequence (see below), the data is saved in output ROOT files. The duration for these files must be set with SetFileDuration().
Once the satellite is configured, run an observation sequence with RunSequence(). This function manages the satellite angular position as a function of time and automatically controls on-board telescopes in a synchronized way.
The observation sequence is saved in a sequence of root files.
Satellite::Satellite | ( | const UInt_t | aTimeResolution | ) |
Satellite class constuctor.
The Satellite object is initialized:
[in] | aTimeResolution | Satellite time resolution [ms]. |
|
virtual |
Satellite class destructor.
bool Satellite::AddTelescope | ( | Telescope * | aTelescope, |
const ULong64_t | aTimePeriodicty | ||
) |
Adds a Telescope in the satellite.
The input telescope should be entirely configured before calling this function. Do not change the telescope configuration after it is added to the satellite. A time periodicity should be specified. It tells the satellite when to take a picture. This periodicity should be a multiple of the satellite time resolution previously set with SetTimeResolution().
[in] | aTelescope | Pointer to a Telescope object. |
[in] | aTimePeriodicty | Time periodicity [ms]. |
double Satellite::GetAlphaFromFlightSequence | ( | const double | aTime | ) |
Returns the satellite \(\alpha\) angle at a given time following the flight sequence.
The Euler angle \(\alpha\) is evaluated following the flight sequence set with SetFlightSequence():
[in] | aTime | Satellite time [ms]. |
double Satellite::GetBetaFromFlightSequence | ( | const double | aTime | ) |
Returns the satellite \(\beta\) angle at a given time according the flight sequence.
The Euler angle \(\beta\) is evaluated according the flight sequence set with SetFlightSequence():
[in] | aTime | Satellite time [ms]. |
double Satellite::GetGammaFromFlightSequence | ( | const double | aTime | ) |
Returns the satellite \(\gamma\) angle at a given time according the flight sequence.
The Euler angle \(\gamma\) is evaluated according the flight sequence set with SetFlightSequence():
[in] | aTime | Satellite time [ms]. |
|
inline |
Returns the satellite name.
|
inline |
Returns the satellite time resolution [ms].
void Satellite::RunSequence | ( | const ULong64_t | aTimeStart, |
const UInt_t | aTimeDuration | ||
) |
Runs a simulation sequence.
The satellite clock is ticking starting at aTimeStart and for a duration aTimeDuration. Each tick is separated by the satellite time resolution set with SetTimeResolution(). When the satellite time matches a telescope periodicity, a picture is taken with Telescope::TakePicture(). During the exposure time, the satellite position is assumed to be static and equal to the scheduled position in the middle of the exposure time.
[in] | aTimeStart | Sequence starting time [ms]. |
[in] | aTimeDuration | Sequence duration [ms]. |
bool Satellite::SetFileDuration | ( | const UInt_t | aFileDuration | ) |
Sets the satellite file duration [ms].
The file duration parameter tells the satellite when to save the sequence in a file. This parameter should be a multiple of the satellite time resolution previously set with SetTimeResolution().
[in] | aFileDuration | Satellite file duration [ms]. |
void Satellite::SetFlightSequence | ( | TGraph * | aAlpha, |
TGraph * | aBeta, | ||
TGraph * | aGamma | ||
) |
Sets the satellite flight sequence.
The satellite Euler angles can be provided using TGraph objects. Each point of the graph gives the angle [rad] as a function of time [ms]. The number of points in the graph does not matter as linear interpolation is used to match the satellite time resolution. If the graph is a single point, it is interpreted as a time-independent value.
[in] | aAlpha | Pointer to a TGraph describing \(\alpha\) as a function of time. |
[in] | aBeta | Pointer to a TGraph describing \(\beta\) as a function of time. |
[in] | aGamma | Pointer to a TGraph describing \(\gamma\) as a function of time. |
void Satellite::SetName | ( | const string | aName | ) |
Sets the satellite name.
The satellite name must be unique if more than one satellite are used in the same time.
[in] | aName | Satellite name. |
|
inline |
Sets the satellite output directory.
Output files will be saved in that directory.
[in] | aOutputDirectory | Path to output directory. |
|
inline |
Sets the satellite time resolution [ms].
[in] | aTimeResolution | Satellite time resolution [ms]. |
|
private |
Satellite flight sequence \(\alpha\).
|
private |
Satellite flight sequence \(\beta\).
|
private |
Satelitte dt [ms].
|
private |
Satelitte file duration [ms].
|
private |
Satellite flight sequence \(\gamma\).
|
private |
Satellite name.
|
private |
Satellite output directory.
|
private |
Vector of telescopes.
|
private |
Vector of telescope periodicity.