atrri

Refractive indices varying with wavelength
git clone git://git.meso-star.fr/atrri.git
Log | Files | Refs | README | LICENSE

commit 77adec42cfdab304d87af9b47559d7a000a4f6f4
parent e8f8ca76547a256ac2275e24e162628df5250abf
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu,  5 Jan 2023 16:09:40 +0100

Merge branch 'release_0.0.2'

Diffstat:
MREADME.md | 24++++++++++++++++++++----
Mcmake/CMakeLists.txt | 17++++++++---------
Adoc/atrri.5.scd | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ddoc/atrri.5.txt | 69---------------------------------------------------------------------
Msrc/atrri.c | 3++-
Msrc/atrri.h | 3++-
Msrc/atrri_c.h | 3++-
Msrc/atrri_log.c | 3++-
Msrc/atrri_log.h | 3++-
Msrc/test_atrri.c | 3++-
Msrc/test_atrri_load.c | 5+++--
11 files changed, 108 insertions(+), 90 deletions(-)

diff --git a/README.md b/README.md @@ -9,8 +9,8 @@ This library is compatible GNU/Linux 64-bits. It relies the [CMake](http://www.cmake.org) and the [RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends on the [RSys](https://gitlab.com/vaplv/rsys/) library. It optionally depends on -the [AsciiDoc](https://asciidoc.org/) suite of tools; if available, the man -pages of the reference documentation will be generated. +[scdoc](https://sr.ht/~sircmpwn/scdoc/) which, if available, is used to +generate the man pages. First ensure that CMake is installed on your system. Then install the RCMake package as well as the aforementioned prerequisites. Finally generate the @@ -20,9 +20,25 @@ resulting project can be edited, built, tested and installed as any CMake project. Refer to the [CMake documentation](https://cmake.org/documentation) for further informations on CMake. +## Release notes + +### Version 0.0.2 + +- Fix compilation warnings detected by gcc 1. +- Use scdoc rather than asciidoc as file format for man sources. + +### Version 0.0.1 + +Set the minimum version of CMake to 3.1. Previously, it was set to the now +obsolete version 2.8. + +## Copyright + +Copyright (C) 2022, 2023 [|Méso|Star](http://www.meso-star.com) (<contact@meso-star.com>) +Copyright (C) 2021 Centre National de la Recherche Scientifique (CNRS) + ## License -Copyright (C) 2021 Centre National de la Recherche Scientifique (CNRS). AtrRI -is free software released under the GPL v3+ license: GNU GPL version 3 or +AtrRI is free software released under the GPL v3+ license: GNU GPL version 3 or later. You are welcome to redistribute it under certain conditions; refer to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,3 +1,4 @@ +# Copyright (C) 2022-2023 |Méso|Star> (contact@meso-star.com) # Copyright (C) 2021 CNRS # # This program is free software: you can redistribute it and/or modify @@ -37,7 +38,7 @@ include_directories(${RSys_INCLUDE_DIR}) ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 0) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(ATRRI_FILES_SRC @@ -88,18 +89,16 @@ endif() ################################################################################ # Man page ############################################################################### -find_program(A2X NAMES a2x a2x.py) -if(NOT A2X) +find_program(SCDOC NAMES scdoc) +if(NOT SCDOC) message(WARNING - "The `a2x' program is missing. " - "The atrri man page cannot be generated.") + "The `scdoc' program is missing. " + "The Astoria Refractive Index man page cannot be generated.") else() - set(_src ${PROJECT_SOURCE_DIR}/../doc/atrri.5.txt) - set(_txt ${CMAKE_CURRENT_BINARY_DIR}/atrri.5.txt) + set(_src ${PROJECT_SOURCE_DIR}/../doc/atrri.5.scd) add_custom_command( OUTPUT atrri.5 - COMMAND ${CMAKE_COMMAND} -E copy ${_src} ${_txt} - COMMAND ${A2X} -dmanpage -fmanpage ${_txt} + COMMAND ${SCDOC} < ${_src} > atrri.5 DEPENDS ${_src} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Buid ROFF man page atrri.5" diff --git a/doc/atrri.5.scd b/doc/atrri.5.scd @@ -0,0 +1,65 @@ +atrri(5) + +; Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) +; Copyright (C) 2021 CNRS +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <http://www.gnu.org/licenses/>. + +# NAME + +atrri - AsToRia: Refractive Index + +# DESCRIPTION + +*atrri* is a plain text file format for storing a list of refractive indices +that vary spectrally. Each refractive index is defined by 3 double precision +floating point numbers: the wavelength in nanometers at which the index is +set, followed by the real part and the imaginary part of the refractive index +itself. Note that the listed refractive indices should be sorted in ascending +order relative to their wavelength. + +Characters behind the pound sign (#) are considered comments and are therefore +ignored. Empty lines, that is, lines without characters or consisting only of +spaces and tabs, are simply skipped. + +# GRAMMAR + +``` +<atrri> ::= <refractive-index> + [ <refractive-index> ... ] + +<refractive-index> ::= <wavelength> <n> <kappa> + +<wavelength> ::= <double> # In nm +<n> ::= <double> # Real part +<kappa> ::= <double> # Imaginary part +``` + +# EXAMPLE + +``` +# Wavelength in nm real part imaginary part + + 300.000011921 1.740000010 0.469999999 + 310.000002384 1.741990328 0.469004273 + 319.999992847 1.743917465 0.468010038 + 329.999983311 1.745785475 0.467014253 + 339.999973774 1.748130083 0.465993971 + 349.999964237 1.750000000 0.464985400 + 359.999954700 1.750000000 0.463959038 + 369.999945164 1.750000000 0.462961257 + 379.999935627 1.750000000 0.461990029 + 389.999926090 1.750000000 0.460981935 + 399.999916553 1.750000000 0.459957659 +``` diff --git a/doc/atrri.5.txt b/doc/atrri.5.txt @@ -1,69 +0,0 @@ -// Copyright (C) 2021 CNRS -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -:toc: - -atrri(5) -======= - -NAME ----- -atrri - AsToRia: Refractive Index - -DESCRIPTION ------------ - -*atrri* is a plain text file format for storing a list of refractive indices -that vary spectrally. Each refractive index is defined by 3 double precision -floating point numbers: the wavelength in nanometers at which the index is -set, followed by the real part and the imaginary part of the refractive index -itself. Note that the listed refractive indices should be sorted in ascending -order relative to their wavelength. - - -Characters behind the pound sign (#) are considered comments and are therefore -ignored. Empty lines, that is, lines without characters or consisting only of -spaces and tabs, are simply skipped. - -GRAMMAR -------- - -[verse] -------- -<atrri> ::= <refractive-index> - [ <refractive-index> ... ] - -<refractive-index> ::= <wavelength> <n> <kappa> - -<wavelength> ::= <double> # In nm -<n> ::= <double> # Real part -<kappa> ::= <double> # Imaginary part -------- - -EXAMPLE -------- - -# Wavelength in nm real part imaginary part - - 300.000011921 1.740000010 0.469999999 - 310.000002384 1.741990328 0.469004273 - 319.999992847 1.743917465 0.468010038 - 329.999983311 1.745785475 0.467014253 - 339.999973774 1.748130083 0.465993971 - 349.999964237 1.750000000 0.464985400 - 359.999954700 1.750000000 0.463959038 - 369.999945164 1.750000000 0.462961257 - 379.999935627 1.750000000 0.461990029 - 389.999926090 1.750000000 0.460981935 - 399.999916553 1.750000000 0.459957659 diff --git a/src/atrri.c b/src/atrri.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri.h b/src/atrri.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_c.h b/src/atrri_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_log.c b/src/atrri_log.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_log.h b/src/atrri_log.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_atrri.c b/src/test_atrri.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_atrri_load.c b/src/test_atrri_load.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2021 CNRS +/* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2021 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -142,7 +143,7 @@ test_load(struct atrri* atrri) 789.999544621, 1.750000000, 0.430177301, 799.999535084, 1.750000000, 0.430253685 }; - const size_t nrefract_ids = sizeof(refract_ids) / sizeof(double[3]); + const size_t nrefract_ids = sizeof(refract_ids) / (sizeof(double)*3); struct atrri_desc desc = ATRRI_DESC_NULL; struct atrri_refractive_index index = ATRRI_REFRACTIVE_INDEX_NULL; size_t irefract_id = 0;