wose / satnogs-monitor

Terminal UI monitor for your SatNOGS ground station.
GNU General Public License v3.0
78 stars 5 forks source link

Waterfall/Spectrum display seem to be different scale #30

Open wose opened 2 years ago

wose commented 2 years ago

image (Submitted by crazy_imp on irc)

wose commented 2 years ago

The waterfall widget does not interpolate between pixels, the spectrum widget does. This leads to an offset between the two displays depending on the available width for the waterfall widget:

// we do not interpolate between pixels so we just zoom slightly in and display
// the area.width pixel in the center of the waterfall
let start = (styles.len() - area.width as usize) / 2;
for (column, style) in styles
    .iter()
    .skip(start)
    .take(area.width as usize)
    .enumerate() {
        buf.set_string(
            area.left() + column as u16,
            area.top() + row as u16,
            PIX,
            *style,
        );
    }

We already try to scale the frequency down to almost the available width. We should stop doing this and instead scale to exactly the correct width and build the pixels using the max (since we don't want to loose narrow signals) between two scaled frequencies (columns).