commit 902b3c458f884fb12adcd0cd28313539b28a295b
parent 002f17b47dd33646343a401df35c06f4ffd8f5aa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 31 Oct 2022 11:05:03 +0100
Replace rnatm_band_get_range by rnatm_band_get_desc
Diffstat:
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/rnatm.c b/src/rnatm.c
@@ -436,15 +436,15 @@ error:
}
res_T
-rnatm_band_get_range
+rnatm_band_get_desc
(const struct rnatm* rnatm,
const size_t iband,
- double range[2]) /* In nm. Upper bound is exclusive */
+ struct rnatm_band_desc* band_desc)
{
struct sck_band band;
res_T res = RES_OK;
- if(!rnatm || !range) {
+ if(!rnatm || !band_desc) {
res = RES_BAD_ARG;
goto error;
}
@@ -460,8 +460,9 @@ rnatm_band_get_range
/* TODO Should the range of the band be clamped to the atmospheric spectral
* domain? */
- range[0] = band.lower;
- range[1] = band.upper;
+ band_desc->lower = band.lower;
+ band_desc->upper = band.upper;
+ band_desc->quad_pts_count = band.quad_pts_count;
exit:
return res;
diff --git a/src/rnatm.h b/src/rnatm.h
@@ -94,6 +94,15 @@ struct rnatm_cell {
#define RNATM_CELL_NULL__ {SUVM_PRIMITIVE_NULL__, RNATM_GAS}
static const struct rnatm_cell RNATM_CELL_NULL = RNATM_CELL_NULL__;
+struct rnatm_band_desc {
+ double lower; /* Lower band wavelength in nm (inclusive) */
+ double upper; /* Upper band wavelength in nm (exclusive) */
+ size_t quad_pts_count; /* #quadrature points */
+};
+#define RNATM_BAND_DESC_NULL__ {0,0,0}
+static const struct rnatm_band_desc RNATM_BAND_DESC_NULL =
+ RNATM_BAND_DESC_NULL__;
+
struct rnatm_cell_get_radcoef_args {
struct rnatm_cell cell; /* Cell to query */
double barycentric_coords[4]; /* Position into and relative to the cell */
@@ -292,10 +301,10 @@ rnatm_band_sample_quad_pt
size_t* iquad);
RNATM_API res_T
-rnatm_band_get_range
+rnatm_band_get_desc
(const struct rnatm* rnatm,
const size_t iband, /* Index of the band to query */
- double range[2]); /* In nm. Upper bound is exclusive */
+ struct rnatm_band_desc* band);
/* Writes a set of octrees following the VTK file format */
RNATM_API res_T