Implement vector variable length and better progress cb in kameleonvolumetorawtask

This commit is contained in:
Jonathan Grangien
2018-06-14 16:50:33 -04:00
committed by Matthias Berg
parent 7fdc139879
commit 69a3bfb1cf
4 changed files with 23 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
return {{
Type = "KameleonVolumeToRawTask",
Input = "/media/jgrangien/SimDataDrive/BastilleDay/mhd_run/3D_CDF/mas_merged_step_112.cdf",
-- Variable = "rho",
VariableVector = "ur uphi utheta",
InnerRadialLimit = 1.75,
Dimensions = {100, 100, 128},
LowerDomainBound = {1, -90, 0},
UpperDomainBound = {15, 90, 360},
RawVolumeOutput = "${DATA}/mas/bastille/u/mas_merged_step_112.rawvolume",
DictionaryOutput = "${DATA}/mas/bastille/u/mas_merged_step_112.dictionary"
}}

View File

@@ -159,6 +159,12 @@ std::unique_ptr<volume::RawVolume<float>> KameleonVolumeReader::readFloatVolume(
continue;
}
// Radius is within custom limit of exclusion, skip value
if (volumeCoords.x < innerRadialLimit) {
// std::cout << "Skipping radius " << volumeCoords.x << std::endl;
continue;
}
float value = !variable.empty() ? sample(volumeCoords) : sampleVectorVariablesLength(volumeCoords);
// Multiply value by the squared first coordinate
@@ -341,3 +347,4 @@ void KameleonVolumeReader::setReaderCallback(callback_t& cb) {
};
} // namespace openspace::kameleonvolume

View File

@@ -30,10 +30,9 @@
#include <string>
#include <vector>
#include <modules/volume/rawvolume.h>
#include <ghoul/misc/dictionary.h>
// #include <ghoul/misc/dictionary.h>
#include <functional>
#ifdef WIN32
#pragma warning (push)
#pragma warning (disable : 4619) // #pragma warning: there is no warning number '4619'
@@ -93,6 +92,8 @@ public:
void setReaderCallback(callback_t& cb);
void setReaderCallback(callback_t& cb);
private:
static void addAttributeToDictionary(ghoul::Dictionary& dictionary,
const std::string& key, ccmc::Attribute& attr);

View File

@@ -35,7 +35,6 @@
#include <fstream>
#include <sstream>
namespace {
constexpr const char* KeyInput = "Input";
constexpr const char* KeyRawVolumeOutput = "RawVolumeOutput";