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 a4779ab4f3b5fefaf55213e5114aed42e547c6f5
parent 6c750e9e018ea2f4e0ff0acc40ec74d2964cf3d3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 19 Dec 2025 17:01:12 +0100

Print the information from the line list as shtr output

Diffstat:
Msrc/shtr_main.c | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/shtr_main.c b/src/shtr_main.c @@ -146,6 +146,28 @@ load_lines(const struct cmd* cmd, struct shtr_line_list** lines) } } +static void +process_lines(const struct cmd* cmd, const struct shtr_line_list* list) +{ + struct shtr_line_list_info info = SHTR_LINE_LIST_INFO_NULL; + + ASSERT(cmd && list); + (void)cmd; + + SHTR(line_list_get_info(list, &info)); + + #define PRINT(Name) \ + printf(STR(Name)" in [%g, %g]; absolute error: %g\n", \ + SPLIT2(info.Name.range), info.Name.err) + PRINT(wavenumber); + PRINT(intensity); + PRINT(gamma_air); + PRINT(gamma_self); + PRINT(lower_state_energy); + PRINT(n_air); + PRINT(delta_air); + #undef PRINT +} static res_T cmd_run(const struct cmd* cmd) @@ -162,6 +184,8 @@ cmd_run(const struct cmd* cmd) } if(cmd->args.lines) { if((res = load_lines(cmd, &lines)) != RES_OK) goto error; + + process_lines(cmd, lines); } sz = MEM_ALLOCATED_SIZE(&cmd->allocator);