From bf49ad76f2868967f87737c12bbc61e6708e7776 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Mon, 12 Oct 2020 09:15:07 +0200 Subject: [PATCH] Cleanup --- include/openspace/util/coordinateconversion.h | 14 ++++++------ modules/exoplanets/exoplanetshelper.h | 4 ++-- .../tasks/exoplanetsdatapreparationtask.cpp | 22 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/openspace/util/coordinateconversion.h b/include/openspace/util/coordinateconversion.h index 1218761f40..7dcce4ad6e 100644 --- a/include/openspace/util/coordinateconversion.h +++ b/include/openspace/util/coordinateconversion.h @@ -30,13 +30,13 @@ namespace openspace { /** -* Converts from ICRS coordinates to galactic cartesian coordinates. -* \param ra Right ascension, given in decimal degrees -* \param dec Declination, given in decimal degrees -* \param distance The distance, or radius, to the position given in any unit. -* \return A position in galactic cartesian coordinates, given in the same unit as the -* distance parameter. -*/ + * Converts from ICRS coordinates to galactic cartesian coordinates. + * \param ra Right ascension, given in decimal degrees + * \param dec Declination, given in decimal degrees + * \param distance The distance, or radius, to the position given in any unit. + * \return A position in galactic cartesian coordinates, given in the same unit as the + * distance parameter. + */ glm::dvec3 icrsToGalacticCartesian(float ra, float dec, double distance); } // namespace openspace diff --git a/modules/exoplanets/exoplanetshelper.h b/modules/exoplanets/exoplanetshelper.h index 8b8c6bff8b..ccb69cc2f5 100644 --- a/modules/exoplanets/exoplanetshelper.h +++ b/modules/exoplanets/exoplanetshelper.h @@ -34,8 +34,8 @@ struct Exoplanet { double aUpper; // Upper uncertainty of orbital semi-major axis double aLower; // Lower uncertainty of orbital semi-major axis float bigOmega; // Longitude of ascending node in degrees - float bigOmegaUpper;// Upper uncertainty of longitude of ascending node - float bigOmegaLower;// Lower uncertainty of longitude of ascending node + float bigOmegaUpper; // Upper uncertainty of longitude of ascending node + float bigOmegaLower; // Lower uncertainty of longitude of ascending node bool binary; // Star known to be binary? float bmv; // B − V color float ecc; // Orbital eccentricity diff --git a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp index f1f8643d1d..8b66c057b7 100644 --- a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp +++ b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp @@ -113,7 +113,7 @@ void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progre if (ec == std::errc()) { return result; } - return NAN; + return std::numeric_limits::quiet_NaN(); #else // clang is missing float support for std::from_chars return !str.empty() ? std::stof(str.c_str(), nullptr) : NAN; @@ -127,7 +127,7 @@ void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progre if (ec == std::errc()) { return result; } - return NAN; + return std::numeric_limits::quiet_NaN(); #else // clang is missing double support for std::from_chars return !str.empty() ? std::stod(str.c_str(), nullptr) : NAN; @@ -159,9 +159,9 @@ void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progre std::string component; std::string speckStarname; - float ra = NAN; // decimal degrees - float dec = NAN; // decimal degrees - float distanceInParsec = NAN; + float ra = std::numeric_limits::quiet_NaN(); // decimal degrees + float dec = std::numeric_limits::quiet_NaN(); // decimal degrees + float distanceInParsec = std::numeric_limits::quiet_NaN(); std::istringstream lineStream(planetRow); int columnIndex = 0; @@ -287,9 +287,9 @@ void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progre // @TODO (emmbr 2020-10-05) Currently, the dataset has no information about the // longitude of the ascending node, but maybe it might in the future - p.bigOmega = NAN; - p.bigOmegaUpper = NAN; - p.bigOmegaLower = NAN; + p.bigOmega = std::numeric_limits::quiet_NaN(); + p.bigOmegaUpper = std::numeric_limits::quiet_NaN(); + p.bigOmegaLower = std::numeric_limits::quiet_NaN(); bool foundPositionFromSpeck = !std::isnan(p.positionX); bool hasDistance = !std::isnan(distanceInParsec); @@ -319,7 +319,7 @@ glm::vec3 ExoplanetsDataPreparationTask::starPosition(const std::string& starNam LERROR(fmt::format("Error opening file expl.speck")); } - glm::vec3 position{ NAN }; + glm::vec3 position{ std::numeric_limits::quiet_NaN() }; std::string line; while (getline(exoplanetsFile, line)) { @@ -357,13 +357,13 @@ glm::vec3 ExoplanetsDataPreparationTask::starPosition(const std::string& starNam float ExoplanetsDataPreparationTask::bvFromTeff(float teff) { if (std::isnan(teff)) { - return NAN; + return std::numeric_limits::quiet_NaN(); } std::ifstream teffToBvFile(_teffToBvFilePath); if (!teffToBvFile.good()) { LERROR(fmt::format("Failed to open teff_bv.txt file")); - return NAN; + return std::numeric_limits::quiet_NaN(); } float bv = 0.f;