use crate::plot::PlotContext;
use plotly::color::NamedColor;
use plotly::common::{Marker, MarkerSymbol};
use plotly::layout::MapboxStyle;
use plotly::ScatterMapbox;
use rinex::prelude::Rinex;
pub fn plot_tec_map(data: &Rinex, _borders: ((f64, f64), (f64, f64)), plot_ctx: &mut PlotContext) {
let _cmap = colorous::TURBO;
for epoch in data.epoch() {
let lat: Vec<_> = data
.tec()
.filter_map(
|(t, lat, _, _, _)| {
if t == epoch {
Some(lat)
} else {
None
}
},
)
.collect();
let lon: Vec<_> = data
.tec()
.filter_map(
|(t, _, lon, _, _)| {
if t == epoch {
Some(lon)
} else {
None
}
},
)
.collect();
let _tec: Vec<_> = data
.tec()
.filter_map(
|(t, _, _, _, tec)| {
if t == epoch {
Some(tec)
} else {
None
}
},
)
.collect();
plot_ctx.add_world_map(
&epoch.to_string(),
true,
MapboxStyle::StamenTerrain,
(32.5, -40.0),
1,
);
let grid = ScatterMapbox::new(lat.clone(), lon.clone())
.marker(
Marker::new()
.size(3)
.symbol(MarkerSymbol::Circle)
.color(NamedColor::Black)
.opacity(0.5),
)
.name("grid");
plot_ctx.add_trace(grid);
}
}