Newer
Older
This program read ASCII file(s) from oceanographic instruments (Seabird CTD, Sippican XBT, RDI LADCP, etc), extract data from header files and write result into one ASCII and NetCDF OceanSITES file.
## installation
The program works under Windows (terminal) or Git bash as well as under Linux. It is recommended to install miniconda and to create a virtual environment oceano2python.
``` bash
conda create -n oceano2python python=3.9
conda activate oceano2python
conda install -c conda-forge netCDF4 toml matplotlib xarray seawater PyInstaller pysimplegui
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
## usage
``` bash
python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -d
python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -k PRES TEMP PSAL DOX2 DENS
python oceano.py data/CTD/cnv/dfr29*.cnv -i CTD -d
python oceano.py data/XBT/T7_0000*.EDF -i XBT -k DEPTH TEMP SVEL
python oceano.py data/LADCP/*.lad - i LADCP - k DEPTH EWCT NSCT
```
This program read multiple ASCII file, extract physical parameter following ROSCOP codification at the given column, fill arrays, write header file.
``` bash
positional arguments:
files ASCII file(s) to parse
optional arguments:
-h, --help show this help message and exit
-d, --debug display debug informations
--demo [{CTD,XBT,LADCP,TSG}]
specify the commande line for instrument, eg CTD, XBT,
TSG, LADCP
-c CONFIG, --config CONFIG
toml configuration file, (default: tests/test.toml)
-i [{CTD,XBT,LADCP,TSG}], --instrument [{CTD,XBT,LADCP,TSG}]
specify the instrument that produce files, eg CTD,
XBT, TSG, LADCP
-k KEYS [KEYS ...], --keys KEYS [KEYS ...]
display dictionary for key(s), (default: ['PRES',
'TEMP', 'PSAL'])
-g, --gui use GUI interface
```
The user must describe in the TOML configuration file the metadata and the structure of the files to be read, see [tests/test.toml](https://github.com/jgrelet/oceano2python/blob/master/tests/test.toml)
We use Visual Studio Code (VSC) with Python, better TOML, markdownlint and makefile extensions
To build, run tests, build (compiled version), test examples (CTD/XBT), with GUI, you can use make:
make build
make ctd
make xbt
make ctd GUI=-g
```
If you want use QT instead of Tk, replace:
``` bash
import PySimpleGUI as gs
```
with
``` bash
import PySimpleGUIQt as gs
```
## Export and create from environments
Duplicate your environment on another machine, just export it to a YAML file:
``` bash
conda env export > environment.yml
```
Deploy to a new instance:
``` bash
conda env create -f environment.yml -n <new_env_name>
```