API Reference¶
Here you can find documentation of all the functions grouped by coding language
and/or function. python script documentation also includes a summary of all
arguments, which can be reproduced on the command line using script.py --help.
Note
All functions that begin with RTS are either borrowed or adapted
from the RTS (Mitchell et al. 2008) calibration package, with permission
from the original authors. All credit to the original authors. The RTS code
can currently be found at the RTS github.
python code¶
wodenpy
C code¶
This refers to the C code that has no GPU equivalent; see below for more
details.
The precision of most functions is determined at compilation time, via the
following #ifdef statement found in WODEN/include/woden_precision_defs.h:
#ifdef DOUBLE_PRECISION
/*! If -DDOUBLE_PRECISION flag is added at compilation,
then user_precision_t is set to double */
typedef double user_precision_t;
/*! If -DDOUBLE_PRECISION flag is added at compilation,
then user_precision_complex_t is set to double _Complex */
typedef double _Complex user_precision_complex_t;
#else
/*! If -DDOUBLE_PRECISION flag is NOT added at compilation,
then user_precision_t defaults to float */
typedef float user_precision_t;
/*! If -DDOUBLE_PRECISION flag is NOT added at compilation,
then user_precision_complex_t defaults to float _Complex */
typedef float _Complex user_precision_complex_t;
#endif
So where you see user_precision_t in the API, this is either a float or
double, and similarly user_precision_complex_t is either a float _Complex
or double _Complex.
GPU and C equivalent functions¶
These functions call either C or GPU code, depending on whether the
user wants to run on a GPU or not. The common functions listed here
are designed to minimise the amount of code dupilcation between the C and
GPU code, either calling a cpu or gpu function depending on the
do_gpu boolean.
common code¶
C code¶
GPU code¶
All GPU code is either compiled as CUDA or HIP code. This is decided at
compilation, depending on whether -D__NVCC__ (for CUDA) or -D__HIPCC__
(for HIP) was passed to the compiler. Various macros found in WODEN/include/gpu_macros.h
are used to drop in the correct GPU calls depending on the language requested.
Similarly to C code, the precision of most functions is determined at
compilation time, via the following #ifdef statement found in
WODEN/include/gpucomplex.h:
#ifdef DOUBLE_PRECISION
/*! If -DDOUBLE_PRECISION flag is added at compilation,
then cuUserComplex is set to cuDoubleComplex */
typedef cuDoubleComplex cuUserComplex;
#else
/*! If -DDOUBLE_PRECISION flag is NOTE added at compilation,
then cuUserComplex is set to cuFloatComplex */
typedef cuFloatComplex cuUserComplex;
#endif
meaning that cuUserComplex in the API either means cuFloatComplex or
cuDoubleComplex depending on compilation flags.