##// END OF EJS Templates
Fixed Spectrogram plots...
jeandet -
r1367:8b508ae3dac1
parent child
Show More
@@ -1,1 +1,1
1 Subproject commit 70eb884a0ee3f19fb2a7dc91d2f25f6348d4167d
1 Subproject commit 54e194b00c35fb5f769eda61234c1b4dd6de3a43
@@ -84,16 +84,18 struct SpectrogramCosinus : public ICosinusType {
84
84
85 double value;
85 double value;
86
86
87 if (SPECTROGRAM_ZERO_BANDS.find(y) != SPECTROGRAM_ZERO_BANDS.end()) {
87 // if (SPECTROGRAM_ZERO_BANDS.find(y) != SPECTROGRAM_ZERO_BANDS.end()) {
88 value = 0.;
88 // value = 0.;
89 }
89 // }
90 else if (SPECTROGRAM_NAN_BANDS.find(y) != SPECTROGRAM_NAN_BANDS.end()) {
90 // else if (SPECTROGRAM_NAN_BANDS.find(y) != SPECTROGRAM_NAN_BANDS.end()) {
91 value = std::numeric_limits<double>::quiet_NaN();
91 // value = std::numeric_limits<double>::quiet_NaN();
92 }
92 // }
93 else {
93 // else
94 {
94 // Generates value for non NaN/zero bands
95 // Generates value for non NaN/zero bands
95 auto r = 3 * std::sqrt(x * x + y * y) + 1e-2;
96 //auto r = 3 * std::sqrt(x * x + y * y) + 1e-2;
96 value = 2 * x * (std::cos(r + 2) / r - std::sin(r + 2) / r);
97 //value = 2 * x * (std::cos(r + 2) / r - std::sin(r + 2) / r);
98 value = x + 10*y;
97 }
99 }
98
100
99 values[componentCount * dataIndex + i] = value;
101 values[componentCount * dataIndex + i] = value;
@@ -136,8 +138,11 std::unique_ptr<ICosinusType> cosinusType(const QString &type) noexcept
136 else if (type.compare(QStringLiteral("spectrogram"), Qt::CaseInsensitive) == 0) {
138 else if (type.compare(QStringLiteral("spectrogram"), Qt::CaseInsensitive) == 0) {
137 // Generates default y-axis data for spectrogram [0., 1., 2., ...]
139 // Generates default y-axis data for spectrogram [0., 1., 2., ...]
138 std::vector<double> yAxisData(SPECTROGRAM_NUMBER_BANDS);
140 std::vector<double> yAxisData(SPECTROGRAM_NUMBER_BANDS);
139 std::iota(yAxisData.begin(), yAxisData.end(), 0.);
141 std::iota(yAxisData.begin(), yAxisData.end(), 1.);
140
142 for (auto & v:yAxisData)
143 {
144 v = std::pow(2,v);
145 }
141 return std::make_unique<SpectrogramCosinus>(std::move(yAxisData), Unit{"eV"},
146 return std::make_unique<SpectrogramCosinus>(std::move(yAxisData), Unit{"eV"},
142 Unit{"eV/(cm^2-s-sr-eV)"});
147 Unit{"eV/(cm^2-s-sr-eV)"});
143 }
148 }
@@ -70,7 +70,7 PYBIND11_MODULE(pytestmockplugin, m){
70
70
71 py::class_<VariableController2>(m, "VariableController2").def_static("createVariable",[](const QString &name,
71 py::class_<VariableController2>(m, "VariableController2").def_static("createVariable",[](const QString &name,
72 std::shared_ptr<IDataProvider> provider, const DateTimeRange& range){
72 std::shared_ptr<IDataProvider> provider, const DateTimeRange& range){
73 return sqpApp->variableController().createVariable(name, {{"cosinusType", "spectrogram"}, {"cosinusFrequency", "1.0"}}, provider, range);
73 return sqpApp->variableController().createVariable(name, {{"cosinusType", "spectrogram"}, {"cosinusFrequency", "0.1"}}, provider, range);
74 });
74 });
75
75
76 py::class_<TimeController>(m,"TimeController")
76 py::class_<TimeController>(m,"TimeController")
General Comments 0
You need to be logged in to leave comments. Login now