Creating a Moving PIP
A moving PIP (Picture-in-Picture) is a PIP that automatically moves on an SOS dataset as the dataset is animating. In order for the PIP to move, a simple path file that contains frame numbers and latitude/longitude coordinates is linked to the PIP.
As an example, if you have a dataset showing the movement of a hurricane, and if you have the coordinates for the hurricane, you could add a PIP image to your dataset (perhaps a small hurricane symbol) and add the path file to the PIP, and the PIP will follow the hurricane.
Moving PIPs provide flexibility in that you do not have to embed moving data into global images/video and you can make edits to the PIP path file without having to edit the global image/video data.
Moving PIPs are available starting with SOS version 5.4.
Brief documentation for moving PIPs can be found in the Datasets Manual and the Visual Playlist Editor Manual. Note that this document contains the most comprehensive information on moving PIPs.
The Path File
Permalink to The Path FileFormat
Permalink to FormatTo make a PIP move on SOS, you simply have to attach a path file to a PIP so that the PIP will automatically move as the dataset is animating. The path file is a simple csv (comma-separated value) file where each line in the file consists of three fields.
As the dataset is animating, the PIP will be moved to the lat,lon
coordinate location that corresponds to the current frame being shown on SOS.
Important (please read):
- There should be no column labels or other extraneous data at the top of the csv file
- Each line of the csv file must have exactly three numerical values separated by a total of two commas
- Each field can only be a numerical value (ex.
10,-25.0,32
). There should be no letters or special characters in any of the fields. The first field, which is the frame number, should only be an integer (no decimal point) - If your latitude or longitude data has directional labels such as N, E, S, or W, the labels should be removed and the S and the W values should be converted to their negative number representations (ex. “25°S” should be converted to
-25
)
Frame Numbers
Permalink to Frame NumbersA dataset’s default start frame number is 0 (not 1). So, if you want your PIP to show up on the very first frame of the dataset, the first frame number in your csv file should be 0.
A moving PIP will not be displayed until it reaches the first frame number in the csv file, and it will disappear after the last frame number in the csv file. So, for example, if your dataset has 600 frames of data, and in your csv file, the first frame# you specify is 100, your moving PIP will not show up until the dataset animation reaches frame 100. Similarly, if the last frame# in your csv file is 400, your moving PIP will disappear when the animation reaches frame 400.
There does not have to be a corresponding lat,lon
location for every frame in the dataset. There can be gaps in the frame numbers. In the following example, there are no coordinates for frames 214 through 224.
This means that when the dataset reaches frame number 213, the moving PIP will remain at location 26,173 until the animation reaches frame number 225, at which time the PIP will be moved to location 43,176.
Example: Leatherback Turtle Track
Permalink to Example: Leatherback Turtle TrackCreating a Moving PIP Path File
Permalink to Creating a Moving PIP Path FileI wanted to display the track of a leatherback turtle on SOS, so, I did a searched the web for animal migration data, which lead me to the Integrated Ocean Observing System website, which contains animal telemetry data. I selected a few options on the left-hand side toolbar, and was presented with a map of the turtle’s track.
Then, from the right-hand side toolbar, I downloaded the following track file (which already happened to be in a csv file format).
For convenience (and also so that I would have a copy of the original file in case I needed it for later or wanted to start over), I copied the file to a new file called leatherback.csv.
I then opened leatherback.csv in Excel (open it in csv mode) and edited the track data to be in the format that a moving pip requires — i.e. removed all column labels and removed all columns of data except for the latitude and longitude columns, and then added a new column of data (the first column) with sequential frame numbers in them.
As a side note, because the file was opened and/or saved using the csv file format, when I view the file in a simple text editor like TextEdit or Gedit, the file should look like this excerpt (i.e. fields separated by commas):
Given this path file, when the SOS dataset animation reaches frame number 6, the turtle PIP will be positioned at latitude 10.33 and longitude -86.02.
Adding a Moving PIP to an SOS Dataset
Permalink to Adding a Moving PIP to an SOS DatasetOnce my moving PIP path file was in its correct format, I was ready to create an SOS dataset. Using the SOS Visual Playlist Editor (VPLE), I created a site-custom dataset by adding a Layer of a sea surface temperature movie that I found in the SOS Data Catalog, and then I added a PIP image of a leatherback turtle that I found online.
To make my PIP move, I needed to link my csv path file to the PIP. So, in the Element tab for the turtle PIP, I clicked on the button next to the “Moving PIP (add/edit)” field to add the leatherback.csv file and to specify the line color and size of the line. If you don’t want a line, simply uncheck the line box. Click Save to save your changes. (See the Create Moving PIPs section in the VPLE manual for more information.)
When I finished creating and saving my dataset in the VPLE, I loaded the dataset onto SOS and the turtle started to move as the dataset was animating.
Many global datasets have timestamps, and many migration tracks also have timestamps. With a little more effort, you can find ways to match the data so that there is a clear and accurate tie-in between the global data and the track data.