commit 3ead605c6ab1fccca6592497cc52e7592010363a
parent 5e09d7be9ac5d5110751f6f10bd5af114b890fa1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 9 Jan 2026 15:32:35 +0100
shtr can no longer serialize molparam
Loading HITRAN isotopologue metadata is actually very fast and
lightweight, so serializing the internal representation of these data in
order to optimize loading and/or memory usage makes no sense.
Diffstat:
2 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/doc/shtr.1 b/doc/shtr.1
@@ -42,8 +42,8 @@ is a utility for analyzing the behavior of the Star-HITRAN library with
regard to the loading and its internal structuring of spectroscopic
data.
It can also be used to serialize the internal representation of loaded
-data, which is much more compact for lines and therefore faster to reload
-by the library.
+lines, which is much more compact and therefore faster to reload by the
+library.
.Pp
All isotopologue metadata are loaded.
However, since the number of lines can be very large, only a subset of
diff --git a/src/shtr_main.c b/src/shtr_main.c
@@ -155,33 +155,6 @@ load_lines(const struct cmd* cmd, struct shtr_line_list** lines)
}
static res_T
-process_molparam(const struct cmd* cmd, struct shtr_isotope_metadata* molparam)
-{
- FILE* fp = NULL;
- res_T res = RES_OK;
- ASSERT(cmd && molparam);
-
- if(!cmd->args.output) goto exit;
-
- fp = fopen(cmd->args.output, "w");
- if(!fp) {
- fprintf(stderr, "%s: error opening file -- %s\n",
- cmd->args.output, strerror(errno));
- res = RES_IO_ERR;
- goto error;
- }
-
- res = shtr_isotope_metadata_write(molparam, fp);
- if(res != RES_OK) goto error;
-
-exit:
- if(fp) CHK(fclose(fp) == 0);
- return res;
-error:
- goto exit;
-}
-
-static res_T
process_lines(const struct cmd* cmd, const struct shtr_line_list* list)
{
FILE* fp = NULL;
@@ -236,7 +209,6 @@ cmd_run(const struct cmd* cmd)
if(cmd->args.molparam) {
if((res = load_molparam(cmd, &molparam)) != RES_OK) goto error;
- if((res = process_molparam(cmd, molparam)) != RES_OK) goto error;
}
if(cmd->args.lines) {
if((res = load_lines(cmd, &lines)) != RES_OK) goto error;