En raison du déménagement des baies serveurs, les services gitlab.irstea.fr et mattermost.irstea.fr seront interrompus le samedi 2 octobre 2021 au matin. Ils devraient revenir à la normale dans la journée.

Commit c013e0ea authored by Harmel Tristan's avatar Harmel Tristan
Browse files

test readme

parent d3fa83c1
# Water color TriOS package
Package to process TriOS-like radiometer data for various acquisition protocols:
- above-water radiometry
- **Above-Water Radiometry** (_awr_): R<sub>rs</sub> (sr<sup>-1</sup>)
<p align="center">
<img src="images/above_water_system.png" width="400">
</p>
- in-water radiometry
- **In-Water Radiometry** (_iwr_): R<sub>rs</sub> (sr<sup>-1</sup>), K<sub>d</sub> (m<sup>-1</sup>), K<sub>Lu</sub> (m<sup>-1</sup>)
<p align="center">
<img src="images/in_water_system.png" width="400">
</p>
- **Surface-Water Radiometry** (_swr_): R<sub>rs</sub> (sr<sup>-1</sup>)
![figure](images/inwater_water_system.png)
<p align="center">
<img src="images/surface_water_radiometry.png" width="400">
</p>
- surface-water radiometry
![figure](images/surface_water_radiometry.png)
This package also contains tools for interactive visualization of the radiometric data:
![animated1](images/visu_trios_data.gif)
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
......@@ -28,20 +36,35 @@ These instructions will get you a copy of the project up and running on your loc
What things you need to install the software and how to install them
```
Give examples
python3 -m pip install --user --upgrade setuptools
```
### Installing
A step by step series of examples that tell you how to get a development env running
First, clone `the repository <https://gitlab.irstea.fr/telquel-obs2co/insitu/trios>`__ and execute the following command in the
local copy:
::
```
python setup.py install
```
$ python setup.py install
This will install the package into the system's Python path. If another
destination directory is preferred, it can be set by
::
$ python setup.py install --prefix=<where-to-install>
This installation is supposed to download
and compile all the associated packages as well as prepare the executables `trios_processing` and `trios_visual`.
## Running the tests
```
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --no_clobber
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method M99 --name _M99 --plot --figdir ./test/fig
trios_processing ./test/data/ 150 awr --lat 42.30351823 --lon 9.462897398 --odir ./test/results --method osoaa --name _osoaa --plot
```
## Authors
......@@ -56,6 +79,5 @@ This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md
## Acknowledgments
* Hat tip to anyone whose code was used
* Inspiration
* etc
This work has been partially supported by the _Programme National de Télédétection Spatiale_ (PNTS,
http://www.insu.cnrs.fr/pnts ), grant n°PNTS-2019-13
\ No newline at end of file
......@@ -25,6 +25,6 @@ setup(
entry_points={
'console_scripts': [
'trios_processing = trios.main:main',
'visu_trios = visu.data_visu:main'
'trios_visual = visu.data_visu:main'
]}
)
Metadata-Version: 1.0
Name: trios
Version: 1.1.4
Version: 1.0.0
Summary: Package to help trios TriOS radiometer data for various above-water or in-water setups
Home-page: https://gitlab.irstea.fr/ETL-TELQUEL/etl/tree/dev/preprocessing/trios
Home-page: https://gitlab.irstea.fr/telquel-obs2co/insitu/trios
Author: T. Harmel
Author-email: tristan.harmel@gmail.com
License: MIT
......
......@@ -14,10 +14,12 @@ aux/surface_reflectance_factor_rho_fine_aerosol_rg0.06_sig0.46.csv
aux/water_coef.txt
exe/__init__.py
exe/db_martinez.py
exe/db_petit-saut.py
simulation/__init__.py
simulation/rho_snapshot.py
trios/__init__.py
trios/config.py
trios/main.py
trios/process.py
trios/process_compar_awr.py
trios/process_sabine.py
......
[console_scripts]
trios = main:main
trios_processing = trios.main:main
visu_trios = visu.data_visu:main
......@@ -2,7 +2,8 @@
Usage:
trios_processing <input_dir> <IDpr> <measurement_type> --lat <lat> --lon <lon> \
[--altitude=alt] [--ofile <ofile>] [--odir <odir>] [--plot] [--figdir <figdir>]
[--altitude=alt] [--ofile <ofile>] [--odir <odir>] [--plot] [--figdir <figdir>] \
[--name <name>] [--method <method>] [--no_clobber]
trios_processing -h | --help
trios_processing -v | --version
......@@ -22,6 +23,9 @@ Options:
--ofile ofile basename of the output file.
--plot Plot output data and save figure in <figdir>
--figdir figdir Directory where figures are saved [default: ./]
--name name Keyword to append to file name and figures [default: ]
--method method Keyword for the method to apply for data processing.
For awr: M99, M15, osoaa, temp_opt [default: M99]
--no_clobber Do not process <input_dir> <IDpr> files if <output_file> already exists.
'''
......@@ -51,14 +55,16 @@ def main():
idir = os.path.abspath(args['<input_dir>'])
idpr = args['<IDpr>']
meas_type = args['<measurement_type>']
method = args['--method']
lat = float(args['--lat'])
lon = float(args['--lon'])
alt = float(args['--altitude'])
odir = os.path.abspath(args['--odir'])
ofile = args['--ofile']
name = ""
name = args['--name']
plot = args['--plot']
figdir = os.path.abspath(args['--figdir'])
noclobber = args['--no_clobber']
try:
type_ = type_list[meas_type]
......@@ -82,6 +88,10 @@ def main():
else:
ofile = os.path.join(odir, 'Rrs_swr_' + date + '_idpr' + idpr + name + '.csv')
if noclobber and os.path.exists(ofile):
print('Skip processing: data already processed with "--no_clobber" set')
return
swr = swr_process(df, wl)
Rrs = swr.call_process(ofile)
......@@ -93,7 +103,7 @@ def main():
ax.set_ylabel(r'$R_{rs}\ (sr^{-1})$')
ax.set_xlabel(r'Wavelength (nm)')
ax.set_title('ID: ' + idpr + ', ' + date + ', sza=' + str(round(df.sza.mean(), 2)))
fig.savefig(os.path.join(figdir, 'trios_swr_' + date + '_idpr' + idpr + '.png'), bbox_inches='tight')
fig.savefig(os.path.join(figdir, 'trios_swr_' + date + '_idpr' + idpr + name+'.png'), bbox_inches='tight')
plt.close()
elif meas_type == 'awr':
......@@ -113,14 +123,18 @@ def main():
else:
ofile = os.path.join(odir, 'Rrs_awr_' + date + '_idpr' + idpr + name + '.csv')
if noclobber and os.path.exists(ofile):
print('Skip processing: data already processed with "--no_clobber" set')
return
awr = awr_process(df, wl, name, idpr)
if plot:
figfile = os.path.join(figdir, 'trios_awr_' + date + '_idpr' + idpr + '.png')
figfile = os.path.join(figdir, 'trios_awr_' + date + '_idpr' + idpr + name +'.png')
else:
figfile=""
figfile = ""
Rrs = awr.call_process(method, ofile, vza=vza, azi=azi,plot_file=figfile)
Rrs = awr.call_process(method, ofile, vza=vza, azi=azi, plot_file=figfile)
elif meas_type == 'iwr':
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment