mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 16:59:37 -05:00
solve merge conflict
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
-1.41872e+11 -2.77206e+10 2.01078e+10
|
||||
-0.114096 0.951265 0.18421 0.219418
|
||||
-4.94688e+09 -7.59111e+10 1.20333e+11
|
||||
0.984329 -0.133178 0.101358 0.0555531
|
||||
|
||||
@@ -7,8 +7,8 @@ function preInitialization()
|
||||
]]--
|
||||
|
||||
--openspace.time.setTime(openspace.time.currentWallTime())
|
||||
--openspace.time.setTime('2015-03-15T11:00:00.00')
|
||||
openspace.time.setTime('2000-01-01T00:00:00.00')
|
||||
openspace.time.setTime('2015-03-15T11:00:00.00')
|
||||
--openspace.time.setTime('2000-01-01T00:00:00.00')
|
||||
openspace.time.setDeltaTime(0)
|
||||
dofile(openspace.absPath('${SCRIPTS}/bind_keys_iswa.lua'))
|
||||
end
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
void changeRange(float minValue, float maxValue);
|
||||
|
||||
friend void operator<<(std::ostream& os, const Histogram& hist);
|
||||
friend std::ostream& operator<<(std::ostream& os, const Histogram& hist);
|
||||
private:
|
||||
int _numBins;
|
||||
float _minValue;
|
||||
|
||||
@@ -165,16 +165,6 @@ void DataProcessor::add(std::vector<std::vector<float>>& optionValues, std::vect
|
||||
int numValues;
|
||||
float mean, value, variance, standardDeviation, low, high;
|
||||
|
||||
// std::ofstream ofs[4];
|
||||
// ofs[0].open ("norm-entropy_n", std::ofstream::out | std::ofstream::app);
|
||||
// ofs[1].open ("norm-entropy_v", std::ofstream::out | std::ofstream::app);
|
||||
// ofs[2].open ("norm-entropy_bz", std::ofstream::out | std::ofstream::app);
|
||||
|
||||
// ofs[0].open ("norm-entropy_eave", std::ofstream::out | std::ofstream::app);
|
||||
// ofs[1].open ("norm-entropy_eflux", std::ofstream::out | std::ofstream::app);
|
||||
// ofs[2].open ("norm-entropy_ep", std::ofstream::out | std::ofstream::app);
|
||||
// ofs[3].open ("norm-entropy_jr", std::ofstream::out | std::ofstream::app);
|
||||
|
||||
for(int i=0; i<numOptions; i++){
|
||||
std::vector<float> values = optionValues[i];
|
||||
numValues = values.size();
|
||||
@@ -196,6 +186,7 @@ void DataProcessor::add(std::vector<std::vector<float>>& optionValues, std::vect
|
||||
_unNormalizedhistograms[i]->add(value, 1);
|
||||
_buildData[i].push_back(value);
|
||||
}
|
||||
|
||||
_unNormalizedhistograms[i]->generateEqualizer();
|
||||
|
||||
standardDeviation = sqrt(variance/ numValues);
|
||||
@@ -204,16 +195,8 @@ void DataProcessor::add(std::vector<std::vector<float>>& optionValues, std::vect
|
||||
_numValues[i] += numValues;
|
||||
mean = (1.0f/_numValues[i])*_sum[i];
|
||||
|
||||
//const float* histData = _unNormalizedhistograms[i]->data();
|
||||
//std::cout << "min: " << _min[i] << " max: " << _max[i] << std::endl;
|
||||
//float histMin = _unNormalizedhistograms[i]->minValue();
|
||||
//float histMax = _unNormalizedhistograms[i]->maxValue();
|
||||
//std::cout << "histMin: " << histMin << " histMax: " << histMax << std::endl;
|
||||
int numBins = _unNormalizedhistograms[i]->numBins();
|
||||
|
||||
// float fit = IswaManager::ref().fit();
|
||||
// float fit = _unNormalizedhistograms[i]->entropy()/IswaManager::ref().fit();
|
||||
|
||||
// the E (entropy) method
|
||||
float fit = _unNormalizedhistograms[i]->entropy();
|
||||
_fitValues[i] = fit;
|
||||
@@ -238,13 +221,6 @@ void DataProcessor::add(std::vector<std::vector<float>>& optionValues, std::vect
|
||||
//restore the highest bin
|
||||
_histograms[i]->setBin(highestBin, highestBinValue);
|
||||
}
|
||||
|
||||
|
||||
// ofs[0].close();
|
||||
// ofs[1].close();
|
||||
// ofs[2].close();
|
||||
// ofs[3].close();
|
||||
|
||||
}
|
||||
|
||||
void DataProcessor::clearBuildData(){
|
||||
|
||||
@@ -21,7 +21,7 @@ openspace.bindKey("h", "openspace.iswa.setBaseUrl('http://iswa-demo-server.herok
|
||||
openspace.bindKey("g", "openspace.iswa.setBaseUrl('http://128.183.168.116:3000/')");
|
||||
openspace.bindKey("l", "openspace.iswa.setBaseUrl('http://localhost:3000/')");
|
||||
|
||||
openspace.bindKey("v", "openspace.time.setTime('2015-03-15T02:00:00.00')");
|
||||
openspace.bindKey("v", "openspace.time.setTime('2015-03-15T11:00:00.00')");
|
||||
|
||||
openspace.bindKey("s", "openspace.saveCameraPosition('${OPENSPACE_DATA}/iswa/magnetosphere.pos');");
|
||||
openspace.bindKey("a", "openspace.restoreCameraPosition('${OPENSPACE_DATA}/iswa/magnetosphere.pos');");
|
||||
+20
-5
@@ -330,11 +330,11 @@ void Histogram::print() const {
|
||||
std::cout << "number of bins: " << _numBins << std::endl
|
||||
<< "range: " << _minValue << " - " << _maxValue << std::endl << std::endl;
|
||||
for (int i = 0; i < _numBins; i++) {
|
||||
// float low = _minValue + float(i) / _numBins * (_maxValue - _minValue);
|
||||
// float high = low + (_maxValue - _minValue) / float(_numBins);
|
||||
// std::cout << i << " [" << low << ", " << high << "]"
|
||||
// << " " << _data[i] << std::endl;
|
||||
std::cout << _data[i]/(float)_numValues << ", ";
|
||||
float low = _minValue + float(i) / _numBins * (_maxValue - _minValue);
|
||||
float high = low + (_maxValue - _minValue) / float(_numBins);
|
||||
std::cout << i << " [" << low << ", " << high << "]"
|
||||
<< " " << _data[i] << std::endl;
|
||||
// std::cout << _data[i]/(float)_numValues << ", ";
|
||||
}
|
||||
std::cout << std::endl << std::endl << std::endl<< "==============" << std::endl;
|
||||
}
|
||||
@@ -367,4 +367,19 @@ float Histogram::binWidth(){
|
||||
return (_maxValue-_minValue) / float(_numBins);
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Histogram& hist){
|
||||
int numBins = hist.numBins();
|
||||
int numValues = hist.numValues();
|
||||
const float* data = hist.data();
|
||||
|
||||
for (int i = 0; i < numBins; i++) {
|
||||
// float low = _minValue + float(i) / _numBins * (_maxValue - _minValue);
|
||||
// float high = low + (_maxValue - _minValue) / float(_numBins);
|
||||
// std::cout << i << " [" << low << ", " << high << "]"
|
||||
// << " " << _data[i] << std::endl;
|
||||
os << data[i]/(float)numValues << ", ";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user