ShangraoSun / binary2segy

地震裸数据到segy数据的转换. [translation: Seismic data to segy data conversion]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binary2segy

Convert binary to seismic files in SeismicUnix format

Rong Tao

  • some swap function
void swap_short_2(short *tni2);
void swap_u_short_2(unsigned short *tni2);
void swap_int_4(int *tni4);
void swap_u_int_4(unsigned int *tni4);
void swap_long_4(long *tni4);
void swap_u_long_4(unsigned long *tni4);
void swap_float_4(float *tnf4);
void swap_double_8(double *tndd8);
void swaphval(segy *tr, int index);
  • the important function that swap float
void swap_float_4(float *tnf4)
/**************************************************************************
swap_float_4		swap a float
***************************************************************************/
{
 int *tni4=(int *)tnf4;
 *tni4=(((*tni4>>24)&0xff) | ((*tni4&0xff)<<24) |
	    ((*tni4>>8)&0xff00) | ((*tni4&0xff00)<<8));
}

By the way

IT's just bytes order(little endian and big endian)

About

地震裸数据到segy数据的转换. [translation: Seismic data to segy data conversion]

License:GNU General Public License v3.0


Languages

Language:C 100.0%