From 1fb156c377f8ca898fc35bbbb69305d74449413c Mon Sep 17 00:00:00 2001 From: Cees Bassa Date: Thu, 3 Feb 2022 23:31:47 +0100 Subject: [PATCH] Improved error handling on SGPD4_ERROR --- rffit.c | 30 +++++++++++++++++++----------- rftrace.c | 24 ++++++++++++++++-------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/rffit.c b/rffit.c index 04e1431..f95f95f 100644 --- a/rffit.c +++ b/rffit.c @@ -197,9 +197,10 @@ int identify_satellite_from_doppler(char *catalog,double rmsmax) while (read_twoline(fp,0,&orb)==0) { // Initialize imode=init_sgdp4(&orb); - if (imode==SGDP4_ERROR) - printf("Error\n"); - + if (imode==SGDP4_ERROR) { + printf("Error with %d, skipping\n",orb.satno); + continue; + } // velocity(orb,d.p[d.n/2].mjd,d.p[d.n/2].s,&v,&azi,&alt); // if (alt<0.0) // printf("Continue?\n"); @@ -247,8 +248,10 @@ int identify_satellite_from_visibility(char *catalog,double altmin) while (read_twoline(fp,0,&orb)==0) { // Initialize imode=init_sgdp4(&orb); - if (imode==SGDP4_ERROR) - printf("Error\n"); + if (imode==SGDP4_ERROR) { + printf("Error with %d, skipping\n",orb.satno); + continue; + } if (orb.rev<10.0) continue; @@ -468,8 +471,10 @@ int main(int argc,char *argv[]) if (satno>0 && plot_curve==1) { // Initialize imode=init_sgdp4(&orb); - if (imode==SGDP4_ERROR) + if (imode==SGDP4_ERROR) { + printf("Error with %d, skipping\n",orb.satno); break; + } cpgsci(15); // for (mjd=d.mjd0,i=0;mjd0) { + rms=fit_curve(orb,ia); redraw=1; plot_curve=1; } @@ -1547,8 +1555,8 @@ double chisq(double a[]) // Initialize imode=init_sgdp4(&orb); - if (imode==SGDP4_ERROR) - printf("Error\n"); + if (imode==SGDP4_ERROR) + printf("Error with %d\n",orb.satno); // Loop over highlighted points for (i=0,sum1=0.0,sum2=0.0;i