PAS software user manual
========================
:toc:
:numbered:

== Real-time operation

All operations have to be run with a dedicated Linux username : solar


=== Telemetry download

Open a new terminal [Application] => [Outils systemes] => [MATE terminal]

The next command will connect to IABG telemetry server and download data.

----
$ GET_TM_RT yyyy-mm-dd [hh:mm:ss]
----

You can specify here:

* an unique date, like yyyy-mm-dd

* a date and a start time, like hh:mm:ss

[CAUTION]
====
Take care of entering two digits for both month, day, hour, min and seconds, and 4 digits for the year

GOOD :: 2018-11-09 +
2018-11-09 09:05:00


BAD :: 2018-11-9 +
2018-11-09 9:15

====

.Example for 2018-11-29
----
$ GET_TM_RT 2018-11-29
----

That will create a L0 binary file, containing all SWA TM packets :

	/DATA/SOLAR/DATA/L0/20181129/solo_L0_swa-pas-tm_20181129.bin

Same procedure, but starting at a given time

.Starting a 2018-11-18 9:15
----
$ GET_TM_RT 2018-11-29 09:15:00
----

Telemetry packets will be added continuously at the end of the binary file,
as long as the GET_TM_RT script is not stopped.

=== L1 data reprocessing loop

Open a new terminal [Application] => [Outils systemes] => [MATE terminal]

----
$ RUN_RT yyyy-mm-dd
----

This command will launch a bash script, that enter in an infinite loop, 
producing PAS L1 data, then wating some seconds and restart.

You have to set the date of the day corresponding to the data.

.Example for 2018-11-29
----
$ RUN_RT 2018-11-29
----

Data will be generated in :

	/DATA/SOLAR/DATA/L1/20181129/

=== PAS data visualisation

Open a new terminal [Application] => [Outils systemes] => [MATE terminal]

----
$ cl 
----

This command will launch IRAP's vizualisation tool (cl).

Ignore the first selection window, "General" by clickiing on [OK] or [Cancel]

Then open a dedicated view : [ Filee] => [Open...] 

image::images/select.png[]

You can change the directory were .cl files are located, default is:

----
Directory : /home/solar
----

You can then select presiously generated CL view (*.cl), for example:


----
/home/solar/solar_iagb_currents.cl
----

Then click [OK] or press [Return]

image::images/solar_iabg_currents.jpg[width="100%"]

== Useful commands

=== Display SWA telecommands

This command will display the list of SWA TC for a given day.

----
$ SWA_TC yyyy-mm-dd
----

.Example
----
$ SWA_TC 2018-11-21
----

Each line contains :

- TC acceptation date and status (OK/ERR)
- TC execution date and status (OK/ERR)
- TC parameters length (bytes)
- TC indentification (service type, service sub-type)
- TC name (SCOS database)
- TC name

Then, you could find some statistics :

- number of TC
- number of TARF : TC Acceptation Request Failure
- number of TECF : TC Execution Completion Failure
- number un-acked : number of not acked commands

See link:txt/SWA_TC.20181121.inc[]

=== Display data processing log informations

----
$ SWA_LOG yyyy-mm-dd
----


=== Display data processing errors (and/or warnings)

----
$ SWA_ERR yyyy-mm-dd
$ SWA_ERR -w yyyy-mm-dd
----

See link:txt/SWA_ERR.20181121.inc[]

=== Display data processing statistics

----
$ STATS yyyy-mm-dd

$ STATS 2018-11-21
----

This command display various statistics :

- number of TC commands and TM packets by APID
- number of TM packets for each SID
- number of record for each CDF L1 file


See link:txt/STATS.20181121.inc[]