Solar Orbiter PAS data processing
=================================
:toc:

== PRODUCE_L1

Produce L1 data from PAS L0 telemetry packets :

* Read PAS L0 data from /DATA/SOLAR/DATA/L0 directory

* Produce PAS L1 CDF files in /DATA/SOLAR/DATA/L1 directory

=== Syntax

----
$ PRODUCE_L1 <option> <yyyy-mm-dd>

Produce Solar Orbiter L1 CDF files

Where <option> in :
-a : Hexadecimal Ascii input file
-b : Binary input file
-t 2000 : set time origin to 2000/01/01
-t 2008 : set time origin to 2008/01/01
-m <model> : set PAS model (EM, EQM, PFM, FS (default))
-V : Display software version
-v <n> : Verbose level (0..9)
----

[NOTE]
--
This software has not to be used generally, it's called by upper level commands like REPROCESS
--

=== Example

Run PAS data processing software for 2019-05-21 :

- reading binary L0 data
- using calibration files for EQM model
- timetags origin set to 2008-01-01T00:00:00Z

----
$ PRODUCE_L1 -b -m EQM -t 2008 2019-05-21
----

== REPROCESS

Automatic processing for a given date.

Extract parameters (Model, time origin, etc...) from tests database and run
the PRODUCE_L1 software with this parameters

=== Syntax

----
$ REPROCESS yyyy-mm-dd
----

=== Examples

Reprocess a given date

----
$ REPROCESS 2019-05-21
----

Reprocess whole dates of tests

----
$ REPROCESS $(ALL_TESTS -d)
----


== POST_PROCESS

PAS data post-processing for a given date :

- run command tools to extract logfiles, memory dumps, ...
- produce various plots for WEB server

=== Syntax 

----
$ POST_PROCESS yyyy-mm-dd [yyyy-mm-dd ...]
----

=== Example

Post processing for single day

----
$ POST_PROCESS 2019-05-21
----

Post processing for a several days

----
$ POST_PROCESS 2019-04-29 2019-04-30 2019-05-01
----

Post processing for whole dates of tests

----
$ POST_PROCESS $(ALL_TESTS -d)
----

== ALL_TESTS

Extract infos from tests database.

Various syntaxs for various usages.

This command runs a python script, that extract data from tests database.

=== Syntax

----
Usage: all_tests.py [options] [<yyyy-mm-dd>] ...

Options:
  -h, --help      show this help message and exit
  -a, --all       Select all test, even not OK
  -d, --date      Display dates with test data
  -f, --filename  Display L0 filename and format
  -s, --stat      Display TM/TC statistics
  -p, --param     Display command line parameters
  -w, --web       Export in .csv format for web usage
----

=== Example

Giving the list of available dates with test data

----
$ ALL_TESTS -d
2016-01-15
2016-08-22
2017-07-07
2017-07-31
2017-08-01
2017-08-02
2017-08-05
2017-08-07
2017-08-08
2017-08-09
...
----

Extract parameters used to run PRODUCE_L1 software for a given data

----
$ ALL_TESTS -p 2019-05-21
2019-05-21	EQM	-b	2008
----

Extrat L0 type and filename for a given date

----
$ ALL_TEST -f 2019-05-21
2019-05-21	-b	MSSL/20190521/PAS_PT_FSW_3_8
----

== SYNCHRO_MSSL

Automatic download of data from MSSL WEB server.