star-hitran

Load line-by-line data from the HITRAN database
git clone git://git.meso-star.fr/star-hitran.git
Log | Files | Refs | README | LICENSE

commit 8ab70939583d83b146d237aa16e2edcc2d76bb94
parent b18dcb66251f1c6ab63c2597641c62dbaca531d2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue,  8 Mar 2022 19:32:52 +0100

Begin the declaration of the shtr_lines_view API

Diffstat:
Msrc/shtr.h | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/shtr.h b/src/shtr.h @@ -39,6 +39,8 @@ #define SHTR(Func) shtr_ ## Func #endif +#define SHTR_MAX_MOLECULES_COUNT 100 + struct shtr_create_args { struct logger* logger; /* May be NULL <=> default logger */ struct mem_allocator* allocator; /* NULL <=> use default allocator */ @@ -48,6 +50,18 @@ struct shtr_create_args { static const struct shtr_create_args SHTR_CREATE_ARGS_DEFAULT = SHTR_CREATE_ARGS_DEFAULT__; +struct shtr_lines_view_create_args { + double wavenumbers_range[2]; /* Spectral range */ + + /* List of molecule identifiers to consider sorted in ascending order */ + int8_t molecules[SHTR_MAX_MOLECULES_COUNT]; + size_t nmolecules; +}; +#define SHTR_LINES_VIEW_CREATE_ARGS_NULL__ {{0,0},{0}, 0} +static const struct shtr_lines_view_create_args +SHTR_LINES_VIEW_CREATE_ARGS_NULL = + SHTR_LINES_VIEW_CREATE_ARGS_NULL__; + struct shtr_isotope { double abundance; /* in ]0, 1] */ double Q296K; /* Partition function at Tref = 296K */ @@ -103,6 +117,7 @@ static const struct shtr_line SHTR_LINE_NULL = SHTR_LINE_NULL__; struct shtr; struct shtr_isotope_metadata; struct shtr_lines_list; +struct shtr_lines_view; BEGIN_DECLS @@ -203,6 +218,23 @@ shtr_lines_list_get (const struct shtr_lines_list* lnlst, const struct shtr_line* lines[]); +/******************************************************************************* + * Lines view API + ******************************************************************************/ +SHTR_API res_T +shtr_lines_view_create + (const struct shtr_lines_list* lnlst, + const struct shtr_lines_view_create_args* args, + struct shtr_lines_view* view); + +SHTR_API res_T +shtr_lines_view_ref_get + (struct shtr_lines_view* view); + +SHTR_API res_T +shtr_lines_view_ref_put + (struct shtr_lines_view* view); + END_DECLS #endif /* SHTR_H */