⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sunan.c

📁 su 的源代码库
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       *//* SUNAN: $Revision: 1.2 $ ; $Date: 2006/03/10 20:43:09 $        */#include <math.h>#include "su.h"#include "segy.h"/*********************** self documentation **********************/char *sdoc[]={"								"," SUNAN - remove NaNs & Infs from the input stream		","								","    sunan <in.su >out.su					","								"," Optional parameters:						"," verbose=1	echo locations of NaNs or Infs to stderr	","	        =0 silent					","								"," Notes:							"," A simple program to remove NaNs and Infs from an input stream."," The program sets NaNs and Infs to 0.0.			","								",NULL};/* * Author: Reginald H. Beardsley  2003   rhb@acm.org *  *  A simple program to remove NaNs & Infs from an input stream. They *  shouldn't be there, but it can be hard to find the cause and fix *  the problem if you can't look at the data. *  *//**************** end self doc ********************************/segy tr;int main(int argc, char **argv){	int i;			/* counter			*/	int itr=0;		/* trace counter		*/	int verbose;		/* =0 silent,  =1 chatty	*/	/* Initialize */   	initargs(argc,argv);   	requestdoc(1);	/* Get info from first trace */	if(!gettr(&tr) ) err("Can't get first trace \n");	/* Get parameters */	if(!getparint("verbose",&verbose))	verbose = 1;        	/* Loop over traces */	do{		++itr;      		for(i=0; i<tr.ns; ++i){		    if(!finite(tr.data[i])) {		       if(verbose) 	                warn("found NaN trace = %d  sample = %d", itr, i);            	       tr.data[i] = 0.0;		    }         	}      		puttr(&tr); 	} while(gettr(&tr));	return(CWP_Exit());}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -