Metadata-Version: 2.1
Name: juice-phs
Version: 0.2.2
Author: Marc Costa
Author-email: marc.costa@ext.esa.int
License: MIT
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: planetary-coverage
Requires-Dist: python-dotenv
Requires-Dist: pytest
Requires-Dist: plotly
Provides-Extra: dev
Requires-Dist: autoflake ; extra == 'dev'
Requires-Dist: black ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: flake8-bugbear ; extra == 'dev'
Requires-Dist: flake8-builtins ; extra == 'dev'
Requires-Dist: flake8-comprehensions ; extra == 'dev'
Requires-Dist: flake8-debugger ; extra == 'dev'
Requires-Dist: flake8-eradicate ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: mkdocs-material ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pep8-naming ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pymdown-extensions ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-github-actions-annotate-failures ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: python-kacl ; extra == 'dev'
Requires-Dist: pyupgrade ; extra == 'dev'
Requires-Dist: tryceratops ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: mkdocstrings >=0.18 ; (python_version >= "3.9") and extra == 'dev'

# 🪢 JUICE Planning Harmonisation System

juice-phs is a Python package that supports the Detailed Scenario Exercises during the Observation Plan,
Pointing and Instrument Timeline Harmonisation processes. 


## 🛠️️ Prerequisites

   * A computer based on a 64-bit Unix operating system: Linux or Mac
   * Python 3.8 (or higher)


## ⎆ Python Installation

Install geopipeline with:

```sh
pip install [--upgrade] juice-geopipeline
```

You can install geopipeline locally from the repository:

```sh
git clone https://juigitlab.esac.esa.int/core-system/uplink/geopipeline
cd geopipeline
pip install .
```

## Using the library

After installing the library can be used with the Python Shell or with its CLI.

### Python Shell

A basic test of the library contents can be done as follows:

```
from itl import export_timeline
output_dir = '.'
csvfile = 'tests/data/juice_example.csv'
export_timeline(output_dir, csvfile)
```

### Command line interface

The package has a number of CLI entry points:
  - `opl2otl` convert Observation Plan (`OPL`) to Observation Timeline (`OTL`).
  - `opl2otc` convert Observation Plan (`OPL`) to Observation Timeline Coverage (`OTC`).

Usage examples are provided hereunder. Using the following input Observation Plan:
```sh
RIME_PRIME_OBSERVATION,2032-07-02T16:09:54.000Z,2032-07-02T16:31:31.000Z,RIME_EUROPA_FLYBY_02,RIME
RPWI_OBSERVATION,2032-07-02T16:08:54.000Z,2032-07-02T16:32:31.000Z,RPWI_In_situ_slow_Radio_Full,RPWI
RPWI_OBSERVATION,2032-07-02T06:52:25.000Z,2032-07-02T14:52:25.000Z,RPWI_In_situ_normal_Radio_Full,RPWI
JANUS_PRIME_OBSERVATION,2032-07-02T04:18:40.000Z,2032-07-02T04:32:00.000Z,SJS0004C50A_UVS_SAT_STELL_OCC_A,JANUS
```

with:
```sh
opl2otl -h 

usage: opl2otl [-h] [-o OUTPUT] [-s SCENARIO] [-i ITERATION] [-u] csv

juice-itl: convert Observation Plan (OPL) to Observation Timeline (OTL).

positional arguments:
  csv                   Observation Plan (OPL) CSV input file.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output directory (default: Current).
  -s SCENARIO, --scenario SCENARIO
                        Scenario Identifier (default: E001).
  -i ITERATION, --iteration ITERATION
                        Iteration reference (default: S01P00).
  -u, --utc             File times as UTC (default: Relative to events).
```

with the following arguments:
```sh
opl2otl opl_input.csv
```

generates the following directory structure:
```sh
.
|-- EVF_E001_01_SOC_S01P01.EVF
|-- EVF_E001_01_SOC_SXXPYY.EVF
|-- JANUS
|   |-- OTL_E001_01_JAN_S01P01.ITL
|   `-- OTL_E001_01_JAN_SXXPYY.ITL
|-- RIME
|   |-- OTL_E001_01_RIM_S01P01.ITL
|   `-- OTL_E001_01_RIM_SXXPYY.ITL
`-- RPWI
    |-- OTL_E001_01_RPW_S01P01.ITL
    `-- OTL_E001_01_RPW_SXXPYY.ITL

```

with the following content for `OTL_E001_01_RPW_SXXPYY.ITL`:
```sh
PTR_OBS_END    (COUNT =   1)   02:20:25  RPWI   OBS_START  RPWI_In_situ_normal_Radio_Full 
PTR_OBS_START  (COUNT =   2)  -01:17:29  RPWI   OBS_END    RPWI_In_situ_normal_Radio_Full

PTR_OBS_START  (COUNT =   2)  -00:01:00  RPWI   OBS_START  RPWI_In_situ_slow_Radio_Full 
PTR_OBS_END    (COUNT =   2)   00:01:00  RPWI   OBS_END    RPWI_In_situ_slow_Radio_Full
```

with :
```sh
opl2qlc -h

usage: opl2otc [-h] [-o OUTPUT] csv

juice-itl: convert Observation Plan (OPL) to Observation Timeline Coverage (OTC).

positional arguments:
  csv                   Quick-Look Coverage input CSV input file.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output file (default: qlc_output.csv at current directory).
```

with the following arguments:
```sh
opl2otc opl_input.csv -o otc_output.csv
```

generates the following output file:
```sh
RIME_EUROPA_FLYBY_02,2032-07-02T16:09:54.000Z,2032-07-02T16:31:31.000Z,0,RIME
RPWI_In_situ_slow_Radio_Full,2032-07-02T16:08:54.000Z,2032-07-02T16:32:31.000Z,0,RPWI
RPWI_In_situ_normal_Radio_Full,2032-07-02T06:52:25.000Z,2032-07-02T14:52:25.000Z,0,RPWI
SJS0004C50A_UVS_SAT_STELL_OCC_A,2032-07-02T04:18:40.000Z,2032-07-02T04:32:00.000Z,0,JANUS
```
