##// END OF EJS Templates
Added Y log tag for Spectrograms...
jeandet -
r87:c6cf2dba079d
parent child
Show More
@@ -12,6 +12,7 class SCIQLOP_CORE_EXPORT SpectrogramTimeSerie
12 public:
12 public:
13 double min_sampling = std::nan("");
13 double min_sampling = std::nan("");
14 double max_sampling = std::nan("");
14 double max_sampling = std::nan("");
15 bool y_is_log = true;
15 using item_t =
16 using item_t =
16 decltype(std::declval<
17 decltype(std::declval<
17 TimeSeries::TimeSerie<double, SpectrogramTimeSerie, 2>>()[0]);
18 TimeSeries::TimeSerie<double, SpectrogramTimeSerie, 2>>()[0]);
@@ -26,10 +27,11 public:
26 SpectrogramTimeSerie::container_type<
27 SpectrogramTimeSerie::container_type<
27 SpectrogramTimeSerie::raw_value_type>&& values,
28 SpectrogramTimeSerie::raw_value_type>&& values,
28 std::vector<std::size_t>& shape, double min_sampling,
29 std::vector<std::size_t>& shape, double min_sampling,
29 double max_sampling)
30 double max_sampling, bool y_is_log = true)
30 : TimeSeries::TimeSerie<double, SpectrogramTimeSerie, 2>(t, values,
31 : TimeSeries::TimeSerie<double, SpectrogramTimeSerie, 2>(t, values,
31 shape),
32 shape),
32 min_sampling{min_sampling}, max_sampling{max_sampling}
33 min_sampling{min_sampling}, max_sampling{max_sampling}, y_is_log{
34 y_is_log}
33 {
35 {
34 _axes[1] = y;
36 _axes[1] = y;
35 }
37 }
@@ -233,7 +233,7 PYBIND11_MODULE(pysciqlopcore, m)
233 .def(py::init<const std::vector<std::size_t>>())
233 .def(py::init<const std::vector<std::size_t>>())
234 .def(py::init([](py::array_t<double> t, py::array_t<double> y,
234 .def(py::init([](py::array_t<double> t, py::array_t<double> y,
235 py::array_t<double> values, double min_sampling,
235 py::array_t<double> values, double min_sampling,
236 double max_sampling) {
236 double max_sampling, bool y_is_log) {
237 if(t.size() >= values.size() and t.size() != 0)
237 if(t.size() >= values.size() and t.size() != 0)
238 SCIQLOP_ERROR(decltype(py::self), "Doesn't look like a Spectrogram");
238 SCIQLOP_ERROR(decltype(py::self), "Doesn't look like a Spectrogram");
239 if(y.size() != values.shape(1))
239 if(y.size() != values.shape(1))
@@ -250,7 +250,7 PYBIND11_MODULE(pysciqlopcore, m)
250 shape.push_back(values.shape(1));
250 shape.push_back(values.shape(1));
251 return SpectrogramTimeSerie(std::move(_t), std::move(_y),
251 return SpectrogramTimeSerie(std::move(_t), std::move(_y),
252 std::move(_values), shape, min_sampling,
252 std::move(_values), shape, min_sampling,
253 max_sampling);
253 max_sampling, y_is_log);
254 }))
254 }))
255 .def("__getitem__",
255 .def("__getitem__",
256 [](SpectrogramTimeSerie& ts,
256 [](SpectrogramTimeSerie& ts,
General Comments 0
You need to be logged in to leave comments. Login now