# Radar Replay

These scripts automate the process of setting up live radar feeds for testing in
a development environment.

* Scripts can be run in development environment
* Radar data will be downloaded as needed from kickstart server

# Requirements

The raw2pb binary is required. This means that radar replay is pretty much
limited to Linux environments until someone is ambitious enough to make a
container image.

## 3rd Party Package

The following 3rd party packages need to be installed on your system.

* tmux
* rsync

## IRIS Focus Software

The following programs from IRIS Focus need to be built. These should
be built automatically for you, but if they fail to build it's not
going to work.

* raw2pb
* data-manager-input-tool.jar

## Radar Data Files

Radar data files used by this script are located on an rsync server
and available via anonymous rsync. 

This server can be configured in these files:
<tools/radar-replay-common.sh>
<tools/radar-replay-install.sh>

You do not need to download these files directly, they will be downloaded as
needed.

# Usage

The first step is to enable the input service which will be used by the replay scripts

docker load < /Focus_installation_files/release/k8s/images/cloud-input-service.tar

```shell
cd scripts/radar-replay
./nz-full-replay.sh
```

## IRIS Focus Usage

Here is an example that copies the necessary files and starts up a couple of
radars in Europe.

```shell
rsync -avh --exclude site-data rsync://hel-fire-tlp-ci.rd.vaisala.com/radar-replay /srv/radar-replay
cd /srv/radar-replay
export daysBack=2 # Optional - defaults to 0 days back
./nz-full-replay.sh
```

## Managing Simulators

The simulators are running in a tmux session. To look at or stop, you can attach
to the session via:

```shell
tmux attach
```

tmux is a very powerful tool with a lot of options. Here's a minimal set of
keyboard commands to know:

* *Control-b d* - Detaches from tmux, but leaves it running in background (you
  can tmux attach again later if desired).
* *Control-b 0* - Switch to window 0. Use 1 to switch to window 1 and so on.
  Window numbers are shown in the tabs at the bottom of the screen.
* *Control-c* - Kills the current process (useful if you want to kill one of the
  running simulators)
* *Control-b c* - Creates a new terminal window in the tmux session.
* *exit* - Exits a terminal window running in the tmux session.

There are a million other useful things you can do. The *man tmux* command is
your friend.
