diff --git a/dsp.c b/dsp.c index 503e160..d5c3467 100755 --- a/dsp.c +++ b/dsp.c @@ -215,7 +215,7 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) { static int npv; static int synced = 0; static double max = 0.0; - static double minDoppler = 100; + static double minDoppler = 100, previous = 0; if(reset) synced = 0; @@ -241,10 +241,11 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) { FreqLine = 1.0+((ecorr-lcorr) / corr / PixelLine / 4.0); // Find the point in which ecorr and lcorr intercept - if(fabs(lcorr - ecorr) < minDoppler && fabs(lcorr - ecorr) > 2){ + if(fabs(lcorr - ecorr) < minDoppler && fabs(fabs(lcorr - ecorr) - previous) < 10){ minDoppler = fabs(lcorr - ecorr); *zenith = nrow; } + previous = fabs(lcorr - ecorr); // The point in which the pixel offset is recalculated if (corr < 0.75 * max) { diff --git a/pngio.c b/pngio.c index 8c146c2..1f20d6e 100644 --- a/pngio.c +++ b/pngio.c @@ -259,7 +259,7 @@ void prow2crow(float **prow, int nrow, char *palette, rgb_t **crow){ crow[y] = (rgb_t *) malloc(sizeof(rgb_t) * IMG_WIDTH); for(int x = 0; x < IMG_WIDTH; x++){ - if(*palette == NULL) + if(palette == NULL) crow[y][x].r = crow[y][x].g = crow[y][x].b = prow[y][x]; else crow[y][x] = applyPalette(palette, prow[y][x]); @@ -337,6 +337,10 @@ int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, c break; } } + + if(opts->map != NULL && opts->map[0] != '\0'){ + greyscale = 0; + } FILE *pngfile; @@ -380,8 +384,8 @@ int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, c // Move prow into crow, crow ~ color rows, if required rgb_t *crow[img->nrow]; - if(!greyscale) - prow2crow(img->prow, img->nrow, palette, crow); + if(!greyscale) + prow2crow(img->prow, img->nrow, palette, crow); // Apply a user provided color palette if(CONTAINS(opts->type, Palleted))