commit fb6684e99fccc01a7487ed78ac845d11ca71283c
parent 668c253f552fed1165dd95ee51ddcf1ecb55839c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sat, 1 Oct 2022 13:59:32 +0200
Fix octree signature computation
Do not consider an aerosol if its properties are not covered by the
input spectral range
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/rnatm_octrees_storage.c b/src/rnatm_octrees_storage.c
@@ -151,8 +151,12 @@ compute_octrees_signature(const struct rnatm* atm, hash256_T signature)
const struct aerosol* aerosol = darray_aerosol_cdata_get(&atm->aerosols)+i;
res = sars_find_bands(aerosol->sars, atm->spectral_range, ibands);
if(res != RES_OK) goto error;
- res = compute_aerosol_signature(aerosol, ibands, aerosol_signatures[i]);
- if(res != RES_OK) goto error;
+
+ if(ibands[0] <= ibands[1]) {
+ /* The aerosol is overlapped by the spectral range to consider */
+ res = compute_aerosol_signature(aerosol, ibands, aerosol_signatures[i]);
+ if(res != RES_OK) goto error;
+ }
}
/* Pay attention to the order of how aerosol hashes are registered.
diff --git a/src/rnatm_properties.c b/src/rnatm_properties.c
@@ -650,6 +650,10 @@ setup_aerosol_properties
res = check_aerosol_sars_desc(atm, aerosol, aerosol_args);
if(res != RES_OK) goto error;
+ /* TODO remove the aerosol if its spectral data are not covered by the
+ * spectral domain, i.e. the aerosol has no influence on the radiative
+ * transfer for the input spectral domain */
+
/* Print elapsed time */
time_sub(&t0, time_current(&t1), &t0);
time_dump(&t0, TIME_ALL, NULL, buf, sizeof(buf));