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

📄 msr_unpack.3

📁 C编写的格式转换程序
💻 3
字号:
.TH MSR_UNPACK 3 2007/03/24 "Libmseed API".SH DESCRIPTIONUnpacking of Mini-SEED records..SH SYNOPSIS.nf.B #include <libmseed.h>.BI "int \fBmsr_unpack\fP ( char *" record ", int " reclen ", MSRecord **" ppmsr ",.BI "                 flag " dataflag ", flag " verbose " );.fi.SH DESCRIPTION\fBmsr_unpack\fP will unpack a Mini-SEED data record and populate aMSRecord data structure, optionally unpacking data samples.  Allmulti-byte quantities will be byte-swapped to the host byte order.The MSRecord data structure is described in \fBms_intro(3)\fP.The \fIreclen\fP parameter specifies the length of the data recordpointed to by \fIrecord\fP in bytes.If the \f*Ippmsr\fP pointer is NULL a new MSRecord will be allocated,if not the existing MSRecord will be reinitialized and reuseddestroying any previous contents.  The \fIppmsr\fP pointer itself mustnot be NULL.If the \fIdataflag\fP flag is not zero any data samples in the recordwill be unpacked/decompressed.  The following data encoding formatsare supported: ASCII, INT16, INT32, FLOAT32, FLOAT64, STEIM1 andSTEIM2.  The MSRecord.datasamples pointer will be set appropriatelyand the samples will be either ASCII, 32-bit integers, 32-bit floatsor 64-bit floats with the same byte order as the host machine.MSRecord.numsamples will be set to the actual number of samplesunpacked/decompressed.  MSRecord.sampletype will indicated the sampletype as either 'a' (ASCII), 'i' (32-bit integers), 'f' (32-bit floats)or 'd' (64-bit doubles).  The size of each sample type in bytes isreturned by the get_samplesize(3) lookup routine.The \fIverbose\fP flag controls verbosity, a value of zero will resultin no diagnostic output..SH UNPACKING OVERRIDESThe following macros and environment variables effect the unpacking ofMini-SEED:.nfMacros:MS_UNPACKHEADERBYTEORDER(X)MS_UNPACKDATABYTEORDER(X)MS_UNPACKDATAFORMAT(X)MS_UNPACKDATAFORMATFALLBACK(X)Environment variables:UNPACK_HEADER_BYTEORDERUNPACK_DATA_BYTEORDERUNPACK_DATA_FORMATUNPACK_DATA_FORMAT_FALLBACK.fiThe UNPACK_HEADER_BYTEORDER and UNPACK_DATA_BYTEORDER macros andvariables force the byte order of the header and data respectively.They could be set to either 0 (little endian) or 1 (big endian).  See\fBms_intro(3)\fP for a description of how libmseed determines arecords byte order.The UNPACK_DATA_FORMAT macro and variable forces the encoding format,this should be set to any of the supported formats codes (i.e. 10 =Steim-1 compression).The UNPACK_DATA_FORMAT_FALLBACK macro and variable defines an encodingformat that will be used when the SEED data record does not indicatethe format, i.e. the record does not include a 1000 blockette.  Bydefault the fallback encoding format is 10 (Steim-1 compression).  Ifthis default is invoked and the byte order of the data is unspecifiedbig endian byte order will be assumed.  If a data record does notinclude a 1000 blockette it is not Mini-SEED, the capability to readthese records is included only to support legacy data..SH RETURN VALUEOn the sucessful parsing of a record \fBmsr_unpack\fP returnsMS_NOERROR and populates the MSRecord struct at *ppmsr.  On error\fBmsr_unpack\fP returns a libmseed error code (defined in libmseed.h).SH EXAMPLESkeleton code for unpacking a Mini-SEED record with msr_unpack(3):.nfmain() {  MSRecord *msr = NULL;  char *record;  int reclen;  int retcode;  record = recordptr;   /* pointer to Mini-SEED record */  reclen = 4096;        /* 4096 byte record length */  /* Unpack record header and data samples */  retcode = msr_unpack (record, reclen, &msr, 1, verbose);  if ( retcode != MS_NOERROR )    fprintf (stderr, "Error parsing record\\n");  else    printf ("Unpacked %d samples\n", msr->numsamples);  /* Print record information */  msr_print (msr, verbose);  msr_free (&msr);}.fi.SH SEE ALSO\fBms_intro(3)\fP, \fBmsr_pack(3)\fP and \fBmsr_print(3)\fP..SH AUTHOR.nfChad TrabantIRIS Data Management Center.fi

⌨️ 快捷键说明

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