Hello and welcome back to the second video about GROOPS. In this video I want to show
you the workflow of creating a script: how do you add programs,
how do you get data from one program to the next and so on. In the end you will have
a script that does multiple things to achieve some goal you want. For this example, we want to
do a small specific task. We want to simulate an orbit for a low Earth orbiting satellite.
We then want to visualize the tidal accelerations acting on the satellite
throughout its orbit and we want to plot this in a map. So it's a relatively simple task,
which can be done with a few programs in GROOPS. I've already created a script file here,
it's empty for now except for some global variables, which are part of our template.
And, yeah, so let's start. First of all we want to add a program. You can just hit the
"Add" button here and select one. The first program we want to add is "SimulateOrbit".
We have a filter here, so we type in "simulate" and we get "SimulateOrbit".
So this is our first program. Our program has several settings or input and output fields.
Here, everything marked with a red star indicates that this is a must-set field. Everything else
is optional to some degree or another. Some of them have default values, others do not.
But "outputfileOrbit" is a must-set value so we need to provide a file where the output is
written to. So the principle of GROOPS and GROOPS programs is that programs possibly read data but
they'll usually always write data to some file and the next program then can read this data. So let's
start with writing our orbit. We just write it into a file called "orbit.txt" in the folder where
the script is located. "inputfileSatelliteModel": This is a model of the satellite, which describes
its mass and geometry and so on. So as you can see here, the "groopsDataDir" variable is used
in the curly braces – and curly braces, I'll talk about this more in the next video
– this variable will be replaced by the global variable "groopsDataDir".
So I can select any satellite model. For this video let's just use the one from GRACE-1.
And, as you can see, in the path the beginning is still replaced by the "groopsDataDir" variable.
Next, we need a time series, so we need to provide the epochs for which the orbit is simulated. As
you can see here, this is both mandatory and there are ellipses here. This means I
could provide multiple fields. So "timeSeries": We have several options to choose from. If we
want a "uniformSampling", "uniformInterval", if we want a "yearly" time series or whatever, or from
an instrument file. We will stick with a uniform sampling. We will say "timeStart":
Here we can choose our global variables, "timeStart" and "timeEnd". We haven't set them yet
but we can do it, so let's say we want to simulate our orbit for 2020-01-01 and for "timeEnd" let's
say we want to do one day. We could enter the date again but what we can also do is just select
"timeStart" and add +1. The time fields are always given in modified Julian date (MJD), so it's in
float days. We can just select "timeStart+1" and GROOPS will know that this "timeStart" is
the global variable "timeStart". As you can see, in the GUI the date already gets parsed, so
we know it is correct. And as you can see here, where we link to these global variables, also
the dates are already correct. For the sampling let's say we want to do a one-minute sampling.
Here, "sampling" is also in days. This is why it is entered as 1/1440. Okay,
so we could add another "timeSeries", but this is fine. We want to use these epochs. So this class
"timeSeries" will create epochs from "timeStart" to "timeEnd" with a one-minute sampling.
Okay, "integrationConstants": We can use Kepler parameters or "positionAndVelocity". Let's stick
with "kepler". Let's say we want to have a semi-major axis of around 7 000 kilometers,
so about 700 kilometers above Earth's surface. "eccentricity": Let's say 0. "inclination":
let's say 85 degrees. And for the purpose of this video, everything else: Let's set it to 0.
But, of course, you could specify whatever you need here. Okay, next,
"orbitPropagator": We'll just stick with "polynomial". There are several others:
"euler", "rungeKutta" and so on. Let's stick with the default one. Same with Earth rotation,
there the default EOP rapid time series from the IERS is selected. We are fine with that.
"ephemerides": also fine with JPL. What we then finally need to provide are our forces that act
on the satellite. First of all, we need a gravity field. So we can select "potentialCoefficients",
and let's use the GOCO06s gravity field. It's just a .gfc file which you can download, for example,
from ICGEM. "maxDegree": Let's set it to 60. So this is the spherical harmonics degree.
For this example it doesn't really matter. Let's keep it like that. For "tides": Let's add
"astronomicalTides", so from planets and so on. Let's add "earthTide". The default
settings are fine in this case. And let's also add "doodsonHarmonicTide", so ocean tides. As
you can see, by default, for ocean tides FES2014b is already selected. We are fine with that,
we just stick to the default settings. And what we also going to add are "miscAccelerations",
in this case "solarRadiationPressure". This is why we need the satellite mode,l which describes
the surfaces of the satellite and their optical properties, because we want to also simulate
"miscAccelerations" in this example, so solar radiation pressure.
Here, all the settings are fine as well. Okay, so this is the first program. This program will
integrate an orbit based on the settings we chose and it will write the output to "orbit.txt".
Next, what we also need is the attitude of the satellite.
We can use a program called "SimulateStarCamera" to simulate a basic star camera which observes
the attitude. And this program just needs as an input file an orbit file and as an output file...
let's call the output file "starCamera.txt". So it will take each epoch from this orbit
and compute the associated star camera file.
As you can see here in the description, the axes of this body frame, which is simulated,
are x = along track, y = cross track, and z in the radial direction. We're fine with that.
Maybe a different satellite needs a different system, but in this case we're fine with that.
Next, let's stimulate an accelerometer. So this is what we wanted to do. We want to visualize
the tidal accelerations acting on our satellite. So we, again, need an output file, let's call it
"accelerometer.txt". We need, again, a satellite model. It should be the same as here, so we can
just copy-paste it. We need an "inputfileOrbit": We can use our orbit. We need the star camera.
We can also provide here "earthRotation" and, again, it's fine. "ephemerides" are again fine.
And for the "forces": This is now which forces do we want to simulate, only for this accelerometer.
Here we can just use the ocean tides because we're only interested in visualizing the ocean tides.
In this case, we will only copy the ocean tides, the "doodsonHarmonicTide" element from above.
And, yeah, that's it, So this program will generate
or will simulate accelerometer measurements from tidal accelerations for the orbit
we simulated using the star camera we simulated.
Now we have all the data we need. We just need to visualize it, and we want to do it in a map
in the form of a ground track. So we can use the program "Orbit2GroundTracks",
which does exactly what it says. It needs an "inputfileOrbit": Let's, again, copy it from here.
And it outputs a gridded data file. So it converts data to a grid, which we can plot on a map. Let's
just call it "grid.txt". Earth rotation, again, is fine. So this program, like this, it only
converts the orbit to a ground track. But since we also want to visualize our accelerometer data,
we can add an additional "inputfileInstrument". You can see here, this is an optional file
and it has the ellipses, so we can add one or more files. So I can add this. We could add additional
files. And the values from this accelerometer file are going to get appended to the grid file.
So it adds the columns from this file to this grid file. Okay, so far so good. The last program is
"PlotMap". We want to visualize our data on a map. Let's call it "groundtrack.png".
We will skip the title and now we can set different "layers" here. First of all,
so we have a reference, let's add a "coast" layer so we can see, in the background, the continents.
I don't particularly like lines, I prefer to have a colored ocean. We can say
the ocean should have the color light blue. "landColor": We will skip it. It will
be white or transparent. So this is our background layer and then we can add a different layer. This
is the same principle as any graphics program, like Photoshop and so on. You just add layers
and they will get visualized on top of each other. Our next layer: We want to visualize
our ground tracks. In this case we want to use the layer "points". We have one position
each minute, so we will visualize them as points. As you can see here, we need
an "inputfileGriddedData", which is the one we created here, you know, with "Orbit2GroundTracks".
As a symbol we will use a circle and the color of the circle should be determined from the value.
So if you set it to "" – you can, of course, choose any color – but if you set it to "",
the color of the circle will be determined from
the value itself. As long as you set a color bar, which is enabled by default. And for "data":
You can see here on the right it says "input columns are data0, data1, ..." one so.
This grid file contains coordinates and then the additional columns for the accelerometer data.
I'll show you later how this file looks like, but for now let's say we want to
visualize the total acceleration. So we can say "sqrt(data0^2+data1^2+data2^2)".
So this is an equation. GROOPS can parse equations and can parse mathematical expressions in most of
the input fields. We have three columns for x, y, and z, the accelerations along x, y,
and z axes. And we just want to compute the total. Something else we want to do here is,
the values in "SimulateAccelerometer", they get output in m/s^2,
so it's SI units. Since these will be very small values, we want to visualize them in nm/s^2.
So we can just, here, multiply times one trillion. We will convert the values to nm/s^2. You have to
know that here in GROOPS, usually in the Plot programs, you have to do this in the values,
because then, later, in the color bar, we could define our "min" and "max" in nm/s^2.
But we will skip the "min" and "max", we just add a label "Acceleration [nm/s^2]".
Okay, that's pretty much it. We will leave all the other settings to our default values. "projection"
is fine as a Robinson projection and, yeah,... let's see if it runs. One thing I forgot is
I go into "options" and set "transparency" to "no", since I'm using a black background
in my file explorer. Okay, now let's run it.
Everything is fine. As you can see, a command window opens. The orbit is simulated – one minute
sampling – tidal model can take a few seconds. It's done. Then, next is "SimulateStarCamera",
which finished instantly. The next is "SimulateAccelerometer" and then
"Orbit2Groundtracks" and "PlotMap", and it's already done. So we close it and go to our
directory. We can see there is now a ground track plot created and it is basically what I expected.
We can see a map in the background with light blue oceans and each point is a point along the orbit.
As we had 85 degrees of inclination it's almost a polar orbit. It's pretty close to Earth so we
have several revolutions for this one day. And tidal accelerations are, of course, largest
over the oceans, especially close to the coast. So this is what I expected.
Okay, that's it for this video. In the next video we'll talk about
the parser in GROOPS, how you can parse global variables and other variables
and use them in your scripts. Thanks, again, for watching and see you in the next video!