rnsf

Define and load a phase function data format
git clone git://git.meso-star.fr/rnsf.git
Log | Files | Refs | README | LICENSE

commit 96e414f7b3cd6454b0ea6f35f30d9071abf34795
parent 254541e21fadb6fd904aa8424d1364cfec03ca4e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 17 Jun 2022 14:29:55 +0200

Add the file format specification

Diffstat:
Adoc/rnsf.5.scd | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 131 insertions(+), 0 deletions(-)

diff --git a/doc/rnsf.5.scd b/doc/rnsf.5.scd @@ -0,0 +1,131 @@ +rnsf(5) + +; Copyright (C) 2022 |Meso|Star> (contact@meso-star.com) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <http://www.gnu.org/licenses/>. + +# NAME + +rnsf - Rad-Net Scattering Functions file format + +# DESCRIPTION + +*rnsf* is a text file format that describes a phase function whose type and +parameters can vary spectrally. Its data are described for a set of wavelengths +or spectral bands that must be listed in ascending order. + +Characters behind the hash mark (#) are considered comments and are therefore +ignored, as well as empty lines, i.e. lines without any characters or composed +only of spaces and tabs. + +# GRAMMAR + +``` +<rnsf> ::= <per-wlen-phase-func> + | <per-band-pĥase-func> + +--- + +<per-wlen-phase-func> ::= wavelengths <wavelengths-count> + <wlen-phase-func> + [ <wlen-phase-func> ... ] + +<wlen-phase-func> ::= <wavelength> <phase-func> +<wavelengths-count> ::= INTEGER +<wavelength> ::= REAL # In nanometers + +--- + +<per-band-phase-func> ::= bands <bands-count> + <band-phase-func> + [ <band-phase-func ... ] + +<wlen-band-func> ::= <wavelength-min> <wavelength-max> <phase-func> + +<bands-count> ::= INTEGER +<wavelength-min> ::= REAL # In nanometers +<wavelength-max> ::= REAL # In nanometers + +--- + +<phase-func> ::= <phase-func-hg> + | <phase-func-discrete> + +<phase-func-hg> ::= hg <asymmetric-param> +<asymmetric-param> ::= REAL # in [-1, 1] + +<phase-func-discrete> ::= discrete <angles-count> + 0 <value> + [ <per-angle-value> ... ] # In ascending order wrt the angle + PI <value> +<per-angle-value> ::= <theta> <value> +<theta> ::= REAL # In radian +<value> ::= REAL # Not necessarily normalized + +``` + +# EXAMPLES + +Spectrally varying phase function on two spectral bands: a band for the visible +part of the spectrum for which a Henyey & Greenstein phase function is used, and +a band for long waves with a discretized phase function on 4 angles: + +``` +bands 2 + +# Visible part +380 780 hg 0 + +# Inrared +1000 100000 discrete 4 + 0 0.079577 + 0.78 0.079577 + 2.35 0.079577 + PI 0.079577 +``` + +Setup a phase function for a set of 10 wavelengths. Use a discrete phase +runction for short waves and Henyey & Greenstein for long waves: + +``` +wavelengths 10 + +# Short waves +430 discrete 8 + 0 0.02 + 0.23 0.04 + 0.5 0.07 + 0.7 0.15 + 1.54 1.23 + 1.8 0.02 + 2 1.23 + PI 0.79 +450 discrete 2 + 0 0.5 + PI 0.796 +750 discrete 2 + 0 0.079577 + 0.78 0.079577 + 2.35 0.079577 + PI 0.079577 + +# Long waves +1100 hg -0.1 +1300 hg 0.57 +1400 hg 0.4 +2100 hg 0.3 +2500 hg -0.9 +2900 hg -0.4 +100000 hg 0.0 +```