61 #define ZERO_CHANNEL -1
89 st_print(
"Channel %d, already set\n", bad);
98 st_report(
"Added %d to BadChan Array", bad);
106 st_fail(
"Bad Chan Array Full");
122 st_report(
"Removing %d from Bad Chan Array", bad);
129 st_fail(
"Bad Chan %d not found in Bad Chan Array()", bad);
144 st_fail(
"autoBad(): Missing args");
183 if(fabs(*f - val) < 0.001)
212 st_fail(
"Looks like no scan has been loaded");
218 st_fail(
"Starting channel, %d, must be >= 0 & < %d", s, n);
225 st_fail(
"Modulo number, %d, must be >= 0 & < %d", m, n);
301 st_fail(
"Bad Chan must be >= 0");
320 sprintf(hint,
"Click Left Mouse Button to pick Bad Channel %d", i+1);
332 st_fail(
"Can't Add/Remove BadChan %d", bad);
414 char *string, line[256], fname[256];
419 st_warn(
"Missing arg for readIgnoreFile()");
425 if((fp = fopen(fname,
"r") ) <= (FILE *)0)
427 fprintf(stderr,
"Unable to open file %s\n", fname);
431 while((
string = fgets(line,
sizeof(line), fp)) != NULL)
455 st_fail(
"Can't Add/Remove BadChan %d", bad);
487 for(i=j;i<image->head.noint;i++)
491 return(image->yplot1[i]);
511 return(image->yplot1[i]);
527 for(i=0;i<image->head.noint;i++)
531 if(i > 0 && i < image->head.noint-1)
577 if(i == image->head.noint-1)
601 image->yplot1[i] = image->yplot1[i];
606 image->yplot1[i] = image->yplot1[i];
624 float cval, aval, ratio;
638 bzero((
char *)&guesses,
sizeof(guesses));
647 ratio = cval / boxout[i];
648 st_print(
"C[%3d] = %f, Avg = %f, ratio = %f", i, cval, aval, ratio);
650 if(ratio < 0.85 || ratio > 1.25)
665 st_print(
"Possible Bad Channels: ");
696 st_report(
"Upgrading Bad Channel Array[%d]", e);
758 st_warn(
"Missing arg for writeBadChans()");
764 if((fp = fopen(fname,
"w") ) <= (FILE *)0)
766 fprintf(stderr,
"Unable to open file %s\n", fname);
770 fprintf(fp,
"badch /c /i\n");
struct LP_IMAGE_INFO * h0
struct PARSE_STACK * args
int deNewLineIt(char *buf)
struct ENVIRONMENT envrs[MAX_ENV]
int printH_FlagHelp(char *cmd)
void boxcar(float *input, float *output, int len, int order)
float findPreGoodChan(struct LP_IMAGE_INFO *image, int j)
int badchans[MAX_BAD_CHANS]
int removeBadChanFromArray(int bad)
struct GLOBAL_MEMORY * CGM
int line_removeBadChans(struct LP_IMAGE_INFO *image, int print)
void subArgs(int wt, const char *fmt,...)
float findNextGoodChan(struct LP_IMAGE_INFO *image, int j)