Change uppercase struct variables to camelcase

This commit is contained in:
Emma Broman
2020-09-18 11:10:15 +02:00
parent fe4bb00108
commit 32c2e59330
3 changed files with 122 additions and 122 deletions

View File

@@ -30,48 +30,48 @@
namespace openspace::exoplanets {
struct Exoplanet {
float A; // Orbital semi-major axis in AU
double AUPPER; // Upper uncertainty of orbital semi-major axis
double ALOWER; // Lower uncertainty of orbital semi-major axis
double UA; // Uncertainty of orbital semi-major axis
float BIGOM; // Longitude of ascending node in degrees
float BIGOMUPPER; // Upper uncertainty of longitude of ascending node
float BIGOMLOWER; // Lower uncertainty of longitude of ascending node
float UBIGOM; // Uncertainty of longitude of ascending node
bool BINARY; // Star known to be binary?
float BMV; // B V color
float ECC; // Orbital eccentricity
float ECCUPPER; // Upper uncertainty of orbital eccentricity
float ECCLOWER; // Lower uncertainty of orbital eccentricity
float UECC; // Uncertainty of orbital eccentricity
float I; // Orbital inclination in degrees (for transiting systems only)
float IUPPER; // Upper uncertainty of orbital inclination
float ILOWER; // Lower uncertainty of orbital inclination
float UI; // Uncertainty of orbital inclination
int NCOMP; // Number of planetary companions known
float OM; // Argument of periastron in degrees
float OMUPPER; // Upper uncertainty of argument of periastron
float OMLOWER; // Lower uncertainty of argument of periastron
float UOM; // Uncertainty of argument of periastron
double PER; // Orbital period in days
float PERUPPER; // Upper uncertainty of period
float PERLOWER; // Lower uncertainty of period
float UPER; // Uncertainty of period
double R; // Radius of the planet in Jupiter radii
double RUPPER; // Upper uncertainty of radius of the planet
double RLOWER; // Lower uncertainty of radius of the planet
double UR; // Uncertainty of radius of the planet
float RSTAR; // Estimated radius of the star in solar radii
float RSTARUPPER; // Upper uncertainty of estimated star radius
float RSTARLOWER; // Lower uncertainty of estimated star radius
float URSTAR; // Uncertainty of estimated star radius
double TT; // Epoch of transit center in HJD-2440000
float TTUPPER; // Upper uncertainty of epoch of transit center
float TTLOWER; // Lower uncertainty of epoch of transit center
float UTT; // Uncertainty of epoch of transit center
float POSITIONX; // Star position's X-coordinate in parsec
float POSITIONY; // Star position's Y-coordinate in parsec
float POSITIONZ; // Star position's Z-coordinate in parsec
float a; // Orbital semi-major axis in AU
double aUpper; // Upper uncertainty of orbital semi-major axis
double aLower; // Lower uncertainty of orbital semi-major axis
double ua; // Uncertainty of orbital semi-major axis
float bigOm; // Longitude of ascending node in degrees
float bigOmUpper; // Upper uncertainty of longitude of ascending node
float bigOmLower; // Lower uncertainty of longitude of ascending node
float uBigOm; // Uncertainty of longitude of ascending node
bool binary; // Star known to be binary?
float bmv; // B V color
float ecc; // Orbital eccentricity
float eccUpper; // Upper uncertainty of orbital eccentricity
float eccLower; // Lower uncertainty of orbital eccentricity
float uEcc; // Uncertainty of orbital eccentricity
float i; // Orbital inclination in degrees (for transiting systems only)
float iUpper; // Upper uncertainty of orbital inclination
float iLower; // Lower uncertainty of orbital inclination
float ui; // Uncertainty of orbital inclination
int nComp; // Number of planetary companions known
float om; // Argument of periastron in degrees
float omUpper; // Upper uncertainty of argument of periastron
float omLower; // Lower uncertainty of argument of periastron
float uOm; // Uncertainty of argument of periastron
double per; // Orbital period in days
float perUpper; // Upper uncertainty of period
float perLower; // Lower uncertainty of period
float uPer; // Uncertainty of period
double r; // Radius of the planet in Jupiter radii
double rUpper; // Upper uncertainty of radius of the planet
double rLower; // Lower uncertainty of radius of the planet
double ur; // Uncertainty of radius of the planet
float rStar; // Estimated radius of the star in solar radii
float rStarUpper; // Upper uncertainty of estimated star radius
float rStarLower; // Lower uncertainty of estimated star radius
float urStar; // Uncertainty of estimated star radius
double tt; // Epoch of transit center in HJD-2440000
float ttUpper; // Upper uncertainty of epoch of transit center
float ttLower; // Lower uncertainty of epoch of transit center
float uTt; // Uncertainty of epoch of transit center
float positionX; // Star position's X-coordinate in parsec
float positionY; // Star position's Y-coordinate in parsec
float positionZ; // Star position's Z-coordinate in parsec
};
// Convert csv-file specific names to the corresponding name in the speck data file

View File

@@ -199,7 +199,7 @@ int addExoplanetSystem(lua_State* L) {
data.close();
lut.close();
bool notEnoughData = isnan(p.POSITIONX) || isnan(p.A) || isnan(p.PER);
bool notEnoughData = isnan(p.positionX) || isnan(p.a) || isnan(p.per);
if (!found || notEnoughData) {
return ghoul::lua::luaError(
@@ -209,9 +209,9 @@ int addExoplanetSystem(lua_State* L) {
}
const glm::dvec3 starPosition = glm::dvec3(
p.POSITIONX * distanceconstants::Parsec,
p.POSITIONY * distanceconstants::Parsec,
p.POSITIONZ * distanceconstants::Parsec
p.positionX * distanceconstants::Parsec,
p.positionY * distanceconstants::Parsec,
p.positionZ * distanceconstants::Parsec
);
const glm::dvec3 sunPosition = glm::dvec3(0.0, 0.0, 0.0);
@@ -248,7 +248,7 @@ int addExoplanetSystem(lua_State* L) {
// Star renderable globe, if we have a radius
std::string starGlobeRenderableString;
const float starRadius = p.RSTAR;
const float starRadius = p.rStar;
if (!isnan(starRadius)) {
std::ifstream colorMap(absPath(BvColormapPath), std::ios::in);
@@ -256,7 +256,7 @@ int addExoplanetSystem(lua_State* L) {
ghoul::lua::luaError(L, "Failed to open colormap data file");
}
const std::string color = starColor(p.BMV, colorMap);
const std::string color = starColor(p.bmv, colorMap);
const float radiusInMeter = starRadius * distanceconstants::SolarRadius;
starGlobeRenderableString = "Renderable = {"
@@ -314,22 +314,22 @@ int addExoplanetSystem(lua_State* L) {
Exoplanet planet = planetSystem[i];
const std::string planetName = planetNames[i];
if (isnan(planet.ECC)) {
planet.ECC = 0.f;
if (isnan(planet.ecc)) {
planet.ecc = 0.f;
}
if (isnan(planet.I)) {
planet.I = 90.f;
if (isnan(planet.i)) {
planet.i = 90.f;
}
if (isnan(planet.BIGOM)) {
planet.BIGOM = 180.f;
if (isnan(planet.bigOm)) {
planet.bigOm = 180.f;
}
if (isnan(planet.OM)) {
planet.OM = 90.f;
if (isnan(planet.om)) {
planet.om = 90.f;
}
Time epoch;
std::string sEpoch;
if (!isnan(planet.TT)) {
epoch.setTime("JD " + std::to_string(planet.TT));
if (!isnan(planet.tt)) {
epoch.setTime("JD " + std::to_string(planet.tt));
sEpoch = std::string(epoch.ISO8601());
}
else {
@@ -339,33 +339,33 @@ int addExoplanetSystem(lua_State* L) {
float planetRadius;
std::string enabled;
if (isnan(planet.R)) {
if (isnan(planet.RSTAR)) {
planetRadius = planet.A * 0.001f * distanceconstants::AstronomicalUnit;
if (isnan(planet.r)) {
if (isnan(planet.rStar)) {
planetRadius = planet.a * 0.001f * distanceconstants::AstronomicalUnit;
}
else {
planetRadius = planet.RSTAR * 0.1f * distanceconstants::SolarRadius;
planetRadius = planet.rStar * 0.1f * distanceconstants::SolarRadius;
}
enabled = "false";
}
else {
planetRadius = planet.R * distanceconstants::JupiterRadius;
planetRadius = planet.r * distanceconstants::JupiterRadius;
enabled = "true";
}
const float period = planet.PER * static_cast<float>(SecondsPerDay);
const float semiMajorAxisInMeter = planet.A * distanceconstants::AstronomicalUnit;
const float period = planet.per * static_cast<float>(SecondsPerDay);
const float semiMajorAxisInMeter = planet.a * distanceconstants::AstronomicalUnit;
const float semiMajorAxisInKm = semiMajorAxisInMeter * 0.001f;
const std::string planetIdentifier = createIdentifier(planetName);
const std::string planetKeplerTranslation = "{"
"Type = 'KeplerTranslation',"
"Eccentricity = " + std::to_string(planet.ECC) + "," //ECC
"Eccentricity = " + std::to_string(planet.ecc) + "," //ECC
"SemiMajorAxis = " + std::to_string(semiMajorAxisInKm) + ","
"Inclination = " + std::to_string(planet.I) + "," //I
"AscendingNode = " + std::to_string(planet.BIGOM) + "," //BIGOM
"ArgumentOfPeriapsis = " + std::to_string(planet.OM) + "," //OM
"Inclination = " + std::to_string(planet.i) + "," //I
"AscendingNode = " + std::to_string(planet.bigOm) + "," //BIGOM
"ArgumentOfPeriapsis = " + std::to_string(planet.om) + "," //OM
"MeanAnomaly = 0.0,"
"Epoch = '" + sEpoch + "'," //TT. JD to YYYY MM DD hh:mm:ss
"Period = " + std::to_string(period) + ""
@@ -403,7 +403,7 @@ int addExoplanetSystem(lua_State* L) {
"Enabled = true,"
"Renderable = {"
"Type = 'RenderableTrailOrbit',"
"Period = " + std::to_string(planet.PER) + ","
"Period = " + std::to_string(planet.per) + ","
"Resolution = 1000,"
"Translation = " + planetKeplerTranslation + ","
"Color = { 1, 1, 1 }"
@@ -419,15 +419,15 @@ int addExoplanetSystem(lua_State* L) {
openspace::scripting::ScriptEngine::RemoteScripting::Yes
);
bool hasUpperAUncertainty = !isnan(planet.AUPPER);
bool hasLowerAUncertainty = !isnan(planet.ALOWER);
bool hasUpperAUncertainty = !isnan(planet.aUpper);
bool hasLowerAUncertainty = !isnan(planet.aLower);
if (hasUpperAUncertainty && hasLowerAUncertainty) {
// Get the orbit plane of the planet trail orbit from the KeplerTranslation
const glm::dmat4 orbitPlaneRotationMatrix = computeOrbitPlaneRotationMatrix(
planet.I,
planet.BIGOM,
planet.OM
planet.i,
planet.bigOm,
planet.om
);
const glm::dmat3 rotation = orbitPlaneRotationMatrix;
@@ -439,10 +439,10 @@ int addExoplanetSystem(lua_State* L) {
"Type = 'RenderableOrbitDisc',"
"Texture = openspace.absPath('" + DiscTextureFile + "'),"
"Size = " + std::to_string(semiMajorAxisInMeter) + ","
"Eccentricity = " + std::to_string(planet.ECC) + ","
"Eccentricity = " + std::to_string(planet.ecc) + ","
"Offset = { " +
std::to_string(planet.ALOWER) + ", " +
std::to_string(planet.AUPPER) +
std::to_string(planet.aLower) + ", " +
std::to_string(planet.aUpper) +
"}," //min / max extend
"Opacity = 0.3"
"},"

View File

@@ -116,16 +116,16 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
std::istringstream lineStream(planetRow);
getline(lineStream, data, ','); // A
p.A = readFloatData(data);
p.a = readFloatData(data);
getline(lineStream, data, ','); // AUPPER
p.AUPPER = readDoubleData(data);
p.aUpper = readDoubleData(data);
getline(lineStream, data, ','); // ALOWER
p.ALOWER = readDoubleData(data);
p.aLower = readDoubleData(data);
getline(lineStream, data, ','); // UA
p.UA = readDoubleData(data);
p.ua = readDoubleData(data);
getline(lineStream, data, ','); // AREF
getline(lineStream, data, ','); // AURL
@@ -143,26 +143,26 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // BREF
getline(lineStream, data, ','); // BURL
getline(lineStream, data, ','); // BIGOM
p.BIGOM = readFloatData(data);
p.bigOm = readFloatData(data);
getline(lineStream, data, ','); // BIGOMUPPER
p.BIGOMUPPER = readFloatData(data);
p.bigOmUpper = readFloatData(data);
getline(lineStream, data, ','); // BIGOMLOWER
p.BIGOMLOWER = readFloatData(data);
p.bigOmLower = readFloatData(data);
getline(lineStream, data, ','); // UBIGOM
p.UBIGOM = readFloatData(data);
p.uBigOm = readFloatData(data);
getline(lineStream, data, ','); // BIGOMREF
getline(lineStream, data, ','); // BIGOMURL
getline(lineStream, data, ','); // BINARY
p.BINARY = static_cast<bool>(readIntegerData(data));
p.binary = static_cast<bool>(readIntegerData(data));
getline(lineStream, data, ','); // BINARYREF
getline(lineStream, data, ','); // BINARYURL
getline(lineStream, data, ','); // BMV
p.BMV = readFloatData(data);
p.bmv = readFloatData(data);
getline(lineStream, data, ','); // CHI2
getline(lineStream, data, ','); // COMP
@@ -204,16 +204,16 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // EANAME
getline(lineStream, data, ','); // EAURL
getline(lineStream, data, ','); // ECC
p.ECC = readFloatData(data);
p.ecc = readFloatData(data);
getline(lineStream, data, ','); // ECCUPPER
p.ECCLOWER = readFloatData(data);
p.eccUpper = readFloatData(data);
getline(lineStream, data, ','); // ECCLOWER
p.ECCLOWER = readFloatData(data);
p.eccLower = readFloatData(data);
getline(lineStream, data, ','); // UECC
p.UECC = readFloatData(data);
p.uEcc = readFloatData(data);
getline(lineStream, data, ','); // ECCREF
getline(lineStream, data, ','); // ECCURL
@@ -247,16 +247,16 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // HIPP
getline(lineStream, data, ','); // HR
getline(lineStream, data, ','); // I
p.I = readFloatData(data);
p.i = readFloatData(data);
getline(lineStream, data, ','); // IUPPER
p.IUPPER = readFloatData(data);
p.iUpper = readFloatData(data);
getline(lineStream, data, ','); // ILOWER
p.ILOWER = readFloatData(data);
p.iLower = readFloatData(data);
getline(lineStream, data, ','); // UI
p.UI = readFloatData(data);
p.ui = readFloatData(data);
getline(lineStream, data, ','); // IREF
getline(lineStream, data, ','); // IURL
@@ -307,20 +307,20 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // MULT
getline(lineStream, data, ','); // NAME
getline(lineStream, data, ','); // NCOMP
p.NCOMP = readIntegerData(data);
p.nComp = readIntegerData(data);
getline(lineStream, data, ','); // NOBS
getline(lineStream, data, ','); // OM
p.OM = readFloatData(data);
p.om = readFloatData(data);
getline(lineStream, data, ','); // OMUPPER
p.OMUPPER = readFloatData(data);
p.omUpper = readFloatData(data);
getline(lineStream, data, ','); // OMLOWER
p.OMLOWER = readFloatData(data);
p.omLower = readFloatData(data);
getline(lineStream, data, ','); // UOM
p.UOM = readFloatData(data);
p.uOm = readFloatData(data);
getline(lineStream, data, ','); // OMREF
getline(lineStream, data, ','); // OMURL
@@ -332,31 +332,31 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // PARLOWER
getline(lineStream, data, ','); // UPAR
getline(lineStream, data, ','); // PER
p.PER = readDoubleData(data);
p.per = readDoubleData(data);
getline(lineStream, data, ','); // PERUPPER
p.PERUPPER = readFloatData(data);
p.perUpper = readFloatData(data);
getline(lineStream, data, ','); // PERLOWER
p.PERLOWER = readFloatData(data);
p.perLower = readFloatData(data);
getline(lineStream, data, ','); // UPER
p.UPER = readFloatData(data);
p.uPer = readFloatData(data);
getline(lineStream, data, ','); // PERREF
getline(lineStream, data, ','); // PERURL
getline(lineStream, data, ','); // PLANETDISCMETH
getline(lineStream, data, ','); // R
p.R = readDoubleData(data);
p.r = readDoubleData(data);
getline(lineStream, data, ','); // RUPPER
p.RUPPER = readDoubleData(data);
p.rUpper = readDoubleData(data);
getline(lineStream, data, ','); // RLOWER
p.RLOWER = readDoubleData(data);
p.rLower = readDoubleData(data);
getline(lineStream, data, ','); //UR
p.UR = readDoubleData(data);
p.ur = readDoubleData(data);
getline(lineStream, data, ','); // RREF
getline(lineStream, data, ','); // RURL
@@ -377,16 +377,16 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // RRREF
getline(lineStream, data, ','); // RRURL
getline(lineStream, data, ','); // RSTAR
p.RSTAR = readFloatData(data);
p.rStar = readFloatData(data);
getline(lineStream, data, ','); // RSTARUPPER
p.RSTARUPPER = readFloatData(data);
p.rStarUpper = readFloatData(data);
getline(lineStream, data, ','); // RSTARLOWER
p.RSTARLOWER = readFloatData(data);
p.rStarLower = readFloatData(data);
getline(lineStream, data, ','); // URSTAR
p.URSTAR = readFloatData(data);
p.urStar = readFloatData(data);
getline(lineStream, data, ','); // RSTARREF
getline(lineStream, data, ','); // RSTARURL
@@ -462,9 +462,9 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // STAR
std::string speckStarname = speckStarName(data);
glm::vec3 position = starPosition(speckStarname);
p.POSITIONX = position[0];
p.POSITIONY = position[1];
p.POSITIONZ = position[2];
p.positionX = position[0];
p.positionY = position[1];
p.positionZ = position[2];
getline(lineStream, data, ','); // STARDISCMETH
getline(lineStream, data, ','); // T0
@@ -493,16 +493,16 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
getline(lineStream, data, ','); // TRANSITURL
getline(lineStream, data, ','); // TREND
getline(lineStream, data, ','); // TT
p.TT = readDoubleData(data);
p.tt = readDoubleData(data);
getline(lineStream, data, ','); // TTUPPER
p.TTUPPER = readFloatData(data);
p.ttUpper = readFloatData(data);
getline(lineStream, data, ','); // TTLOWER
p.TTLOWER = readFloatData(data);
p.ttLower = readFloatData(data);
getline(lineStream, data, ','); // UTT
p.UTT = readFloatData(data);
p.uTt = readFloatData(data);
getline(lineStream, data, ','); // TTREF
getline(lineStream, data, ','); // TTURL
@@ -523,8 +523,8 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
if (!isKeplerObject) {
// calculate B-V from Teff if not exsisting
if (std::isnan(p.BMV)) {
p.BMV = bvFromTeff(teff);
if (std::isnan(p.bmv)) {
p.bmv = bvFromTeff(teff);
}
// create look-up table