- This class simulates a telescope.
- This class uses the position information of celestial bodies and returns the following data:
- Flags that show whether the bright celestial bodies(the Earth, the Moon, and the Sun) are in the forbidden angle of the telescope
- Positions of the celestial bodies on the image sensor
- Positions of stars on the image sensor
MainRoutine
runs the following three functions:JudgeForbiddenAngle
- Function to judge whether the celestial body is in the forbidden angle.
Observe
- Function to
- judge whether the celestial body(provided by
CelesInfo
) is in the field of view. - output position of its image on the image sensor, if it is in the field of view.
- judge whether the celestial body(provided by
- Function to
ObserveStars
- Function to output some HIP IDs of the brightest stars in the field of view, using
HipparcosCatalogue
. - Specify how many stars this function outputs in
telescope.ini
.
- Function to output some HIP IDs of the brightest stars in the field of view, using
telescope.cpp
,telescope.hpp
- Definitions and declarations of the class
hipparcos_catalogue.cpp
,hipparcos_catalogue.hpp
- Definitions and declarations of the class to read Hipparcos catalogue.
- Set the parameters in
telescope.ini
- Create instance by using initialization function
InitTelescope
.- Each telescope is numbered as "Telescope1,…"
- To use
HipparcosCatalogue
data,hip_main.csv
is necessary.s2e-core/scripts/Common/download_HIPcatalogue.sh
is the script to download it. Run the following code using Git bash ins2e-core/scripts/
:bash download_HIPcatalogue.sh
- Function to judge whether a celestial body is in the forbidden angle.
- input
- The position vector of the celestial body in the body-fixed coordinate.
- This position vector is provided by
CelestialInformation
.
- This position vector is provided by
- The forbidden angle about the celestial body
- Specify the forbidden angle in
telescope.ini
.
- Specify the forbidden angle in
- The position vector of the celestial body in the body-fixed coordinate.
- output
- true: The celestial body is in forbidden angle
- false: The celestial body is not in forbidden angle
- The judging process is calculated in the telescope's component coordinate.
$q_{b2c}$ is the quaternion to convert from the body coordinate(B) to the component coordinate(C). Specify$q_{b2c}$ intelescope.ini
. The X-axis of the component coordinate is defined as the line of sight of the telescope.
- This function judges whether the celestial bodies(provided by
CelestialInformation
) are in the field of view and outputs the position of them on the image sensor if they are in the field of view - If they are not in the field of view, this function outputs
$(-1,-1)$ .
- input
- The reference to the position of the celestial body on the image sensor
- The position vector of the celestial body in the body-fixed coordinate
CelestialInformation
provides the position vector.
- output
- (void)
- This function rewrites the "reference to the celestial body's position on the image sensor" given as the input.
- (void)
- A 2D coordinate on the image sensor is defined to handle the position on the image sensor. The definition is as follows:
- The X-axis of the image sensor coordinate corresponds with the Z-axis of the component coordinate.
- The Y-axis of the image sensor coordinate corresponds with the Y-axis of the component coordinate.
- Then, the inclination angle from the X-axis of the celestial body's direction in the XZ plane of the component coordinate is calculated using
$(x_c, y_c, z_c)$ as follows:
- In the same way, the inclination angle from the X-axis of the celestial body's direction in the XY plane of the component coordinate is calculated as follows:
- They are written as
arg_x
andarg_y
in the code. In this manual,$\theta_x$ and$\theta_y$ are used for them. If$\theta_x$ is within FOV_x and$\theta_y$ is within FOV_y, the celestial body is judged to be in the field of view.
- The origin of the sensor coordinate is the corner of the image sensor, so
$x_{imgsensor}$ and$y_{imgsensor}$ have positive values. The unit of them is pixel(pix). In this manual,$N_x$ and$N_y$ are used for the total number of pixels along x, y axes of the sensor coordinate (They arex_num_of_pix
andy_num_of_pix
in the code). In the same way,X
andY
are used for the position of the celestial body on the image sensor (They arepos_imgsensor[0]
andpos_imgsensor[1]
). Then,X
andY
are calculated as follows:
If the celestial body is not in the field of view, the output is
- Function to output some HIP IDs of the brightest stars in the field of view, using
HipparcosCatalogue
- input
- (void)
- output
- (void)
When ObserveStars
is called in the MainRoutine
, this function works as follows:
- Clear
star_in_sight
- Judge the brightest star (provided by
HipparcosCatalogue
) is in the field of view - If the star is in the field of view, push the information (such as the HIP ID and its position on the image sensor) to
star_in_sight
- Go to step 2. to judge the next brightest star
- Exit the loop when the number of elements of
star_in_sight
reaches the specified number
If all the data in HipparcosCatalogue
are checked before the number of elements of star_in_sight
reaches the specified number, the data of lacking element is filled with -1.
In this section, the output of the functions when some angular velocity is input is verified.
- input $ω_b=[0.1
00]^T$ .
- input files
sample_simulation_base.ini
telescope.ini
- initial condition
sample_simulation_base.ini
Simulation start date[UTC] : 2017/12/01 11:00:00.0 Simulation finish time[sec] : 1500 Quaternion : q_i2b=[0 0 0 1]^T
telescope.ini
q_b2c=[0 0 0 1]^T sun_forbidden_angle = 60 earth_forbidden_angle = 60 moon_forbidden_angle = 60 x_num_of_pix = 2048 y_num_of_pix = 2048 x_fov_par_pix = 0.02 y_fov_par_pix = 0.02
sample_simulation_base.ini
[HIPPARCOS_CATALOGUE] max_magnitude = 5.0 calculation = ENABLE logging = DISABLE
The disturbance torque in the main function of sample_case.cpp
is commented out.
- judge for forbidden angle
- The angle from the line of sight about the direction of the Sun, the Earth, the Moon is as follows:
Observe
function- Only the Moon and the Earth are in the field of view (See the figure "The angle from the line of sight about the direction of the Sun, the Earth, the Moon"). The track of the image of the Moon on the image sensor is as follows:
In addition, the 3D plot of EARTH_POS_B is as follows:
As well as the Moon case, this result seems to be reasonable because the projection of the track of the Earth to the YZ plane corresponds with the track of the image.ObserveStars
function
- The first, second, and third HIP ID outputs were 113368, 9884, and 3419. Their track on the image sensor are as follows:
The tracks make circles, which are the reasonable outputs because of the same reason stated in the verification of Observe
function. In addition, the each Vmag of HIP ID=113368,9884,and 3419 is 1.17,2.01,and 2.04, so it is verified that the outputs are in order of brightness.
- The angular velocity input is $ω_b=[0.1
00]^T$ .The other condition is the same as the case of 1. Note that the verification of the case around z axis is omitted because y and z are equivalent under this condition.
- judge for forbidden angle
- The angle from the line of sight about the direction of the Sun, the Earth, the Moon is as follows:
Observe
function
- The figure "The angle from the line of sight about the direction of the Sun, the Earth, the Moon" shows that the earth is mainly in the field of view, so this section discusses only about the Earth. The track of the image of the Earth is as follows (For the sake of ease, only 4 tracks in the field of view are displayed):
ObserveStars
function
- The tracks of the stars are partially as follows: