Ssa3
====

Keywords: space situational awareness

== Summary ==
This demo shows how to setup an imaging platform in a GEO orbit that is
tracking a satellite in a LEO orbit.  

== Details ==
Some of the key elements of this simulation inolve the positioning of
the two orbiting satallites.  The location of both satellites is
setup using the *Flexible* motion model and the Two-Line Elements (TLEs)
for two real satellites.  The imaging satallite is using the orbit for the
Canadian Anik-F1 telecommunications satellite.  The target satellite is
using the orbit for the NASA EO-1 satallite.

The TLE for the GEO imaging satellite is (recent Anik-F1 is used):
----
1 26624U 00076A   14071.62213340 -.00000092  00000-0  00000+0 0  2575
2 26624   0.0179 165.5599 0001149 199.2228 282.0497  1.00273915 48818
----

The TLE for the LEO target satellite is (recent EO-1 TLE is used):
----
1 26619U 00075A   14086.18494821  .00002663  00000-0  52402-3 0  4248
2 26619  97.9906 145.4495 0008900 226.0780 133.9706 14.63359462711179
----


== Important Files ==
The goal of this demo is to show how to use a a TLE to define the
motion of the target satellite and and to tell the imaging platform
what to track.  Therefore, the materials used in the scene are miminal
to help the user visualize the simulation.

=== Target Satellite ===
A very low resolution geometry model for the EO-1 satellite is used (see 
the `geometry/eo1_simple.obj` file).  

.The simple geometry model for the EO-1 satellite.
image::geometry/eo1_simple.png[]

The EO-1 target satellite OBJ model is positioned and oriented within the
`geometry/eo1_simple.glist` file:
----
<geometrylist enabled="true">
  <object>
    <basegeometry>
      <obj><filename>eo1_simple.obj</filename></obj>
    </basegeometry>
    <dynamicinstance>
      <motion type="flexible">
        <locationengine type="sgp4">
          <data source="internal">
            <tle1>1 26619U 00075A   14086.18494821  .00002663  00000-0  52402-3 0  4248</tle1>
            <tle2>2 26619  97.9906 145.4495 0008900 226.0780 133.9706 14.63359462711179</tle2>
          </data>
        </locationengine>
        <orientationengine type="velocity">
          <up frame="ecef" vector="0,0,1"/>
        </orientationengine>
      </motion>
    </dynamicinstance>
  </object>
</geometrylist>
----

The `<motion>` description uses the EO-1 TLE for the location and
uses the *velocity* to define the orientation (the vehicle points
along spatial velocity).  In order to make the orientation robust
at locations far from the Scene ENU origin (both satellite are
_very_ far away), we have explicitly specified that we want to use
the ECEF +Z vector to constrain the orientation.

=== Imaging Platform ===
Because we wanted to be able to image the EO-1 satellite from our GEO
orbit, a _very_ high resolution camera is setup.  The angular extent of the
EO-1 satellite when viewed from a GEO altitude is 50 nanoradians (5.0e-08
radians), which is very small.  The camera has 10 micron pixels and a
2,000,000 mm or 2,000 m focal length.  The camera has a 0.05 Hz frame
rate.  The capture method is setup to save a *file per capture*, which
means a separate imge file we be generated for each image frame.

IMPORTANT: Obviously this is a fictional imaging system created for
           demonstration purposes.

The platform motion configuration is contained in the `demo.motion`
file.  It uses the SGP4 location engine and the Anik-F1 TLE to
position the imaging platform.  The orientation of the platform is
defined so that it is always looking at the location of the EO-1
satellite, but specifying the TLE for that satellite:
----
<motion type="flexible">
  <locationengine type="sgp4">
    <data source="internal">
      <tle1>1 26624U 00076A   14071.62213340 -.00000092  00000-0  00000+0 0  2575</tle1>
      <tle2>2 26624   0.0179 165.5599 0001149 199.2228 282.0497  1.00273915 48818</tle2>
    </data>
  </locationengine>
  <orientationengine type="lookat">
    <locationengine type="sgp4">
      <data source="internal">
        <tle1>1 26619U 00075A   14086.18494821  .00002663  00000-0  52402-3 0  4248</tle1>
        <tle2>2 26619  97.9906 145.4495 0008900 226.0780 133.9706 14.63359462711179</tle2>
      </data>
    </locationengine>
    <up frame="ecef" vector="0,0,1"/>
  </orientationengine>
</motion>
----

Again, in order to make the orientation robust at locations far
from the Scene ENU origin (both satellites are _very_ far away),
we have explicitly specified that we want to use the ECEF +Z vector
to constrain the orientation.

=== Tasks ===
The simulation is setup for a very specific time window where EO-1
decends across the northern hemisphere (passing over Rochester, NY).

.A visualization of the EO-1 track in STK
image::geometry/eo1_track.png[]

The start time for the acquisition is 11 March 2014 14:47:00 UTC and the
end time is 11 March 2014 14:51:00 UTC.  The `demo.tasks` file has this 14
minute long window defined.  Given the 0.05 Hz read out rate, this results
in 41 frames.  


== Setup ==
There are two simulation scenarios in this demo:

. A single-frame simulation
. A multi-frame (video) simulation

=== Running the Single-Frame Simulation ===
This single-frame simulation produces a single image file.
To run the simulation, perform the following steps:

. Run the DIRSIG `demo.sim` file
. Load the resulting `demo-t0000-c0000.img` file in the image viewer.


=== Running the Multi-Frame Simulation ===
The multi-frame simulation produces 41 image files.
To run the simulation, perform the following steps:

. Run the DIRSIG `video.sim` file
. Load the resulting `demo-t0000-c0000.img`, `demo-t0000-c0001.img`, etc.
  files in the image viewer.


== Results ==

=== Single-Frame Simulation ===
The simulations produces the single-frame simulation shown below:

.Output of the single-frame simulation (two sigma scaling).
image::images/demo.png[]

=== Multi-Frame Simulation ===
The output of the multi-frame simulation is 41 individual image
files.  The frames can be scaled and encoded into a video format
for viewing using a variety of 3rd party software tools (ffmpeg,
mpeg_encode, etc.) and the `make_pngs.csh` is included (works on
UNIX and Mac OSX only) for this purpose.  The animation below
compiles the frames from the multi-frame simulation.  The line-of-sight
to the target satellite starts with space as the background (the
early frames have black background) as the object decends from the
north pole towards the equator.  The background brightens as the
line-of-sight to the target satellite has the Earth as the background.
moves over the Earth 

.An animation of the 41 frames produced by the multi-frame simulation.
image::images/video.gif[]
