rnatm

Load and structure data describing an atmosphere
git clone git://git.meso-star.fr/rnatm.git
Log | Files | Refs | README | LICENSE

commit c91f8ebe300d244447dc828766a411c06d0e3002
parent 3053c964f897602e875acbe6a9f2d173f3378145
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 30 Aug 2022 11:10:12 +0200

Spectral bands are defined in nanometers

Diffstat:
Msrc/rnatm.h | 6+++---
Msrc/rnatm_octree.c | 10+++++-----
Msrc/rnatm_properties.c | 2+-
Msrc/test_rnatm.c | 4++--
4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/rnatm.h b/src/rnatm.h @@ -89,7 +89,7 @@ struct rnatm_create_args { * kept in memory */ FILE* octrees_storage; - /* Spectral range to consider (in wavenumbers). Limits are inclusive */ + /* Spectral range to consider (in nanometers). Limits are inclusive */ double spectral_range[2]; double optical_thickness; /* Threshold used during octree building */ @@ -110,7 +110,7 @@ struct rnatm_create_args { \ NULL, /* octrees storage */ \ \ - {12820.513, 26315.789}, /* Spectral range */ \ + {380, 780}, /* Spectral range */ \ 1, /* Optical thickness */ \ \ 512, /* Hint on the grid definition */ \ @@ -168,7 +168,7 @@ rnatm_get_octrees_count RNATM_API res_T rnatm_write_vtk_octrees (struct rnatm* atm, - const size_t octrees[2], /* Range of consider. Limits are inclusive */ + const size_t octrees[2], /* Range to consider. Limits are inclusive */ FILE* stream); #endif /* RNATM_H */ diff --git a/src/rnatm_octree.c b/src/rnatm_octree.c @@ -283,7 +283,7 @@ find_band_range if(bands[0] > bands[1]) { log_err(atm, - "the spectral range [%g, %g] cm^-1 does not overlap any bands\n", + "the spectral range [%g, %g] nm does not overlap any bands\n", SPLIT2(range)); res = RES_BAD_ARG; goto error; @@ -291,7 +291,7 @@ find_band_range nbands_overlaped = bands[1] - bands[0] + 1; log_info(atm, - "the spectral range [%g, %g] cm^-1 overlaps %lu band%sin [%g, %g] cm^-1\n", + "the spectral range [%g, %g] nm overlaps %lu band%sin [%g, %g[ nm\n", SPLIT2(range), (unsigned long)nbands_overlaped, nbands_overlaped > 1 ? "s ": " ", @@ -505,7 +505,7 @@ setup_tetra_radcoefs_aerosol { struct sck_band gas_band; struct sars_band ars_band; - double gas_spectral_range[2]; /* In cm^-1 */ + double gas_spectral_range[2]; /* In nm */ size_t ars_ibands[2]; float ka[4], ks[4], kext[4]; ASSERT(atm && aerosol && tetra && radcoefs); @@ -584,8 +584,8 @@ setup_tetra_radcoefs_aerosol tau_ka[0] += ars_band.ka_list[tetra->indices[0]] * lambda_len; tau_ka[1] += ars_band.ka_list[tetra->indices[1]] * lambda_len; - tau_ka[2] += ars_band.ka_list[tetra->indices[2]] * lambda_len; - tau_ka[3] += ars_band.ka_list[tetra->indices[3]] * lambda_len; + tau_ka[2] += ars_band.ka_list[tetra->indices[2]] * lambda_len; + tau_ka[3] += ars_band.ka_list[tetra->indices[3]] * lambda_len; } /* Compute the radiative coefficients of the tetrahedron */ diff --git a/src/rnatm_properties.c b/src/rnatm_properties.c @@ -355,7 +355,7 @@ setup_gas_properties(struct rnatm* atm, const struct rnatm_gas_args* gas_args) if(res != RES_OK) goto error; res = sck_get_band(atm->gas.ck, nbands-1, &band_upp); if(res != RES_OK) goto error; - log_info(atm, "the gas is composed of %lu band%sin [%g, %g] cm^-1\n", + log_info(atm, "the gas is composed of %lu band%sin [%g, %g] nm\n", nbands, nbands > 1 ? "s " : " ", band_low.lower, band_upp.upper); diff --git a/src/test_rnatm.c b/src/test_rnatm.c @@ -84,8 +84,8 @@ print_help(const char* cmd) printf( " -o file offload octrees to file\n"); printf( -" -s nu0,nu1 spectral range to consider (in cm^-1).\n" -" Default is visible spectrum, i.e [%g, %g] cm^1\n", +" -s nu0,nu1 spectral range to consider (in nm).\n" +" Default is visible spectrum, i.e [%g, %g] nm\n", ARGS_DEFAULT.rnatm.spectral_range[0], ARGS_DEFAULT.rnatm.spectral_range[1]); printf(