pax_global_header00006660000000000000000000000064142204713510014511gustar00rootroot0000000000000052 comment=4314359aaf99857522c91f21cd13c00f961e4a70 iris-edu-libmseed-4314359/000077500000000000000000000000001422047135100152125ustar00rootroot00000000000000iris-edu-libmseed-4314359/.clang-format000066400000000000000000000002471422047135100175700ustar00rootroot00000000000000BasedOnStyle: LLVM AlwaysBreakAfterDefinitionReturnType: TopLevel SpaceBeforeParens: Always BreakBeforeBraces: Allman AlignConsecutiveAssignments: true ColumnLimit: 0 iris-edu-libmseed-4314359/.gitignore000066400000000000000000000006561422047135100172110ustar00rootroot00000000000000# Prerequisites *.d # Object files *.o *.ko *.obj *.elf # Linker output *.ilk *.map *.exp # Precompiled Headers *.gch *.pch # Libraries *.lib *.a *.la *.lo # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app *.i*86 *.x86_64 *.hex # Debug files *.dSYM/ *.su *.idb *.pdb # Kernel Module Compile Results *.mod* *.cmd .tmp_versions/ modules.order Module.symvers Mkfile.old dkms.conf iris-edu-libmseed-4314359/ChangeLog000066400000000000000000001313311422047135100167660ustar00rootroot000000000000002022.087: 2.19.8 - Update numsamples and samplecnt consistently in mst_addmsr(), #33 @pn2200 - Fix small compiler warnings. 2022.075: 2.19.7 - Avoid braceless multiple statements MS_SWAPBTIME macro usage. - Fix statement macros by @QuLogic. #73 - Simplification of byte swapping routines by @QuLogic. #74 - Avoid string buffer overflow warnings. - Makefile mods for CMake as ExternalProject by Sriram Sundararajan. - Encapsulate value of MS_NSTIME2EPOCH and MS_EPOCH2NSTIME macros. - Fix example mst_pack(). 2018.240: 2.19.6 - Allow ms_readleapsecondfile() to be called multiple times, by @pn2200 - Fix compiler warning in mst_printsynclist(). - Fix memory leak (on error) in msr_duplicate() and other fixes by @pn2200. 2017.283: 2.19.5 - msr_endtime(): calculate correct end time during a leap second. - Fixed signedness comparison warning. 2017.125: - Export LM_SIZEOF_OFF_T on Windows via libmseed.def. 2017.118: 2.19.4 - Add global LM_SIZEOF_OFF_T variable that is set to the size of the off_t data type as determined at compile time. 2017.075: 2.19.3 - Add missing public, global symbols to libmseed.map, thanks to Elliott Sales de Andrade. 2017.061: 2.19.2 - Provide install target in Makefile thanks to by Pierre Duperray. - Deprecate dynamic build target, the shared target will now build shared or dynamic (Darwin) libraries depending on the system. - Limit symbols exported in shared libraries to public interfaces as defined in libmseed.map, thanks again to Pierre Duperray. - Allow tests to work on Darwin with dynamic libraries. 2017.060: 2.19.1 - Derive versioning of shared/dynamic library from canonical version defined as LIBMSEED_VERSION in libmseed.h. - Apply updates to more standardized use of NAME and typos in man pages, submitted by Pierre Duperray. 2017.053: 2.19 - Incorporate lmplatform.h details into libmseed.h for improved usage. All that is needed is the static/shared/dynamic library and libmseed.h. - Avoid undefined left shifts of signed values that would go out of range and specify the types of some constants. 2016.290: - Remove dependency on ntwin32.mak for Windows nmake makefiles, now building works in plain MSVC development environments. 2016.286: 2.18 - Remove limitation on sample rate before calling ms_genfactmult() in the normal path of packing records. Previously generating the factor and multiplier was not attempted for rates higher than 32,767. 2016.281: 2.18rc4 - ms_genfactmult() now support a much larger range of integer sample rates and periods. - ms_genfactmult() now sets the factor and multiplier using the SECONDS/SAMPLE notation for sample rates less than 1.0 to retain precision for low rates. - ms_genfactmult() now assumes the specified rate is a sample period in seconds if the samprate value is negative. - Add ms_rsqrt64() as a general use reciprocal sqrt for doubles. - Use memcpy() instead of assignment when unpacking float32 and float64 samples to avoid problems with NaN's. Thanks Lion Krischer. - Add test for reading records without Blockette 1000. - Reformat all source code using included clang-format profile. 2016.277: - A more elegant sanity check for output length in packing by mbyt. 2016:276: 2.18rc3 - Improvements for test suite, more consistency. - Remove msr_decode_steim? from libmseed.def, they are internal. - Add sanity to length check before memset calls in packing functions. 2016:274: 2.18rc2 - Check for environment variables ENCODE_DEBUG and DECODE_DEBUG and set debugging output, at this point it is Steim frame details and differences being encoded/decoded. - Fix padding in steim[12] encoding routines. - Remove unneeded output buffer checks in steim[12] decoding routines. 2016.272: 2.18rc1 - Replace data sample packing and unpacking routines from qlib2 with new routines developed from scratch. All code is now LGPL licensed. - Add test suite with tests for encoding, decoding, parsing, etc. - Update licensing to GNU-LGPL version 3 and include (L)GPL licenses in LICENSE.txt. 2015.053: - Define needed C99 int types for MSVC 2012 or earlier. Previously this was only done for versions earlier than MSVC 2010. 2015.213: 2.17 - Round Fixed Section Data Header start time values to the nearest tenth of millisecond and restrict the microsecond offset value to a range between -50 and +49 as recommended in SEED. Previously start times were truncated at tenths of millisecond resolution and the microsecond offset value was between 0 and +99. This also addresses a bug where microsecond offsets were off by 100ms for times before Jan 1 1970. Thanks to Lion Krischer for reporting. Note to future hackers: the definition of HPTMODULUS governing the time tick interval for high precision time values implies that this tick interval may be changed. In reality, this should not be changed from the default, microsecond tick value without thorough testing. Some logic is know to be dependent on the microsecond tick. 2015.134: 2.16m - Add defines for needed integer types and macros from inttypes.h missing in older MSVC versions. MSVC 2010 and later appear to have enough C99 support. - Add define tests for _WIN32 and _WIN64 to cover all WINs. - ms_fread(): Add cast to quiet warning for conversion from size_t to int. In this case the read will always be <= MAXRECLEN, much smaller than int, making the conversion safe. 2015.113: 2.16 - Update minor release version in Makefile. 2015.108: - Cleanup of lmplatform.h removing unneeded headers and using C99 standard headers except for a few platform specific cases. - Convert all printf() and scanf() usage of %lld for 64-bit integers to use the C99 PRId64 and SCNd64 macros for portability (MinGW). - Change detection of Linux/Cygwin to set global define LMP_LINUX instead of LMP_GLIB2 (now marked as deprecated). - Change detection of Windows to set global define LMP_WIN instead of LMP_WIN32 (now marked as deprecated). - Add detection of __MINGW64__ define. - Tested building on Win7 with: Open Watcom 1.9, MinGW gcc 4.8.1 and Cygwin 1.7.35 (gcc 2.9.2). 2015.074: - Define NTP-Posix time epoch conversion constant specifically as a long long integer to avoid warnings on some compilers. 2015.070: 2.15 - Fix infinite loop if blockette chain is corrupt. Patch submitted by Elliott Sales de Andrade. 2015.062: 2.14 - Fix memory leak when msr_pack() returns after an error. Patch contributed by Larry Baker and Eric Thomas. - Change casting of values passed to isdigit() to int intead of unsigned character. Apparently this was consufing on ARM archs. 2015.061: - Add ms_readleapseconds() and ms_readleapsecondfile() routines to read a leap seconds file into an internal list. - Modify msr_endtime() to check for an internal leap second list, check for overlap with the record and adjust the end time as needed when leap seconds are present. When a leap second list is present any indication of positive leap seconds in the fixed section data header are ignored. 2014.248: - Add casting to size_t and int to avoid build warnings on certain build systems (e.g. older MS Visual Studio). The effective maximum sample buffer and record buffer size is ~2GB. 2014.234: 2.13 - Clean up Makefile and example/Makefile, remove all GCC-specific and debug targets. Makefiles are compatible with both GNU and BSD make. As before, the shared target works only for GCC-compatible compilers. Thanks to Elliott Sales de Andrade for pointing out that shared library targets did not work with parallel builds, prompting this clean up. 2014.197: 2.13rc - Support 128-byte record length by changing MINRECLEN to 128 (was 256). The current SEED specification is a minimum record length of 256-bytes, but there are cases (e.g. low latency data flow) using 128-byte records. - Add declarations, casting and string truncation to clear warnings uncovered in ObsPy testing (thanks to Elliott Sales de Andrade). 2014.074: - Add __CYGWIN__ defined test to Linux section of lmplatform.h. 2013.273: 2.12 - Add mst_convertsamples() and mstl_convertsamples() to convert sample types. When converting from float & double types to integer type a simple rounding is employed to compensate for machine representation of floating point numbers. 2013.267: - msr_endtime(): Check activity flags in fixed section of data header, if bit 4 is set then a positive leap occurred during the record and the end time should be reduced by one second to properly match the now shifted UTC time. As long as the next record in the series is properly marked with the correct UTC time no artificial time tear will be generated when reconstructing the time series. 2013.137: - Update docs for transition to 64-bit sample counts done in 2011! 2013.117: 2.11 - Initialize internal counters in mst_pack() to avoid their use in error conditions. Thanks to D. Ketchum and M. Potter for help. - Add 'const' qualifier to the msfile argument of the file reading and writing family of routines to stop compiler warnings resulting from generated binding functions. Thanks to M. Bach for reporting. 2013.056: 2.10 - Add more sanity checks to msr_unpack_data() to catch bad/corrupted data records and avoid crashes due to impossible pointer construction. 2013.053: 2.9 - Extend parsing of day-of-year style time strings to allow parsing of time fields separated by dashes in addition to allowing the day and time fields to be separated by a 'T' or space. Modifications were made to ms_seedtimestr2hptime(). - Extend parsing of year-month-day style time strings to allow parsing of time fields separated by commas. Modifications were made to ms_timestr2hptime(). 2013.050: - Add MS_ISVALIDYEARDAY() macro to test range for year and day values, years between 1900 and 2100 and days between 1 and 366. - Use new macro to determine when byte swapping is needed. This test leaves a non-determination of byte order for days 1, 256 and 257 in the year 2056, beware future data users. 2013.007: 2.8 (again) - Add msr_parse_selection() to libmseed.def for Windows builds. - Fix errors in pseudo code in doc/msr_parse.3. 2012.363: 2.8 - Implement msr_parse_selection() which is a wrapper of msr_parse() that searches for the first parsable miniSEED record in a memory buffer and returns it. Optionally a Selections list may be specified to limit the returned data to records matching specific criteria. 2012.357: - Fix corruption of float sample types when opposite byte order than host in certain architecture combinations. By not addressing individual float samples directly as floats prior to byte swapping we avoid the values being placed into the FPU where they may be corrupted. Thanks to Moritz Beyreuther and Lion Krischer for discovery and testing. - Expose the msr_unpack_data() function for use by removing the static declaration. Change verbose flag type to match others and document. - Fix some logging messages, typos, etc. 2012.138: 2.7 Add define for MINGW32 to use _fstat and _stat. 2012.114: 2.7rc2 - Change record parsing code to trim trailing spaces from network, station, location and channel parameters. Spaces in between non-space characters remain. 2012.111: - Update example/test.mseed to new data with an earthquake to make it more recognizable compared to ambient noise in the previous example. 2012.105: 2.7rc1 - Add many type casts to quiet newer GCC and MSVC compilers. For 32-bit programs there are some places, mostly in packing routines, where 64-bit integers are converted to 32-bit values for sample buffer sizes and counts leaving the potential for overflow. This will become a problem when byte counts for sample buffers are beyond 2^31, for 32-bit integer sample values that is more than 536 million samples. So programmer beware if using such buffer sizes for packing miniSEED. 2012.088: - When parsing records copy the ASCII string fields (sequence number, network, station, location, channel) directly without removing spaces. This makes the parser more lenient to unallowed characters and synchronizes read and write capabilities. - For sampling rates above 32,767 Hz only print a warning for high verbosity settings and set the sample rate factor and multipler to zero. Previously an error was printed during rational approximation. The expectation is that a record with such a high sample rate will include a blockette 100 to specify the actual sample rate. This is not an official convention for SEED, but is a kludge to support extremly high sample rates without printing errors. - Fix conversion to doubles in examples/msrepack.c. 2011.304: 2.6.2 - Increase precision of sample rate in SYNC printing routines to avoid trucation of rate values. 2011.262: - Add '_lm' suffix to declaration of pivotal_gmtime_r_stamp in genutils.c to avoid conflicts with other libraries. Thanks to Doug Neuhauser for the tip. 2011.164: - example/msrepack.c: add -N option to specify network code for output data records. 2011.160: - example/msrepack.c: make sure input buffer is flushed/packed, retain good input data when the end of the file contains bad data. 2011.158: - example/msrepack.c: convert samples to needed type for specified output encoding, e.g. integers to floats. - example/msrepack.c: do not open output file until after all options have been parsed to avoid clobbering the output file unnecessarily. 2011.144: 2.6.1 - Update dynamic library version. - Add notes to the users guide and intro about functions useful for detecting and parsing records in a memory buffer. 2011.129: - Correctly determine record lengths implied by presence of pack header by avoiding record header searches in buffer beyond pack header. - Fix ms_parse to return correct hint of how many more bytes are needed when record length has not been determined. - Change the samplecnt and numsamples elements of the MSRecord, MSTrace and MSTraceSeg structures to 64-bit integers to avoid overflow. 2011.124: - Allow lowercase 't' in ISO time string parsing. 2011.090: - Add check for invalid blockette offset in ms_detect(). 2011.056: 2.6 - Fix handling of sample data in internal MSTraceList routines. - Cleanup WIN32 defines, make MSVC and Open Watcom play nicely. - Default data byte order to big endian when blockette 1000 contains invalid byte order value, previously defaulted to host byte order. 2011.042: - Update libmseed.def to match current libmseed.h declaractions. - Cleanup to avoid MSVC warnings. 2011.039: 2.6rc4 - Do not return MS_NOTSEED when no records read from packed file. - Update user guide to include note about MSTraceLists and change the miniSEED creation example to use mst_writemseed(). 2011.036: 2.6rc3 - Fix parsing of records without blockette 1000, use pack headers and end-of-file to determine implied record lengths. 2011.032: 2.6rc2 - Fix handling of truncated records, partial reads at EOF. - Fix offset tracking when reading from stdin. 2011.006: 2.6rc1 - Add convience routines to only read selected records from a file: ms_readtracegroup_timewin() ms_readtracegroup_selection() ms_readtracelist_timewin() ms_readtracelist_selection() - Add convience routines to write Mini-SEED data to specified file: msr_writemseed() mst_writemseed() mst_writemseedgroup(). - Fix bug when either mst_pack() or mst_packgroup() was called with a NULL packedsamples pointer. - Fix bugs when (re)initializing read buffer. - Fix return of file position in ms_readmsr_main().. 2010.365: - Add internal ms_gmtime_r() to replace call to system gmtime_r(). The internal version handles dates beyond year 2038 and avoids the system call. Tested with years up to 5000. 2010.363: - Add parseutils.c source file. - Add msr_parse() to detect & unpack a record in a memory buffer. - Add ms_detect() to check a memory buffer for a record. - Rewrite ms_readmsr_main() to use msr_parse() and reduce I/O by using a double-buffer to increase the average read size and other simplifications and optimizations. The internal read buffer size is MAXRECLEN as defined in libmseed.h. Each file parameter structure used, including the global default, will allocate a buffer of this size. For specialized applications requiring low memory use the MAXRECLEN, current 1 MB, can be reduced. - Change ms_readmsr_main() to interpret reclen <= 0 as a request for autodetection of each record, a value of 0 no longer means all records are the same length as the first record. - Remove ms_find_reclen() function, replacement is ms_detect(). - Move ms_parse_raw() into parseutils.c. - Change year sanity check to allow range 1800 to 5000. - Use 64-bit values in hptime calculation to correctly handle years beyond 2038. - The "last" record indicator argument to the ms_readmsr() family is considered deprecated and will probably be removed in future releases. New programs should not use this functionality, it does not, and will never, work in cases where there is more than MINRECLEN padding after the last valid record in a file. 2010.304: - Use gmtime_r() to avoid the non-thread-safe system gmtime() function. - Define gmtime_r() for WIN32 and WIN64 in terms of gmtime() which is thread-safe under WIN32. - Add define for WIN64 even though WIN32 is probably defined for 64-bit. 2010.291: - Add check for spaces as valid characters in sequence numbers. 2010.253: - Add check for log parameters in ms_log_main(). 2010.129: - Fix small printing bug in diagnostic ms_printselections(). 2010.068: 2.5.1 - Allow file name for ms_readselectionfile() to be "-" and read stdin as a special case. 2010.047: 2.5 - Fix tracking of first and last MSTraceSeg entries in mstl_addmsr(). - Make the non-fatal Steim integrity failure and sample mismatch log output print as "Warning" instead of "ERROR". 2010.015: 2.4 - Change ms_addselect() to take a srcname argument and create ms_addselect_comp() as a wrapper that creates a srcname from individual source name components. 2010.012: - Fix unpacking of 16-bit integer encoded data, thanks to Robert Barsch. 2010.008: - Fix special case of "--" location ID in ms_addselect(). 2010.007: - Add SelectTime **ppselecttime argument to ms_matchselect() and msr_matchselect() routines so that the matching time range can optionally be returned to the caller. 2010.006: - Add a check for ATTRIBUTE_PACKED define (lmplatform.h) and if set add an __attribute__((packed)) qualifier to all structs that are mapped to SEED structures (and cannot be padded). This is useful on platforms such as ARM that pad structures for alignment by default. To use add "-DATTRIBUTE_PACKED" to CFLAGS or equivalent. - Fixes to gswapX() routines for platforms where structures are padded for alignment; patch from Laurence Withers, thanks. - Add msr_matchselect and ms_printselections() routine to selections.c. 2010.005: - Simplify packed file reading in ms_readmsr_main() and allow data sections to be skipped based on a Selection list, packed files are used internally at the IRIS DMC. - Rename ms_readmsr_r() to ms_readmsr_main() and create a simple wrapper function for ms_readmsr_r(). 2010.004: - Add selection.c containing routines to manage data selection lists based on network, station, location, channel, quality, start and end times. The name parameters may contain globbing charaters for matching. External routines are: ms_addselect(), ms_matchselect(), ms_readselectionfile() and ms_freeselections(). 2009.365: - Correctly track microsecond offset in Blockette 1001 when msr_pack() creates more than one record. 2009.357: - Reduce error accumulation of record start times in pack.c, thanks to Roman Racine for the report and suggested fix. The error only accumulated to significant values when packing a large number of records with a single call to msr_pack(). 2009.354: - Change return type of internal ms_readpackinfo() to off_t and fix small error return check. 2009.353: - Add ms_splitsrcname() routine to split "NET_STA_LOC_CHAN[_QUAL]" into separate components. - Update MINOR_VER version to 4 anticipating the 2.4 release (seem to have forgotten 3). 2009.201: 2.3 - msr_unpack(): change new blockette count and data offset test failures to "Warning" instead of "ERROR". 2009.194: 2.3rc - Fix record offset reporting when record length detection fails. - Add diagnostic reporting of data problems in ms_readmsr_r() by calling ms_parse_raw(). 2009.174: - Fix corner case trace sorting error in mstl_addmsr(). - Add ms_nomsamprate() to genutils.c to calculate the sample rate specified as a SEED sample rate factor and multiplier. - Add ms_parse_raw() implementing a simple validating parser to report invalid header values and print raw header fields. - msr_unpack(): add tests for blockette count and data offset. - Change byte swapping test of year to 1920 to 2050 range. - Store blockette offset in BlktLink structure. 2009.111: 2.2 - Add CDSN decoding support due to popular demand. - Incorporate enhanced dynamic library versioning as recommended by Laurence Withers. - Fix bug in ASCII encoding routine, thanks again Laurence Withers. - Add and update libmseed.def which can be used with the Win32 DLL for linking, original file contributed by Robert Barsch. 2008.361: 2.2rc3 - Improve mstl_addmsr() sorting and suturing logic so that it matches the healed and sorted output from the trace group routines. 2008.327: 2.2rc2 - Add ms_readtracelist() to read all records from a file into a MSTraceList. - Update all man pages with changes and add new man pages. - Fix auto sorting of traces in mstl_addmsr(). 2008.320: 2.2rc - Add MSTraceList facility which is functionally equivalent to the existing MSTraceGroup facility but more efficiently populated, especially when data records are in time order or the time series are very gappy. The MSTraceList related functions are prefixed with "mstl_" and exist in the new source file tracelist.c. - Add mst_printsynclist() and mstl_printsynclist() functions to print trace segment lists in SYNC format. 2008.318: - Change one call in fileutils.c to fseeko() to lmp_fseeko() so Win32 builds work again. 2008.313: - Optimize mst_findadjacent() by first testing for time segment match, then sample rate and finally source name components. 2008.283: 2.1.7 - Allow a caller of ms_readmsr()/ms_readmsr_r() to specify a starting offset into the file by setting the value pointed to by the fpos argument to a negative value (interpreted as a positive offset). 2008.220: 2.1.6 - Optimize Steim 1 & 2 encoders significantly by using small local working buffers and eliminating many redundant calculations. Thanks to Jean-Francois Fels. 2008.171: - Add Matlab/GNU Octave interface routines, thanks to Stefan Mertl. - Remove 'const' qualifier from argument of log printing function pointers, too many useless compiler warnings. 2008.163: - Allow data record sequence numbers to be NULL values in addition to ASCII numbers. 2008.161: 2.1.5 - Fix string parsing error for IRIS DMC packed files, thanks Sandy! - Use a merge sort algorithm insteam of the bubble sort previsouly used in mst_groupsort(), better performance. - Do raw string manipulation in msr_srcname() and mst_srcname() instead of using sprintf(), slightly better performance. - Do raw string comparison in mst_findmatch() for better performance. 2007.228: 2.1.4 - Include compression history for Steim encodings by tracking the last sample value packed for each data stream. For the first record of a stream, a cold-start, the first difference is zero. This included the addition of a StreamState struct and associated pointers for MSRecord and MSTrace which get allocated during packing routines. - Do not adjust start time of record header during packing when sampling rate is zero or negative. - Add ms_hptime2mdtimestr() and ms_btime2mdtimestr routines to create time strings in month-day format, this is the same as the ISO format without the 'T' between the date and time. - Add a 'subsecond' flag argument to all ms_hptime2 routines to control the addition of sub-second precision. 2007.178: 2.1.3 - Fix log message bug for unknown encoding format while unpacking, this could cause certain systems to segfault if encountered. - Rename MS_UNPACKENCODINGFORMATFALLBACK macro to MS_UNPACKENCODINGFALLBACK to match the actual variable name. - Fix handling of fallback encoding format in unpack.c, worked earlier but had regressed to a broken state. - Remove declaration for lmp_strerror() which does not exist. 2007.148: 2.1.2 - Use calloc instead of malloc to allocate and clear a fsdh_s in msr_pack_header_raw() when none is available in the passed MSRecord. Previously this could result in a subtle bug for systems where malloc'd memory is not zeroed. This would only have effected programs that were creating Mini-SEED in a particular way. 2007.138: 2.1.1 - Create LMP_BSD platform definition to cover the BSDs including Apple Mac OS X, this replaces LMP_DARWIN. Specifically FreeBSD, OpenBSD, NetBSD and Apple are detected for this platform. 2007.118: - Add msr_duplicate() function to duplicate an MSRecord struct. - Use msr_duplicate() in example/msrepack.c example program to track the most current MSRecord as a template for packing. 2007.102: 2.1 - Removed caveat comment from mst_groupheal() man page. 2007.083: - mst_groupheal() now sorts the MSTraceGroup before it tries to heal the traces, this increases the chances of healing all possible segments. - msr_pack(): add void *handlerdata argument that wil be passed directly to the record_handler(), this is intended to allow private data to be passed from the msr_repack() caller to the record handling routine. - mst_pack(): add void *handlerdata argument that is passed directly to msr_pack() and used as described above. - mst_packgroup(): add void *handlerdata argument that is passed directly to mst_pack() and used as described above. - Add macros for setting the pack & unpack, header & data byte order override variables: MS_PACKHEADERBYTEORDER(X), MS_PACKDATABYTEORDER(X), MS_UNPACKHEADERBYTEORDER(X) and MS_UNPACKDATABYTEORDER(X). - Add macros for setting the unpack encoding format override and encoding format fallback variables: MS_UNPACKENCODINGFORMAT(X) and MS_UNPACKENCODINGFORMATFALLBACK(X). 2007.074: - Fix typos in the docs referring to msr_readtraces() that should be ms_readtraces(), thanks Richard Boaz. 2007.034: - mst_groupheal(): fix removal of first trace in group. - mst_groupheal(): reset MSTrace data quality indicator when merged traces do not have matching qualities. 2007.030: 2.0 - Set no default CFLAGS and CC variables for building and add a note to the Makefile about using them for build configuration. - Eliminate compiler warning for genutils.c routines. 2007.028: - Add new pack file type 8. - Allow 'M' as a valid data record indidator/quality flag. 2007.023: - Determine needs for GEOSCOPE decoding and remove the need for using the pow() function and linking with the math library. 2007.005: - Fix resetting of global MSFileParam in ms_readmsr_f() when cleanup is requested. 2006.363: - Change mst_groupsort() to sort on: srcname, then starttime, then descending endtime and finally sample rate. This moves sample rate to the end of the criteria, the previous order was: srcname, sample rate, starttime and endtime. 2006.354: 2.0rc1 - Stamp 2.0rc1. - Fix diagnostic printing bug in pack.c. - Fix ms_gswap.3 man page. 2006.346: - Change "get_" prefix for lookup routines to "ms_". - Change ms_encoding() to ms_encodingstr(). - Document ms_errorstr() in the lookup and other man pages. - Document and use ms_log(3) in User Guide/ms_intro(3). 2006.344: - Add "ms_" prefix to gswap routines. - Change SWAPBTIME macro to MS_SWAPBTIME. 2006.339: 2.0pre8 - Add buffer length sanity check in ms_find_reclen() suggested by Doreen Pahlke. - Change mst_printracelist() and mst_printgaplist() to print "-0" when the gap is 0 (one sample overlap) and "==" when there is no gap. 2006.332: - Add memory allocation checks, every allocation is now tested. - Fix usage message for example programs, use fprintf for the long section of the output. 2006.331: 2.0pre7 - Add source name to all unpacking error and diagnostic messages. - Add source name to all packing error and diagnostic messages. - Reorganize sanity check code in msr_unpack() to use the MS_ISVALIDHEADER macro. - Add ms_recsrcname() function to calculate the source name for an unpacked record. 2006.326: 2.0pre6 - Add ms_readmsr_r() as a reenentrant, thread safe version of what ms_readmsr() used to be and make ms_readmsr() a wrapper for the new reentrant version that uses global file reading parameters. - Use ms_readmsr_r() in ms_readtraces() so that it's now thread safe too. - Add logging.c routines and declarations in libmseed.h. This constitutes a new logging facility that is used throughout the library and can be used by libmseed based programs. The facility allows the caller to redirect all the log, diagnostic and error output from the library to specific functions. The facility also allows user specifed prefixes for all output messages. 2006.321: - Prefix all data encoding type defines with DE_ to avoid collision. - Add GEOSCOPE (three subtypes), SRO and DWWSSN data decoders, there are no encoders for these types. - Need of the pow() function now requires linking with -lm (math lib). 2006.312: 2.0pre5 - Add MS_ISVALIDBLANK macro to libmseed.h to test memory for valid blank/noise records: valid sequence number followed by ASCII spaces. - Use MS_ISVALIDBLANK in ms_find_reclen() to implicitly find record lengths, when reading ahead the record length can now be determined if then next record is a real data record or a blank record. - Use MS_ISVALIDBLANK in ms_readmsr() to print out a more specific message when skipping blank records as opposed to non-data records records. 2006.311: 2.0pre4 - Use MS_ISVALIDHEADER instead of MS_ISDATAINDICATOR when verifying data records when the record length is not autodetected in ms_readmsr(). - In msr_unpack_data() move the test of reallocation directly after the reallocation so it's only tested when actually done. - In msr_unpack_data() include text description of encoding in the unsupported encoding error message. 2006.296: 2.0pre3 - Add 'quality' flag argument to mst_srcname() to control the addition of the quality indicator in the srcname. - Add 'quality' flag argument to mst_groupsort() to control the inclusion of quality indicator in the sorting. 2006.292: 2.0pre2 - Use memory-aligned swap functions in unpackdata.c for speed. 2006.291: - Fix return type of ms_readtraces() on success and documentation. - Tweak verbose flag checking in fileutils.c to avoid spurious msgs. - Add gcc32gprof and gcc64gprof targets to Makefiles for profiling. 2006.284: 2.0pre - Fix dynamic target and update API version in Makefile. - Require GCC for shared and dynamic library building. - Include ctype.h header in lmplatform.h for WIN32 platform. 2006.283: - Add function msr_normalize_header() to update the FSDH and blockettes with values at the MSRecord level. - Add 'normalize' flag argument to msr_pack_header() control the calling of msr_normalize_header() when packing. - Change the MSRecord element 'private' to 'prvtptr' to avoid collision with the C++ reserved word. - Add a 'quality' flag argument to msr_srcname() to control the addition of the quality indicator to the srcname. - Move MS_ISVALIDHEADER(X) macro to libmseed.h for general use; this macro tests for valid SEED data record signatures and is used for detection of data records when reading data from files. - Remove two redundant tests of swapflag in Steim-1 decompression. - Declare starttime in msr_starttime() as hptime_t instead of double, testing indicates that this never caused a problem in practice. - Update example programs for API changes. - Add -fPIC to GCCFLAGS in Makefile. - Remove declaration for non-existent ms_verify_header() in libmseed.h (thanks LLoyd Carothers). 2006.251: - Add correct swapping of fsdh.numsamples and fsdh.data_offset, problem and fix reported by Doreen Pahlke (thanks!). This fixes packing of data when packing to a byte-order opposite of the host machine. 2006.208: version 1.8 - Fix memmove bounds for out-of-time-order data additions in both mst_addmsr() and mst_addspan(). - Fix memory leak in mst_pack() by freeing the temporary MSRecord when no template is used. - Add get_errorstr() function in lookup.c to return text descriptions for specified libmseed return/error codes. - Add gcc32, gcc32debug and gcc64debug targets to Makefiles. 2006.182: version 1.7 - Add MS_WRONGLENGTH error code and have msr_unpack() and the file reading routines return it when the read length does not match length specified in the Blockette 1000. This most commonly occurs when either the specified record length or the length of the first record is auto detected and the following record lengths assumed do not match the actual records. - Use MS_ISRATETOLERABLE macro in mst_groupsort() to compare the sampling rates of adjacent trace segments. This is how sampling rates are compared in other routines and will avoid problems associated with testing the equality of floating point values. 2006.173: - Remove some of the useless error codes. - Steim compression integrity check failure and sample count mismatch are not fatal unpacking errors, only warnings are printed. 2006.172: - Changed return type of ms_readmsr() to int and added a pointer to a pointer to an MSRecord to the arguments. Function now returns status/error codes. - Changed return type of ms_readtraces() to int and added a pointer to a pointer to an MSTraceGroup to the arguments. Function now returns status/error codes. - Changed return type of msr_unpack() to int. Function now returns status/error codes. - Changes to many internal functions to support the new unpacking error code bubble. - Removed the MSRecord.unpackerr element as it is now unneeded. - Found and fixed bug resulting in the assumption that all sample sizes were 8 bytes (which would usually be wrong) during unpacking. 2006.124: version 1.6.3 - Fix (int *)packedsamples handling for packing routines. - Fix compilation under Open Watcom (Win32). 2006.122: version 1.6.2 - More fixes for sampling rate == 0 when calculating the sample period. 2006.121: version 1.6.1 - msr_endtime() now checks that the sample count is greater than zero. If the sampling rate or sample count is less than or equal to zero msr_endtime() returns the starttime. 2006.115: version 1.6 - Rename mst_heal() to mst_groupheal(). - Change examples for ms_readtraces() in documentation that implied an incorrect return type. - Small changes to error messages for clarity (e.g. add file read offset, print sample types as char not int). - Fix offset determination for packed files and files without blockette 1000s. 2006.107: - Add MS_ISVALIDHEADER macro to fileutils.c, verifies that a specified buffer contains a valid fixed section data header. - ms_find_reclen(): moved to fileutils.c - ms_find_reclen(): More data record verification by checking for valid time values (e.g. 0 <= hour <= 23 ). - ms_find_reclen(): Detect record lengths even when no blockette 1000 is found by reading the next 48 bytes from the file and looking for another record header or EOF. This check is not performed if the specified FILE pointer is NULL. The original file read position is restored. This required adding another argument: FILE *fileptr. - Change output of msr_print() to include record length for the lowest detail output (single line per record). - Change example msview program to autodetect each record by default. 2006.082: version 1.5.2 - Make msr_pack() emit a warning with the function pointer to the record_handler() is not set instead of bombing out. The packed record is not accessible any other way. - Make the packedsamples argument to msr_pack() optional, the pointer can be NULL if this information is not needed. - Modify ms_readmsr() to be able to read packed files which are indexed files used internally at the IRIS-DMC and probably no where else. - Add lmp_fseeko() portable function (used in fileutils.c). 2006.079: version 1.5.1 - Add file name check in ms_readmsr() to make sure subsequent reads are done on the same file. If the function is called with a different file name than the file that is currently open the current file will be closed and the new one opened and an error message printed. - Change mst_srcname to include the data quality code in the srcname if it is non-zero. - Remove the data quality code specifics from mst_print* functions as it is now included in the source name. 2006.076: version 1.5 - No changes, just stamp 1.5. 2006.058: - Change structure names: * Trace -> MSTrace * TraceGroup -> MSTraceGroup * MSrecord -> MSRecord A bothersome change, but it will ease inclusion into source base of other libraries, etc. - Change struct fsdh.drec_indicator to fsdh.dataquality. - Change MSRecord.drec_indicator to MSRecord.dataquality. - Add MSTrace.dataquality element. - Add data quality matching flag arguments to ms_readtraces() and mst_addmsrtogroup() to control matching of data qualities. - Add data quality value arguments to mst_findmatch() and mst_findadjacent() to control matching of data qualities. - Modify mst_printtracelist() and mst_printgaplist() to include data quality flags in their output when they have been set. 2005.336: 1.4.5 - Improve the data record verification in ms_find_reclen() to improve the detection of non-data versus data records. In particular the routine now requires a record to start with 6 ASCII digits followed by a valid data record indicator followed by either a space or NULL character (even though a NULL here is not valid SEED). - Fix mst_groupsort for near srcname matches. 2005.325: 1.4.4 - Add end time sort level to mst_groupsort(), now the function will sort on: source name, sample rate, start time and descending end time in that order. 2005.315: 1.4.3 - Include WIN32 define for strcasecmp->_stricmp. - Fix typo in blockette 200 printing. 2005.300: 1.4.2 - Include sys/types.h for Win32 systems in lmplatform.h and do not typedef off_t. 2005.299: 1.4.1 - In mst_findadjacent() do not perform the time and sample rate tolerance checks if the tolerance is specified as -2.0. - Remove the msi.c example program, it has diverged from the separate released msi. 2005.292: 1.4 - In mst_addmsr() and mst_addspan() test if data sample memory needs to be moved before moving, allows adding an msr to a trace which has no data samples (e.g. a flushing pack has been done). - Do not try to pack Traces with numsamples==0 in mst_packgroup(). 2005.289: - Add check for sample count mismatch and decrement mst->samplecnt when packing in mst_pack(). - Free mst->private in mst_init(). 2005.271: 1.3 - Add lmplatform.[ch] to hold platform dependent defines and portability routines. - Create lmp_ftello() portable routines and use it. - Change all uses of fopen() to include a 'b' in the mode in order to open files in "binary" mode on Win32. - Add Makefile.wat for Open Watcom's wmake. - Add Makefile.win for Microsoft's nmake. - Test using Open Watcom 1.3 under Win32 (Windows XP). - Add 'dynamic' target in Makefile to build a dynamic lib on Mac OSX. 2005.269: 1.2 - Update many unpacking routines so that the MS_SAMPMISMATCH error code is correctly returned and that none of the errors are show stoppers, it is left to the application to decide. - Remove error message when read fails during detection, the end of the file is simply that, no error. - Fix definition of MS_EPOCH2HPTIME and MS_HPTIME2EPOCH in ms_time.3 man page. - Change int64_t types to hptime_t types in documentation. 2005.203: 1.1 - Add 'chainpos' argument to msr_addblockette() to control which end of the blockette chain the blockette is added to. - Change msr_pack() to add any missing 1000 Blockettes to the end of the blockette chain. 2005.201: 1.0 Final - Change version of example programs so they don't conflict with future, non-example versions. - Generate links to man pages and tar up a source package. - No library code changes since pre6. 2005.173: 1.0pre6 - Set MSrecord->reclen to -1 in msr_init() to trigger the default value in msr_pack(), etc. 2005.157: 1.0pre5 - Fix off-by-one error in number of samples for overlaps. 2005.146: 1.0pre4 - Add check for an UNPACK_DATA_FORMAT_FALLBACK environment variable that defines a fallback format for when no encoding format is specified in the data record (no blkt 1000). - Set a default format fallback encoding of 10 (Steim 1). If this default gets invoked, the byteorder will fallback to big-endian if it has not been specified. - Change the MS_EPOCH2HPTIME(X) and MS_HPTIME2EPOCH(X) macro definitions to not include a semi-colon, duh. - Add a 'timeformat' flag to the mst_printtracelist() and mst_printgaplist() functions that indicates which format the time stamp will be in: SEED time, ISO time or epoch. - Add an option to msi to specify the time format in trace and gap listings. 2005.117: 1.0pre3 - Add check for the following environment variable to force the data encoding format when unpacking: UNPACK_DATA_FORMAT = data encoding format - Add '-e' option to msi/msrepack to specify the input data encoding format allowing them to work with plain data records. - Define _LARGEFILE_SOURCE in fileutils.c to get ftello() without a compiler warning on Linux. - Fixup swapping when byte order is forced on LE arch. 2005.116: 1.0pre2 - Add checking for the following environment variables that can be used to force the byte-order for the header and data: PACK_HEADER_BYTEORDER = 0 or 1 PACK_DATA_BYTEORDER = 0 or 1 UNPACK_HEADER_BYTEORDER = 0 or 1 UNPACK_DATA_BYTEORDER = 0 or 1 - Change the fpos argument to ms_readmsr() to be type off_t. - Change the calls to ftell() in ms_readmsr() to ftello() to return type off_t, this is required for large file support where 64-bit offsets are needed. - Change the header byte order determination to check for start years between 1920 and 2020. - Add gcc64 target to Makefile and example/Makefile. 2005.102: 1.0pre1 - Change msr_pack() to use a 'D' record indicator by default. - Cleanup examples directory. 2005.097: 0.9.9b - Remove '-g' from common GCCFLAGS in examples/Makefile. - Small update to ms_time.3 to clarify that MS_HPTIME2EPOCH can be used to get both a truncated integer epoch or a double precision epoch. 2005.093: 0.9.9a - Remove '-g' from common GCCFLAGS in Makefile. 2005.091: 0.9.9 - Fix printing of Blockette 500. - Change macro defines to upper case macro names. 2005.080: 0.9.8 - Add ms_isratetolerable() macro to perform the default sample rate tolerance check. Update appropriate functions. - Fix sample rate checking in mst_print*() functions. - Fix msi example code so negative min/max gaps (overlaps) are parsed correctly from command line. 2005.069: 0.9.7 - Change mst_print() to mst_printtracelist() and add mst_printgaplist(). - Both of the above routines now report gaps as the time of the first sample after the gap minus the time of the last sample before the gap, sample "coverage" time is no longer included. - Make mst_groupsort() sort on source->samplerate->starttime instead of source->starttime. - ms_readmsr() will now skip non-data records when doing record length autodetection. - Add ms_hptime2epoch() macro to convert hptimes to Unix/POSIX epoch times, integer truncation, no rounding. - Add macro ms_isdataindicator() which tests a character for a valid data record header indicator (D,R,Q,etc.) - Example program msi now takes -min and -max options to specify min and max gap/overlap to display in gap list. 2005.047: 0.9.6 - Add ms_epoch2hptime() macro to convert Unix/POSIX epoch times to hptimes. 2005.025: 0.9.5 - Add 'skipnotdata' flag argument to ms_readmsr() and ms_readtraces() and update their respective man pages. - Shuffle order of arguments for ms_readtraces(), no big deal but since the interface was changing anyway... 2005.004: 0.9.4 - Change printing of sample rates to print higher precision so that small differences in rates are noticeable. - Change fixed section header printing of sample rate to be the actual calculated value using the factor and multiplier. - Spell check README/INSTALL files and man pages. - Remove WIN32 Makefiles and hooks in example sources. - Minor printing fixups in the example code msi.c. 2004.352: 0.9.3 - Change ms_readmsr() to search valid record lengths up to 8192 bytes when auto detecting the record size. - Change msr_addblockette() to always add Blockette 1000s to the beginning of the blockette chain and others to the end of the blockette chain. 2004.349: - Fix reduction of precision when unpacking doubles. - Change typo in pack.c from 'Unpacking' to 'Packing'. - Improve printing of float/double samples in msi. 2004.342: 0.9.2 - Add proper rounding for span calculation in msr_endtime(). 2004.341 - Release version 0.9.1 iris-edu-libmseed-4314359/INSTALL.md000066400000000000000000000025411422047135100166440ustar00rootroot00000000000000 The library requires that C99 integer types are available on the target computer. Specifically the int8_t, int16_t, int32_t, int64_t and their unsigned counterpart types. ## Unix, Linux, macOS A simple 'make' on most Unix-like systems should build the library. The included Makefile should work for most Unix-like environments and most make variants. It is know to work with GNU make, which, if not the default, is sometimes installed as gmake. The CC, CFLAGS, LDFLAGS and CPPFLAGS environment variables can be set to control the build. By default a statically linked version of the library is built: 'libmseed.a'. With GCC, clang or compatible build tools it is possible to build a shared library with 'make shared'. A simple install method for the shared library can be invoked with 'make install'. By default the installation destination is /usr/local. The install destination may be specified using the PREFIX variable, for example: make install PREFIX=/path/to/install/ ## Windows (Win32) On a WIN32 platform the library can be compiled by using the Nmake compatible Makefile.win (e.g. 'nmake -f Makefile.win') or Open Watcom's Wmake with Makefile.wat (e.g. 'wmake -f Makefile.wat'). The default target is a static library 'libmseed.lib'. The library has been tested with Open Watcom 1.8. A libmseed.def file is included for use building and linking a DLL. iris-edu-libmseed-4314359/LICENSE.txt000066400000000000000000001237621422047135100170500ustar00rootroot00000000000000libmseed is licensed under the LGPL v3.0, i.e. it is licensed with the GPL v3.0 and the additional set of permissions granted by the LGPL v3.0 license. This file contains both licenses. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. iris-edu-libmseed-4314359/Makefile000066400000000000000000000065501422047135100166600ustar00rootroot00000000000000 # Build environment can be configured the following # environment variables: # CC : Specify the C compiler to use # CFLAGS : Specify compiler options to use # LDFLAGS : Specify linker options to use # CPPFLAGS : Specify c-preprocessor options to use # Extract version from libmseed.h, expected line should include LIBMSEED_VERSION "#.#.#" MAJOR_VER = $(shell grep LIBMSEED_VERSION libmseed.h | grep -Eo '[0-9]+.[0-9]+.[0-9]+' | cut -d . -f 1) FULL_VER = $(shell grep LIBMSEED_VERSION libmseed.h | grep -Eo '[0-9]+.[0-9]+.[0-9]+') COMPAT_VER = $(MAJOR_VER).0.0 # Default settings for install target PREFIX ?= /usr/local EXEC_PREFIX ?= $(PREFIX) LIBDIR ?= $(EXEC_PREFIX)/lib INCLUDEDIR ?= $(PREFIX)/include DATAROOTDIR ?= $(PREFIX)/share DOCDIR ?= $(DATAROOTDIR)/doc/libmseed MANDIR ?= $(DATAROOTDIR)/man MAN3DIR ?= $(MANDIR)/man3 LIB_SRCS = fileutils.c genutils.c gswap.c lmplatform.c lookup.c \ msrutils.c pack.c packdata.c traceutils.c tracelist.c \ parseutils.c unpack.c unpackdata.c selection.c logging.c LIB_OBJS = $(LIB_SRCS:.c=.o) LIB_LOBJS = $(LIB_SRCS:.c=.lo) LIB_NAME = libmseed LIB_A = $(LIB_NAME).a OS := $(shell uname -s) # Build dynamic (.dylib) on macOS/Darwin, otherwise shared (.so) ifeq ($(OS), Darwin) LIB_SO_BASE = $(LIB_NAME).dylib LIB_SO_MAJOR = $(LIB_NAME).$(MAJOR_VER).dylib LIB_SO = $(LIB_NAME).$(FULL_VER).dylib LIB_OPTS = -dynamiclib -compatibility_version $(COMPAT_VER) -current_version $(FULL_VER) -install_name $(LIB_SO) else LIB_SO_BASE = $(LIB_NAME).so LIB_SO_MAJOR = $(LIB_NAME).so.$(MAJOR_VER) LIB_SO = $(LIB_NAME).so.$(FULL_VER) LIB_OPTS = -shared -Wl,--version-script=libmseed.map -Wl,-soname,$(LIB_SO_MAJOR) endif all: static static: $(LIB_A) shared dynamic: $(LIB_SO) # Build static library $(LIB_A): $(LIB_OBJS) @echo "Building static library $(LIB_A)" $(RM) -f $(LIB_A) $(AR) -crs $(LIB_A) $(LIB_OBJS) # Build shared/dynamic library $(LIB_SO): $(LIB_LOBJS) @echo "Building shared library $(LIB_SO)" $(RM) -f $(LIB_SO) $(LIB_SO_MAJOR) $(LIB_SO_BASE) $(CC) $(CFLAGS) $(LDFLAGS) $(LIB_OPTS) -o $(LIB_SO) $(LIB_LOBJS) ln -s $(LIB_SO) $(LIB_SO_BASE) ln -s $(LIB_SO) $(LIB_SO_MAJOR) test check: static FORCE @$(MAKE) -C test test clean: $(RM) $(LIB_OBJS) $(LIB_LOBJS) $(LIB_A) $(LIB_SO) $(LIB_SO_MAJOR) $(LIB_SO_BASE) @$(MAKE) -C test clean @echo "All clean." install: shared @echo "Installing into $(PREFIX)" @mkdir -p $(DESTDIR)$(PREFIX)/include @cp libmseed.h $(DESTDIR)$(PREFIX)/include @mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig @cp -a $(LIB_SO_BASE) $(LIB_SO_MAJOR) $(LIB_SO_NAME) $(LIB_SO) $(DESTDIR)$(LIBDIR) @sed -e 's|@prefix@|$(PREFIX)|g' \ -e 's|@exec_prefix@|$(EXEC_PREFIX)|g' \ -e 's|@libdir@|$(LIBDIR)|g' \ -e 's|@includedir@|$(PREFIX)/include|g' \ -e 's|@PACKAGE_NAME@|libmseed|g' \ -e 's|@PACKAGE_URL@|http://ds.iris.edu/ds/nodes/dmc/software/downloads/libmseed/|g' \ -e 's|@VERSION@|$(FULL_VER)|g' \ mseed.pc.in > $(DESTDIR)$(LIBDIR)/pkgconfig/mseed.pc @mkdir -p $(DESTDIR)$(DOCDIR)/example @cp -r example $(DESTDIR)$(DOCDIR)/ @cp doc/libmseed-UsersGuide $(DESTDIR)$(DOCDIR)/ @mkdir -p $(DESTDIR)$(MAN3DIR) @cp -a doc/ms*.3 $(DESTDIR)$(MAN3DIR)/ .SUFFIXES: .c .o .lo # Standard object building .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ # Standard object building for shared library using -fPIC .c.lo: $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c $< -o $@ FORCE: iris-edu-libmseed-4314359/Makefile.wat000066400000000000000000000030721422047135100174460ustar00rootroot00000000000000# # # Wmake File For libmseed - For Watcom's wmake # Use 'wmake -f Makefile.wat' .BEFORE @set INCLUDE=.;$(%watcom)\H;$(%watcom)\H\NT @set LIB=.;$(%watcom)\LIB386 cc = wcc386 cflags = -zq lflags = OPT quiet OPT map cvars = $+$(cvars)$- -DWIN32 # To build a DLL uncomment the following two lines #cflags = -zq -bd #lflags = OPT quiet OPT map SYS nt_dll LIB = libmseed.lib DLL = libmseed.dll INCS = -I. OBJS= fileutils.obj & genutils.obj & gswap.obj & lmplatform.obj & lookup.obj & msrutils.obj & pack.obj & packdata.obj & traceutils.obj & tracelist.obj & parseutils.obj & unpack.obj & unpackdata.obj & selection.obj & logging.obj all: lib lib: $(OBJS) .SYMBOLIC wlib -b -n -c -q $(LIB) +$(OBJS) dll: $(OBJS) .SYMBOLIC wlink $(lflags) name libmseed file {$(OBJS)} # Source dependencies: fileutils.obj: fileutils.c libmseed.h genutils.obj: genutils.c libmseed.h gswap.obj: gswap.c libmseed.h lmplatform.obj: lmplatform.c libmseed.h lookup.obj: lookup.c libmseed.h msrutils.obj: msrutils.c libmseed.h pack.obj: pack.c libmseed.h packdata.h packdata.obj: packdata.c libmseed.h packdata.h traceutils.obj: traceutils.c libmseed.h tracelist.obj: tracelist.c libmseed.h parseutils.obj: parseutils.c libmseed.h unpack.obj: unpack.c libmseed.h unpackdata.h unpackdata.obj: unpackdata.c libmseed.h unpackdata.h logging.obj: logging.c libmseed.h # How to compile sources: .c.obj: $(cc) $(cflags) $(cvars) $(INCS) $[@ -fo=$@ # Clean-up directives: clean: .SYMBOLIC del *.obj *.map del $(LIB) $(DLL) iris-edu-libmseed-4314359/Makefile.win000066400000000000000000000012471422047135100174520ustar00rootroot00000000000000# # Nmake file For libmseed - MS Visual C/C++ version # Use 'nmake -f Makefile.win' NODEBUG=1 INCS = -I. OPTS = -D_CRT_SECURE_NO_WARNINGS LIB = libmseed.lib DLL = libmseed.dll OBJS= fileutils.obj \ genutils.obj \ gswap.obj \ lmplatform.obj \ lookup.obj \ msrutils.obj \ pack.obj \ packdata.obj \ traceutils.obj \ tracelist.obj \ parseutils.obj \ unpack.obj \ unpackdata.obj \ selection.obj \ logging.obj all: lib lib: $(OBJS) link.exe /lib /nologo /out:$(LIB) $(OBJS) dll: $(OBJS) link.exe /dll /nologo /out:$(DLL) $(OBJS) .c.obj: $(CC) /nologo $(CFLAGS) $(INCS) $(OPTS) /c $< # Clean-up directives clean: -del a.out core *.o *.obj *% *~ $(LIB) $(DLL) iris-edu-libmseed-4314359/README.byteorder000066400000000000000000000050431422047135100200720ustar00rootroot00000000000000 -- Byte order handling in libmseed -- The SEED 2.4 standard allows data only SEED (Mini-SEED) to be either in big (most significant byte first) or little (least significant byte first) endian byte order. One exception is that Steim-1 and Steim-2 data compression are only defined as big-endian, that said libmseed supports little-endian Steim compression schemes anyway. While libmseed supports all four combinations of big and little endian header and data the surest way to avoid compatibility problems is to always create big endian Mini-SEED records (header and data). Reading MiniSEED - how libmseed determines the byte order of a record: The byte order of a record header including blockettes is determined by checking if the record start year and day is a sane value (e.g. year between 1900 and 2100 and day between 1 and 366). The byte order of encoded data samples is determined by the byte order flag in the Blockette 1000, if a Blockette 1000 is not present the byte order is assumed to be the same as the header. To force the byte order determination of either the header or data section of a record the following environment variables can be set: UNPACK_HEADER_BYTEORDER UNPACK_DATA_BYTEORDER These variables should be set to either 0 (little endian) or 1 (big endian). A programmatic equivalent of setting these environment variables is provided via the following macros: MS_UNPACKHEADERBYTEORDER(X) MS_UNPACKDATABYTEORDER(X) Writing MiniSEED - in what byte order libmseed creates records: Normally the byte order of MiniSEED created by libmseed is controlled via a flag in the API. This byte order flag determines the ordering for both the header and data sections of a record. To force the byte order of either the header or data section of a record the following environment variables can be set: PACK_HEADER_BYTEORDER PACK_DATA_BYTEORDER These variables should be set to either 0 (little endian) or 1 (big endian). A programmatic equivalent of setting these environment variables is provided via the following macros: MS_PACKHEADERBYTEORDER(X) MS_PACKDATABYTEORDER(X) Note that some interpretations of the SEED 2.4 format imply that so-called little endian MiniSEED means that the record header is little endian but that the data section is big endian (as the only defined data encodings must be based on the SEED DDL which, in turn, must be defined in terms of big endian). Libmseed will not create MiniSEED of this flavor by default but can be configured to do so by setting the environment variables described above appropriately. iris-edu-libmseed-4314359/README.md000066400000000000000000000044021422047135100164710ustar00rootroot00000000000000 # libmseed - The Mini-SEED library The Mini-SEED library provides a framework for manipulation of SEED data records including the unpacking and packing of data records. Functionality is also included for managing waveform data as continuous traces. All structures of SEED 2.4 data records are supported with the following exceptions: Blockette 2000 opaque data which has an unknown data structure by definition and Blockette 405 which depends on full SEED (SEED including full ASCII headers) for a full data description. The library should work in Linux, BSD (and derivatives like macOS), Solaris and Win32 environments. ## Documentation The [Wiki](https://github.com/iris-edu/libmseed/wiki) provides an overview of using the library. For function level documentation, man pages are included in the [doc](doc) directory. ## Downloading and installing The [releases](https://github.com/iris-edu/libmseed/releases) area contains release versions. For installation instructions see the [INSTALL](INSTALL.md) file. For further information regarding the library interface see the documentation in the 'doc' directory. For example uses of libmseed see the source code in the 'examples' directory. ## License Copyright (C) 2016 Chad Trabant, IRIS Data Management Center This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License (GNU-LGPL) for more details. You should have received a copy of the GNU Lesser General Public License along with this software. If not, see . ## Acknowlegements Numerous improvements have been incorporated based on feedback and patches submitted by others. Individual acknowlegements are included in the ChangeLog. This library also uses code bits published in the public domain and acknowledgement is included in the code whenever possible. With software provided by http://2038bug.com/ (site offline, checked Oct. 2017) iris-edu-libmseed-4314359/doc/000077500000000000000000000000001422047135100157575ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/libmseed-UsersGuide000066400000000000000000000434361422047135100215550ustar00rootroot00000000000000 An introduction to libmseed -- Introduction -- The Mini-SEED library provides a framework for manipulation of SEED data records including the unpacking and packing of data records. Functionality is also included for managing waveform data as continuous traces. All structures of SEED 2.4 data records are supported with the following exceptions: Blockette 2000 opaque data which has an unknown data structure by definition and Blockette 405 which depends on full SEED (SEED including full ASCII headers) for a full data description. The primary purpose of the library is to hide the details of Mini-SEED in order to allow rapid development of Mini-SEED reading/writing software. The framework allows everything from manipulation of Mini-SEED on a record-by-record basis to reading of Mini-SEED into continuous trace segments to packing of large continuous traces using a record template. Certain common tasks have, through library design, been streamlined, for example: reading Mini-SEED records from a file, adding data from unpacked records to a group of traces or packing a group of continuous traces into Mini-SEED records. The following data encoding formats are supported for both unpacking and packing: ASCII, INT16, INT32, FLOAT32, FLOAT64, STEIM1 and STEIM2. The INT and FLOAT encodings each have two versions for quantities with a different number of bits of representation. The STEIM decompression produces 32-bit integers; likewise the compression routines require 32-bit integers as input. The following data encoding formats are supported for unpacking only: GEOSCOPE (24-bit, 16/3 and 16/4 gain ranged), CDSN, SRO and DWWSSN. -- Data Records -- A Mini-SEED record is represented in the library using the data structure given below. This structure is used for both unpacking and packing of Mini-SEED records. When unpacking with msr_unpack(3) this structure is populated. When packing with msr_pack(3) this structure is used as a template for the resulting data records and as a source of samples to be packed. Blockettes following the fixed section of the header are contained in the blockette chain of BlktLink structures. Shortcut pointers to commonly used blockettes are maintained for types 100, 1000 and 1001. Many common header fields which are not easily accessible/usable in the raw header are available directly from the structure. When this structure is used as a packing template, these common header fields are packed into the appropriate place in the fixed section or blockette. As examples, the ASCII stream identifiers (network, station, location and channel) are available as NULL terminated strings, the start time is available as a high precision epoch time (see ms_time(3)) and the sample rate is available as a double precision floating point value. The MSRecord data structure: typedef struct MSRecord_s { char *record; /* Mini-SEED record */ int32_t reclen; /* Length of Mini-SEED record in bytes */ /* Pointers to SEED data record structures */ struct fsdh_s *fsdh; /* Fixed Section of Data Header */ struct BlktLink *blkts; /* Root of blockette chain */ struct blkt_100_s *Blkt100; /* Blockette 100, if present */ struct blkt_1000_s *Blkt1000; /* Blockette 1000, if present */ struct blkt_1001_s *Blkt1001; /* Blockette 1001, if present */ /* Common header fields in accessible form */ int32_t sequence_number; /* SEED record sequence number */ char dataquality; /* Data quality indicator */ char network[11]; /* Network designation, NULL terminated */ char station[11]; /* Station designation, NULL terminated */ char location[11]; /* Location designation, NULL terminated */ char channel[11]; /* Channel designation, NULL terminated */ hptime_t starttime; /* Record start time, corrected (first sample) */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in record */ int8_t encoding; /* Data encoding format */ int8_t byteorder; /* Byte order of record */ /* Data sample fields */ void *datasamples; /* Data samples, 'numsamples' of type 'sampletype'*/ int64_t numsamples; /* Number of data samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ /* Stream oriented state information */ StreamState *ststate; /* Stream processing state information */ } MSRecord; Explanation of fields: record: Pointer to the Mini-SEED record which was unpacked into the MSRecord. reclen: When unpacking this is the record length in bytes of the record pointed to by the 'record' pointer. When packing this is the length of records to pack. fsdh: A pointer to the Fixed Section of the Data Header, all appropriate multi-byte quantities are in host byte order. blkts: The root of the blockette chain. The chain is constructed from linked BlktLink structures. All appropriate multi-byte quantities in the blockettes are in host byte order. The msr_addblockette(3) routine can be used to add blockettes to this chain. The BlktLink structure and SEED blockette structures are defined in libmseed.h. Blkt100: Blkt1000: Blkt1001: Shortcut pointers to common blockettes in the blockette chain. If a given blockette does not exist in the blockette chain the shortcut pointer will be 0. If more than one of these blockette types exist in the chain this pointer will point to the last one. sequence_number: SEED record sequence number, should be between 0 and 999999. dataquality: Data record indicator, should be 'D', 'R', 'Q' or 'M'. network: station: location: channel: SEED stream identifiers as NULL terminated strings. starttime: Record start time, the time of the first sample, as a high precision epoch time (seed ms_time(3)). This time can be converted using the various ms_hptime2 functions. samprate: The sample rate in samples per second in double precision. During unpacking this value will be set to the sample rate given in the 100 blockette if it is present, otherwise the sample rate derived from the factor and multiplier in the fixed section of the header. In a packing template this value will be used to derive a factor and multiplier for the fixed section of the header and will be written into 100 blockettes if any are in the blockette chain. samplecnt: The sample count, i.e. number of data samples in the record. encoding: The SEED data sample encoding format. During packing this dictates what format will be used to pack the data samples. Supported packing formats are 0 (DE_ASCII), 1 (DE_INT16), 3 (DE_INT32), 4 (DE_FLOAT32), 5 (DE_FLOAT64), 10 (DE_STEIM1) and 11 (DE_STEIM2). byteorder: Byte order of multi-byte quantities in the record. A value of 0 indicates little endian and a value of 1 indicates big endian. During packing this dictates the byte order of the final records. datasamples: A pointer to the unpacked data samples. If no data samples were unpacked this will be 0. The 'numsamples' field indicates how many samples are in this array and the 'sampletype' field indicates what type of samples they are. numsamples: The number of samples pointed to by the 'datasamples' pointer. sampletype: The type of samples pointed to by the 'datasamples' pointer. Supported types are 'a' (ASCII), 'i' (integer), 'f' (float) and 'd' (double). The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. ststate: Pointer to a StreamState struct used internally to track stream oriented state variables. Memory for this only allocated when needed. -- Traces -- In order to manage continuous trace segments the library provides a couple of different mechanisms: Trace Groups and Trace Lists. Initially only Trace Groups were implimented and later Trace Lists were added, from a general standpoint they do the same thing. The Trace Lists are more efficient and slightly more complicated in their structure. Either can be used for most tasks, but there are more utilities functions for Trace Groups. The TraceGroup functionality is centered around the MSTrace data structure and a MSTraceGroup data structure in which MSTrace structures can be grouped. While a MSTrace structure is normally used to hold trace information and associated data samples it can also be used without data samples as a means to keep trace of data coverage without actual samples. Numerous routines are provided for basic management of MSTrace structures, including the creation of new MSTrace structures, adding data from Mini-SEED data structures to MSTrace structures, printing trace information, etc. The MSTraceGroup data structure acts as a very simple place to begin a chain of MSTrace structures and keep track of the number of traces. The MSTrace and MSTraceGroup data structures: typedef struct MSTrace_s { char network[11]; /* Network designation, NULL terminated */ char station[11]; /* Station designation, NULL terminated */ char location[11]; /* Location designation, NULL terminated */ char channel[11]; /* Channel designation, NULL terminated */ char dataquality; /* Data quality indicator */ char type; /* MSTrace type code */ hptime_t starttime; /* Time of first sample */ hptime_t endtime; /* Time of last sample */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in trace coverage */ void *datasamples; /* Data samples, 'numsamples' of type 'sampletype'*/ int64_t numsamples; /* Number of data samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ void *prvtptr; /* Private pointer for general use */ StreamState *ststate; /* Stream processing state information */ struct MSTrace_s *next; /* Pointer to next trace */ } MSTrace; typedef struct MSTraceGroup_s { int32_t numtraces; /* Number of MSTraces in the trace chain */ struct MSTrace_s *traces; /* Root of the trace chain */ } MSTraceGroup; Explanation of fields: dataquality: A SEED data quality indicator, either 'D', 'R', 'Q' or 'M'. This value will be (binary) 0 when the quality is unknown or mixed. network: station: location: channel: MSTrace identifiers as NULL terminated strings. type: A single character trace type indicator. This field is not used by libmseed but could be used for application specific trace identification. starttime: MSTrace start time, the time of the first sample, as a high precision epoch time (see ms_time(3)). This time can be converted using the various ms_hptime2 functions. endtime: MSTrace end time, the time of the last sample, as a high precision epoch time (see ms_time(3)). This time can be converted using the various ms_hptime2 functions. samprate: The sample rate in samples per second in double precision. samplecnt: The sample count, i.e. number of data samples in the trace. datasamples: A pointer to the data samples. If no data samples are included this will be 0. The 'numsamples' field indicates how many samples are in this array and the 'sampletype' field indicates what type of samples they are. numsamples: The number of samples pointed to by the 'datasamples' pointer. sampletype: The type of samples pointed to by the 'datasamples' pointer. Supported types are 'a' (ASCII), 'i' (integer), 'f' (float) and 'd' (double). The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. prvtptr: A private pointer for general use. This pointer is not used by libmseed and can safely be used by the calling program. ststate: Pointer to a StreamState struct used internally to track stream oriented state variables. Memory for this only allocated when needed. next: A pointer to the next MSTrace structure. The value will be 0 for the last link in a chain of MSTrace structures. -- Log Messages -- All of the log and diagnostic messages emitted by the library functions use the same interface. The output from this interface can be controlled. This is useful when the library will be embedded in a larger system with a custom logging facility. See the man page for more details. ms_log() : the central logging facility. Behavior is controlled by the settings specified with ms_loginit(). ms_loginit() : set the functions and prefixes used for log, diagnostic and error messages. The default destination for log messages is standard output (stdout), while all diagnostic (including error) messages go to standard error (stderr). Most of the internal messages emmited by the library are considered diagnostic and will, by default, go to standard error. The default prefix for log and diagnostic messages is nothing. The default prefix for diagnostic error messages is "error: ". There are reentrant versions of these functions that operate directly on a logging parameter MSLogParam struct. These are intended for use in threaded programs or where a complex logging scheme is desired. See the man pages for more details. -- Waveform Data -- Waveform data samples are managed by libmseed in a couple of different formats depending on how they are unpacked or will be packed. An array of samples is completely represented by an array of sample values, the number of samples and a sample type. The number of samples is always the actual number of sample values, not the number of bytes needed for storing the values. Samples can be either ASCII, 32-bit integer, 32-bit floats or 64-bit double precision floats. Sample types are identified by a type character: 'a' - ASCII (8 bits) 'i' - integer (32 bits) 'f' - float (32 bits) 'd' - double (64 bits) The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. -- Common Usage -- Example programs using libmseed are provided in the 'examples' directory of the source code distribution. One of the most common tasks is to read a file of Mini-SEED records and either perform some action based on the header values or apply some process to the data samples. This task is greatly simplified by using the library functions ms_readmsr(3) and ms_readtraces(3). The ms_readmsr(3) routine will open a specified file and return MSRecord structures for each Mini-SEED record it reads from the file. The ms_readtraces(3) routine will do the same except add all the data read to a MSTraceGroup, this is ideal for quickly reading data for processing. Both of these routines are able to automatically detect record length. If your application is not designed to read Mini-SEED from files the library also provides functions to detect and parse Mini-SEED records in memory buffers. For more information see ms_detect(3) and msr_parse(3). Skeleton code for reading a file with ms_readmsr(3): main() { MSRecord *msr = NULL; int retcode; while ( (retcode = msr_readmsr (&msr, filename, 0, NULL, NULL, 1, 0, verbose)) == MS_NOERROR ) { /* Do something with the record here, e.g. print */ msr_print (msr, verbose); } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename, ms_errorstr(retcode)); /* Cleanup memory and close file */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0); } For reading two files with ms_readtraces(3): main() { MSTraceGroup *mstg = NULL; int retcode; retcode = ms_readtraces (&mstg, filename, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename, ms_errorstr(retcode)); retcode = ms_readtraces (&mstg, filename2, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename2, ms_errorstr(retcode)); if ( ! mstg ) { fprintf (stderr, "Error reading file\\n"); return -1; } /* Do something with the traces here, e.g. print */ mst_printtracelist (mstg, 0, verbose, 0); mst_freegroup (&mstg); } Another common task is to create (pack) Mini-SEED records. The library supports packing of Mini-SEED either from MSRecord structures, MSTrace structures or MSTraceGroup collections using, respectively, msr_pack(3), mst_pack(3) or mst_packgroup(3). In each case the appropriate data structure and parameters are provided to the routine along with a function pointer to a routine that will be called each time a record is complete and should be disposed of. When packing Mini-SEED records the concept of a record header template is used, the template is always in the form of a MSRecord structure. This allows the calling program to dictate the contents, with a few exceptions, of the header in the final data records. Skeleton code for creating (packing) and writing Mini-SEED records to a file with mst_writemseed(3): main() { int precords; int verbose = 0; char msfile = "output.mseed"; MSTrace *mst; mst = mst_init (NULL); /* Populate MSTrace values */ strcpy (mst->network, "XX"); strcpy (mst->station, "TEST"); strcpy (mst->channel, "BHE"); mst->starttime = ms_seedtimestr2hptime ("2004,350,00:00:00.000000"); mst->samprate = 40.0; mst->datasamples = dataptr; /* pointer to 32-bit integer data samples */ mst->numsamples = 1234; mst->sampletype = 'i'; /* declare type to be 32-bit integers */ /* Write 4096 byte, big-endian records, using Steim-2 compression */ precords = mst_writemseed (mst, msfile, 1, 4096, DE_STEIM2, 1, verbose); ms_log (0, "Wrote %d records to %s\n", precords, msfile); /* Disconnect datasamples pointer, otherwise mst_free() will free it */ mst->datasamples = NULL; mst_free (&mst); } iris-edu-libmseed-4314359/doc/ms_addselect.3000077700000000000000000000000001422047135100232352ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_addselect_comp.3000077700000000000000000000000001422047135100242532ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_bigendianhost.3000066400000000000000000000013721422047135100213630ustar00rootroot00000000000000.TH MS_BIGENDIANHOST 3 2004/11/22 "Libmseed API" .SH NAME ms_bigendianhost - Determine host computer byte order .SH SYNOPSIS .nf .B #include .BI "int \fBms_bigendianhost\fP ();" .fi .SH DESCRIPTION \fBms_bigendianhost\fP is a run-time test of host computer byte order. It is assumed that there are only two possible byte orders: Most Significant Byte First (MSBF), i.e. big-endian, and Least Significant Byte First (LSBF), i.e. little-endian. No middle-endian schemes are accounted for. Binary quantities in SEED are commonly big-endian, but it is not necessarily so. .SH RETURN VALUES \fBms_bigendianhost\fP returns 1 if the host is big-endian and 0 if the host is little-endian. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_blktdesc.3000077700000000000000000000000001422047135100224242ms_lookup.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_blktlen.3000077700000000000000000000000001422047135100222642ms_lookup.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_btime2isotimestr.3000077700000000000000000000000001422047135100235632ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_btime2mdtimestr.3000077700000000000000000000000001422047135100233712ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_btime2seedtimestr.3000077700000000000000000000000001422047135100237112ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_btime3hptime.3000077700000000000000000000000001422047135100226502ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_detect.3000077700000000000000000000000001422047135100220642msr_parse.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_doy2md.3000066400000000000000000000017731422047135100177500ustar00rootroot00000000000000.TH MS_DOY2MD 3 2004/11/22 "Libmseed API" .SH NAME ms_doy2md - Convert between day of year and month and day of month .SH SYNOPSIS .nf .B #include .BI "int \fBms_doy2md\fP ( int " year ", int " jday ", int *" month ", int *" mday " );" .BI "int \fBms_md2doy\fP ( int " year ", int " month ", int " mday ", int *" jday " );" .fi .SH DESCRIPTION \fBms_doy2md\fP calculates the \fImonth\fP and day of month (\fImday\fP) for a given \fIyear\fP and day of year (\fIjday\fP). \fBms_md2doy\fP calculates the day of year (\fIjday\fP) for a given \fIyear\fP, \fImonth\fP and day of month (\fImday\fP). For both routines the expected and resulting ranges for each value are: .sp .nf year : 1900 - 2100 jday : 1 - 366 month : 1 - 12 mday : 1 - 31 .fi A day of year of 366 corresponds to the last day of a leap year. .SH RETURN VALUES \fBms_doy2md\fP returns 0 on success and -1 on error. \fBms_md2doy\fP returns 0 on success and -1 on error. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_encodingstr.3000077700000000000000000000000001422047135100231502ms_lookup.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_errorstr.3000077700000000000000000000000001422047135100225132ms_lookup.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_find_reclen.3000066400000000000000000000041701422047135100210140ustar00rootroot00000000000000.TH MS_FIND_RECLEN 3 2006/11/08 "Libmseed API" .SH NAME ms_find_reclen - Determine SEED record data length .SH SYNOPSIS .nf .B #include .BI "int \fBms_find_reclen\fP ( const char *" recbuf ", int " recbuflen ", .BI " FILE " *fileptr " ); .fi .SH DESCRIPTION \fBms_find_reclen\fP verifies that the specified \fIrecbuf\fP buffer contains a SEED data record by looking for data record signatures in the fixed section data header and determines the data record length by 1) searching the buffer up to \fIrecbuflen\fP bytes for a Blockette 1000 and, failing that, 2) if \fIfileptr\fP is not NULL reading the next 48 bytes from the file and looking for a data record signature (with detection of the next data record implying the length of the current record). If data is read from \fIfileptr\fP the read position is returned to it's position prior to this function call. The MS_ISVALIDHEADER macro is used to verify that the buffer contains a valid SEED data record. When searching for the next record header to determine record length one of the macros MS_ISVALIDHEADER or MS_ISVALIDBLANK must test positively for a record to be detected. Blank/noise records are records with a valid SEED sequence number followed by ASCII space characters to the end of the record. \fBms_find_reclen\fP will return 0 when it detects that the buffer contains a SEED data record but cannot determine the record length. This happens when no Blockette 1000 is not found within \fIrecbuflen\fP bytes and, assuming a valid \fIfileptr\fP is supplied, no record header is detected in the next 48 bytes of the file. The idea is to then read more data from the file (i.e. the next larger, valid record length) and call \fBms_find_reclen\fP again and so on until the record length can be determined. .SH RETURN VALUES \fBms_find_reclen\fP returns the length of the Mini-SEED record in bytes or 0 if a data record was detected but the length could not be determined or -1 when no data record was detected. .SH SEE ALSO \fBms_readmsr(3)\fP, \fBms_readtraces(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_freeselections.3000077700000000000000000000000001422047135100243172ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_genfactmult.3000066400000000000000000000036731422047135100210640ustar00rootroot00000000000000.TH MS_GENFACTMULT 3 2016/10/07 "Libmseed API" .SH NAME ms_genfactmult - Generate SEED sample rate factor and multiplier .SH SYNOPSIS .nf .B #include .BI "int \fBms_genfactmult\fP ( double " samprate ", int16_t *" factor ", .BI " int16_t *" multiplier " );" .BI "int \fBms_ratapprox\fP ( double " real ", int *" num ", int *" den ", .BI " int " maxval ", double " precision " );" .fi .SH DESCRIPTION \fBms_genfactmult\fP generates an appropriate SEED sample rate \fIfactor\fP and \fImultiplier\fP pair from a double precision sample rate. If \fIsamprate\fP is positive it is expected to represent a rate in samples/second, if negative is is expected to represent a period in seconds/sample. Non-integer sample rates and periods are supported between 32767.0 and 1/32767.0. An error will be returned for non-integer rates and periods outside this range. Integer sample rates and periods are supported between 1 and the maximum possible value (32767 * 32767). Values from 1 to 32767 are represented directly. Values larger than 32767 are factored and represented exactly when possible and approximated otherwise, with the discrepency becoming larger as the values reach the maximum possible value. The factor and multiplier are int16_t because that is the integer size needed for the fixed section of the SEED data header. \fBms_ratapprox\fP finds an approximate rational number for a real through continued fraction expansion. Given a double precision \fIreal\fP the routine tries to find a rational in numerator (\fInum\fP) and denominator (\fIden\fP) form whose absolute values are not larger than \fImaxval\fP while trying to reach a specified \fIprecision\fP. .SH RETURN VALUES \fBms_genfactmult\fP returns 0 on success and -1 when value is outside of the supported range or error. \fBms_ratapprox\fP returns the number of iterations performed. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_gswap.3000066400000000000000000000015521422047135100176660ustar00rootroot00000000000000.TH MS_GSWAP 3 2006/12/20 "Libmseed API" .SH NAME ms_gswap - Generalized, in-place byte swapping routines .SH SYNOPSIS .nf .B #include .BI "void \fBms_gswap2\fP ( void *" data2 " );" .BI "void \fBms_gswap3\fP ( void *" data3 " );" .BI "void \fBms_gswap4\fP ( void *" data4 " );" .BI "void \fBms_gswap8\fP ( void *" data8 " );" .BI "void \fBms_gswap2a\fP ( void *" data2 " );" .BI "void \fBms_gswap4a\fP ( void *" data4 " );" .BI "void \fBms_gswap8a\fP ( void *" data8 " );" .fi .SH DESCRIPTION These routines swap between LSBF (little-endian) and MSBF (big-endian) byte orders. The specified quantities are swapped in-place. The \fBms_gswap*a\fP routines are provided for backwards compatibility, but should not be used in new code. They are aliases for the regular versions above. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_gswap2.3000077700000000000000000000000001422047135100216442ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap2a.3000077700000000000000000000000001422047135100220052ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap3.3000077700000000000000000000000001422047135100216452ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap4.3000077700000000000000000000000001422047135100216462ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap4a.3000077700000000000000000000000001422047135100220072ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap8.3000077700000000000000000000000001422047135100216522ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_gswap8a.3000077700000000000000000000000001422047135100220132ms_gswap.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_hptime2btime.3000077700000000000000000000000001422047135100226472ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_hptime2isotimestr.3000077700000000000000000000000001422047135100237512ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_hptime2mdtimestr.3000077700000000000000000000000001422047135100235572ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_hptime2seedtimestr.3000077700000000000000000000000001422047135100240772ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_intro.3000066400000000000000000000516141422047135100177040ustar00rootroot00000000000000.TH MS_INTRO 3 2013/07/17 .SH NAME ms_intro - Introduction to libmseed .SH INTRODUCTION The Mini-SEED library provides a framework for manipulation of SEED data records including the unpacking and packing of data records. Functionality is also included for managing waveform data as continuous traces. All structures of SEED 2.4 data records are supported with the following exceptions: Blockette 2000 opaque data which has an unknown data structure by definition and Blockette 405 which depends on full SEED (SEED including full ASCII headers) for a full data description. The primary purpose of the library is to hide the details of Mini-SEED in order to allow rapid development of Mini-SEED reading/writing software. The framework allows everything from manipulation of Mini-SEED on a record-by-record basis to reading of Mini-SEED into continuous trace segments to packing of large continuous traces using a record template. Certain common tasks have, through library design, been streamlined, for example: reading Mini-SEED records from a file, adding data from unpacked records to a group of traces or packing a group of continuous traces into Mini-SEED records. The following data encoding formats are supported for both unpacking and packing: ASCII, INT16, INT32, FLOAT32, FLOAT64, STEIM1 and STEIM2. The INT and FLOAT encodings each have two versions for quantities with a different number of bits of representation. The STEIM decompression produces 32-bit integers; likewise the compression routines require 32-bit integers as input. The following data encoding formats are supported for unpacking only: GEOSCOPE (24-bit, 16/3 and 16/4 gain ranged), CDSN, SRO and DWWSSN. .SH DATA RECORDS A Mini-SEED record is represented in the library using the data structure given below. This structure is used for both unpacking and packing of Mini-SEED records. When unpacking with msr_unpack(3) this structure is populated. When packing with msr_pack(3) this structure is used as a template for the resulting data records and as a source of samples to be packed. Blockettes following the fixed section of the header are contained in the blockette chain of BlktLink structures. Shortcut pointers to commonly used blockettes are maintained for types 100, 1000 and 1001. Many common header fields which are not easily accessible/usable in the raw header are available directly from the structure. When this structure is used as a packing template, these common header fields are packed into the appropriate place in the fixed section or blockette. As examples, the ASCII stream identifiers (network, station, location and channel) are available as NULL terminated strings, the start time is available as a high precision epoch time (see ms_time(3)) and the sample rate is available as a double precision floating point value. The MSRecord data structure: .nf typedef struct MSRecord_s { char *record; /* Mini-SEED record */ int32_t reclen; /* Length of Mini-SEED record */ /* Pointers to SEED data record structures */ struct fsdh_s *fsdh; /* Fixed Section of Data Header */ struct BlktLink *blkts; /* Root of blockette chain */ struct blkt_100_s *Blkt100; /* Blockette 100, if present */ struct blkt_1000_s *Blkt1000; /* Blockette 1000, if present */ struct blkt_1001_s *Blkt1001; /* Blockette 1001, if present */ /* Common header fields in accessible form */ int32_t sequence_number; /* SEED record sequence number */ char dataquality; /* Data quality indicator */ char network[11]; /* Network designation */ char station[11]; /* Station designation */ char location[11]; /* Location designation */ char channel[11]; /* Channel designation */ hptime_t starttime; /* Record start time */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in record */ int8_t encoding; /* Data encoding format */ int8_t byteorder; /* Byte order of record */ /* Data sample fields */ void *datasamples; /* Data samples */ int64_t numsamples; /* Number of data samples */ char sampletype; /* Sample type code: a, i, f, d */ /* Stream oriented state information */ StreamState *ststate; /* Stream processing state information */ } MSRecord; .fi .SS Explanation of fields .IP record: Pointer to the Mini-SEED record which was unpacked into the MSRecord. .IP reclen: When unpacking this is the record length in bytes of the record pointed to by the 'record' pointer. When packing this is the length of records to pack. .IP fsdh: A pointer to the Fixed Section of the Data Header, all appropriate multi-byte quantities are in host byte order. .IP blkts: The root of the blockette chain. The chain is constructed from linked BlktLink structures. All appropriate multi-byte quantities in the blockettes are in host byte order. The msr_addblockette(3) routine can be used to add blockettes to this chain. The BlktLink structure and SEED blockette structures are defined in libmseed.h. .IP Blkt100: .IP Blkt1000: .IP Blkt1001: Shortcut pointers to common blockettes in the blockette chain. If a given blockette does not exist in the blockette chain the shortcut pointer will be 0. If more than one of these blockette types exist in the chain this pointer will point to the last one. .IP sequence_number: SEED record sequence number, should be between 0 and 999999. .IP dataquality: Data record and quality indicator, should be 'D', 'R', 'Q' or 'M'. .IP network: .IP station: .IP location: .IP channel: SEED stream identifiers as a NULL terminated strings. .IP starttime: Record start time, the time of the first sample, as a high precision epoch time (see ms_time(3)). This time can be converted using the various ms_hptime2 functions. .IP samprate: The sample rate in samples per second in double precision. During unpacking this value will be set to the sample rate given in the 100 blockette if it is present, otherwise the sample rate derived from the factor and multiplier in the fixed section of the header. In a packing template this value will be used to derive a factor and multiplier for the fixed section of the header and will be written into 100 blockettes if any are in the blockette chain. .IP samplecnt: The sample count, i.e. number of data samples in the record. .IP encoding: The SEED data sample encoding format. During packing this dictates what format will be used to pack the data samples. Supported packing formats are 0 (DE_ASCII), 1 (DE_INT16), 3 (DE_INT32), 4 (DE_FLOAT32), 5 (DE_FLOAT64), 10 (DE_STEIM1) and 11 (DE_STEIM2). .IP byteorder: Byte order of multi-byte quantities in the record. A value of 0 indicates little endian and a value of 1 indicates big endian. During packing this dictates the byte order of the final records. .IP datasamples: A pointer to the unpacked data samples. If no data samples were unpacked this will be 0. The 'numsamples' field indicates how many samples are in this array and the 'sampletype' field indicates what type of samples they are. .IP numsamples: The number of samples pointed to by the 'datasamples' pointer. .IP sampletype: The type of samples pointed to by the 'datasamples' pointer. Supported types are 'a' (ASCII), 'i' (integer), 'f' (float) and 'd' (double). The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. .IP ststate: Pointer to a StreamState struct used internally to track stream oriented state variables. Memory for this only allocated when needed. .SH TRACES The library includes two facilities to manage collections of continuous trace segments, each represented by their top most structure: MSTraceGroup and MSTraceList. The MSTraceList facility is a next generation version of the MSTraceGroup facility. Whereas the MSTraceGroup facility uses a single linked list of time segments the MSTraceList facility is slightly more complex with two levels of linked lists and common access pointers. The advantages are that the MSTraceList structure is faster to populate, especially when there are many segments (gappy data), and the list is always maintained in a sorted order. .SH TRACE LISTS MSTraceList data structures allow the grouping of MSTraceID structures which are themselves the root of MSTraceSeg structures, see libmseed.h as a reference to these structures. .SH TRACE GROUPS MSTraceGroup data structures allow the grouping of MSTrace structures. While a MSTrace structure is normally used to hold trace information and associated data samples it can also be used without data samples as a means to keep trace of data coverage without actual samples. Numerous routines are provided for basic management of MSTrace structures, including the creation of new MSTrace structures, adding data from Mini-SEED data structures to MSTrace structures, printing trace information, etc. The MSTraceGroup data structure acts as a very simple place to begin a chain of MSTrace structures and keep track of the number of traces. The MSTrace and MSTraceGroup data structures: .nf typedef struct MSTrace_s { char network[11]; /* Network designation */ char station[11]; /* Station designation */ char location[11]; /* Location designation */ char channel[11]; /* Channel designation */ char dataquality; /* Data quality indicator */ char type; /* MSTrace type code */ hptime_t starttime; /* Time of first sample */ hptime_t endtime; /* Time of last sample */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Num. in trace coverage */ void *datasamples; /* Data samples */ int64_t numsamples; /* Num. samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ void *prvtptr /* Private pointer for general use */ struct MSTrace_s *next; /* Pointer to next trace */ } MSTrace; typedef struct MSTraceGroup_s { int32_t numtraces; /* Number of MSTraces in trace chain */ struct MSTrace_s *traces; /* Root of the trace chain */ } MSTraceGroup; .fi .SS Explanation of fields .IP dataquality: SEED data quality indicator, either 'D', 'R', 'Q' or 'M'. This value will be (binary) 0 when the quality is unknown or mixed. .IP network: .IP station: .IP location: .IP channel: MSTrace identifiers as a NULL terminated strings. .IP type: A single character trace type indicator. This field is not used by libmseed but could be used for application specific trace identification. .IP starttime: MSTrace start time, the time of the first sample, as a high precision epoch time (see ms_time(3)). This time can be converted using the various ms_hptime2 functions. .IP endtime: MSTrace end time, the time of the last sample, as a high precision epoch time (see ms_time(3)). This time can be converted using the various ms_hptime2 functions. .IP samprate: The sample rate in samples per second in double precision. .IP samplecnt: The sample count, i.e. number of data samples in the trace. .IP datasamples: A pointer to the data samples. If no data samples are included this will be 0. The 'numsamples' field indicates how many samples are in this array and the 'sampletype' field indicates what type of samples they are. .IP numsamples: The number of samples pointed to by the 'datasamples' pointer. .IP sampletype: The type of samples pointed to by the 'datasamples' pointer. Supported types are 'a' (ASCII), 'i' (integer), 'f' (float) and 'd' (double). The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. .IP prvtptr: A private pointer for general use. This pointer is not used by libmseed and can safely be used by the calling program. .IP ststate: Pointer to a StreamState struct used internally to track stream oriented state variables. Memory for this only allocated when needed. .IP next: A pointer to the next MSTrace structure. The value will be 0 for the last link in a chain of MSTrace structures. .SH LOG MESSAGES All of the log and diagnostic messages emitted by the library functions use the same interface. The output from this interface can be controlled. This is useful when the library will be embedded in a larger system with a custom logging facility. See the man page for more details. .nf ms_log() : the central logging facility. Behavior is controlled by the settings specified with ms_loginit(). ms_loginit() : set the functions and prefixes used for log, diagnostic and error messages. .fi The default destination for log messages is standard output (stdout), while all diagnostic (including error) messages go to standard error (stderr). Most of the internal messages emmited by the library are considered diagnostic and will, by default, go to standard error. The default prefix for log and diagnostic messages is nothing. The default prefix for diagnostic error messages is "Error: ". There are reentrant versions of these functions that operate directly on a logging parameter MSLogParam struct. These are intended for use in threaded programs or where a complex logging scheme is desired. See the man pages for more details. .SH WAVEFORM DATA Waveform data samples are managed by libmseed in a couple of different formats depending on how they are unpacked or will be packed. An array of samples is completely represented by an array of sample values, the number of samples and a sample type. The number of samples is always the actual number of sample values, not the number of bytes needed for storing the values. Samples can be either ASCII, 32-bit integer, 32-bit floats or 64-bit double precision floats. Sample types are identified by a single ASCII type character: .nf "a" - ASCII (8 bits) "i" - integer (32 bits) "f" - float (32 bits) "d" - double (64 bits) .fi The size of each sample type in bytes is returned by the get_samplesize(3) lookup routine. .SH BYTE ORDER The SEED 2.4 standard allows data only SEED (Mini-SEED) to be either in big (most significant byte first) or little (least significant byte first) endian byte order. Unfortunately it is not well defined what little endian Mini-SEED really means. While libmseed supports all four combinations of big and little endian header and data the surest way to avoid compatibility problems is to always create big endian Mini-SEED records (header and data). .B Reading MiniSEED - how libmseed determines the byte order of a record: The byte order of a record header is determined by checking if the record start year is a sane value (e.g. between 1920 and 2020). The byte order of (compressed) data samples is determined by the byte order flag in the Blockette 1000, if a Blockette 1000 is not present the byte order is assumed to be the same as the header. To force the byte order determination of either the header or data section of a record the following environment variables can be set: .nf UNPACK_HEADER_BYTEORDER UNPACK_DATA_BYTEORDER .fi These variables should be set to either 0 (little endian) or 1 (big endian). A programmatic equivalent of setting these environment variables is provided via the following macros: .nf MS_UNPACKHEADERBYTEORDER(X) MS_UNPACKDATABYTEORDER(X) .fi .B Writing MiniSEED - in what byte order libmseed creates records: Normally the byte order of MiniSEED created by libmseed is controlled via a flag in the API. This byte order flag determines the ordering for both the header and data sections of a record. To force the byte order of either the header or data section of a record the following environment variables can be set: .nf PACK_HEADER_BYTEORDER PACK_DATA_BYTEORDER .fi These variables should be set to either 0 (little endian) or 1 (big endian). A programmatic equivalent of setting these environment variables is provided via the following macros: .nf MS_PACKHEADERBYTEORDER(X) MS_PACKDATABYTEORDER(X) .fi Note that some interpretations of the SEED 2.4 format imply that so-called little endian MiniSEED means that the record header is little endian but that the data section is big endian (as the only defined data encodings must be based on the SEED DDL which, in turn, must be defined in terms of big endian). Libmseed will not create MiniSEED of this flavor by default but can be configured to do so by setting the environment variables described above appropriately. .SH COMMON USAGE Example programs using libmseed are provided in the 'examples' directory of the source code distribution. One of the most common tasks is to read a file of Mini-SEED records and either perform some action based on the header values or apply some process to the data samples. This task is greatly simplified by using the library functions ms_readmsr(3) and ms_readtraces(3). The ms_readmsr(3) routine will open a specified file and return MSRecord structures for each Mini-SEED record it reads from the file. The ms_readtraces(3) routine will do the same except add all the data read to a MSTraceGroup, this is ideal for quickly reading data for processing. Both of these routines are able to automatically detect record length. If your application is not designed to read Mini-SEED from files the library also provides functions to detect and parse Mini-SEED records in memory buffers. For more information see ms_detect(3) and msr_parse(3). Skeleton code for reading a file with ms_readmsr(3): .nf main() { MSRecord *msr = NULL; int retcode; while ( (retcode = ms_readmsr (&msr, filename, 0, NULL, NULL, 1, 0, verbose)) == MS_NOERROR ) { /* Do something with the record here, e.g. print */ msr_print (msr, verbose); } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename, ms_errorstr(retcode)); /* Cleanup memory and close file */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0); } .fi For reading two files with ms_readtraces(3): .nf main() { MSTraceGroup *mstg = NULL; int retcode; retcode = ms_readtraces (&mstg, filename, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename, ms_errorstr(retcode)); retcode = ms_readtraces (&mstg, filename2, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_ENDOFFILE ) ms_log (2, "Cannot read %s: %s\n", filename2, ms_errorstr(retcode)); if ( ! mstg ) { fprintf (stderr, "Error reading file\\n"); return -1; } /* Do something with the traces here, e.g. print */ mst_printtracelist (mstg, 0, verbose, 0); mst_freegroup (&mstg); } .fi Another common task is to create (pack) Mini-SEED records. The library supports packing of Mini-SEED either from MSRecord structures, MSTrace structures or MSTraceGroup collections using, respectively, msr_pack(3), mst_pack(3) or mst_packgroup(3). In each case the appropriate data structure and parameters are provided to the routine along with a function pointer to a routine that will be called each time a record is complete and should be disposed of. When packing Mini-SEED records the concept of a record header template is used, the template is always in the form of a MSRecord structure. This allows the calling program to dictate the contents, with a few exceptions, of the header in the final data records. Skeleton code for creating (packing) Mini-SEED records with mst_pack(3): .nf static void record_handler (char *record, int reclen, void *srcname) { if ( fwrite(record, reclen, 1, outfile) != 1 ) { ms_log (2, "Error writing %s to output file\n", (char *)srcname); } } main() { int64_t psamples; int precords; MSTrace *mst; char srcname[50]; mst = mst_init (NULL); /* Populate MSTrace values */ strcpy (mst->network, "XX"); strcpy (mst->station, "TEST"); strcpy (mst->channel, "BHE"); mst->starttime = ms_seedtimestr2hptime ("2004,350,00:00:00.000000"); mst->samprate = 40.0; /* The datasamples pointer and numsamples counter will be adjusted by the packing routine, the datasamples array must be dynamic memory allocated by the malloc() family of routines. */ mst->datasamples = dataptr; /* pointer to 32-bit integer data samples */ mst->numsamples = 1234; /* number of samples in array at dataptr */ mst->samplecnt = mst->numsamples; mst->sampletype = 'i'; /* declare type to be 32-bit integers */ mst_srcname (mst, srcname, 0); /* Pack 4096 byte, big-endian records, using Steim-2 compression */ precords = mst_pack (mst, &record_handler, srcname, 4096, DE_STEIM2, 1, &psamples, 1, verbose, NULL); ms_log (0, "Packed %"PRId64" samples into %d records\n", psamples, precords); /* Disconnect datasamples pointer, otherwise mst_free() will free it */ mst->datasamples = NULL; mst_free (&mst); } .fi .SH SEE ALSO \fBmsr_unpack(3)\fP, \fBms_time(3)\fP and \fBmsr_pack(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_log.3000066400000000000000000000104611422047135100173250ustar00rootroot00000000000000.TH MS_LOG 3 2014/07/16 .SH NAME ms_log - Central logging facility for libmseed .SH SYNOPSIS .nf .B #include .sp .BI "int \fBms_log\fP (int " level ", const char *" format ", ...); .sp .BI "int \fBms_log_l\fP (MSLogParam *" logp ", int " level ", const char *" format ", ...); .sp .BI "void \fBms_loginit\fP (void (*" log_print ")(char*), const char *" logprefix ", .BI " void (*" diag_print ")(char*), const char *" errprefix "); .sp .BI "MSLogParam * \fBms_loginit_l\fP (MSLogParam *" logp ", .BI " void (*" log_print ")(char*), const char *" logprefix ", .BI " void (*" diag_print ")(char*), const char *" errprefix "); .fi .SH DESCRIPTION The \fBms_log\fP functions are the central logging facility for all output from libmseed functions. They are also intended to be used by libmseed based programs if desired. Three message levels are recognized: 0 : Normal log messages, printed using log_print with logprefix 1 : Diagnostic messages, printed using diag_print with logprefix 2+ : Error messages, printed using diag_print with errprefix It is the task of the \fBms_log\fP functions to format a message using \fBprintf\fP conventions and pass the formatted string to the appropriate printing function (\fIlog_print\fP or \fIdiag_print\fP). \fBms_log\fP will process messages using the global logging parameters. \fBms_log_l\fP is a reentrant version of \fBms_log\fP. It will use the logging parameters specified in the supplied MSLogParam struct. If \fBlogp\fP is NULL global parameters will be used, this would be equivalent to a call to ms_log(). This is intended for use only when complicated logging schemes are desired, e.g. in a threaded application. Note that it is not possible to set thread specific logging parameters for the internal library functions because global parameters are used. The \fBms_loginit\fP functions are used to set the log and error printing functions and the log and error message prefixes used by the \fBms_log\fP functions. \fBms_loginit\fP will operate on the global logging parameters. \fBms_loginit_l\fP is a reentrant version of \fBms_loginit\fP. It will initialize or change the logging parameters specified in the MSLogParam struct. If \fIlogp\fP is NULL a new MSLogParam struct will be allocated. A pointer to the created or re-initialized MSLogParam struct will be returned. The returned pointer is suitable for use with \fBms_log_l\fP. Use NULL for the print function pointers or the prefixes if they should not be changed from previously set or default values. The default values for the logging parameters are: log_print = fprintf (printing to standard out) log_prefix = "" diag_print = fprintf (printing to standard error) err_prefix = "Error: " By setting the printing functions it is possible to re-direct all of the output from these logging routines. This is useful when the libmseed based software is embedded in a system with its own logging facilities. Most of the libmseed internal messages are logged at either the diagnostic or error level. .SH RETURN VALUES \fBms_log\fP and \fBms_log_l\fP return the number of characters formatted on success, and a negative value on error. \fBms_loginit_l\fP returns a pointer to the MSLogParam struct that it operated on. If the input MSLogParam struct is NULL a new struct will be allocated with \fBmalloc()\bP. .SH EXAMPLE Unless a complicated logging scheme is needed most uses of this logging facility will be limited to the ms_loginit and ms_log functions. An example of setting the printing functions: .nf #include void log_print (const char *message); void diag_print (const char *message); main () { ms_loginit (&log_print, "LOG: ", &diag_print, "ERR: "); /* Normal log message, "LOG: " will be prefixed */ ms_log (0, "Normal log message for %s\n", argv[0]); /* Diagnostic message, "LOG: " will be prefixed */ ms_log (1, "Diagnostic message for %s\n", argv[0]); /* Error message, "ERR: " will be prefixed */ ms_log (2, "Error message for %s\n", argv[0]); } void log_print (const char *message) { /* Send message to external log message facility */ send_log(message); } void diag_print (const char *message) { /* Send message to external error message facility */ send_error(message); } .fi .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_log_l.3000077700000000000000000000000001422047135100211752ms_log.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_loginit.3000077700000000000000000000000001422047135100215462ms_log.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_loginit_l.3000077700000000000000000000000001422047135100220612ms_log.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_lookup.3000066400000000000000000000053411422047135100200560ustar00rootroot00000000000000.TH MS_LOOKUP 3 2006/12/12 "Libmseed API" .SH NAME ms_lookup - Look up libmseed and Mini-SEED related information .SH SYNOPSIS .nf .B #include .BI "char *\fBms_errorstr\fP ( int " errorcode " );" .BI "uint8_t \fBms_samplesize\fP ( const char " sampletype " );" .BI "char *\fBms_encodingstr\fP ( const char " encoding " );" .BI "char *\fBms_blktdesc\fP ( uint16_t " blkttype " );" .BI "uint16_t \fBms_blktlen\fP ( uint16_t " blkttype ", const char *" blktdata ", .BI " flag " swapflag " ); .fi .SH DESCRIPTION \fBms_errorstr\fP returns a pointer to a string describing the specified libmseed error code. The error codes are defined in libmseed.h and returned by various functions. \fBms_samplesize\fP returns the sample size based on the specified \fIsampletype\fP. In general libmseed uses the following character sample types: .sp .nf "a" = 1 byte (ASCII) "i" = 4 bytes (integer) "f" = 4 bytes (float) "d" = 8 bytes (double) .fi \fBms_encoding\fP returns a pointer to a string describing the specified data \fIencoding\fP format. If the encoding format is unknown an appropriate string is return stating just that. \fBms_blktdesc\fP returns a pointer to a string describing the specified blockette type (\fIblkttype\fP). If the blockette type is unknown NULL is returned. \fBms_blktlen\fP returns the total length of the specified blockette type (\fIblkttype\fP) in bytes. A pointer to the blockette itself (\fIblkt\fP) should also be provided along with a \fIswapflag\fP that should be set to 1 when the blockette is known to have a different byte order than the host computer. The length returned includes both the blockette "header" (type and next fields) and "body". Technically a pointer to blockette and the swapflag only need to be supplied when the blockette type is a variable length blockette and the length is contained within the blockette itself (e.g. blockette type 2000). For blockettes of known fixed length (most of them) the \fIblkt\fP pointer and \fIswapflag\fP are not used. In the case of blockette type 405 that is variable length and not self describing 0 will be returned. In the case of blockette type 2000 that is variable length and self describing the length will be read from a known offset into the blockette data. .SH RETURN VALUES \fBms_errorstr\fP returns a pointer to a static string. \fBms_samplesize\fP returns the sample size in bytes or 0 for unknown sample type. \fBms_encoding\fP returns a pointer to a static string. \fBms_blktdesc\fP returns a pointer to a static string or NULL if the blockette type is unknown. \fBms_blktlen\fP returns the total length of the specified blockette type or 0 for unknown type. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_matchselect.3000077700000000000000000000000001422047135100236012ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_md2doy.3000077700000000000000000000000001422047135100217142ms_doy2md.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_parse_raw.3000066400000000000000000000025111422047135100205240ustar00rootroot00000000000000.TH MSR_PARSE 3 2010/12/30 "Libmseed API" .SH NAME msr_parse - Parse, validate and print details of a SEED data record .SH SYNOPSIS .nf .B #include .BI "int \fBms_parse_raw\fP ( char *" record ", int " maxreclen "," .BI " flag " details ", flag " swapflag " );" .fi .SH DESCRIPTION \fBms_parse_raw\fP is a simple validating SEED data record header parser. The data in \fIrecord\fP is assumed to contain a SEED data record with a maximum length of \fImaxreclen\fP. In addition to validating header fields where possible, raw header fields can be printed. This routine is primarily intended for identifying invalid data record headers and printing record header contents. The \fIdetails\fP flag is interpreted as follows: .nf 0 = only print error messages for invalid header fields 1 = print basic fields in addition to invalid field errors 2 = print all fields in addition to invalid field errors .fi The \fIswapflag\fP flag is interpreted as follows: .nf 1 = swap multibyte quantities 0 = do no swapping -1 = autodetect byte order using year test, swap if needed .fi .SH RETURN VALUES \fBms_parse_raw\fP returns 0 when no errors were detected or a positive count of errors detected. .SH SEE ALSO \fBmsr_parse(3)\fP and \fBms_detect(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_printselections.3000077700000000000000000000000001422047135100245322ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_ratapprox.3000077700000000000000000000000001422047135100236512ms_genfactmult.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readleapsecondfile.3000077700000000000000000000000001422047135100262652ms_readleapseconds.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readleapseconds.3000066400000000000000000000031151422047135100216760ustar00rootroot00000000000000.TH MS_READLEAPSECONDS 3 2016/10/01 "Libmseed API" .SH NAME ms_readleapseconds - Read a leap second file into a global buffer .SH SYNOPSIS .nf .B #include .BI "int \fBms_readleapseconds\fP ( char *" envvarname " );" .BI "int \fBms_readleapsecondfile\fP ( char *" filename " );" .fi .SH DESCRIPTION These functions read a leap seconds file and store a list of leap seconds in an internal, global list. The leap seconds are used to determine the proper end time of a record (and consquently a trace). The use of this facility causes the leap second indication in the fixed section data header to be ignored. The \fBms_readleapseconds\fP function takes and environment variable name that is expected to contain the name of a leap seconds file. The \fBms_readleapsecondfile\fP function takes the name of a leap second file. .SH LEAP SECOND LIST FILE The leap second list file is expected to contain a list of leap second times and TAI-UTC difference values. The first column should be time stamps as seconds since the NTP epoch (Jan. 1 1900). The second column should be an integer number of seconds that specify the difference between TAI and UTC. Usually the most recent version of this file is available here: https://www.ietf.org/timezones/data/leap-seconds.list .SH RETURN VALUES \fBms_readleapseconds\fP returns the number of leap seconds read on success, -1 on file read errors and -2 when the environment variable is not set. \fBms_readleapsecondfile\fP returns the number leap seconds read on success and -1 on errors. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_readmsr.3000066400000000000000000000224731422047135100202070ustar00rootroot00000000000000.TH MS_READMSR 3 2011/01/06 "Libmseed API" .SH NAME ms_readmsr - Read Mini-SEED data from files .SH SYNOPSIS .nf .B #include .BI "int \fBms_readmsr\fP ( MSRecord **ppmsr, char *" msfile ", int " reclen "," .BI " off_t *" fpos ", int *" last ", flag " skipnotdata "," .BI " flag " dataflag ",flag " verbose " );" .BI "int \fBms_readmsr_r\fP ( MSFileParam **ppmsfp, MSRecord **ppmsr, char *" msfile "," .BI " int " reclen ", off_t *" fpos ", int *" last "," .BI " flag " skipnotdata ", flag " dataflag ",flag " verbose " );" .BI "int \fBms_readtraces\fP ( MSTraceGroup **ppmstg, char *" msfile ", int " reclen ", " .BI " double " timetol ", double " sampratetol "," .BI " flag " dataquality ", flag " skipnotdata "," .BI " flag " dataflag ", flag " verbose " );" .BI "int \fBms_readtraces_timewin\fP ( MSTraceGroup **ppmstg, char *" msfile "," .BI " int " reclen ", double " timetol ", double " sampratetol "," .BI " hptime_t " starttime ", hptime_t " endtime "," .BI " flag " dataquality ", flag " skipnotdata "," .BI " flag " dataflag ", flag " verbose " );" .BI "int \fBms_readtraces_selection\fP ( MSTraceGroup **ppmstg, char *" msfile "," .BI " int " reclen ", double " timetol ", double " sampratetol "," .BI " Selections *" selections ", flag " dataquality "," .BI " flag " skipnotdata ", flag " dataflag ", flag " verbose " );" .BI "int \fBms_readtracelist\fP ( MSTraceList **ppmstl, char *" msfile ", int " reclen "," .BI " double " timetol ", double " sampratetol "," .BI " flag " dataquality ", flag " skipnotdata "," .BI " flag " dataflag ", flag " verbose " );" .BI "int \fBms_readtracelist_timewin\fP ( MSTraceList **ppmstl, char *" msfile "," .BI " int " reclen ", double " timetol ", double " sampratetol "," .BI " hptime_t " starttime ", hptime_t " endtime "," .BI " flag " dataquality ", flag " skipnotdata "," .BI " flag " dataflag ", flag " verbose " );" .BI "int \fBms_readtracelist_selection\fP ( MSTraceList **ppmstl, char *" msfile "," .BI " int " reclen ", double " timetol ", double " sampratetol "," .BI " Selections *" selections ", flag " dataquality "," .BI " flag " skipnotdata ", flag " dataflag ", flag " verbose " );" .fi .SH DESCRIPTION Both \fBms_readmsr\fP and \fBms_readmsr_r\fP will open and read, with subsequent calls, all Mini-SEED records from a specified file. Standard input will be opened if \fImsfile\fP is "-" (dash). As each record is read it is unpacked using \fBmsr_unpack(3)\fP. If the MSRecord struct at \fI*ppmsr\fP has not been initialized it must be set to NULL and it will be initialize it automatically. The \fBms_readmsr\fP version is not thread safe. The reentrant \fBms_readmsr_r\fP version is thread safe and can be used to read more than one file in parallel. \fBms_readmsr_r\fP stores all static file reading parameters in a MSFileParam struct. A pointer to this struct must be supplied by the caller (\fIppmsfp\fP), memory will be allocated on the initial call if the pointer is NULL. If \fIreclen\fP is 0 or negative the length of every record is automatically detected. For auto length detection records are first searched for a Blockette 1000 and if none is found a search is conducted for the next valid record header (the existence of the next record or end-of-file implying the length of the current record). If the \fIfpos\fP pointer is not NULL the value will be set to the file position (offset from the beginning in bytes) from where the returned record was read. As a special case, if \fIfpos\fP is not NULL and the value it points to is less than zero it will be interpreted as the (positive) offset in the file at which to begin reading data; this feature does not work with packed files. If the \fIlast\fP pointer is not NULL the value will be set to 1 when the record at the end of the file is being returned, otherwise it will be 0. This indicator will not be set when the last valid record in the file is followed by padding. If the \fIskipnotdata\fP flag is true (not 0) any data chunks read that do not have valid data record indicators (i.e. D, R, or Q) will be skipped. The \fIdataflag\fP argument is passed directly to \fBmsr_unpack(3)\fP and controls whether data samples are unpacked. After reading all the input records the controlling program should call it one last time with \fImsfile\fP set to NULL. This will close the file and cleanup allocated memory. If \fBms_readmsr\fP or \fBms_readmsr_r\fP are called with a different file than the one they currently have open they will close the currently open file, open the new file and print an error message. Properly coded applications should reset the function when the end of file has been reached as described above and not rely on this behavior. The \fBms_readtraces\fP and \fBms_readtracelist\fP routines read all Mini-SEED records from a file using \fBms_readmsr_r\fP and adds each one to either a MSTraceGroup or MSTraceList using \fBmst_addmsrtogroup(3)\fP and \fBmstl_addmsr(3)\fP respectively. The \fImsfile\fP, \fIreclen\fP, \fIskipnotdata\fP and \fIdataflag\fP arguments are passed directly to \fBms_readmsr_r\fP. The \fItimetol\fP, \fIsampratetol\fP and \fIdataquality\fP arguments are passed directly to \fBmst_addmsrtogroup(3)\fP or \fBmstl_addmsr(3)\fP. If the pointer to the MSTraceGroup or MSTraceList struct has not been initialized it must be set to NULL and it will be initialize automatically. The MSTraceGroup or MSTraceList structures may already contain entries and will be added to by these routines. These routines are thread safe. The \fBms_readtraces_timewin\fP and \fBms_readtracelist_timewin\fP routines perform the same function as \fBms_readtraces\fP and \fBms_readtracelist\fP but will limit the data to records containing samples between the specified \fIstarttime\fP and \fIendtime\fP. The \fBms_readtraces_selection\fP and \fBms_readtracelist_selection\fP routines perform the same function as \fBms_readtraces\fP and \fBms_readtracelist\fP but will limit the data to records that match the specified \fIselections\fP. Selections include criteria for source name and time window parameters, see \fBms_selection(3)\fP for more information. .SH RETURN VALUES On the successful read and parsing of a record \fBms_readmsr\fP and \fBms_readmsr_r\fP return MS_NOERROR and populate the MSRecord struct at \fI*ppmsr\fP. Upon reaching the end of the input file these routines return MS_ENDOFFILE. On error these routines return a libmseed error code (defined in libmseed.h) On the successful read and parsing of a file \fBms_readtraces\fP and \fBms_readtracelist\fP return MS_NOERROR and populate the MSTraceGroup or MSTraceList struct. On error these routines return a libmseed error code (defined in libmseed.h) .SH PACKED FILES \fBms_readmsr\fP, \fBms_readtraces\fP and \fBms_readtracelist\fP will read packed Mini-SEED files. Packed Mini-SEED is the indexed archive format used internally at the IRIS Data Management Center and probably not used anywhere else. .SH EXAMPLE Skeleton code for reading a file with \fBms_readmsr(3)\fP: .nf main() { MSRecord *msr = NULL; int retcode; while ( (retcode = ms_readmsr (&msr, filename, 0, NULL, NULL, 1, 0, verbose)) == MS_NOERROR ) { /* Do something with the record here, e.g. print */ msr_print (msr, verbose); } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Error reading input file %s: %s\\n", filename, ms_errorstr(retcode)); /* Cleanup memory and close file */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, verbose); } For reading a file with the thread safe \fBms_readmsr_r(3)\fP: .nf main() { MSRecord *msr = NULL; MSFileParam *msfp = NULL; int retcode; while ( (retcode = ms_readmsr_r (&msfp, &msr, filename, 0, NULL, NULL, 1, 0, verbose)) == MS_NOERROR ) { /* Do something with the record here, e.g. print */ msr_print (msr, verbose); } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Error reading input file %s: %s\\n", filename, ms_errorstr(retcode)); /* Cleanup memory and close file */ ms_readmsr_r (&msfp, &msr, NULL, 0, NULL, NULL, 0, 0, verbose); } .fi For reading a file with \fBms_readtraces(3)\fP: .nf main() { MSTraceList *mstl = NULL; int retcode; retcode = ms_readtracelist (&mstl, filename, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_NOERROR ) ms_log (2, "Error reading input file %s: %s\\n", filename, ms_errorstr(retcode)); retcode = ms_readtracelist (&mstl, filename2, 0, -1.0, -1.0, 0, 1, 0, verbose); if ( retcode != MS_NOERROR ) ms_log (2, "Error reading input file %s: %s\\n", filename2, ms_errorstr(retcode)); if ( ! mstl ) { ms_log (2, "Error reading file\\n"); return -1; } /* Do something with the traces here, e.g. print */ mstl_printtracelist (mstl, 0, verbose, 0); mstl_free (&mstl); } .fi .SH SEE ALSO \fBms_intro(3)\fP, \fBmsr_unpack(3)\fP, \fBmst_addmsrtogroup(3)\fP, \fBmstl_addmsr(3)\fP, \fBms_log(3)\fP and \fBms_errorstr(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_readmsr_r.3000077700000000000000000000000001422047135100227332ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readselectionsfile.3000077700000000000000000000000001422047135100251512ms_selection.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtracelist.3000077700000000000000000000000001422047135100236032ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtracelist_selection.3000077700000000000000000000000001422047135100256502ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtracelist_timewin.3000077700000000000000000000000001422047135100253372ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtraces.3000077700000000000000000000000001422047135100230722ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtraces_selection.3000077700000000000000000000000001422047135100251372ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_readtraces_timewin.3000077700000000000000000000000001422047135100246262ms_readmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_recsrcname.3000077700000000000000000000000001422047135100230722ms_srcname.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_samplesize.3000077700000000000000000000000001422047135100230052ms_lookup.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_seedtimestr2hptime.3000077700000000000000000000000001422047135100240772ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_selection.3000066400000000000000000000173201422047135100205320ustar00rootroot00000000000000.TH MS_SELECTION 3 2012/12/28 "Libmseed API" .SH NAME ms_selection - Routines to manage and use data selection lists. .SH SYNOPSIS .nf .B #include .BI "Selections *\fBms_matchselect\fP ( Selections *" selections ", char *" srcname "," .BI " hptime_t " starttime ", hptime_t " endtime "," .BI " SelectTime **" ppselecttime " );" .BI "Selections *\fBmsr_matchselect\fP ( Selections *" selections ", MSRecord *" msr "," .BI " SelectTime **" ppselecttime " );" .BI "int \fBms_addselect\fP ( Selections **" ppselections ", char *" srcname "," .BI " hptime_t " starttime ", hptime_t " endtime " );" .BI "int \fBms_addselect_comp\fP ( Selections **" ppselections ", char *" net "," .BI " char *" sta ", char *" loc ", char *" chan ", char *" qual "," .BI " hptime_t " starttime ", hptime_t " endtime " );" .BI "int \fBms_readselectionsfile\fP ( Selections **" ppselections ", char *" filename " );" .BI "void \fBms_freeselections\fP ( Selections *" selections " );" .BI "void \fBms_printselections\fP ( Selections *" selections " );" .fi .SH DESCRIPTION These routines serve as a convienence facility for creating a list of data selections and using it to match data. The selection criteria are the \fIsrcname\fP and optional start and end times. The \fIsrcname\fP components in a selection may contain globbing characters for matching (wildcards, character range, etc.). A \fIsrcname\fP is generally composed of network, station, location, channel and optional quality components; normally these are created with \fBmsr_srcname(3)\fP and \fBmst_srcname(3)\fP. \fBms_matchselect\fP checks for an entry in the \fPselections\fP list that matches the supplied \fIsrcname\fP and optionally \fIstarttime\fP and \fIendtime\fP. The start and/or end times can be set to HTPERROR to mean "any" time. A selection will match the specified time range if there is any overlap in time coverage. If the \fIppselecttime\fP pointer is not NULL it will be set to the matching SelectTime entry. \fBmsr_matchselect\fP is a simple wrapper to call \fBms_matchselect\fP using the details from a specified MSRecord. \fBms_addselect\fP adds a selection entry to the \fIselections\fP list based on the \fsrcname\fP and the \fIstarttime\fP and \fIendtime\fP boundaries. The source name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. Note that the \fIppselections\fP is a pointer to a pointer, if the secondary pointer has not been allocated (i.e. the list is empty) the first entry will be created and the primary pointer updated. \fBms_addselect_comp\fP is a wrapper of \fBms_addselect\fP used to add a selection entry to the \fIselections\fP list. The \fInet\fP, \fIsta\fP, \fIloc\fP, \fIchan\fP and \fIqual\fP source name components are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank (space-space) location ID. \fBms_readselectionsfile\fP reads a file containing a list of selections and adds them to the specified \fIselections\fP list. As with \fBms_addselect\fP if the selections list is empty it will be created. For more details see the \fBSELECTION FILE\fR section below. \fBms_freeselections\fP frees all memory associated with \fIselections\fP. \fBms_printselections\fP prints all of the entries in the \fIselections\fP list using the ms_log() facility. .SH RETURN VALUES The \fBms_matchselect\fP and \fBmsr_matchselect\fP routines return a pointer to the matching Selections entry on success and NULL when no match was found. These routines will also set the \fIppselecttime\fP pointer to the matching SelectTime entry if supplied. \fBms_addselect\fP and \fBms_addselect_comp\fP return 0 on success and -1 on error. \fBms_readselectionsfile\fP returns the number of selections added to the list or -1 on error. .SH "SELECTION FILE" A selection file is used to match input data records based on network, station, location and channel information. Optionally a quality and time range may also be specified for more refined selection. The non-time fields may use the '*' wildcard to match multiple characters and the '?' wildcard to match single characters. Character sets may also be used, for example '[ENZ]' will match either E, N or Z. The '#' character indicates the remaining portion of the line will be ignored. Example selection file entries (the first four fields are required) .nf #net sta loc chan qual start end IU ANMO * BH? II * * * Q IU COLA 00 LH[ENZ] R IU COLA 00 LHZ * 2008,100,10,00,00 2008,100,10,30,00 .fi .SH SRCNAME MATCHING Entries in a Selections list include a "source name" (srcname) string to represent matching parameters for network, station, location, channel and optionally the quality name components. Each name component may contain globbing characters to match more than one unique srcname. .nf Valid glob patterns include: * matches zero or more characters ? matches any single character [set] matches any character in the set [^set] matches any character NOT in the set where a set is a group of characters or ranges. a range is written as two characters separated with a hyphen: a-z denotes all characters between a to z inclusive. [-set] set matches a literal hyphen and any character in the set []set] matches a literal close bracket and any character in the set char matches itself except where char is '*' or '?' or '[' \char matches char, including any pattern character examples: a*c ac abc abbc ... a?c acc abc aXc ... a[a-z]c aac abc acc ... a[-a-z]c a-c aac abc ... .fi .SH EXAMPLE USAGE The primary intention of the Selections list facility is to limit data to a specific selection as it's read into a program. This is illustrated below. .nf main() { MSRecord *msr = NULL; Selections *selections = NULL; hptime_t starttime; hptime_t endtime; int retcode; ms_addselect (&selections, "IU_*_*_LH?_?", HPTERROR, HPTERROR); starttime = timestr2hptime ("2009/1/15 00:00:00.00"); endtime = timestr2hptime ("2009/1/31 23:59:59.99"); ms_addselect (&selections, "IU_ANMO_00_LH?_?", starttime, endtime); while ( (retcode = ms_readmsr (&msr, filename, 0, NULL, NULL, 1, 0, verbose)) == MS_NOERROR ) { /* Print details if data record matches selection criteria */ if ( msr_matchselect (selections, msr, NULL) ) { msr_print (msr, verbose); } } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Error reading input file %s: %s\\n", filename, ms_errorstr(retcode)); /* Cleanup memory and close file */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, verbose); } /* End of main() */ .fi The following two calls are equivalent: .nf ms_addselect (&selections, "IU_ANMO_00_LH?_?", starttime, endtime); ms_addselect_comp (&selections, "IU", "ANMO", "00", "LH?", "?", startime, endtime); .fi As a further convienence usage of \fBms_readselectionsfile()\fP would allow the selections to be specified in a simple ASCII file and avoid the need to directly call \fBms_addselect()\fP. .SH SEE ALSO \fBmsr_srcname(3)\fP and \fBmst_srcname(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_splitsrcname.3000066400000000000000000000045161422047135100212540ustar00rootroot00000000000000.TH MS_SPLITSRCNAME 3 2009/12/19 "Libmseed API" .SH NAME ms_splitsrcname - Split source names into the SEED naming nomenclature. .SH SYNOPSIS .nf .B #include .BI "char *\fBms_splitsrcname\fP ( char *" srcname ", char *" net ", char * " sta "," .BI " char * " loc ", char *" chan ", char *" qual " );" .fi .SH DESCRIPTION The \fBms_splitsrcname\fP routine parses SEED channel naming components from a source name string in the following format: .nf "NET_STA_LOC_CHAN[_QUAL]" .fi The first four components are required to uniquely identify a SEED channel, generally these are always present in a \fIsrcname\fP. The Quality code is normally optional in a source name. The arguments for the first four components (net, sta, loc & chan) are treated as strings but the quality code (qual) is treated as a pointer to a single character. Memory for the requested component strings must already be allocated. If a component pointer is NULL it will not be parsed from the string. Source names in the expected format are created, for example, by the \fBms_recsrcname(3)\fP, \fBmsr_srcname(3) and \fBmst_srcname(3)\fP routines. .SH LOCATION IDS AND SPACES The source name should never include spaces. The fixed format nature of SEED data records leads to blank or unused location IDs represented by spaces, in a source name such blank location IDs should be collapsed to nothing in the resulting sources names. A blank location ID is parsed from a source name as an empty string (not two spaces). .SH EXAMPLES This usage will result in net="IU", sta="ANMO", loc="00", chan="BHZ" and qual will remain unchanged (because it was not contained in the input srcname): .nf ms_splitsrcname("IU_ANMO_00_BHZ", net, sta, loc, chan, qual); .fi This usage will limit the parsing to only the network and station components with net="IU", sta="ANMO": .nf ms_splitsrcname("IU_ANMO_00_BHZ", net, sta, NULL, NULL, NULL); .fi The following usage illustrates a blank location ID and included quality code: .nf ms_splitsrcname("IU_ANMO__BHZ_Q", net, sta, loc, chan, qual); .fi The result is: .nf net = "IU" sta = "ANMO" loc = "" chan = "BHZ" qual = 'Q' .fi .SH RETURN VALUES Return 0 on success and -1 on error. .SH SEE ALSO \fBms_recsrcname(3)\fP, \fBmsr_srcname(3) and \fBmst_srcname(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_srcname.3000066400000000000000000000040761422047135100202010ustar00rootroot00000000000000.TH MS_SRCNAME 3 2006/11/27 "Libmseed API" .SH NAME ms_srcname - Determine source names using the SEED naming nomenclature. .SH SYNOPSIS .nf .B #include .BI "char *\fBms_recsrcname\fP ( char *" record ", char *" srcname ", flag " quality " );" .BI "char *\fBmsr_srcname\fP ( MSRecord *" msr ", char *" srcname ", flag " quality " );" .BI "char *\fBmst_srcname\fP ( MSTrace *" mst ", char *" srcname ", flag " quality " );" .fi .SH DESCRIPTION These routines generate a source name using the SEED naming nomenclature in the format: 'NET_STA_LOC_CHAN' and stores it in the buffer provided at \fIsrcname\fP. If the \fIquality\fP flag is true the data quality character will be appended to the source name resulting in a format of: 'NET_STA_LOC_CHAN_QUAL'. The memory pointed to by \fIsrcname\fP must have enough room for the resulting string. As of SEED 2.4 this is a maximum of 18 characters including the terminating NULL. The MSRecord and MSTrace structs are capable of producing a source name of 42 characters (including the terminating NULL) and libmseed commonly allocates 50 characters for the \fIsrcname\fP buffer. \fBms_recsrcname\fP generates a source name string for the SEED data record at \fIrecord\fP. If the \fIquality\fP flag is true the quality character will be appended. \fBmsr_srcname\fP generates a source name string for the specified MSRecord struct. If the \fIquality\fP flag is true the quality character will be appended. \fBmst_srcname\fP generates a source name string in for the specified MSTrace struct. If the \fIquality\fP flag is true *and* mst->dataquality is not zero the quality character will be appended. .SH LOCATION IDS AND SPACES The source name produced by these routines never include spaces. The fixed format nature of SEED data records leads to blank or unused location IDs represented by spaces. Such blank location IDs will be collapsed to nothing in the resulting sources names. .SH RETURN VALUES The routines return a pointer to the resulting string or NULL on error. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_strncpclean.3000066400000000000000000000024361422047135100210630ustar00rootroot00000000000000.TH MS_STRNCPCLEAN 3 2004/11/22 "Libmseed API" .SH NAME ms_strncpclean - Non-standard string copying .SH SYNOPSIS .nf .B #include .BI "int \fBms_strncpclean\fP ( char *" dest ", const char *" source ", int " length " );" .BI "int \fBms_strncpopen\fP ( char *" dest ", const char *" source ", int " length " );" .fi .SH DESCRIPTION \fBms_strncpclean\fP copies up to \fIlength\fP characters from \fIsource\fP to \fIdest\fP while removing all spaces. The result is left justified and always NULL terminated. The destination string must have enough room for the non-space characters within \fIlength\fP and the NULL terminator, a maximum of \fPlength\fP + 1. \fBms_strncpopen\fP copies \fIlength\fP characters from \fIsource\fP to \fIdest\fP padding the right side with spaces if needed and leaves the string open-ended (unterminated). The result will always be \fIlength\fP characters and will never be NULL terminated. These routines are useful for converting to and from known length SEED string fields. .SH RETURN VALUES \fBms_strncpclean\fP returns the number of characters (not including the terminating NULL) in the destination string. \fBms_strncpopen\fP returns the number of characters copied from the source string. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_strncpopen.3000077700000000000000000000000001422047135100240272ms_strncpclean.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_time.3000066400000000000000000000206361422047135100175070ustar00rootroot00000000000000.TH MS_TIME 3 2013/02/22 "Libmseed API" .SH NAME ms_time - Time conversion and string generation .SH SYNOPSIS .nf .B #include .BI "MS_EPOCH2HPTIME(X) X * (hptime_t) HPTMODULUS" .BI "MS_HPTIME2EPOCH(X) X / HPTMODULUS" .BI "hptime_t \fBms_btime2hptime\fP ( BTime *" btime " );" .BI "char *\fBms_btime2isotimestr\fP ( BTime *" btime ", char *" isotimestr " );" .BI "char *\fBms_btime2mdtimestr\fP ( BTime *" btime ", char *" mdtimestr " );" .BI "char *\fBms_btime2seedtimestr\fP ( BTime *" btime ", char *" seedtimestr " );" .BI "int \fBms_hptime2btime\fP ( hptime_t " hptime ", BTime *" btime " );" .BI "char *\fBms_hptime2isotimestr\fP ( hptime_t " hptime ", char *" isotimestr "," .BI " flag " subseconds " );" .BI "char *\fBms_hptime2mdtimestr\fP ( hptime_t " hptime ", char *" mdtimestr "," .BI " flag " subseconds " );" .BI "char *\fBms_hptime2seedtimestr\fP ( hptime_t " hptime ", char *" seedtimestr "," .BI " flag " subseconds " );" .BI "hptime_t \fBms_time2hptime\fP ( int " year ", int " day ", int " hour ", int " min "," .BI " int " sec ", int " usec " );" .BI "hptime_t \fBms_seedtimestr2hptime\fP ( char *" seedtimestr " );" .BI "hptime_t \fBms_timestr2hptime\fP ( char *" timestr " );" .fi .SH DESCRIPTION These routines convert between various time formats. Internally, libmseed represents time values as high precision epoch times (hptime), the number of ticks from the epoch: 00:00:00.00 1 January 1970. By default a tick is defined as a microsecond (0.000001 seconds). See \fBINTERNAL HPTIME\fP below for more details. Also used is the SEED binary time represented by the following data structure (defined in libmseed.h): .sp .nf typedef struct btime_s { uint16_t year; /* year with century */ uint16_t day; /* day, 1 - 366 */ uint8_t hour; /* hour, 0 - 23 */ uint8_t min; /* minute, 0 - 59 */ uint8_t sec; /* second, 0 - 60 (60 = leap second) */ uint8_t unused; /* unused alignment byte */ uint16_t fract; /* fractional seconds, 0 - 9999 */ } BTime; .fi \fBMS_EPOCH2HPTIME\fP is a macro which converts a Unix/POSIX epoch time (elapsed seconds since 1 January 1970) to a hptime which are related by a simple scaling factor. \fBMS_HPTIME2EPOCH\fP is a macro which converts an hptime to a Unix/POSIX epoch time (elapsed seconds since 1 January 1970) which are related by a simple scaling factor. The result can be cast to an integer, in which cast no rounding is performed and sub-second precision is truncated, or can be cast into a double to get a double precision epoch time. \fBms_btime2hptime\fP converts a \fIbtime\fP to a hptime. \fBms_btime2isotimestr\fP generates an ISO recommended format time string from a \fIbtime\fP. Example: '2001-07-29T12:38:00.0000'. The \fIisotimestr\fP must have enough room for 25 characters. The resulting string will be NULL terminated. \fBms_btime2mdtimestr\fP generates a month-day formatted time string from a \fIbtime\fP. Example: '2001-07-29 12:38:00.0000'. The \fImdtimestr\fP must have enough room for 25 characters. The resulting string will be NULL terminated. \fBms_btime2seedtimestr\fP generates a SEED format time string from a \fIbtime\fP. Example: '2001,195,12:38:00.0000'. The \fIseedtimestr\fP must have enough room for 23 characters. The resulting string will be NULL terminated. \fBms_hptime2btime\fP converts a \fIhptime\fP to a \fIbtime\fP. By default, hptime has microsecond precision whereas a BTime structure can only represent time to 0.0001 seconds. The precision will be lost during this conversion, it will not be accounted for by rounding but will be truncated. This behavior is by design. \fBms_hptime2isotimestr\fP generates an ISO recommended format time string from a \fIhptime\fP. Example: '2001-07-29T12:38:00.000000' or '2001-07-29T12:38:00'. The \fIisotimestr\fP must have enough room for 27 characters. The \fIsubseconds\fP flag controls whether the sub-second precision is included or not. The resulting string will be NULL terminated. \fBms_hptime2mdtimestr\fP generates a month-day formatted time string from a \fIhptime\fP. Example: '2001-07-29 12:38:00.000000' or '2001-07-29 12:38:00'. The \fIisotimestr\fP must have enough room for 27 characters. The \fIsubseconds\fP flag controls whether the sub-second precision is included or not. The resulting string will be NULL terminated. \fBms_hptime2seedtimestr\fP generates a SEED format time string from a \fIhptime\fP. Example: '2001,195,12:38:00.000000' or '2001,195,12:38:00'. The \fIseedtimestr\fP must have enough room for 25 characters. The \fIsubseconds\fP flag controls whether the sub-second precision is included or not. The resulting string will be NULL terminated. \fBms_time2hptime\fP converts the time represented by the specified \fIyear\fP, \fIday\fP, \fIhour\fP, \fImin\fP, \fIsec\fP and \fIusec\fP (microseconds) to an hptime. The range expected for each value is as follows: .sp .nf year : 1800 - 5000 day : 1 - 366 (366 = last day of leap year) hour : 0 - 23 min : 0 - 59 sec : 0 - 60 (60 = leap second) usec : 0 - 999999 .fi \fBNOTE:\fP miniSEED data records are only supported by limbseed with a year range between 1900 and 2100. These routines allow a wider range to support times for metadata, etc. \fBms_seedtimestr2hptime\fP converts a SEED time string (day-of-year style) to a high precision epoch time. The time format expected is "YYYY[,DDD,HH,MM,SS.FFFFFF]", the delimiter can be a comma [,], dash [-], colon [:] or period [.]. Additionally a 'T' or space may be used to seprate the day and hour fields. The fractional seconds ("FFFFFF") must begin with a period [.] if present. \fBms_timestr2hptime\fP converts a generic time string to a high precision epoch time. SEED time format is "YYYY[/MM/DD HH:MM:SS.FFFF]", the delimiter can be a dash [-], comma[,], slash [/], colon [:], or period [.]. Additionally a 'T' or space may be used between the date and time fields. The fractional seconds ("FFFFFF") must begin with a period [.] if present. For both \fBms_seedtimestr2hptime\fP and \fBms_timestr2hptime\fP the input time string may be "short", in which case the vales omitted on the right hand side are assumed to be 0 (with the exception of month and day which are assumed to be 1). The year is always required. This characteristic means that these time string parsers are very lenient and should not be used for validation or considered to be applying any strict validation. .SH RETURN VALUES \fBms_btime2hptime\fP, \fBms_time2hptime\fP, \fBms_seedtimestr2hptime\fP and \fBms_timestr2hptime\fP return a hptime on success and HPTERROR on error. \fBms_btime2isotimestr\fP, \fBms_btime2mdtimestr\fP, \fBms_btime2seedtimestr\fP, \fBms_hptime2isotimestr\fP, \fBms_hptime2mdtimestr\fP and \fBms_hptime2seedtimestr\fP return a pointer to the resulting string or NULL on error. \fBms_hptime2btime\fP returns 0 on success and -1 on error. .SH INTERNAL HPTIME The time values internal to libmseed are defined as the number of ticks from the epoch: 00:00:00.00 1 January 1970 and often referred to as hptime. By default a tick is defined as a microsecond (0.000001 seconds). The tick interval, and thus hptime precision, is controlled by the definition of HPTMODULUS in libmseed.h. It is not recommended to change HPTMODULUS from the default value of 1000000. This epoch time system is similar to the Unix/POSIX epoch times except that the ticks are higher precision than the 1-second ticks used in POSIX. An hptime can always be converted to a Unix/POSIX epoch time by dividing hptime by HPTMODULUS (reducing the hptime to second precision) and vise-versa, see the documentation for the MS_HPTIME2EPOCH and MS_EPOCH2HPTIME macros above. As long as the system's \fPgmtime\fP function supports negative epoch times the internal time routines will be able to represent times earlier than the epoch, i.e. times earlier than 1 January 1970. The hptime values are stored as 64-bit integers to allow high precision and avoid accumulation errors associated with floating point values. A special value defined as HPTERROR in libmseed.h is used to represent errors for routines returning hptime. .SH ACKNOWLEDGEMENTS With software provided by http://2038bug.com/ (site offline, checked Oct. 2017) .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/ms_time2hptime.3000077700000000000000000000000001422047135100225052ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_timestr2hptime.3000077700000000000000000000000001422047135100232362ms_time.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/ms_writemseed.3000066400000000000000000000070351422047135100207170ustar00rootroot00000000000000.TH MS_WRITEMSEED 3 2011/01/06 "Libmseed API" .SH NAME ms_writemseed - Write Mini-SEED records to files. .SH SYNOPSIS .nf .B #include .BI "int \fBmsr_writemseed\fP ( MSRecord *" msr ", char *" msfile ", flag " overwrite "," .BI " int " reclen ", flag " encoding ", flag " byteorder "," .BI " flag " verbose " );" .BI "int \fBmst_writemseed\fP ( MSTrace *" mst ", char *" msfile ", flag " overwrite "," .BI " int " reclen ", flag " encoding ", flag " byteorder "," .BI " flag " verbose " );" .BI "int \fBmst_writemseedgroup\fP ( MSTraceGroup *" msr ", char *" msfile "," .BI " flag " overwrite ", int " reclen ", flag " encoding "," .BI " flag " byteorder ", flag " verbose " );" .fi .SH DESCRIPTION These routines will packed the data contained in the \fBMSRecord\fP, \fBMSTrace\fP or \fBMSTraceGroup\fP into Mini-SEED records and write them to the specified file. The \fIoverwrite\fP flag controls whether the output file is overwritten or appended to. Mini-SEED records are created using the specified record length (\fIreclen\fP), Mini-SEED \fIencoding\fP and \fIbyteorder\fP. Default values will be used for any of the key characteristics of record length, encoding format and byte order that are specified as -1. The default values are: reclen = 4096 bytes, encoding = 11 (Steim2) and byteorder = 1 (MSBF or big-endian). \fIreclen\fP should be set to the desired data record length in bytes which must be expressible as 2 raised to the power of X where X is between (and including) 8 to 20. \fIencoding\fP should be set to one of the following supported Mini-SEED data encoding formats: DE_ASCII (0), DE_INT16 (1), DE_INT32 (3), DE_FLOAT32 (4), DE_FLOAT64 (5), DE_STEIM1 (10) and DE_STEIM2 (11). The encoding aliases are defined in libmseed.h. MSTrace.sampletype should indicated the sample type as either 'a' (ASCII), 'i' (32-bit integers), 'f' (32-bit floats) or 'd' (64-bit doubles). The encoding format must be appropriate for the sample type of the MSTrace samples. For example, Steim compression and integer encoding formats require integer samples and float encoding formats require the appropriate size floats as input. As a counter example, float samples cannot be packed using Steim compression or integer encoding formats. \fIbyteorder\fP must be either 0 (LSBF or little-endian) or 1 (MBF or big-endian). The \fIverbose\fP flag controls verbosity, a value of zero will result in no diagnostic output. .SH RETURN VALUES All of these routines return the number of records written on success and -1 on error. .SH EXAMPLE Skeleton code for writing Mini-SEED records with \fBmsr_writemseed(3)\fP: .nf main() { MSRecord *msr; int precords; msr = msr_init (NULL); /* Populate MSRecord values */ strcpy (msr->network, "XX"); strcpy (msr->station, "TEST"); strcpy (msr->channel, "BHE"); msr->starttime = ms_seedtimestr2hptime ("2004,350,00:00:00.00"); msr->samprate = 40.0; msr->datasamples = dataptr; /* pointer to 32-bit integer data samples */ msr->numsamples = 1234; msr->sampletype = 'i'; /* declare type to be 32-bit integers */ /* Write record(s) with 4096-byte length, Steim-2 compression, big-endian */ precords = msr_writemseed (msr, "output.mseed", 1, 4096, DE_STEIM2, 1, 0); ms_log (0, "Wrote %d records\n", precords); msr_free (&msr); } .fi .SH SEE ALSO \fBms_intro(3)\fP, \fBmsr_pack(3)\fP and \fBmst_pack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_addblockette.3000066400000000000000000000033421422047135100213530ustar00rootroot00000000000000.TH MSR_ADDBLOCKETTE 3 2006/02/27 "Libmseed API" .SH NAME msr_addblockette - Add a blockette to the blockette chain of an MSRecord structure .SH SYNOPSIS .nf .B #include .BI "BlktLink *\fBmsr_addblockette\fP ( MSRecord *" msr ", char *" blktdata ", .BI " int " length ", int " blkttype ", int " chainpos " ); .fi .SH DESCRIPTION \fBmsr_addblockette\fP adds a blockette to a blockette chain of an MSRecord structure. The \fIchainpos\fP value controls which end of the chain the blockette is added to. If \fIchainpos\fP is 0 the blockette will be added to the end of the chain (last blockette), other wise it will be added to the beginning of the chain (first blockette). A blockette chain is composed of linked BlktLink structures. A blockette chain for a given MSRecord structure begins at MSRecord.blkts. \fIblktdata\fP should be the blockette body (no blockette type and next header) of \fIlength\fP bytes and type \fIblkttype\fP. Data structures for all SEED 2.4 data blockette types are defined in \fBlibmseed.h\fP with these minor exceptions: Blockette 2000 (opaque data) is only partially represented as it has an unknown data structure by definition and Blockette 405 which depends on full SEED for a full data description. It is highly recommended to use these provided data structures when adding blockettes as it allows the library to manipulate the blockette (swap byte order, etc.) and assures SEED 2.4 compatibility. .SH RETURN VALUE \fBmsr_addblockette\fP returns a pointer to the BlktLink structure added to the blockette chain on success or NULL on error. .SH SEE ALSO \fBms_intro(3)\fP, \fBmsr_pack(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_duplicate.3000066400000000000000000000013761422047135100207050ustar00rootroot00000000000000.TH MSR_DUPLICATE 3 2007/04/28 "Libmseed API" .SH NAME msr_duplicate - Duplicate an MSRecord structure .SH SYNOPSIS .nf .B #include .BI "MSRecord *\fBmsr_duplicate\fP ( MSRecord *" msr ", flag " datadup " );" .fi .SH DESCRIPTION \fBmsr_duplicate\fP creates a copy of an MSRecord structure including all sub-structures (FSDH and blockette chain). If the \fIdatadup\fP flag is true the data samples from \fImsr\fP will also be duplicated, otherwise the copy MSRecord will not have any associated data sample array regardless if the source MSRecord had any. .SH RETURN VALUE \fBmsr_duplicate\fP returns a pointer to an MSRecord on success and NULL on error. .SH SEE ALSO \fBms_intro(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_endtime.3000077700000000000000000000000001422047135100233252msr_starttime.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_free.3000077700000000000000000000000001422047135100215502msr_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_free_blktchain.3000077700000000000000000000000001422047135100235672msr_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_host_latency.3000066400000000000000000000016721422047135100214260ustar00rootroot00000000000000.TH MSR_HOST_LATENCY 3 2006/02/27 "Libmseed API" .SH NAME msr_host_latency - Calculate latency between last sample in a Mini-SEED record and the host computer time. .SH SYNOPSIS .nf .B #include .BI "double \fBmsr_host_latency\fP ( MSRecord *" msr " );" .fi .SH DESCRIPTION \fBmsr_host_latency\fP calculates the latency in seconds of the Mini-SEED data as the difference between current time in UTC of the host computer and the time of the last sample in the record. This routine is only really useful when dealing with a telemetered data stream or something similar. Double precision is returned, but the true precision is dependent on the accuracy of the host system clock among other things. .SH RETURN VALUES \fBmsr_host_latency\fP returns seconds of latency or 0.0 on error (indistinguishable from 0.0 latency). .SH SEE ALSO \fBms_intro(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_init.3000066400000000000000000000024211422047135100176660ustar00rootroot00000000000000.TH MSR_INIT 3 2006/02/27 "Libmseed API" .SH NAME msr_init - Initializing and freeing MSRecord and related structures .SH SYNOPSIS .nf .B #include .BI "MSRecord *\fBmsr_init\fP ( MSRecord *" msr " ); .BI "void \fBmsr_free\fP ( MSRecord **" ppmsr " ); .BI "void \fBmsr_free_blktchain\fP ( MSRecord *" msr " ); .fi .SH DESCRIPTION \fBmsr_init\fP will initialize a MSRecord structure. If the \fImsr\fP parameter is NULL a new structure will be allocated. If the \fImsr\fP parameter is not NULL the blockette chain (MSRecord.blkts) will be freed but any memory allocated for MSRecord.fsdh and MSRecord.datasamples will be preserved as it will cleanly be re-used by routines such as \fBmsr_unpack(3)\fP. \fBmsr_free\fP will free all memory associated with a MSRecord structure including the blockette chain and set the structure pointer (*ppmsr) to 0. \fBmsr_free_blktchain\fP will free all memory associated with the blockette chain of an MSRecord structure. The shortcut blockette pointers will also be reset. .SH RETURN VALUES \fBmsr_init\fP returns a pointer to the MSRecord structure initialized on success or NULL on error. .SH SEE ALSO \fBms_intro(3)\fP, \fBmsr_pack(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_nomsamprate.3000077700000000000000000000000001422047135100240262msr_samprate.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_normalize_header.3000066400000000000000000000027601422047135100222410ustar00rootroot00000000000000.TH MSR_NORMALIZE_HEADER 3 2007/04/28 "Libmseed API" .SH NAME msr_normalize_header - Normalize or synchronize the header fields of an MSRecord structure. .SH SYNOPSIS .nf .B #include .BI "int \fBmsr_normalize_header\fP ( MSRecord *" msr ", flag " verbose ); .fi .SH DESCRIPTION \fBmsr_normalize_header\fP updates the SEED structures associated with an MSRecord structure (MSRecord.fsdh and the blockette chain at MSRecord.blkts) with primary values stored at the MSRecord level (e.g. MSRecord.starttime, MSRecord.samprate, etc.). The long explanation is that certain key values (start time, sample rate, etc.) are duplicated in a given MSRecord structure. For example the start time is stored at both MSRecord.starttime and in the BTIME structure in the FSDH at MSRecord.fsdh. The base values at the MSRecord level (e.g. MSRecord.starttime) are always the primary values. But before the data record can be packed these values must be translated back into the SEED structures. For these duplicated values the \fBmsr_normalize_header\fP routine peforms this translation. Normally this routine will be called via internal functions when \fBmsr_pack\fP is called, it could also be used to synchronize the header values when they are directly modified. .SH RETURN VALUE \fBmsr_normalize_header\fP returns the header length in bytes on success and -1 on error. .SH SEE ALSO \fBms_intro(3)\fP, \fBmsr_pack(3)\fP and \fBmsr_pack_header(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_pack.3000066400000000000000000000165411422047135100176510ustar00rootroot00000000000000.TH MSR_PACK 3 2013/05/17 "Libmseed API" .SH NAME msr_pack - Packing of Mini-SEED records. .SH SYNOPSIS .nf .B #include .BI "int \fBmsr_pack\fP ( MSRecord *" msr "," .BI " void (*" record_handler ") (char *, int, void *)," .BI " void *" handlerdata ", int64_t *" packedsamples "," .BI " flag " flush ", flag " verbose " );" .BI "int \fBmsr_pack_header\fP ( MSRecord *" msr ", flag " normalize "," .BI " flag " verbose " );" .fi .SH DESCRIPTION \fBmsr_pack\fP creates (packs) Mini-SEED data records. Using the record header values in a MSRecord data structure, \fImsr\fP, as a template, the common header fields and blockettes are packed into a record header. A Blockette 1000 will be added if one is not present in the template. The data samples at MSRecord.datasamples are packed in the encoding format indicated by the MSRecord.encoding field. The MSRecord.datasamples array and MSRecord.numsamples value will not be changed by this routine. It is the responsibility of the calling routine to adjust the data buffer if desired. This routine will modify the start time and sequence number of the MSRecord template as it packs records. The key characteristics of data record & quality indicator, record length, encoding format and byte order of packed records are taken from \fBMSRecord.dataquality\fP, \fBMSRecord.reclen\fP, \fBMSRecord.encoding\fP and \fBMSRecord.byteorder\fP respectively. Default values for these quantities will be used when the indicator is 0 or the reclen, encoding or byteorder are -1 respectively. The default values are: dataquality = 'D', reclen = 4096 bytes, encoding = 11 (Steim2) and byteorder = 1 (MSBF or big-endian). \fBMSRecord.dataquality\fP should be either 'D', 'R', 'Q' or 'M'. \fBMSRecord.reclen\fP should be set to the desired data record length in bytes which must be expressible as 2 raised to the power of X where X is between (and including) 8 to 20. \fBMSRecord.encoding\fP should be set to one of the following supported Mini-SEED data encoding formats: DE_ASCII (0), DE_INT16 (1), DE_INT32 (3), DE_FLOAT32 (4), DE_FLOAT64 (5), DE_STEIM1 (10) and DE_STEIM2 (11). The encoding aliases are defined in libmseed.h. \fBMSRecord.sampletype\fP should indicated the sample type as either 'a' (ASCII), 'i' (32-bit integers), 'f' (32-bit floats) or 'd' (64-bit doubles). The encoding format must be appropriate for the sample type. For example, Steim compression and integer encoding formats require integer samples and float encoding formats require the appropriate size floats as input. As a counter example, float samples cannot be packed using Steim compression or integer encoding formats. \fBMSRecord.byteorder\fP must be either 0 (LSBF or little-endian) or 1 (MBF or big-endian). Each time a complete record is packed it will be passed to the \fIrecord_handler()\fP function which expects three arguments: 1) a char * to the record buffer, 2) the length of the record in bytes and 3) a void pointer supplied by the caller. It is the responsibility of \fIrecord_handler()\fP to process the record, the memory will be re-used or freed when \fIrecord_handler()\fP returns. This function pointer is required, there is no other way to access the packed records. The \fIhandlerdata\fP pointer will be passed as the 3rd argument to \fIrecord_handler()\fP. This allows the caller to optionally pass data directly to the \fIrecord_handler()\fP. The integer pointed to by \fIpackedsamples\fP will be set to the total number of samples packed if not NULL. If the \fIflush\fP flag is not zero all of the data will be packed into records, otherwise records will only be packed while there are enough data samples to completely fill a record. The \fIverbose\fP flag controls verbosity, a value of zero will result in no diagnostic output. \fBmsr_pack_header\fP packs header information, fixed section and blockettes, in a MSRecord structure into the Mini-SEED record at MSRecord.record. This is useful for re-packing record headers after modification. The \fInormalize\fP flag controls whether msr_normalize_header() is called before the header is packed. Normalizing updates the SEED structures associated with the MSRecord with values using the MSRecord base members (e.g. MSRecord.network, MSRecord.samplerate, etc.). Normally this should be set to true (1) unless the associated SEED structures have been directly modified. The \fIverbose\fP flag controls verbosity, a value of zero will result in no diagnostic output. .SH PACKING OVERRIDES The following macros and environment variables effect the packing of Mini-SEED: .nf Macros: MS_PACKHEADERBYTEORDER(X) MS_PACKDATABYTEORDER(X) Environment variables: PACK_HEADER_BYTEORDER PACK_DATA_BYTEORDER .fi These macros and environment variables force the byte order of the header and data respectively. They could be set to either 0 (little endian) or 1 (big endian). Normally the byte order of the header and data is determined by the byteorder flag of the MSRecord, this capability is included to support any combination of byte orders in a generalized way. .SH COMPRESSION HISTORY When the encoding format is Steim 1 or 2 compression contiguous records will be created including compression history. Put simply, this means that the first difference in the compression series will be the difference between the first sample of the current record and the last sample of the previous record. For the first record in a series (no previous record), a so-called cold start, the first difference will be zero. The compression history can be seeded by allocating the StreamState struct for the MSRecord and setting the \fBlastintsample\fP member to the integer sample value that preceded the first sample in the current series and setting the \fBcomphistory\fP flag to true (1). .SH RETURN VALUES \fBmsr_pack\fP returns the number records created on success and -1 on error. \fBmsr_pack_header\fP returns the header length in bytes on success and -1 on error. .SH EXAMPLE Skeleton code for creating (packing) Mini-SEED records with msr_pack(3): .nf static void record_handler (char *record, int reclen, void *srcname) { if ( fwrite(record, reclen, 1, outfile) != 1 ) { ms_log (2, "Error writing %s to output file\n", (char *)srcname); } } main() { int64_t psamples; int precords; MSRecord *msr; char srcname[50]; msr = msr_init (NULL); /* Populate MSRecord values */ strcpy (msr->network, "XX"); strcpy (msr->station, "TEST"); strcpy (msr->channel, "BHE"); msr->starttime = ms_seedtimestr2hptime ("2004,350,00:00:00.00"); msr->samprate = 40.0; msr->reclen = 4096; /* 4096 byte record length */ msr->encoding = DE_STEIM2; /* Steim 2 compression */ msr->byteorder = 1; /* big endian byte order */ msr->datasamples = dataptr; /* pointer to 32-bit integer data samples */ msr->numsamples = 1234; msr->sampletype = 'i'; /* declare type to be 32-bit integers */ msr_srcname (msr, srcname, 0); /* Pack the record(s) */ precords = msr_pack (msr, &record_handler, srcname, &psamples, 1, verbose); ms_log (0, "Packed %"PRId64" samples into %d records\n", psamples, precords); msr_free (&msr); } .fi .SH SEE ALSO \fBms_intro(3)\fP, \fBmst_pack(3)\fP, \fBmst_packgroup(3)\fP, \fBmsr_normalize_header(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_pack_header.3000077700000000000000000000000001422047135100230302msr_pack.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_parse.3000066400000000000000000000112341422047135100200370ustar00rootroot00000000000000.TH MSR_PARSE 3 2013/01/07 "Libmseed API" .SH NAME msr_parse - Detect and parse a SEED data record from a memory buffer .SH SYNOPSIS .nf .B #include .BI "int \fBmsr_parse\fP ( char *" record ", int " recbuflen ", MSRecord " **ppmsr "," .BI " int " reclen ", flag " dataflag ", flag " verbose " );" .BI "int \fBmsr_parse_selection\fP ( char *" recbuf ", int " recbuflen "," .BI " int64_t *" offset ", MSRecord " **ppmsr "," .BI " int " reclen ", Selections *" selections "," .BI " flag " dataflag ", flag " verbose " );" .BI "int \fBms_detect\fP ( const char *" record ", int " recbuflen " );" .SH DESCRIPTION \fBmsr_parse\fP will parse a SEED data record from the \fIrecord\fP buffer and populate the MSRecord structure at \fIppmsr\fP, allocating one if needed. The \fIrecbuflen\fP argument is the length of the \fIrecord\fP buffer. Records must begin at the start of the buffer. If \fIreclen\fP is 0 or negative the length of record is automatically determined, otherwise \fIreclen\fP should be the correct record length. For auto detection of record length the record should include a 1000 blockette or be followed by another record header in the buffer. If \fIdataflag\fP is true (non-zero) the data samples will be unpacked when parsing the record. This argument is passed directly to \fBmsr_unpack(3)\fP. \fBmsr_parse_selection\fP will parse the first SEED data record from the \fIrecbuf\fP buffer that matches the optional \fIselections\fP. The \fIoffset\fP value indicates where to start searching the buffer. On success, the MSRecord structure at \fIppmsr\fP is populated and the \fIoffset\fP to the record in the buffer is set. See the example below for the intended usage pattern. \fBms_detect\fP determines whether the supplied \fIrecord\fP buffer contains a SEED data record by verifying known signatures, if a record is found the record length is determined by: 1) Searching the buffer up to \fIrecbuflen\fP for a Blockette 1000. 2) If no Blockette 1000 is found search at MINRECLEN-byte offsets for the fixed section of the next header in the buffer, thereby implying the record length. .SH RETURN VALUES \fBmsr_parse\fP returns values: .nf 0 : On success and populates the supplied MSRecord. >0 : Data record was detected but not enough data is present in buffer, the value returned is a hint of how much more data is needed. <0 : On error a negative libmseed error value is returned. \fBms_detect\fP returns values: .nf -1 : Data record not detected or error 0 : Data record detected but could not determine length >0 : Length of the data record in bytes .fi .SH EXAMPLE USAGE OF MS_PARSE_SELECTION() The \fBms_parse_selection()\fP routine uses the initial setting of \fIoffset\fP as the starting point to search the buffer. On successful parsing of a miniSEED record the value of \fIoffset\fP will be the offset in the buffer to the record parsed. To properly parse all records matching specificed selection criteria, a caller must check and manage the value of \fIoffset\fP. In particular, when the end of the buffer is reached a value of MS_GENERROR will be returned and the caller should check if the offset is still within the buffer length to determine if this is a parsing error or simply the end of the buffer. The following example illustrates the intended usage: .nf char *recbuf = ; int64_t recbuflen = ; int64_t offset = 0; MSRecord *msr = NULL; int reclen = -1; Selections *selections = NULL; flag dataflag = 1; flag verbose = 0; // You probaby want to set Selections // For example with a call to ms_readselectionsfile (&selections, selectfile) /* Loop over all selected records in recbuf */ while ( offset < recbuflen ) { if ( msr_parse_selection (recbuf, recbuflen, &offset, &msr, reclen, selections, dataflag, verbose) ) { /* Only print error if offset is still within buffer length */ if ( verbose && offset < recbuflen ) ms_log (2, "Error parsing record at offset %"PRId64"\n", offset); } else /* Successfully found and parsed record */ { /* Do something with the record, for example print the details */ msr_print (msr, verbose); /* Increment offset in buffer for subsequent call to msr_parse_selection() */ offset += msr->reclen; } } /* Clean up */ msr_free (&msr); if ( selections ) ms_freeselections (selections); .fi .SH SEE ALSO \fBmsr_unpack(3)\fP, \fBms_parse_raw(3)\fP and \fBms_errorstr(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_parse_selection.3000077700000000000000000000000001422047135100241552msr_parse.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_print.3000066400000000000000000000015641422047135100200660ustar00rootroot00000000000000.TH MSR_PRINT 3 2006/11/27 "Libmseed API" .SH NAME msr_print - Printing of Mini-SEED record header values. .SH SYNOPSIS .nf .B #include .BI "void \fBmsr_print\fP ( MSRecord *" msr ", flag " details " );" .fi .SH DESCRIPTION \fBmsr_print\fP prints formatted details from the given MSRecord struct (parsed record header), i.e. fixed section and blockettes. All output is printed using \fBms_log(3)\fP at level 0. The \fIdetails\fP flag controls how much information is printed: .nf 0 : a single line summarizing the record 1 : most commonly desired header details 2+ : all header details .fi If no fixed section header information is available at MSRecord.fsdh then a single line is printed from the other information in the MSRecord structure. .SH SEE ALSO \fBms_intro(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_samprate.3000066400000000000000000000025321422047135100205420ustar00rootroot00000000000000.TH MSR_SAMPRATE 3 2006/02/27 "Libmseed API" .SH NAME msr_samprate - Determine sample rate from an MSRecord structure .SH SYNOPSIS .nf .B #include .BI "double \fBmsr_samprate\fP ( MSRecord *" msr " ); .BI "double \fBmsr_nomsamprate\fP ( MSRecord *" msr " ); .fi .SH DESCRIPTION \fBmsr_samprate\fP will calculate a double precision sample rate in samples per second using the header values in the specified MSRecord. If a Blockette 100 is included, the "Actual sample rate" (field 3) will be returned, otherwise a nominal sample rate will be calculated from the sample rate factor and multiplier in the fixed section data header. NOTE: The sample rate for a MSRecord structure is available directly at MSRecord.samplerate. libmseed based programs should use that sample rate whenever possible (\fBmsr_unpack\fP uses \fBmsr_samprate\fP to set MSRecord.samplerate). \fBmsr_nomsamprate\fP will calculate a double precision sample rate in samples per second using the sample rate factor and multiplier in the fixed section data header. .SH RETURN VALUES \fBmsr_samprate\fP returns a double precision sample rate on success and -1.0 on error. \fBmsr_nomsamprate\fP returns a double precision sample rate on success and -1.0 on error. .SH SEE ALSO \fBms_intro(3)\fP and \fBmsr_unpack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_srcname.3000077700000000000000000000000001422047135100225622ms_srcname.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_starttime.3000066400000000000000000000042611422047135100207430ustar00rootroot00000000000000.TH MSR_STARTTIME 3 2015/03/02 "Libmseed API" .SH NAME msr_starttime - Start and end time determination for MSRecord structures .SH SYNOPSIS .nf .B #include .BI "hptime_t \fBmsr_starttime\fP ( MSRecord *" msr " );" .BI "hptime_t \fBmsr_starttime_uc\fP ( MSRecord *" msr " );" .BI "hptime_t \fBmsr_endtime\fP ( MSRecord *" msr " );" .fi .SH DESCRIPTION \fBmsr_starttime\fP returns the start time of the record as a high precision epoch time (see \fBms_time(3)\fP). Any time correction given in the fixed section data header is applied if it has not already been applied. If Blockette 1001 is included and parsed the microseconds indicated (field 4) are also applied. NOTE: The record start time for a MSRecord structure is available directly at MSRecord.starttime. Libmseed based programs should use that start time whenever possible (\fBmsr_unpack\fP uses \fBmsr_starttime\fP to set MSRecord.starttime). \fBmsr_starttime_uc\fP is a version of \fBmsr_starttime\fP that applies no time corrections, just a basic conversion of the start time values in the fixed section data header. \fBmsr_endtime\fP returns the time of the last sample in the record as a high precision epoch time (seed \fBms_time(3)\fP). This is *not* the time "covered" by the last sample, but the actual sample time. This function calculates the record start time with \fBmsr_starttime\fP and then adds the time covered by the samples in the record which is calculated from the number of samples and sample rate. \fBmsr_endtime\fP will adjust the end time appropriately if the record is known to contain a positive leap second. If the \fBms_readleapseconds\fP or \fBms_readleapsecondfile\fP routines have been called to read a leap second file into an internal list, it will be checked to know when leap seconds occur. If a leap second list is not available the fixed section data header is checked for a positive leap second indicator. .SH RETURN VALUES \fBmsr_starttime\fP, \fBmsr_starttime_uc\fP and \fBmsr_endtime\fP return a high precision epoch time on success and HPTERROR on error. .SH SEE ALSO \fBms_intro(3)\fP, \fBms_time(3)\fP and \fBmsr_unpack(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_starttime_uc.3000077700000000000000000000000001422047135100244032msr_starttime.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/msr_unpack.3000066400000000000000000000107521422047135100202120ustar00rootroot00000000000000.TH MSR_UNPACK 3 2012/12/22 "Libmseed API" .SH NAME msr_unpack - Unpacking of Mini-SEED records. .SH SYNOPSIS .nf .B #include .BI "int \fBmsr_unpack\fP ( char *" record ", int " reclen ", MSRecord **" ppmsr ", .BI " flag " dataflag ", flag " verbose " ); .fi .BI "int \fBmsr_unpack_data\fP ( MSRecord *" msr ", int " swapflag ", flag " verbose " ); .fi .SH DESCRIPTION \fBmsr_unpack\fP will unpack a Mini-SEED data record and populate a MSRecord data structure, optionally unpacking data samples. All multi-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 record pointed to by \fIrecord\fP in bytes. If the \fI*ppmsr\fP pointer is NULL a new MSRecord will be allocated, if not the existing MSRecord will be reinitialized and reused destroying any previous contents. The \fIppmsr\fP pointer itself must not be NULL. If the \fIdataflag\fP flag is not zero any data samples in the record will be unpacked/decompressed. The following data encoding formats are supported: ASCII, INT16, INT32, FLOAT32, FLOAT64, STEIM1 and STEIM2. The MSRecord.datasamples pointer will be set appropriately and the samples will be either ASCII, 32-bit integers, 32-bit floats or 64-bit floats with the same byte order as the host machine. MSRecord.numsamples will be set to the actual number of samples unpacked/decompressed. MSRecord.sampletype will indicated the sample type 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 is returned by the get_samplesize(3) lookup routine. The \fIverbose\fP flag controls verbosity, a value of zero will result in no diagnostic output. \fBmsr_unpack_data\fP will unpack the data samples for an already parsed MSRecord structure from the original record available at the \fIMSRecord->record\fP pointer. Normally this is called by \fBmsr_unpack\fP when the \fIdataflag\fP is not zero, but it can be useful when the program needs to first unpack the header of a record and decide later if the samples are needed. If called independently the caller must determine if byte swapping of data samples is needed. .SH UNPACKING OVERRIDES The following macros and environment variables effect the unpacking of Mini-SEED: .nf Macros: MS_UNPACKHEADERBYTEORDER(X) MS_UNPACKDATABYTEORDER(X) MS_UNPACKDATAFORMAT(X) MS_UNPACKDATAFORMATFALLBACK(X) Environment variables: UNPACK_HEADER_BYTEORDER UNPACK_DATA_BYTEORDER UNPACK_DATA_FORMAT UNPACK_DATA_FORMAT_FALLBACK .fi The UNPACK_HEADER_BYTEORDER and UNPACK_DATA_BYTEORDER macros and variables 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 a records 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 encoding format that will be used when the SEED data record does not indicate the format, i.e. the record does not include a 1000 blockette. By default the fallback encoding format is 10 (Steim-1 compression). If this default is invoked and the byte order of the data is unspecified big endian byte order will be assumed. If a data record does not include a 1000 blockette it is not Mini-SEED, the capability to read these records is included only to support legacy data. .SH RETURN VALUE On the successful parsing of a record \fBmsr_unpack\fP returns MS_NOERROR and populates the MSRecord struct at *ppmsr. On error \fBmsr_unpack\fP returns a libmseed error code (defined in libmseed.h) .SH EXAMPLE Skeleton code for unpacking a Mini-SEED record with msr_unpack(3): .nf main() { 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 .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/msr_writemseed.3000077700000000000000000000000001422047135100240222ms_writemseed.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_addmsr.3000066400000000000000000000056151422047135100202070ustar00rootroot00000000000000.TH MST_ADDMSR 3 2013/05/17 "Libmseed API" .SH NAME mst_addmsr - Add time coverage and data samples to MSTrace structures .SH SYNOPSIS .nf .B #include .BI "int *\fBmst_addmsr\fP ( MSTrace *" mst ", MSRecord *" msr ", flag " whence " ); .BI "int \fBmst_addspan\fP ( MSTrace *" mst ", hptime_t " starttime ", hptime_t " endtime ", .BI " void *" datasamples ", int64_t " numsamples ", .BI " char " sampletype ", flag " whence " ); .BI "MSTrace *\fBmst_addmsrtogroup\fP ( MSTraceGroup *" mstg ", MSRecord *" msr ", .BI " flag " dataquality ", double " timetol ", .BI " double " sampratetol " ); .BI "MSTrace *\fBmst_addtracetogroup\fP ( MSTraceGroup *" mstg ", MSTrace *" mst " );" .fi .SH DESCRIPTION These routines provides different ways of adding time coverage to MSTrace objects. A common way to organize MSTrace objects is with a MSTraceGroup. The \fBmst_addmsrtogroup\fP provides a convenient way to add MSRecord data to a MSTraceGroup, hiding many of the details of MSTrace matching and bookkeeping. \fBmst_addmsr\fP will add the time coverage from a MSRecord to a MSTrace. The start or end time will be updated and data samples copied if they exist. No checking is done to verify that the record matches the trace in any way. If \fIwhence\fP is 1 the MSRecord coverage will be added at the end of the MSTrace. If \fIwhence\fP is 2 the MSRecord coverage will be added at the beginning of the MSTrace. \fBmst_addspan\fP does the same thing as \fBmsr_addmsr\fP except that time coverage and data samples are explicitly provided. See \fBms_time(3)\fP for a description of the high precision epoch time format needed for \fIstarttime\fP and \fIendtime\fP. See the \fBWaveform Data\fP section of \fBms_intro(3)\fP for a description of data sample representation. \fBmst_addmsrtogroup\fP adds time coverage from the specified MSRecord to the first adjacent MSTrace found in the specified MSTraceGroup. If the \fIdataquality\fP flag is true traces will be grouped by quality in addition to the source name identifiers. \fBmst_findadjacent(3)\fP is used with the specified sample rate and time tolerances to find an adjacent trace, see \fBmst_findadjacent(3)\fP for further details. If no adjacent MSTrace is found a new MSTrace will be added to the MSTraceGroup. \fBmst_addtracetogroup\fP adds a MSTrace structure to a MSTraceGroup structure. The MSTrace is added at the end of the MSTrace chain. .SH RETURN VALUES \fBmst_addmsr\fP and \fBmst_addspan\fP return 0 on success and -1 on error. \fBmst_addmsrtogroup\fP returns a pointer to the MSTrace updated or 0 on error. \fBmst_addtracetogroup\fP returns a pointer to the MSTrace added or 0 on error. .SH SEE ALSO \fBms_intro(3)\fP, \fBmst_init(3)\fP, \fBmst_findadjacent(3)\fP and \fBms_time(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_addmsrtogroup.3000077700000000000000000000000001422047135100240342mst_addmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_addspan.3000077700000000000000000000000001422047135100225542mst_addmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_addtracetogroup.3000077700000000000000000000000001422047135100243312mst_addmsr.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_convertsamples.3000066400000000000000000000031541422047135100217760ustar00rootroot00000000000000.TH MST_CONVERTSAMPLES 3 2013/10/01 "Libmseed API" .SH NAME mst_convertsamples - Convert data samples between numeric types .SH SYNOPSIS .nf .B #include .BI "int \fBmst_convertsamples\fP ( MSTrace *" mst ", char " type ", flag " truncate ");" .BI "int \fBmstl_convertsamples\fP ( MSTraceSeg *" seg ", char " type ", flag " truncate ");" .SH DESCRIPTION \fBmst_convertsamples\fP and \fBmst_convertsamples\fP convert any data samples associated with an \fIMSTrace\fP or \fIMSTraceSeg\fP to a specified \fitype\fP. The routines can convert between 32-bit integers (type \fIi\fP), 32-bit floats (type \fIf\fP) and 64-bit doubles (type \fId\fP). When converting float and double sample types to integer type a simple rounding is applied by adding 0.5 to the sample value before converting (truncating) to integer. This compensates for common machine representations of floating point values (e.g. "40.0" represented by "39.99999999"). If the \fItruncate\fP flag is true data samples will be truncated to integers even if loss of sample precision is detected. If the \fItruncate\fP flag is false (0) and loss of precision is detected an error is returned. Loss of precision is determined by testing that the difference between the floating point value and the (truncated) integer value is greater than 0.000001. ASCII data samples (type \fIa\fP) cannot be converted, if supplied or requested an error will be returned. .SH RETURN VALUES \fBmst_convertsamples\fP and \fBmstl_convertsamples\fP return 0 on success and -1 on error. .SH SEE ALSO \fBms_intro(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_findadjacent.3000077700000000000000000000000001422047135100242372mst_findmatch.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_findmatch.3000066400000000000000000000054601422047135100206700ustar00rootroot00000000000000.TH MST_FINDMATCH 3 2006/02/27 "Libmseed API" .SH NAME mst_findmatch - Searching a MSTraceGroup for specific MSTrace structures. .SH SYNOPSIS .nf .B #include .BI "MSTrace *\fBmst_findmatch\fP ( MSTrace *" startmst ", char " dataquality ", .BI " char *" network ", char *" station ", .BI " char *" location ", char *" channel " ); .BI "MSTrace *\fBmst_findadjacent\fP ( MSTraceGroup *" mstg ", .BI " flag *" whence ", char " dataquality ", .BI " char *" network ", char *" station ", .BI " char *" location ", char *" channel ", .BI " double " samprate ", double " sampleratetol ", .BI " hptime_t " starttime ", hptime_t " endtime ", .BI " double " timetol ");" .SH DESCRIPTION \fBmst_findmatch\fP traverses a MSTrace chain starting at \fIstartmst\fP and returns the first entry that matches the source name identifiers. If \fIdataquality\fP is not zero it must also match the found entry. A calling program commonly calls this routine in a loop in order to find all matching MSTraces in a MSTraceGroup. \fBmst_findadjacent\fP finds the first entry in the MSTraceGroup pointed to by \fImstg\fP that matches the given source name identifiers and is time adjacent to the time coverage described by the \fIsamprate\fP, \fIstarttime\fP and \fIendtime\fP. If \fIdataquality\fP is not zero it must also match the found entry. See \fBms_time(3)\fP for a description of the high precision epoch time format needed for \fIstarttime\fP and \fIendtime\fP. The tolerance for sample rate and time matching can also be specified. If \fIsampratetol\fP is -1.0 the default tolerance of abs(1-sr1/sr2) < 0.0001 is used. If \fItimetol\fP is -1.0 the default time tolerance of 1/2 the sample period will be used. If \fIsampratetol\fP or \fItimetol\fP is -2.0 the respective tolerance check will not be performed. If time tolerance is not checked \fIwhence\fP will be set to whichever end fits best. The time tolerance is specified in seconds. When an adjacent MSTrace is found the \fIwhence\fP flag will be set to indicate where the indicated time span is adjacent in the following way: .sp .nf 1: time span fits at the end of the MSTrace 2: time span fits at the beginning of the MSTrace .fi .SH RETURN VALUES \fBmst_findmatch\fP returns a pointer to the matching MSTrace structure or 0 if no match found or error. \fBmst_findadjacent\fP returns a pointer to the adjacent MSTrace structure and the \fIwhence\fP flag is set when an adjacent MSTrace is found or 0 when no adjacent MSTrace is found. .SH SEE ALSO \fBms_intro(3)\fP, \fBmst_init(3)\fP and \fBms_time(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_free.3000077700000000000000000000000001422047135100215542mst_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_freegroup.3000077700000000000000000000000001422047135100226312mst_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_groupheal.3000077700000000000000000000000001422047135100237222mst_groupsort.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_groupsort.3000066400000000000000000000034711422047135100207770ustar00rootroot00000000000000.TH MST_GROUPSORT 3 2007/04/12 "Libmseed API" .SH NAME mst_groupsort - Manipulate MSTrace segments in a MSTraceGroup .SH SYNOPSIS .nf .B #include .BI "MSTrace *\fBmst_groupsort\fP ( MSTraceGroup *" mstg ", flag " quality " ); .BI "MSTrace *\fBmst_groupheal\fP ( MSTraceGroup *" mstg ", double " timetol ", .BI " double " sampratetol " );" .fi .SH DESCRIPTION \fBmst_groupsort\fP will sort the MSTrace segments in a MSTraceGroup first on the source name (as returned by \fBmst_srcname\fP), then on start time, then on descending end time, and finally on sample rate. The \fIquality\fP flag, passed directly to \fBmst_srcname\fP, controls the addition of the quality indicator to the source name and thus the addition of sorting on the quality indicator (but only if the MSTrace has an associated quality, see \fBmst_srcname(3)\fP for more details). \fBmst_groupheal\fP will attempt to heal MSTrace segments in a MSTraceGroup if they fit within the specified time and sample rate tolerance (\fItimetol\fP and \fIsampratetol\fP respectively). This is useful when, for whatever reason, the MSTraceGroup has separate MSTrace segments which belong together. This usually only happens when data is added to a MSTraceGroup in random data time order. Before attempting to heal the MSTraces the MSTraceGroup will be sorted using \fBmst_groupsort\fP. If \fIsampratetol\fP is -1.0 the default tolerance of abs(1-sr1/sr2) is used. If \fItimetol\fP is -1.0 the default time tolerance of 1/2 the sample period will be used. .SH RETURN VALUES \fBmst_groupsort\fP returns 0 on success and -1 on error. \fBmst_groupheal\fP returns the number of MSTrace segments merged on success and -1 on error. .SH SEE ALSO \fBms_intro(3)\fP and \fBmst_srcname(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_init.3000066400000000000000000000032001422047135100176640ustar00rootroot00000000000000.TH MST_INIT 3 2006/10/10 "Libmseed API" .SH NAME mst_init - Initializing and freeing MSTrace and MSTraceGroup structures .SH SYNOPSIS .nf .B #include .BI "MSTrace *\fBmst_init\fP ( MSTrace *" mst " ); .BI "void \fBmst_free\fP ( MSTrace **" ppmst " ); .BI "MSTraceGroup *\fBmst_initgroup\fP ( MSTraceGroup *" mstg " ); .BI "void \fBmst_freegroup\fP ( MSTraceGroup **" ppmstg " ); .fi .SH DESCRIPTION \fBmst_init\fP will initialize a MSTrace structure. If the \fImst\fP parameter is NULL a new structure will be allocated. If the \fImst\fP parameter is not NULL the structure will be cleared and any memory allocated for the MSTrace.datasamples and MSTrace.prvtptr members will be freed. \fBmst_free\fP will free all memory associated with a MSTrace structure and set the structure pointer (*\fIppmst\fP) to 0. This includes any memory pointed to by the \fIprvtptr\fP member of the MSTrace structure. \fBmst_initgroup\fP will initialize a MSTraceGroup structure. If the \fImstg\fP parameter is NULL a new structure will be allocated. If the \fImstg\fP parameter is not NULL the structure will be cleared and any all associated MSTrace structures will be freed. \fBmst_freegroup\fP will free all memory associated with a MSTraceGroup structure and set the structure pointer (*\fIppmstg\fP) to 0. .SH RETURN VALUES \fBmst_init\fP returns a pointer to the MSTrace structure initialized on success or NULL on error. \fBmst_initgroup\fP returns a pointer to the MSTraceGroup structure initialized on success or NULL on error. .SH SEE ALSO \fBms_intro(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_initgroup.3000077700000000000000000000000001422047135100226532mst_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_pack.3000066400000000000000000000153611422047135100176520ustar00rootroot00000000000000.TH MST_PACK 3 2013/05/17 "Libmseed API" .SH NAME mst_pack - Packing of Mini-SEED records from MSTrace segments. .SH SYNOPSIS .nf .B #include .BI "int \fBmst_pack\fP ( MSTrace *" mst "," .BI " void (*" record_handler ") (char *, int, void *)," .BI " void *" handlerdata ", int " reclen ", flag " encoding "," .BI " flag " byteorder ", int64_t *" packedsamples ", flag " flush "," .BI " flag " verbose ", MSRecord *" mstemplate " );" .BI "int \fBmsr_packgroup\fP ( MSTraceGroup *" mstg "," .BI " void (*" record_handler ") (char *, int, void *)," .BI " void *" handlerdata ", int " reclen ", flag " encoding "," .BI " flag " byteorder ", int64_t *" packedsamples ", flag " flush "," .BI " flag " verbose ", MSRecord *" mstemplate " );" .fi .SH DESCRIPTION \fBmst_pack\fP creates (packs) Mini-SEED data records from a MSTrace segment using the specified record length (\fIreclen\fP), Mini-SEED \fIencoding\fP and \fIbyteorder\fP. Using \fImstemplate\fP as a template, the common header fields and blockettes are packed into a record header. If no template will be used \fImstemplate\fP should be set to NULL. A Blockette 1000 will be added if one is not present in the template. The MSTrace.datasamples array and MSTrace.numsamples value will be adjusted (reduced) as samples are packed into data records. This routine will modify the record length, encoding format, byte order and sequence number of the MSRecord template. The start time, sample rate, data array, number of samples and sample type of the MSRecord template are preserved. Default values will be used for any of the key characteristics of record length, encoding format and byte order that are -1. The default values are: reclen = 4096 bytes, encoding = 11 (Steim2) and byteorder = 1 (MSBF or big-endian). \fIreclen\fP should be set to the desired data record length in bytes which must be expressible as 2 raised to the power of X where X is between (and including) 8 to 20. \fIencoding\fP should be set to one of the following supported Mini-SEED data encoding formats: DE_ASCII (0), DE_INT16 (1), DE_INT32 (3), DE_FLOAT32 (4), DE_FLOAT64 (5), DE_STEIM1 (10) and DE_STEIM2 (11). The encoding aliases are defined in libmseed.h. MSTrace.sampletype should indicated the sample type as either 'a' (ASCII), 'i' (32-bit integers), 'f' (32-bit floats) or 'd' (64-bit doubles). The encoding format must be appropriate for the sample type of the MSTrace samples. For example, Steim compression and integer encoding formats require integer samples and float encoding formats require the appropriate size floats as input. As a counter example, float samples cannot be packed using Steim compression or integer encoding formats. \fIbyteorder\fP must be either 0 (LSBF or little-endian) or 1 (MBF or big-endian). Each time a complete record is packed it will be passed to the \fIrecord_handler()\fP function which expects three arguments: 1) a char * to the record buffer, 2) the length of the record in bytes and 3) a void pointer supplied by the caller. It is the responsibility of \fIrecord_handler()\fP to process the record, the memory will be re-used or freed when \fIrecord_handler()\fP returns. This function pointer is required, there is no other way to access the packed records. The \fIhandlerdata\fP pointer will be passed as the 3rd argument to \fIrecord_handler()\fP. This allows the caller to optionally pass data directly to the \fIrecord_handler()\fP. The integer pointed to by \fIpackedsamples\fP will be set to the total number of samples packed. If the \fIflush\fP flag is not zero all of the data will be packed into records, otherwise records will only be packed while there are enough data samples to completely fill a record. The \fIverbose\fP flag controls verbosity, a value of zero will result in no diagnostic output. \fBmst_packgroup\fP simply calls \fBmst_pack\fP for each MSTrace in the specified MSTraceGroup. The integer pointed to by \fIpackedsamples\fP will be set to the total number of samples packed. .SH COMPRESSION HISTORY When the encoding format is Steim 1 or 2 compression contiguous records will be created including compression history. Put simply, this means that the first difference in the compression series will be the difference between the first sample of the current record and the last sample of the previous record. For the first record in a series (no previous record), a so-called cold start, the first difference will be zero. The compression history can be seeded by allocating the StreamState struct for the MSTrace and setting the \fBlastintsample\fP member to the integer sample value that preceded the first sample in the current series and setting the \fBcomphistory\fP flag to true (1). .SH RETURN VALUES \fBmst_pack\fP returns the number records created on success and -1 on error. \fBmst_packgroup\fP returns the total (for all MSTraces) number of record created on success and -1 on error. .SH CAVEATS When using a MSRecord template (\fImstemplate\fP) the dataquality member must be set to a valid value. It is also advisable to set the network, station, location and channel indicators to appropriate values. Unless these source indicators need to change they can simply be copied from the matching MSTrace members. .SH EXAMPLE Skeleton code for creating (packing) Mini-SEED records with mst_pack(3): .nf static void record_handler (char *record, int reclen, void *srcname) { if ( fwrite(record, reclen, 1, outfile) != 1 ) { ms_log (2, "Error writing %s to output file\n", (char *)srcname); } } main() { int64_t psamples; int precords; MSTrace *mst; char srcname[50]; mst = mst_init (NULL); /* Populate MSTrace values */ strcpy (mst->network, "XX"); strcpy (mst->station, "TEST"); strcpy (mst->channel, "BHE"); mst->starttime = ms_seedtimestr2hptime ("2004,350,00:00:00.000000"); mst->samprate = 40.0; /* The datasamples pointer and numsamples counter will be adjusted by the packing routine, the datasamples array must be dynamic memory allocated by the malloc() family of routines. */ mst->datasamples = dataptr; /* pointer to 32-bit integer data samples */ mst->numsamples = 1234; mst->sampletype = 'i'; /* declare type to be 32-bit integers */ mst_srcname (mst, srcname, 0); /* Pack 4096 byte, big-endian records, using Steim-2 compression */ precords = mst_pack (mst, &record_handler, srcname, 4096, DE_STEIM2, 1, &psamples, 1, verbose, NULL); ms_log (0, "Packed %"PRId64" samples into %d records\n", psamples, precords); mst_free (&mst); } .fi .SH SEE ALSO \fBms_intro(3)\fP and \fBmsr_pack(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_packgroup.3000077700000000000000000000000001422047135100226012mst_pack.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_printgaplist.3000077700000000000000000000000001422047135100254572mst_printtracelist.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_printsynclist.3000077700000000000000000000000001422047135100256642mst_printtracelist.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_printtracelist.3000066400000000000000000000060571422047135100220050ustar00rootroot00000000000000.TH MST_PRINT 3 2008/11/21 "Libmseed API" .SH NAME mst_print - Printing of MSTrace information. .SH SYNOPSIS .nf .B #include .BI "void \fBmst_printtracelist\fP ( MSTraceGroup *" mstg ", flag " timeformat "," .BI " flag " details ", flag " gaps " );" .BI "void \fBmst_printsynclist\fP ( MSTraceGroup *" mstg ", char *" dccid "," .BI " flag " subsecond " );" .BI "void \fBmst_printgaplist\fP ( MSTraceGroup *" mstg ", flag " timeformat "," .BI " double *" mingap ", double *" maxgap " );" .fi .SH DESCRIPTION \fBmst_printtracelist\fP prints a formatted list of the MSTrace segments in the given MSTraceGroup. If the \fIdetails\fP flag is greater than 0 the sample rate and sample count are printed for each trace. If the \fIgaps\fP flag is greater than zero the time gap from the previous MSTrace (if the source name matches) is printed. All output is printed using \fBms_log(3)\fP at level 0. \fBmst_printsynclist\fP prints a formatted list of the MSTrace segments in the given MSTraceGroup similar to \fBmst_printtracelist\fP but the format is a SYNC listing. If a \fIdccid\fP string is supplied it will be used along with the current system date to create the SYNC header line. If the \fIsubsecond\fP flag is true (non-zero) the time values in the SYNC lines will include full libmseed precision, otherwise they will be truncted to integer second values. \fBmst_printgaplist\fP prints a formatted list of the gaps between MSTrace segments in the given MSTraceGroup. If \fImingap\fP or \fImaxgap\fP is not NULL their values will be enforced and only gaps/overlaps matching their implied criteria will be printed. The \fItimeformat\fP argument for both \fBmst_printtracelist\fP and \fBmst_printgaplist\fP controls the format of the resulting time strings. Possible formats are: .nf 0 : SEED time format (2005,146,00:00:00.000000) 1 : ISO time format (2005-05-26T00:00:00.000000) 2 : Epoch time, seconds since the epoch (1117065600.00000000) .fi Both \fBmst_printtracelist\fP and \fBmst_printgaplist\fP represent time overlaps as negative gaps. For a single sample overlap the value of the gap is calculated as zero, this will be printed as "-0" or negative zero to indicate an overlap. .SH GAP/OVERLAP RULES The existence of gaps and overlaps is implicit in the structure of the MSTraceGroup, no special processing is done to detect gaps and overlaps in these routines. The value of a gap is calculated as the difference between the time of the last sample before the gap and the time of the first sample after the gap. No sample 'coverage' time is included. The value of an overlap is calculated as the time between two samples which represent the maximum amount of timeseries overlap. When the MSTraces in the MSTraceGroup include a small segment that is completely overlapped by another larger segment the gap/overlap value will not be correct for either the smaller segment or the segment following it. .SH SEE ALSO \fBms_intro(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mst_srcname.3000077700000000000000000000000001422047135100225642ms_srcname.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_writemseed.3000077700000000000000000000000001422047135100240242ms_writemseed.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mst_writemseedgroup.3000077700000000000000000000000001422047135100251012ms_writemseed.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mstl_addmsr.3000066400000000000000000000033411422047135100203550ustar00rootroot00000000000000.TH MSTL_INIT 3 2008/11/21 "Libmseed API" .SH NAME mstl_init - Adding MSRecord data coverage to and MSTraceList structure .SH SYNOPSIS .nf .B #include .BI "MSTraceSeg *\fBmstl_addmsr\fP ( MSTraceList *" mstl ", MSRecord *" msr "," .BI " flag " dataquality ", flag " autoheal "," .BI " double " timetol ", double " sampratetol " );" .fi .SH DESCRIPTION \fBmstl_addmsr\fP adds the data coverage in a MSRecord structure to the specified MSTraceList structure. If data samples are associated with the MSRecord they will also be added to the MSTraceList. New MSTraceID and MSTraceSeg sub-structures will be created and added to the MSTraceList as needed. Each MSTraceList contains a list of trace IDs as MSTraceID structures each of which contain a list of time segments as MSTraceSeg structures. This routine will maintain the list of trace IDs in alphanumeric sort order and the subsequent time segments in time order. If the \fIdataquality\fP flag is true traces will be grouped by quality in addition to the source name identifiers, in short differentiate using quality or not. If the \fIautoheal\fP flag is true any two trace segments which would fit together due to the addition of the new MSRecord coverage will be merged. The only reason to set this option to false (0) is if the \fBprvtptr\fP pointer member of the MSTraceSeg structures is being used since libmseed has no knowledge how such data should be merged. .SH RETURN VALUES \fBmstl_addmsr\fP returns NULL on error and a pointer to the MSTraceSeg structure to which the data coverage was added on success. .SH SEE ALSO \fBmstl_init(3)\fP and \fBmstl_free(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mstl_convertsamples.3000077700000000000000000000000001422047135100261562mst_convertsamples.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mstl_free.3000077700000000000000000000000001422047135100221042mstl_init.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mstl_init.3000066400000000000000000000020231422047135100200420ustar00rootroot00000000000000.TH MSTL_INIT 3 2008/11/21 "Libmseed API" .SH NAME mstl_init - Initializing and freeing MSTraceList structures .SH SYNOPSIS .nf .B #include .BI "MSTrace *\fBmstl_init\fP ( MSTrace *" mstl " );" .BI "void \fBmstl_free\fP ( MSTrace **" ppmstl ", flag " freeprvtptr " );" .fi .SH DESCRIPTION \fBmstl_init\fP will initialize a MSTraceList structure. If the \fImstl\fP parameter is not NULL the structure will be cleared before being reallocated any memory allocated for associated MSTraceID and relate sub-structures will be freed. \fBmstl_free\fP will free all memory associated with a MSTraceList structure and set the structure pointer (*\fIppmstl\fP) to 0. If the \fIfreeprvtptr\fP flag is true any memory pointed to by the \fIprvtptr\fP members of the MSTraceID or MSTraceSeg structures. .SH RETURN VALUES \fBmstl_init\fP returns a pointer to the MSTraceList structure initialized on success or NULL on error. .SH SEE ALSO \fBmstl_addmsr(3)\fP. .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/doc/mstl_printgaplist.3000077700000000000000000000000001422047135100260072mstl_printtracelist.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mstl_printsynclist.3000077700000000000000000000000001422047135100262142mstl_printtracelist.3ustar00rootroot00000000000000iris-edu-libmseed-4314359/doc/mstl_printtracelist.3000066400000000000000000000060221422047135100221510ustar00rootroot00000000000000.TH MSTL_PRINT 3 2008/11/21 "Libmseed API" .SH NAME mstl_print - Printing of MSTrace information. .SH SYNOPSIS .nf .B #include .BI "void \fBmstl_printtracelist\fP ( MSTraceList *" mstl ", flag " timeformat "," .BI " flag " details ", flag " gaps " );" .BI "void \fBmstl_printsynclist\fP ( MSTraceList *" mstl ", char *" dccid "," .BI " flag " subsecond " );" .BI "void \fBmstl_printgaplist\fP ( MSTraceList *" mstl ", flag " timeformat "," .BI " double *" mingap ", double *" maxgap " );" .fi .SH DESCRIPTION \fBmstl_printtracelist\fP prints a formatted list of the trace segments in the given MSTraceList. If the \fIdetails\fP flag is greater than 0 the sample rate and sample count are printed for each trace. If the \fIgaps\fP flag is greater than zero the time gap from the previous segment is printed. All output is printed using \fBms_log(3)\fP at level 0. \fBmstl_printsynclist\fP prints a formatted list of the trace segments in the given MSTraceList similar to \fBmstl_printtracelist\fP but the format is a SYNC listing. If a \fIdccid\fP string is supplied it will be used along with the current system date to create the SYNC header line. If the \fIsubsecond\fP flag is true (non-zero) the time values in the SYNC lines will include full libmseed precision, otherwise they will be truncted to integer second values. \fBmstl_printgaplist\fP prints a formatted list of the gaps between trace segments in the given MSTraceList. If \fImingap\fP or \fImaxgap\fP is not NULL their values will be enforced and only gaps/overlaps matching their implied criteria will be printed. The \fItimeformat\fP argument for both \fBmstl_printtracelist\fP and \fBmstl_printgaplist\fP controls the format of the resulting time strings. Possible formats are: .nf 0 : SEED time format (2005,146,00:00:00.000000) 1 : ISO time format (2005-05-26T00:00:00.000000) 2 : Epoch time, seconds since the epoch (1117065600.00000000) .fi Both \fBmstl_printtracelist\fP and \fBmstl_printgaplist\fP represent time overlaps as negative gaps. For a single sample overlap the value of the gap is calculated as zero, this will be printed as "-0" or negative zero to indicate an overlap. .SH GAP/OVERLAP RULES The existence of gaps and overlaps is implicit in the structure of the MSTraceList, no special processing is done to detect gaps and overlaps in these routines. The value of a gap is calculated as the difference between the time of the last sample before the gap and the time of the first sample after the gap. No sample 'coverage' time is included. The value of an overlap is calculated as the time between two samples which represent the maximum amount of timeseries overlap. When the traces in the MSTraceList include a small segment that is completely overlapped by another larger segment the gap/overlap value will not be correct for either the smaller segment or the segment following it. .SH SEE ALSO \fBms_intro(3)\fP .SH AUTHOR .nf Chad Trabant IRIS Data Management Center .fi iris-edu-libmseed-4314359/example/000077500000000000000000000000001422047135100166455ustar00rootroot00000000000000iris-edu-libmseed-4314359/example/Makefile000066400000000000000000000010441422047135100203040ustar00rootroot00000000000000 # Build environment can be configured the following # environment variables: # CC : Specify the C compiler to use # CFLAGS : Specify compiler options to use # Required compiler parameters CFLAGS += -I.. LDFLAGS = -L.. LDLIBS = -lmseed all: msview msrepack msview: msview.o $(CC) $(CFLAGS) -o $@ msview.o $(LDFLAGS) $(LDLIBS) msrepack: msrepack.o $(CC) $(CFLAGS) -o $@ msrepack.o $(LDFLAGS) $(LDLIBS) clean: rm -f msview.o msview msrepack.o msrepack install: @echo @echo "No install target, copy the executable(s) as needed" @echo iris-edu-libmseed-4314359/example/Makefile.wat000066400000000000000000000013301422047135100210740ustar00rootroot00000000000000# # Wmake file - For Watcom's wmake # Use 'wmake -f Makefile.wat' .BEFORE @set INCLUDE=.;$(%watcom)\H;$(%watcom)\H\NT @set LIB=.;$(%watcom)\LIB386 cc = wcc386 cflags = -zq lflags = OPT quiet OPT map LIBRARY ..\libmseed.lib cvars = $+$(cvars)$- -DWIN32 BINS = msrepack.exe msview.exe INCS = -I.. all: $(BINS) msrepack.exe: msrepack.obj wlink $(lflags) name msrepack file {msrepack.obj} msview.exe: msview.obj wlink $(lflags) name msview file {msview.obj} # Source dependencies: msrepack.obj: msrepack.c msview.obj: msview.c # How to compile sources: .c.obj: $(cc) $(cflags) $(cvars) $(INCS) $[@ -fo=$@ # Clean-up directives: clean: .SYMBOLIC del *.obj *.map del $(BINS) iris-edu-libmseed-4314359/example/Makefile.win000066400000000000000000000007351422047135100211060ustar00rootroot00000000000000# # Nmake file - Windows version # Use 'nmake -f Makefile.win' NODEBUG=1 INCS = /I.. OPTS = -D_CRT_SECURE_NO_WARNINGS LIBS = ../libmseed.lib BINS = msrepack.exe msview.exe all: $(BINS) msrepack.exe: msrepack.obj link.exe /nologo /out:msrepack.exe $(LIBS) msrepack.obj msview.exe: msview.obj link.exe /nologo /out:msview.exe $(LIBS) msview.obj .c.obj: $(CC) /nologo $(CFLAGS) $(INCS) $(OPTS) /c $< # Clean-up directives clean: -del a.out core *.o *.obj *% *~ $(BINS) iris-edu-libmseed-4314359/example/README000066400000000000000000000012151422047135100175240ustar00rootroot00000000000000 Documentation of the libmseed interfaces can be found in the 'doc' directory. Unix: the Makefile should work for most systems, try 'make'. Win32: the Makefile.win is for Microsoft's nmake (e.g. 'nmake -f Makefile.win') and Makefile.wat is for Open Watcom's wmake (e.g. 'wmake -f Makefile.wat'). msview.c: An example program that demonstrates basic usage of libmseed. A Makefile is provided to build the program. The example does not exercise all of the functionality of libmseed but should illustrate some of the basic ideas. msrepack.c: An example of using libmseed to build Mini-SEED records, this program will repack input Mini-SEED data. iris-edu-libmseed-4314359/example/msrepack.c000066400000000000000000000413531422047135100206240ustar00rootroot00000000000000/*************************************************************************** * msrepack.c * * A simple example of using the Mini-SEED record library to pack data. * * Opens a user specified file, parses the Mini-SEED records and * opionally re-packs the data records and saves them to a specified * output file. * * Written by Chad Trabant, IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include #include #define VERSION "[libmseed " LIBMSEED_VERSION " example]" #define PACKAGE "msrepack" static flag verbose = 0; static flag ppackets = 0; static flag tracepack = 1; static int reclen = 0; static int packreclen = -1; static char *encodingstr = 0; static char *netcode = 0; static int packencoding = -1; static int byteorder = -1; static char *inputfile = 0; static FILE *outfile = 0; static int convertsamples (MSRecord *msr, int packencoding); static int parameter_proc (int argcount, char **argvec); static void record_handler (char *record, int reclen, void *ptr); static void usage (void); #ifndef WIN32 #include static void term_handler (int sig); #endif int main (int argc, char **argv) { MSRecord *msr = 0; MSTraceGroup *mstg = 0; MSTrace *mst; int retcode; int64_t packedsamples; int64_t packedrecords; int lastrecord; int iseqnum = 1; #ifndef WIN32 /* Signal handling, use POSIX calls with standardized semantics */ struct sigaction sa; sa.sa_flags = SA_RESTART; sigemptyset (&sa.sa_mask); sa.sa_handler = term_handler; sigaction (SIGINT, &sa, NULL); sigaction (SIGQUIT, &sa, NULL); sigaction (SIGTERM, &sa, NULL); sa.sa_handler = SIG_IGN; sigaction (SIGHUP, &sa, NULL); sigaction (SIGPIPE, &sa, NULL); #endif /* Process given parameters (command line and parameter file) */ if (parameter_proc (argc, argv) < 0) return -1; /* Setup input encoding format if specified */ if ( encodingstr ) { int inputencoding = strtoul (encodingstr, NULL, 10); if ( inputencoding == 0 && errno == EINVAL ) { ms_log (2, "Error parsing input encoding format: %s\n", encodingstr); return -1; } MS_UNPACKENCODINGFORMAT (inputencoding); } /* Init MSTraceGroup */ mstg = mst_initgroup (mstg); /* Loop over the input file */ while ( (retcode = ms_readmsr (&msr, inputfile, reclen, NULL, &lastrecord, 1, 1, verbose)) == MS_NOERROR ) { msr_print (msr, ppackets); /* Convert sample type as needed for packencoding */ if ( packencoding >= 0 && packencoding != msr->encoding ) { if ( convertsamples (msr, packencoding) ) { ms_log (2, "Error converting samples for encoding %d\n", packencoding); break; } } if ( packreclen >= 0 ) msr->reclen = packreclen; else packreclen = msr->reclen; if ( packencoding >= 0 ) msr->encoding = packencoding; else packencoding = msr->encoding; if ( byteorder >= 0 ) msr->byteorder = byteorder; else byteorder = msr->byteorder; /* After unpacking the record, the start time in msr->starttime is a potentially corrected start time, if correction has been applied make sure the correction bit flag is set as it will be used as a packing template. */ if ( msr->fsdh->time_correct && ! (msr->fsdh->act_flags & 0x02) ) { ms_log (1, "Setting time correction applied flag for %s_%s_%s_%s\n", msr->network, msr->station, msr->location, msr->channel); msr->fsdh->act_flags |= 0x02; } /* Replace network code */ if ( netcode ) strncpy (msr->network, netcode, sizeof(msr->network) - 1); /* If no samples in the record just pack the header */ if ( outfile && msr->numsamples == 0 ) { msr_pack_header (msr, 1, verbose); record_handler (msr->record, msr->reclen, NULL); } /* Pack each record individually */ else if ( outfile && ! tracepack ) { msr->sequence_number = iseqnum; packedrecords = msr_pack (msr, &record_handler, NULL, &packedsamples, 1, verbose); if ( packedrecords == -1 ) ms_log (2, "Cannot pack records\n"); else ms_log (1, "Packed %d records\n", packedrecords); iseqnum = msr->sequence_number; } /* Pack records from a MSTraceGroup */ else if ( outfile && tracepack ) { mst = mst_addmsrtogroup (mstg, msr, 0, -1.0, -1.0); if ( ! mst ) { ms_log (2, "Error adding MSRecord to MStrace!\n"); break; } /* Reset sequence number and free previous template */ if ( mst->prvtptr ) { MSRecord *tmsr = (MSRecord *) mst->prvtptr; /* Retain sequence number from previous template */ msr->sequence_number = tmsr->sequence_number; msr_free (&tmsr); } else { msr->sequence_number = 1; } /* Copy MSRecord and store as template */ mst->prvtptr = msr_duplicate (msr, 0); if ( ! mst->prvtptr ) { ms_log (2, "Error duplicating MSRecord for template!\n"); break; } /* Pack traces based on selected method */ packedrecords = 0; if ( tracepack == 1 ) { mst = mstg->traces; while ( mst ) { packedrecords += mst_pack (mst, &record_handler, NULL, packreclen, packencoding, byteorder, &packedsamples, 0, verbose, (MSRecord *)mst->prvtptr); mst = mst->next; } ms_log (1, "Packed %d records\n", packedrecords); } if ( tracepack == 2 && lastrecord ) { mst = mstg->traces; while ( mst ) { packedrecords += mst_pack (mst, &record_handler, NULL, packreclen, packencoding, byteorder, &packedsamples, 1, verbose, (MSRecord *)mst->prvtptr); mst = mst->next; } ms_log (1, "Packed %d records\n", packedrecords); } } } /* Make sure buffer of input data is flushed */ packedrecords = 0; if ( tracepack ) { mst = mstg->traces; while ( mst ) { packedrecords += mst_pack (mst, &record_handler, NULL, packreclen, packencoding, byteorder, &packedsamples, 1, verbose, (MSRecord *)mst->prvtptr); mst = mst->next; } if ( packedrecords ) ms_log (1, "Packed %d records\n", packedrecords); } if ( retcode != MS_ENDOFFILE ) ms_log (2, "Error reading %s: %s\n", inputfile, ms_errorstr(retcode)); /* Make sure everything is cleaned up */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, 0); mst_freegroup (&mstg); if ( outfile ) fclose (outfile); return 0; } /* End of main() */ /*************************************************************************** * convertsamples: * * Convert samples to type needed for the specified pack encoding. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int convertsamples (MSRecord *msr, int packencoding) { char encodingtype; int32_t *idata; float *fdata; double *ddata; int idx; if ( ! msr ) { ms_log (2, "convertsamples: Error, no MSRecord specified!\n"); return -1; } /* Determine sample type needed for pack encoding */ switch (packencoding) { case DE_ASCII: encodingtype = 'a'; break; case DE_INT16: case DE_INT32: case DE_STEIM1: case DE_STEIM2: encodingtype = 'i'; break; case DE_FLOAT32: encodingtype = 'f'; break; case DE_FLOAT64: encodingtype = 'd'; break; default: encodingtype = msr->encoding; break; } idata = (int32_t *) msr->datasamples; fdata = (float *) msr->datasamples; ddata = (double *) msr->datasamples; /* Convert sample type if needed */ if ( msr->sampletype != encodingtype ) { if ( msr->sampletype == 'a' || encodingtype == 'a' ) { ms_log (2, "Error, cannot convert ASCII samples to/from numeric type\n"); return -1; } /* Convert to integers */ else if ( encodingtype == 'i' ) { if ( msr->sampletype == 'f' ) /* Convert floats to integers with simple rounding */ { for (idx = 0; idx < msr->numsamples; idx++) { /* Check for loss of sub-integer */ if ( (fdata[idx] - (int32_t)fdata[idx]) > 0.000001 ) { ms_log (2, "Warning, Loss of precision when converting floats to integers, loss: %g\n", (fdata[idx] - (int32_t)fdata[idx])); return -1; } idata[idx] = (int32_t) (fdata[idx] + 0.5); } } else if ( msr->sampletype == 'd' ) /* Convert doubles to integers with simple rounding */ { for (idx = 0; idx < msr->numsamples; idx++) { /* Check for loss of sub-integer */ if ( (ddata[idx] - (int32_t)ddata[idx]) > 0.000001 ) { ms_log (2, "Warning, Loss of precision when converting doubles to integers, loss: %g\n", (ddata[idx] - (int32_t)ddata[idx])); return -1; } idata[idx] = (int32_t) (ddata[idx] + 0.5); } /* Reallocate buffer for reduced size needed */ if ( ! (msr->datasamples = realloc (msr->datasamples,(size_t)(msr->numsamples * sizeof(int32_t)))) ) { ms_log (2, "Error, cannot re-allocate buffer for sample conversion\n"); return -1; } } msr->sampletype = 'i'; } /* Convert to floats */ else if ( encodingtype == 'f' ) { if ( msr->sampletype == 'i' ) /* Convert integers to floats */ { for (idx = 0; idx < msr->numsamples; idx++) fdata[idx] = (float) idata[idx]; } else if ( msr->sampletype == 'd' ) /* Convert doubles to floats */ { for (idx = 0; idx < msr->numsamples; idx++) fdata[idx] = (float) ddata[idx]; /* Reallocate buffer for reduced size needed */ if ( ! (msr->datasamples = realloc (msr->datasamples, (size_t)(msr->numsamples * sizeof(float)))) ) { ms_log (2, "Error, cannot re-allocate buffer for sample conversion\n"); return -1; } } msr->sampletype = 'f'; } /* Convert to doubles */ else if ( encodingtype == 'd' ) { if ( ! (ddata = (double *) malloc ((size_t)(msr->numsamples * sizeof(double)))) ) { ms_log (2, "Error, cannot allocate buffer for sample conversion to doubles\n"); return -1; } if ( msr->sampletype == 'i' ) /* Convert integers to doubles */ { for (idx = 0; idx < msr->numsamples; idx++) ddata[idx] = (double) idata[idx]; free (idata); } else if ( msr->sampletype == 'f' ) /* Convert floats to doubles */ { for (idx = 0; idx < msr->numsamples; idx++) ddata[idx] = (double) fdata[idx]; free (fdata); } msr->datasamples = ddata; msr->sampletype = 'd'; } } return 0; } /* End of convertsamples() */ /*************************************************************************** * parameter_proc: * * Process the command line parameters. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int parameter_proc (int argcount, char **argvec) { int optind; char *outputfile = 0; /* Process all command line arguments */ for (optind = 1; optind < argcount; optind++) { if (strcmp (argvec[optind], "-V") == 0) { ms_log (1, "%s version: %s\n", PACKAGE, VERSION); exit (0); } else if (strcmp (argvec[optind], "-h") == 0) { usage(); exit (0); } else if (strncmp (argvec[optind], "-v", 2) == 0) { verbose += strspn (&argvec[optind][1], "v"); } else if (strncmp (argvec[optind], "-p", 2) == 0) { ppackets += strspn (&argvec[optind][1], "p"); } else if (strcmp (argvec[optind], "-a") == 0) { reclen = -1; } else if (strcmp (argvec[optind], "-i") == 0) { tracepack = 0; } else if (strcmp (argvec[optind], "-t") == 0) { tracepack = 2; } else if (strcmp (argvec[optind], "-r") == 0) { reclen = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-e") == 0) { encodingstr = argvec[++optind]; } else if (strcmp (argvec[optind], "-R") == 0) { packreclen = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-E") == 0) { packencoding = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-b") == 0) { byteorder = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-N") == 0) { netcode = argvec[++optind]; } else if (strcmp (argvec[optind], "-o") == 0) { outputfile = argvec[++optind]; } else if (strncmp (argvec[optind], "-", 1) == 0 && strlen (argvec[optind]) > 1 ) { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } else if ( ! inputfile ) { inputfile = argvec[optind]; } else { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } } /* Make sure an inputfile was specified */ if ( ! inputfile ) { ms_log (2, "No input file was specified\n\n"); ms_log (1, "%s version %s\n\n", PACKAGE, VERSION); ms_log (1, "Try %s -h for usage\n", PACKAGE); exit (1); } /* Make sure an outputfile was specified */ if ( ! outputfile ) { ms_log (2, "No output file was specified\n\n"); ms_log (1, "Try %s -h for usage\n", PACKAGE); exit (1); } else if ( (outfile = fopen(outputfile, "wb")) == NULL ) { ms_log (2, "Error opening output file: %s\n", outputfile); exit (1); } /* Make sure network code is valid */ if ( netcode ) { if ( strlen(netcode) > 2 || strlen(netcode) < 1 ) { ms_log (2, "Error, invalid output network code: '%s'\n", netcode); exit (1); } } /* Report the program version */ if ( verbose ) ms_log (1, "%s version: %s\n", PACKAGE, VERSION); return 0; } /* End of parameter_proc() */ /*************************************************************************** * record_handler: * Saves passed records to the output file. ***************************************************************************/ static void record_handler (char *record, int reclen, void *ptr) { if ( fwrite(record, reclen, 1, outfile) != 1 ) { ms_log (2, "Cannot write to output file\n"); } } /* End of record_handler() */ /*************************************************************************** * usage: * Print the usage message and exit. ***************************************************************************/ static void usage (void) { fprintf (stderr, "%s version: %s\n\n", PACKAGE, VERSION); fprintf (stderr, "Usage: %s [options] -o outfile infile\n\n", PACKAGE); fprintf (stderr, " ## Options ##\n" " -V Report program version\n" " -h Show this usage message\n" " -v Be more verbose, multiple flags can be used\n" " -p Print details of input headers, multiple flags can be used\n" " -a Autodetect every input record length, needed with mixed lengths\n" " -r bytes Specify record length in bytes, required if no Blockette 1000\n" " -e encoding Specify encoding format for input data samples\n" " -i Pack data individually for each input record\n" " -t Pack data from traces after reading all data\n" " -R bytes Specify record length in bytes for packing\n" " -E encoding Specify encoding format for packing\n" " -b byteorder Specify byte order for packing, MSBF: 1, LSBF: 0\n" " -N netcode Specify network code for output data\n" "\n" " -o outfile Specify the output file, required\n" "\n" " infile Input Mini-SEED file\n" "\n" "The default packing method is to use parameters from the input records\n" "(reclen, encoding, byteorder, etc.) and pack records as soon as enough\n" "samples are available. This method is a good balance between preservation\n" "of blockettes, header values from input records and pack efficiency\n" "compared to the other methods of packing, namely options -i and -t.\n" "In most Mini-SEED repacking schemes some level of header information loss\n" "or time shifting should be expected, especially in the case where the record\n" "length is changed.\n" "\n" "Unless each input record is being packed individually, option -i, it is\n" "not recommended to pack files containing records for different data streams.\n"); } /* End of usage() */ #ifndef WIN32 /*************************************************************************** * term_handler: * Signal handler routine. ***************************************************************************/ static void term_handler (int sig) { exit (0); } #endif iris-edu-libmseed-4314359/example/msview.c000066400000000000000000000145471422047135100203360ustar00rootroot00000000000000/*************************************************************************** * msview.c * * A simple example of using libmseed. * * Opens a user specified file, parses the Mini-SEED records and prints * details for each record. * * Written by Chad Trabant, ORFEUS/EC-Project MEREDIAN ***************************************************************************/ #include #include #include #include #include #include #define VERSION "[libmseed " LIBMSEED_VERSION " example]" #define PACKAGE "msview" static flag verbose = 0; static flag ppackets = 0; static flag basicsum = 0; static int printdata = 0; static int reclen = -1; static char *inputfile = 0; static int parameter_proc (int argcount, char **argvec); static void usage (void); #ifndef WIN32 #include static void term_handler (int sig); #endif int main (int argc, char **argv) { MSRecord *msr = 0; int64_t totalrecs = 0; int64_t totalsamps = 0; int retcode; #ifndef WIN32 /* Signal handling, use POSIX calls with standardized semantics */ struct sigaction sa; sa.sa_flags = SA_RESTART; sigemptyset (&sa.sa_mask); sa.sa_handler = term_handler; sigaction (SIGINT, &sa, NULL); sigaction (SIGQUIT, &sa, NULL); sigaction (SIGTERM, &sa, NULL); sa.sa_handler = SIG_IGN; sigaction (SIGHUP, &sa, NULL); sigaction (SIGPIPE, &sa, NULL); #endif /* Process given parameters (command line and parameter file) */ if (parameter_proc (argc, argv) < 0) return -1; /* Loop over the input file */ while ((retcode = ms_readmsr (&msr, inputfile, reclen, NULL, NULL, 1, printdata, verbose)) == MS_NOERROR) { totalrecs++; totalsamps += msr->samplecnt; msr_print (msr, ppackets); if (printdata && msr->numsamples > 0) { int line, col, cnt, samplesize; int lines = (msr->numsamples / 6) + 1; void *sptr; if ((samplesize = ms_samplesize (msr->sampletype)) == 0) { ms_log (2, "Unrecognized sample type: '%c'\n", msr->sampletype); } for (cnt = 0, line = 0; line < lines; line++) { for (col = 0; col < 6; col++) { if (cnt < msr->numsamples) { sptr = (char *)msr->datasamples + (cnt * samplesize); if (msr->sampletype == 'i') ms_log (0, "%10d ", *(int32_t *)sptr); else if (msr->sampletype == 'f') ms_log (0, "%10.8g ", *(float *)sptr); else if (msr->sampletype == 'd') ms_log (0, "%10.10g ", *(double *)sptr); cnt++; } } ms_log (0, "\n"); /* If only printing the first 6 samples break out here */ if (printdata == 1) break; } } } if (retcode != MS_ENDOFFILE) ms_log (2, "Cannot read %s: %s\n", inputfile, ms_errorstr (retcode)); /* Make sure everything is cleaned up */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, 0); if (basicsum) ms_log (1, "Records: %" PRId64 ", Samples: %" PRId64 "\n", totalrecs, totalsamps); return 0; } /* End of main() */ /*************************************************************************** * parameter_proc(): * Process the command line parameters. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int parameter_proc (int argcount, char **argvec) { int optind; /* Process all command line arguments */ for (optind = 1; optind < argcount; optind++) { if (strcmp (argvec[optind], "-V") == 0) { ms_log (1, "%s version: %s\n", PACKAGE, VERSION); exit (0); } else if (strcmp (argvec[optind], "-h") == 0) { usage (); exit (0); } else if (strncmp (argvec[optind], "-v", 2) == 0) { verbose += strspn (&argvec[optind][1], "v"); } else if (strncmp (argvec[optind], "-p", 2) == 0) { ppackets += strspn (&argvec[optind][1], "p"); } else if (strncmp (argvec[optind], "-d", 2) == 0) { printdata = 1; } else if (strncmp (argvec[optind], "-D", 2) == 0) { printdata = 2; } else if (strcmp (argvec[optind], "-s") == 0) { basicsum = 1; } else if (strcmp (argvec[optind], "-r") == 0) { reclen = atoi (argvec[++optind]); } else if (strncmp (argvec[optind], "-", 1) == 0 && strlen (argvec[optind]) > 1) { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } else if (inputfile == 0) { inputfile = argvec[optind]; } else { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } } /* Make sure an inputfile was specified */ if (!inputfile) { ms_log (2, "No input file was specified\n\n"); ms_log (1, "%s version %s\n\n", PACKAGE, VERSION); ms_log (1, "Try %s -h for usage\n", PACKAGE); exit (1); } /* Report the program version */ if (verbose) ms_log (1, "%s version: %s\n", PACKAGE, VERSION); return 0; } /* End of parameter_proc() */ /*************************************************************************** * usage(): * Print the usage message and exit. ***************************************************************************/ static void usage (void) { fprintf (stderr, "%s version: %s\n\n", PACKAGE, VERSION); fprintf (stderr, "Usage: %s [options] file\n\n", PACKAGE); fprintf (stderr, " ## Options ##\n" " -V Report program version\n" " -h Show this usage message\n" " -v Be more verbose, multiple flags can be used\n" " -p Print details of header, multiple flags can be used\n" " -d Print first 6 sample values\n" " -D Print all sample values\n" " -s Print a basic summary after processing a file\n" " -r bytes Specify record length in bytes, required if no Blockette 1000\n" "\n" " file File of Mini-SEED records\n" "\n"); } /* End of usage() */ #ifndef WIN32 /*************************************************************************** * term_handler: * Signal handler routine. ***************************************************************************/ static void term_handler (int sig) { exit (0); } #endif iris-edu-libmseed-4314359/example/test.mseed000066400000000000000000000440001422047135100206410ustar00rootroot00000000000000000001M COLA 00LHZIUÚ:2·p @0è8  éd'Fªªªÿüuöÿübd€ ´ŠQ‡„·Ím¤€Èƒ·wo¬€{ƒI “Šäöß¶Ýj@¸¾rˆ7‰´ûÕµé‡*ªªª‹KtI§dW”¾hq«º|‡†¼2ŒCŠ|‹ô’Z¾Œˆ¥ã‰E„õ³½X®±èó7·»|_µ±ŠëŠ*ªªª³f„…€¬[°ìú‚¿è}¼…ú•8‡ÂÝ‚|„™tV±%뉰ìñƒÙŒè¡Žÿ ø¿¯y¿´cßß*ªª µ§úÜ¿ ÚŠ à…ÙŽ9½Áú6½t†Šs†‰¾ |V¹%ø÷‚j~ß¼(r'¸â|˜…© )000000M COLA 00LHZIUÚ:34·¹ @0è8  éd)Fªªªÿücÿüë¼€\…ä……é.zµg¡±7ã‚…é#:’a¤N’ Þº¬î³…d-»#óÕ¸^€Rƒ ã*ªªª†šs„÷в¿{pIºÜo>·¨ýI€^‚Áƒ —‰º„Mqy¶Šïô¹ „åíM¾£ž…œ‚ž*ªªªV€‚ŠŠ/†Vº vÆ€j†ù¹ªgA¸¯ñQ‹E¯Š²xÐ+걎öˆ‰˜Ñ½°oˆ—š³´¬Z*ªªª¿­©€±ÿ›¹Ë|ʈn¼½ª†ÕŠ74ŒãÜà±Eìv®a⵸ê™n“£ Z‰x±Â^ˆ‹õ¿T*ªªª‰è“²‘lK½JÙνP д5ì•ó §´³šì‘²h’®Ø~f›ž%´Rt‰•庯Z6„®ñþÿªâ*ªªª@ ã@y¹@W—нrrŒ1§ð‹‚ÿpÃþòÈÿ/"ÿº¢@;@½ù@ <@Mÿ°*ªªª©ü?(@c@rŒ—„Üä¸êH@ÿ¤V·÷\ÿ‚«· “Hÿ–š Ñ*ì§;µ@r‹@ƒb@qÏ000000M COLA 00LHZIUÚ:69·p @0è8  éd'Fªªªÿý“!ÿúºã@§e@‚#„¯ÚIÿ¦6ÿhëÿ¡ÿ´FÿÍ¿@T²œ/lºÿ†ÿ0ã@ *ªªª@7@ öÿ®ÿ×'@Z¹@«@kD@OŸÿ§ ÿ„@¬û@ݧÿáÿ5øÿC©*ªªªÿ#¤þÒ9@6C@¤˜ë73@…Ä@@i@¦ƒ@&Š@ºÿ±ÏþøôþìWÿBÿAÑ*ªªªÿ°k@~’@´@Éo@iù@BŒÿ¢¿¬‚ÃÿPÿsÍÿ¤¢ÿBâÿœ©>·Ø@Ìz*ªªª@Š@šÞ@ýB@›-ÿ†ñþí@ÿ³2@‰ÿšÿœ¼ÿvÞÿËã@V”@2³@Ru*ªªª@¤“@¯@ ŸÿM Éü˜ÿ«&ÿD†¦d¯ãÿþñ@U¿@¢\@lh@?@@H•¸kJ*ªªªÿÆœÿ¾4ÿÝÿ¾–ÿq‡ÿ¥Æ@ ¤@E@wT@¦p@ƒÍÀççÿbMþÊñþò]000000M COLA 00LHZIUÚ:81·„ @0è8  éd'FªªªÿúPvÿü²ÿ•“€ã$ @eê@öš@Ç@\@u„@žIˆ¯Ë“ÿ[?þ÷ÙÿgÕÿ¸*ªªª¢ë@@G"@’D@Gÿþÿ~ÿ~Ú@TR@˜ú@m`“Tä¼ùGÏÿ®¾@d *ªªª@=nÿxçÿži„ˆï°a®¡C!ÿñ-@Fê‹Ç@²Ç@µ;©ypw@t;šŽGRÿ¦ *ªªªÿ©€ÿ”Qÿ˜ à„™@rÅ@oÕÿÍ›ÿmϠ䬶@N5ì“•zyÿ•üÿóÿ|˜*ªªª@DR@ÌL@…A@d¢@aT@`‘EÀÿ¦”ÿ‚­ÿD}ÿ8îÿ¥‚@8\@f@Ÿ *ªªª@¬m”ä é@GàÿòÌÿ•ÿ¡\ÿ°ÿ…á½^=CL"%@p2@h¯!Ë,¼H¨ÿÔ²*ªªª@Vr@“ß@ nÿ³E®³Qøÿ£é¯<бýš(¨Ú¸ZDÔ² ¨ÎU5@Pò@w²ƒQÞ000000M COLA 00LHZIUÚ:;· @0è8  éd'Fªªªÿü¬ƒÿû¿½9Þ «Éil£=ÔÁ‹— ùµ¨ý‘@j†@Ë2@ž÷ÿî3ÿ ïÿ­ŒÿhNÿ_Â*ªªª²ƒ_bÿ£Ù@c@v@h·@\Ÿ@FrŠÍ_]ÿÍšÿºe§1İÿøÃ@O 𣙗Uàú*ªªªÿ¯Ýÿ£bÿ»¼ˆó•jµ¥h˜ƒ¡¨‰=¥r‰?@a|@N€ÿ¾Jÿ¶ˆ¼õO¾ú‹V·¡Y¤*ªªª@Î@HœÿþÿËÿ°{ƒ/‘X@TÓ@w1“ù @¦ÿ¼óÿ¹>ƒÛ훤rÄ@2"*ªªª@]ýˆªV}“8—ÿ«/¥ÅÇ¿ Œ@m@x’‚…α§qácºÖõš@/Û@GBÿàÂÿ¸+*ªªª¨ŒÞ\ÿç¸ÿ§Yÿ¡ ²a”@b@n@Š1@…)›}̆!Eƒ­}õÿéPÿÊÿ•—*ªªª¨ÑÓI¸2˜Ô—Òݾ@O|@O’@AE“Uqÿ¡ý¢7@gÿ–mÿ«Çÿ¾†@G@S>000000M COLA 00LHZIUÚ:·š @0è8  éd'Fªªªÿü(ùÿûS@ix@k–7´D‘í㉿PŠ$©@bÿµ¨¦MæK°E»ö–‚­ +™Äüm*ªªªÿó@Cf•èç­ÊÈCÿ²žÿ˜|ÿ‚áÿû-@pA@WÅ•r“j@4Æ@Z©@Jwïöî*ªªª´[Eÿšîÿ¡ÿ¶ìÿý@f¢@{¹ŸH`Pÿ“o¥¡%ÿÔ¢ÿ`)ÿ™d@*Y@hâ*ªªª@Vä@G–—’ã†b]`¤ë(ôôX ©Áqû½Ø;Oš–f¦Gݰ¨ÝȪ»±-©‘8t¿Ù‰ð¿etD*ªªª¸ ¡Ù@Q0@eÈ@L¿¾nCû®Ó‡G¹Ôí½¦p„x‘ui‚@ Ð@D ÿì£ÿ¿²(r*ªªªŒD‹ÑÿÂ|ÿ»^¯rŠ·ßWçª!ˆM@TÞ@\ p~·ôk¶H„â€ÞÏû¾ÿ³D‚S ´@ß*ªªªÿ©aÿ• ÿ§¬@I@Ï@+ÿ˜3ÿ»íˆ1¼‡¤"N‡Ç©ÿîLÿ®Ãÿ¾Å¹O000000M COLA 00LHZIUÚ:;·x @0è8  éd'FªªªÿûÿÿÌO¥<½û@†:ZL‹º{b¬Ìãì½€š@2i@NŸ@^ @‹C@ŽJ@«‹@Àã*ªªª@yT˜Wf.ÿ…¸ÿ?‡ÿLÿnÿ~ζ¬éï»æ³¹@U×@Df‚]Ô@¡@E~´æ&*ªªª@Œÿ´¯ðdÿ´îÿ¦«½Ê¾^@mï@h¸@Rd5ÞÐ@)6@N ®åkpÿçÓÿvÉ*ªªªÿ–ÿ¹Õÿt#ÿw»@%\@§Ì@iË@‰â@ˆ@ y@Ë|@]¯ÿáÿ°m»3*Š*ªªª‰¥)Õ@Ùÿ§"ÿR÷ÿ…þÄ”þþÍÿ þÑ þ¸?ÿ#ÿj±ÿCŠÿ‚‰@…A*ªªª@?y@Ké@“@÷¢@Àó@ÔÅ@Ó@Èà@¥†@_ÏÿÀÿAþã¿þºšþÉ *ªªªÿKÀ@*0@|¤@Ÿ@²S@Fi@Li@¥8@´Â@Ýæ@ÿ‡@¹™fzâÿæŸÿ£ 000000M COLA 00LHZIUÚ:;·~ @0è8  éd'Fªªªÿÿ>ˆÿüEbÿr9ÿhäÿŠXÿ”ÿW§ÿrü±qBÍÿqÛÿ˜È¶­¹Õ@K“ŒŠÅ@:*ªªªÿVÿ9!ÿàç@’Â@ýŠ@óh@–@Lc—æ˜[:{ñÿ¢1ÿaùÿ„ÿ²Õ žÄ *ªªª¬äµ @2÷ÿ¤?ÿZíÿ‰uÿ¢ÿmÿOaÿXrÿŒÅ@ )@Ÿç@ä›@¾@g*ªªª@š@ˆÀ@{Þ@šÙ@mÿé¥ÿ®¬¦%z@b$@fÝ@C~“wxµ¾Ñ¯ÿÞ†ÿ º*ªªªÿdþÿ„7­Yïÿ­"½˜²ÙvÓ@>”@Ÿ²@š\ÿû³ÿ³í€˜u÷©„áS¦TþB–x ê*ªªª@Nu@`v@AO°j·YA!ÿÖ‹ÿ¼nÿ™3ÿ®‘ÿÖÿ®>ÿ (ÿÿ€Ž¼ÿ¦N*ªªª€õ·8¾ê¿"@½‘@k@´Ë@Hü@mu@qÿ~Ô¬¾ŒK@ƒ@`—ÿäøÿ:Àÿx 000000M COLA 00LHZIUÚ:·x @0è8  éd'FªªªÿüG¶ÿý©=*'ÿ¼’ÿNÈÿ†€@4ê@H$°ìv@@AÙ@C•Ð>@(©@ ù*ªªª@Ÿµ@E0ÿÂ&ÿ5 ÿªÿeCÿ¾S@*z@b£@ÿ²*©õxQÿ«ÄÿÃÿä’*ªªª@@MžM!)@l`@±Y@ohÿæãÿìÿŽàÿjáÿ…ïÿÖ¬ÿ¾ÿ¥˜@š@¤º*ªªª@È€@È‹@Îö@‡ž¡–ë@·@I†@%>ÿ°üÿ*{þó½ÿiCÿ¯Áÿål@[ *ªªª@­@ðª@¹’5bÏÿ§zÿ=xÿ ºÿQ½ÿéØ@MA@¬³@ @ ¶@û@ÚE*ªªª@&•ÿšzÿ=Tþäƒþâaþê¸ÿTÿ¹Ž’ì;Ä@Jl@Wì9)M@F2@|:@šâ*ªªª›ÑÀ®ÿ·U®«×õ¨Gûò…à‡”,,†Ëºä@u—g“—qZlÿ›Éÿ¨ŽÿÙÊ@BÍ@y‘000000M COLA 00LHZIUÚ: ·{ @0è8  éd'Fªªªÿýõ—ÿüNö@LZ“Í•¾Sa˪N4ÿ˜÷ÿ”œª¶õ™‹º€äaË»O”L@Ä@J@bò*ªªª@JÑ@p(@nÀÿú»ÿµìÿ¹Óÿ¡Mÿ„¯ÿ[>ÿXÿÞÿk7ÿP¤ÿ€ÖÿÆØ*ªªª@R'@mj‚yƒø@I5š´ ƒ oLbmÿäò@YÚœ=ÛÔÿ»Ôÿ‹Òÿ{ÿÿ€ÿŽS*ªªª± Z® øÜ@Qæ@l5@R~¤o<­CÖß@7à@Çš@$¼è~ï@g@Fk@¥û@ˆÔ*ªªªÿÿ9ÿŠ­ÿgÒÿ¶ÝÿÙuÿZtÿ# ÿ}¾ÿ¹…«y»—@žÎ@§´@+@\?@æ¼*ªªª@šÜ@f@jc@ÊA@øò@† @7a@B@F­ÿçOÿ*³þïôÿ4ÜÿÅÿPÛ*ªªªªîî«@Â@Žf@’šƒ–å{@=è@Y®@,>@PM@Zÿ«ÀÿZþ¶sþÈTÿ¬o000000M COLA 00LHZIUÚ: · @0è8  éd'Fªªªÿü“ìÿÿI@Dö@yÿ²yÿeòÿ ÿxm€Æ gÿð¾@T™@ØÏ@ï%@"ÿ@+É*ªªª@¼¬@U €KæÿÄèÿzcÿºÅÿª¤ÿ“tÿqRþú!ÿ9!ÿ€³ÿQgÿhqÿEË*ªªªÿHõÿéÐ@Rq@€e@˜m@«@P«ÿæ‚ÿ~qÿ€”¦8üŒ@(@­W@Z@…õ*ªªª@úi›ÂÇð«‚!@yÿ‹iÿMÿ°¿‡Óu›«w]çÿò(@S›@ž,@SL¼_ ÿ”#*ªªªÿ¸Ü»þŽÿæ_ÿ«æÿˆ&ÿ•Çÿ¹X²£V#¦Ò¾?@—¹@r)@N¯@a¹@aœú*ªªª‚±'…ð衯o#…õÞè§Áä°¸¶1”ŠÌRÿv3ÿ~Ëÿ®+©Œ:„­¥ @p®@G¿†öÌ*ªªªÿŸŠÿs?ÿ„Dÿ±Y8õ@lë@¬¥@ÂD@ËS@ÿÍ@ý@ŠÝ@OMzÛMÿˆŠ000000M COLA 00LHZIUÚ:·w @0è8  éd&FªªªÿþÐõÿú©ÿ‡ôÿ¯1ÿ´Rÿ’8ÿh³ÿ3@ÿÿ;`ÿ€¬ÿ ®§%Ø@\5@Ží*ªªª@ó>@@ÿO@@+@µm@Eóÿöÿ¦qÿnKÿjÿ^úÿ.%þçÔþΦ*ªªªÿÁÿoÌ@%@f“@@­Ž@×à@‹ ¥ØÖÿ»8¯Vâ<ÿ°šÿ°+¥L~˜@DG*ªªª@$µÿ¶²£#<ÿ@PÞ@@M@CØhÿë:ÿ•òÿ‘Ĭcÿ®9ÿ”Bÿª ÿ¹*ªªª©Ñ#s@k@‚@t¶@J[@C­@#@“Î@ˆ$@¦˜@w$¾E}ÿ«TÿŒ´ÿ£*ªªªÿí»@BÇ@„\@Šº@I¾oî½»ú]çbfÄ„CÿÀÿ]ÿ„Ûÿ¡Þÿ±Áÿôä*ªªª@R/@{¾@ˆx@”4@ e@}R‰êÀrÿ–ÿ\âÿ'þüƒÿ–ÿcX¤å†£ˆ»pØ000000M COLA 00LHZIUÚ:·ˆ @0è8  éd&Fªªªÿú|šÿüÅÿÓÿ¸Óÿ¬Îÿ±âÿ†ÿFÿ\7ÿ–cÿñI@J*@o™@–h@–ä*ªªª@ŸP@Ñ.@¹@`ù…Çû2@1r@U3@M—ý‡³#Ìåÿ¹ˆ®Fy ­éØš¾ŒŒ¥ú+*ªªª¿ŸˆÂ‰9(ì@o4@Ì@ɱ@ˆú@[f˜]Ž ÿå9ÿ¶Œÿ¨ ÿ£Aÿ“[¡:ñ@§EH*ªªª²ß^è¤#Õ†ÿælÿ¿†ÿÿ…ÓªÏuÿÏ*ÿ”}ÿ¸”¾À–7@+@oŽ@¹æ@Ü\*ªªª@ÑÀ@»±@£­@Ø@Nʼnqëý¨'ÀZ£ŒÇÿÀÉÿ²Õÿ¥Dÿ¬žÿ³¡óx8˜+»~*ªªªŒ*ôìÿÚÿ¯ÍÿŽ;ÿž­¨l@v†@|²–ŠÚ„§ÿŠ,ÿ–ßÿ£¸ÿ®Àªl ß*ªªª@HÄ@Wl›Ú-Ó‰»ÔR£Á`2®ÛÈÿ±$©6&R@O–@m¤@ü@\½_ÊÕ¥ËÚ@m000000M COLA 00LHZIUÚ:·— @0è8  éd&FªªªÿüÑÿüæí@{ @×@³,@]‚¼ÜÓÿ¼Ìÿ–ÿ*ÿv-ÿ]Oÿ€Õÿ¤žª°3-*ªªª@zÉ@Š;@w@W•%Œ„)œ‚Rÿ¹ ¡&ÖŸ¹{؇ëîÿñ¢ÿŒ.ÿZÿ…F*ªªª©ˆ™‹œ/)cŒ)˜\ƒá]¬­ùs¨º4ÿ‰ ó‡þ`‰¥ú빊* 3´ „³@E‡@Q¡’Ž{ª¶em&*ªªª@ @J‘@]#š}ÿŸ:“ µ—Õ¸…ƒ ™¥GÿшÿƒIÿ‘°.È@#Æ@L*ªªª@ˆJ@˜0@_ʉ^ÿ»„ÿ¸1¯ÏþÏ…£Ÿ}•–•ÿÙhÿ—ÿx8ÿsÿ™/ÿ»"*ªªª¯?må¾toÿÄTÿµ…©ã棶sÕƒžw•H'y Ž›~Ò#Èš.6’ʶ @kò@hÛ*ªªª…°¸•¹!·@¤ÿµ—ÿ„ÿg)ÿ]­ÿ˜v¯;€ÑŠ•Q‹¡»ñ@m%@l[@áÿº‚000000M COLA 00LHZIUÚ:·ˆ @0è8  éd&FªªªÿürnÿýΪÿ‹ÿ'ÿ­·°–›,@X°@…1@@}2@W\•ióÿ—Éÿgÿp]*ªªªÿ“ò¤7îž{¿[—O‹mêÿïßÿ®-ÿŠÿŒÿ¹«€Ø3Ð@R @‹r@Å2@¾*ªªª@o;ŽMç´ÿ»ƒÿŸ/ÿ¢†ÿ¸.© õ²+1p“(„ÅÿØ›ÿ²^ÿ‘pÿ’öÿ´B¥ø‡*ªªª@=@]@SÛž[´˜ð­HŒ_ag¤Ñbû±N³§,cÖˆR½ @J1š™c^÷F»HŠázå*ªªªÿ¾œÿ™Ñÿ˜¹ÿ£ÿªÙÿ¹¢¬ óO¼ùõÝ´%Nèÿ·£ÿ±:­Ÿ'„@Z–@|i@¤ò*ªªª@»š@§´@oÔ@BA 4µ‰…ÜPÿ˜ÿjŠÿlvÿ—òÿñ/@]Î@¤ @ª @pº*ªªª‹ËRg¡&Àÿ§ÿ–zÿ”žÿ–ÿ¤D¤œÿ@,@_@‰û@ï@`-@J›V000000M COLA 00LHZIUÚ:·‰ @0è8  éd&FªªªÿýÄ¥ÿýˆòºýÍ!ÿº"ÿ¶ÿ¾T£DJ®~ö†!jêÿ·Òÿ£ÿ¾º 1¢@c@u€*ªªª@j@S@S@t@@ˆÅ@rTœ¶ô¤ƒÄ5©¬fVµ¼h˜µûÛß¡Ùiƒ™…Åÿ¤/*ªªªÿ«§ÿ±Öÿ¾ª§ÓÝg¶Pé°¬ÒУñD³ ÔÁö³÷¾›ª¿Y@Gf@S @N/sªµ!ë&*ªªª¿N+e@Gï@Z>@@ž»@œq@pw@åÿ®ßÿÿv™ÿ”:¬Û@I}@Y*ªªª@V·@@¢Š~Z¨ÿŸ]ÿw5ÿ]âÿM’ÿJúÿH½ÿL£ÿeVÿŒàÿ¿L¸W¡Ð@I*ªªª@F™›´¿ @aê@Ž"@‘Ó@kj™:úÁ«9Ê”®Æñ2ºqƲ s'.Ä@@m@Uú@`þ*ªªª@n¨@’@˜³@¥Ÿ@žœ@œï@’¥@o6@C ˆà•ÿ»eÿŠŠÿLhÿ)Üÿ:,000000M COLA 00LHZIUÚ:"·z @0è8  éd&Fªªªÿüìÿû¬‚ÿc,ÿ|ÿ{-ÿeyÿd ÿ„R¦c”þ™K1“y¯à@ET@O@Sb@Vï*ªªª@Xî@Y8žøãÿ¹ÿ™œÿ“.ÿšKÿ ðÿ§¹ÿµ"©3õP»ãÚ*¦?n2@"@@¢*ªªª@Yó@l†@g @_<@MŽ“Þ‚±"\7¾• “ -ü@G@sE@›¿@¢@‰ƒ@S *ªªª‡Ù¼ÿ³Oÿ–aÿ‰×ÿ’Êÿ»w·Z˜Ö—š°3@E©@jÂ@s @]z›u äÿÛ ÿ¨\*ªªªÿ~Qÿnÿ«ß©¹åγðVÿ²iÿzôÿN¾ÿPÿ`Öÿp÷ÿ™tÿæE@I¤@Ž9*ªªª@‘_@o @G9|§ÿÐÿš·ÿ‚§Ó(9@xø@¼·@Ú­@Ú@Â@ŒÃ@f4*ªªª@`N@e=@v@‹‚@‹Ö@g¼@ÝÿEÿÍþù¨ÿ ÿ!wÿHÍÿbHÿqæ000000M COLA 00LHZIUÚ:$·y @0è8  éd$Fªªªÿû/X¥’ÿ‚Öÿª¸õ#  2·íÈÿ«ªÿ˜äÿ“RÿŸ\ÿª­ÿ¦Lÿ™óÿ§ú*ªªª§®÷§@/Ñ@|@Âï@ð3@ò÷@Ѳ@˜š@J‰†NrÛ±Þë8†Ý ,Žl í@9@Xº*ªªª@oÙ@†9@žK@–^@ju@M„@O7@U @D›@ ÿ¶)ÿ_îÿÂþá/þÑ›*ªªªþýÿTóÿ¥ ÿîù@Gù@šY@Í@ߣ@Å\@yrÍÑDÿ‡ÿHÕÿ'´ÿ(G*ªªªÿE·ÿx÷¢Zª™„?l™‡è²Ï\È­Ûµ^ .@0U@B´@EœD f„ëeHÿ¢ÿTƒ*ªªªÿ þúÖÿñÿM/ÿŽ4ÿâ@MÙ@¦˜@Þ>@Y@ R@g@v@óÀ@È*ªªª@ž @@oÎ@\@IžU<@Dc@KÀ@X·@o@ƒº@“ @“N@w“@Lˆ000000M COLA 00LHZIUÚ:%· @0è8  éd&Fªªª» ÿïÚ°Š»ÛTÿ¹¡ÿ»§3Rÿ³Äÿ}ÈÿNïÿ8èÿ3Yÿ9uÿO´ÿtÿ˜=*ªªªÿšûÿq(ÿ2çþúÃþâ)þùeÿ=ÿ—Õµ©)i@K@Qb@C’ùÚ«³Á’§2h°*ªªª—'Ë@F5@Fåš°¤öˆ¶|F¸;f¯DÛ†® c ³xì6¼uæ@?ë@i4@i @S œ ¬*ªªª‰Ž”Ž7±„@F@YE@Yu@F±š2"ˆ ùŠ–°“@^;@î@¯Ç@¼|@¹æ@®*ªªª@“|@né@P™žº$ú€áåðÿÐÛÿ»ðÿ±…ÿ¤Ýÿ…bÿU¤ÿ"¬ÿ_ÿ+ùÿM*ªªªÿhÝÿzHÿ{GÿrÿeXÿb}ÿpïÿŠÿ¬ñ¯z£@\ª@wÙ@|?@jH@Q8*ªªª@@ß“HóQÿ´:ÿxžÿF¼ÿ!‰ÿîÿ¨ÿ# ÿ'´ÿ'ÿ ÿÿ„ÿ%o000000M COLA 00LHZIUÚ:,·l @0è8  éd&FªªªÿïK Èÿpb¨/µ@vþ@±@°@cª@Ó@Na@²Í@ê @ÿ€@öD@ÕØ*ªªª@žÊ@<@®&@¦@•\–3WGÿ¬ ÿ Lÿ’˜ÿ}ÿdgÿH'ÿþîäþÒÛ*ªªªþÑÚþÞ×þê½þæ§þ¸öþX-ýÙBýZ"üðü«äü—fü´&ýÓýŠþ4U*ªªªþüìÿÚì@µZ@}¿@.6@½À@: @ž–@Çù@÷@°G@ƒ@8n@Ðm@M~*ªªª@¼¤@ ë@H¡ÿ”þå9þ5³ý‘„ý¼üëýÓý‰äþSþ£Lÿ2ÿ£p*ªªª´Äá‚7nöÿÊRÿƒÿ þ­òþ:ëýâáýÄ•ýÃ>ýð’þtÑÿ#ÿäg@½ß*ªªª@‹›@AI@Öœ@5}@c9@Zâ@$)@ã>@Ž@Í@ŒX@˜@ºb@QÀƒ[æ000000M COLA 00LHZIUÚ:! ·i @0è8  éd&FªªªÞ­éÿÐåÿ¹Šÿ®@ÿ«/ÿ“‘ÿlÇÿO}ÿ>àÿ;©ÿ:`ÿ<šÿ6Õÿß*ªªªþè)þË8þÀ›þÛ¡ÿìÿwÌÿó(@d@Á²@–@dÄ@“_@®¡@¤Î@j*ªªª@%‹@ç¤@•i–íÌNÿskÿþàGþÒþ±üþŽ þ‚¶þx¢þvþ„þ¬}*ªªªþóÿ60ÿW(ÿdPÿt•ÿ’¸ÿ­=ÿª1ÿ±°Þ@jS@ì7@¥N@{b@%*ªªª@‹™@ÍQ@¾“@o*@Ò@t*@žz@ÈÌÿÔŸþËóýâÚý˜ü‹˜üXçüŽ$*ªªªý½ýkýߥþ”ÿ |ÿV;ÿoTÿAÿyþí]þÀKþ·)þ×±ÿ-˜ÿšK*ªªª@ 7@Áü@>@,@™‡@Óå@ o@M@D›@ä–@Vã@˜@pÿxïþzª000000M COLA 00LHZIUÚ:#·j @0è8  éd&Fªªªâ/Ï\ýÆFý2çüÂü¹ü¯ý \ý[)ý¼òþ=mþ«'ÿ tÿ[Iÿ’Á*ªªª­ª@yR@Ò@@W@¿˜@+f@þ@át@íý@ÊU@ƒ„@ö@8$@jœÿ‡N*ªªªþ›ýËËýÂü‘ŒüGxü@¡ü|üï ý‡»þJ¼ÿBç@FÂ@$­@Õ}@j *ªªª@ó&@S¦@m@\´@>D@«@ªj@bÁ@ @Å@ÿœ@¶v@nî@Äÿµ*ªªªÿZ—ÿþœüþC`þXýÔœý™ýƒ¼ý˜yýÓ%þ7õþˤÿÙ@0s@Çç*ªªª@;K@‚é@©@²¢@žÇ@iq@·@É‹@w–šJ’ÿÉÄÿ•ÿsÉÿZ”ÿI˜*ªªªÿYûÿ:©9R@`;@V@¹]@´@±@ªÏ@š@›@¢@©_@³­@®>000000M COLA 00LHZIUÚ:%·l @0è8  éd$FªªªêÿóÈÞ@²Ž@ÂL@°~@~™žcÿyÿ/þÈ=þ‹üþSîþ25þ%-þÌ*ªªªýþþÃþ.qþW`þ†«þéHÿk™ÿý•@šÚ@+Y@³†@,ƒ@i…@[@#É*ªªª@ÝV@‚\@i@¨Î@ZÉ”–ƒÿÏúÿœùÿ€?ÿyÿ—–¥ís“@$¿@W|@Xë*ªªªŽmÀdÿeÿ{þãaþÈþ¹ñþµªþ°þ±5þµÀþ±ÐþÃhþëµÿÿ*ªªªÿI-ÿˆ6ÿ»¸D)p@[n@• @ÖL@œ@X´@²@§È@µm@Ãñ@Æ$@Ѹ*ªªª@ñ{@@D7@k@X@be@êò@ñ@9ÿFðþFžýYü‡úûÚHûeË*ªªªû ûìûvëü!aüðFýÒ±þ¿ÿ£˜@k@=@á@›@ð@Ün@(t000000M COLA 00LHZIUÚ:&3·h @0è8  éd&Fªªªÿ÷*ùÿùŽ“@b@pR@@‚@ßÑ@XÈ@º@/C@¿¯@GÎÿÌ£ÿyÇÿU)ÿKù*ªªªÿbâÿ˜W­£›€@EÖ@c½@uÙ@]E@Kÿ­ÿÚþkMý›$üÁ8ûõÜû^/*ªªªû(û)*û©Züœ³ýâSÿb@þ¡@™Û@T@Y`@5Ø@Ÿ$@•#@ @Hƒ*ªªª@)•@×Ê@l@ þÐýÂüæßüWÝüõûÜaûÞ§üÒüýhnþX‡*ªªªÿUÉ@=@úŽ@‹2@æH@ùP@غ@¨´@R‰@Ì@5oÿ˜-ÿ4þvþR*ªªªýËýÃçþõþ—5ÿg@RÖ@_å@tL@[ @üì@O=@9´@«C@º,@„×*ªªª@2òþõ˜ýê—ý(Aü¼šü¦ïüçkýuSþ*&þî&ÿ°¤@;È@}<@š9@š000000M COLA 00LHZIUÚ:(#·i @0è8  éd&FªªªÿùéaÃ"@ZÎÿî1ÿŠ­ÿ4‚þóªþàšÿµÿZݤ—75@­D@!Y@n@†É*ªªª@gø@$@é:@«Á@`È™+ºÜ@‚¦@†@¶Ò@V @áâ@(½@ýî@RS@¯*ªªªÿ‡ýÎ1ûù¨ú:tøîøA.ø_PùaÙû!ýs0@Ý@ªu@Øï@]9@#Ì*ªªª@,_@n@}@@/ÿ@ý]Ôü9YûÄLüÅüÒ þ ÿ¢µ@<þ@±_*ªªª@½@FÞ@A+@–Ü@lï@ý¢ÿa]ý¬ü"úâú%ùåŸúH…ûCü°Ð*ªªªþ‚ï@ˆB@uÀ@À@2@Åú@»³@¶@I@Â@Ãþô¼ýcßüHîû«n*ªªªû§ÉüJ¾ý‚{ÿ-{@÷ž@@È[@tù@|¿@Í @„`@ö ÿ?.ý}ûþ 000000M COLA 00LHZIUÚ:*·g @0è8  éd&FªªªÿþÀÿüò,úüúúªûXüyýÉÿ?Ü@å+@Gˆ@7z@—Y@b&@â@ò•*ªªª@ñ™ÿÛÿþîÔþLVþéþdÍÿ:ê@vÔ@ÅŠ@ïª@¿Î@ýÝ@£@¯«@+]*ªªªÿO?ýoÞûÑŸú¥8ú ©ú`ú³Rü ýÔiÿÀ@–Ç@>@(@„ß@q~*ªªª@ÛJ@Ì»@’ @BÿÑ‘ÿ2ÎþÚ^þàÿGÿ‡@ ™@‹@Ðä@äC@³·*ªªª@W£ÿÂÿ#×þ·BþU5ýøýÊ5ýÈýïŒþ@„þ§Ùÿ!éÿ­/@3´@¨*ªªª@Ô@=ª@sÐ@µ@ê@g-@İ@.@$â@å @U@}¸@ZáÿíýÕ:*ªªªüÚü6jûæ¡ûùsü“‹ý’lþ²Bÿå5@ýô@Àª@$r@$‚@½*@ý@+000000M COLA 00LHZIUÚ:,·g @0è8  éd&Fªªªÿü=k]ÿJØþ||ý×ý„JýŒþ!Oÿ¨@Z•@¸@Y@‘@ÐR@¦*ªªª@©‘@ÐÆ@›r@²ÿg ýÑüˆ{û©¢û(EûzûzÝüïüÛ ýÞ þò*ªªªÿã¶@ƒ—@Üx@$³@cç@’J@¿Ã@ÿ?@_’@Óí@@!@¡é@åw@Ó/@PÛ*ªªª@]+@—ÿ[?ýŽVûöùúÈgúLú¨úÏIü.ŠýÉÿy¿@$·@„.@\µ*ªªª@• @Aî@€w@nÓ@[Ãÿ‘'ÿ+þÿ#Âÿj'@ö@Óý@••@3.@{„@;c*ªªª@{ð@^Vÿìýеü¾«ü3ûø+üg ýLþ’j@Ã@Kp@Fû@×9@äÖ*ªªª@vÚ@°Ô@ÈšÿÞÀÿPþ{‘þp{þÛ$ÿ¡&@ޤ@v@F!@Öÿ@ô&@—Í000000M COLA 00LHZIUÚ:-.·g @0è8  éd&Fªªª:ÿý™Ë@ι@¤ÈÿA”ýÜü°˜ûóUûÂmü/Àý$þ`€ÿ»N@ü¥@ã*ªªª@u¹@¶i@†I@Ý]@ÙÿÌ×þýãþ‡Žþ„cþî>ÿ¡=@uÖ@Ty@%i@£'*ªªª@›È@@0Fÿõªþ™ý[ü„çüYUüâcýì!ÿF÷@»ô@ú@ÁŒ@ñ$*ªªª@€¶@xO@*þwý/ü`üHýwþfh@*P@Š@án@@ˆ¹@K*ªªª@â·@)ÿ­`ýKsûJsúù²8úe§ûúŒþè@]¸@h,@Ô;@j"@8~*ªªª@]«@ @œÿTþcý÷Áþ&þÚ_ÿØå@І@ˆ©@áZ@³Õ@ÿõ'*ªªªþÑçýæ_ýhLýh\ýïÙþç·@À@Y@M@»ƒ@‚É@¦þ@TºþÔñý…"000000M COLA 00LHZIUÚ:/·g @0è8  éd&FªªªÿúD¥ÿõÙ!üªÚün[üòÖþ9ý@\@÷†@§3@ÄW@!s@¬@iÔ@ˆ³ÿ^<*ªªªý\}ûßAûùû0üšý„‚ÿß@®@¢Q@/T@%@}Ø@®/ÿÒÿ#‡*ªªªþáZÿ-Zÿÿœ@:@*ò@ß@q„@F¯@r”@ù ÿeý8 ûÅ4ûPûF>*ªªªüZYþ k@O@U@ˆ-@bÒ@n+@¥…@+@Jßþa(üÈ—ûÔ ûµ®üwo*ªªªýïeÿËî@¬@-F@ ¶@0a@‘¨@QÊ@±ëÿfý§„üÏnüƒüÉ%ý‰*ªªªþy2ÿqã@\=@ýF@>k@/Z@ãe@‡Í@L“@WE@»è@V@ï]@oI@µ³*ªªª@‡¶@Å@Œçÿ=ý~ùüWû+dúìÉûgü’"þ&BÿÝ_@•@öÀ@â000000M COLA 00LHZIUÚ:1 ·h @0è8  éd&Fªªªÿú"°ÿö(@I@3$@ŸÔ@°m@¢U@¥ÅÿË*ÿ%þË…þ¢þ|#þM@þ*ªªªýÑÆýƒÌýF±ýC ýžÄþaýÿuŸ@µ¡@ @g!@sq@ë_@­”@Ä@Yv*ªªª@•ýþºæýƒûìkûS³ût\üK7ý™5ÿ©@Š1@®I@bu@¶Ú@´8@pL*ªªª@@|@õw@…ý˜(d-ÿ…ÿ\þÁ‚þl˜þ$6ýû%þÅþBÁþ­~ÿN'*ªªª@@àè@€@æô@ôÀ@¯¡@6w@¦Z@üÿš¢ÿSÅÿc5ÿ·ƒ@,è@ p*ªªª@ðñ@õ@Îù@F«ÿ}¢þ›¸ýË1ý1>üõÌý6@ýí¡þøÊ@-à@cª@q*ªªª@.™@ƒ™@l—@ê@ Ÿ@ùéÿáþàþµý‹Zý^cýxqýЈþZ¾ÿê000000M COLA 00LHZIUÚ:28·g @0è8  éd$Fªªªÿõâäÿñ·[ÿºÆ@o3@ @}:@½Ú@ßÚ@Ùš@™@%@|¸ÿ±Tþî€þX4*ªªªýý†ýá©þéþ­6ÿ(@‘R@}÷@7H@©¦@µ>@G^@n@T&ÿ.Ùþ*ò*ªªªýghý‰ýHýŒóþ`Hÿk‡@}Ð@m@Â@a@@T@¾@…+@éI@M—*ªªªÿÏÈÿ†fÿYÿ- þþþÆþyœþ1œþ …þkþoËþðHÿ’M@Uä@%1*ªªª@åÔ@~ì@Å@®"@J@‘Å@’Œÿyþwíý¿DýiÀýƒýþ™ÿ4@x*ªªª@@ï¯@b›@j-@ Ÿ@EÍ@,Üþû±ýö@ýIÍý³ýSÓþÿAG@ŠÞ*ªªª@»‚@ªÜ@8k@JÌ@Û‡@ùÖ@Æäÿp#þ+<ý&ŠüzEüB0üœUýzþ¹000000M COLA 00LHZIUÚ:4'·g @0è8  éd&Fªªªÿñî×ÿÿÊÀ@7|@°û@æå@» @µ@îu@@à@ Ê@Œ&ÿý¢Áü{\ûÒp*ªªªûÖnü€…ý¡Ìÿ  @ ù@1@w?@Eÿ#(ÿø#@¥6@!@G®@0·@ø±@ÍÏ@·E@¢|@Ž{@|}000000M COLA 00LHZIUÚ:6·h @0è8  éd&Fªªª:‡ÿþ| @oÇ@g¤@L®ŽD×Ãÿkåþðòþ†àþ3rþþ?‰þ¤DÿB@ °*ªªª@à…@¢k@±@)ë@ìŒ@m@±ÿײÿ Uþ±þWþŽ}þÒWÿ< ÿ¼+*ªªª@:@¡@æO@ @t@ºs@ad@¶ÿ¼<ÿN»þë©þ›{þ{uþ“-þÌ*ªªªÿ'cÿ©k@Pî@Ð@Â@Jl@ž0@œX@)~@KÜ@7üÿ £þ#6ýc³ýç*ªªªý §ýƒ2þl}ÿ¦™@ôÔ@H@Ú˜@"ç@èŒ@?$@Bé@Iÿ{þ"Zý˜ù*ªªªýrZý²©þQ<ÿ5ä@+@ö\@‡@Ï@Å8@x³@ù¼@ivÿäÜÿmÿ D*ªªªþÜ[þÛ þéÅþïþð ÿ‡ÿ(cÿXÿ—èÿü@„°@[@¸ƒ@:ž@h–000000M COLA 00LHZIUÚ:8·g @0è8  éd&Fªªª¤­ÿ÷xX@(@˜)@ËõÿÕþÓåýì´ýM÷ýfýLÇýõ—þëØ@@;S*ªªª@?@ðê@6Õ@@W^@f@aÂÿZmþu±ýÕfý…KýŒýäþ…ôÿO.*ªªª@“@¬<@*@Oò@TË@1ô@Á@ÒÛ@’Ÿ@Gþÿöêÿ£~ÿXQÿãþë*ªªªþÊ0þ¾-þÙäÿ"³ÿ’§@"@À@]@@ñ¡@cY@ŠÎ@Rú@³?@¾Ðÿ¤ã*ªªªþ„Zý|Cü¬+ü+üÛü…qýfžþ©5@-5@»=@Z@$q@Ãø@ã‚@m–*ªªª@lI@!@g{þ¾Áý11ûìãû!Uúí+ûO ü5Šý„ºÿ µ@™Ü@¥@Dø*ªªª@‡@3‚@ñ@D¦@3b@ô`ÿ¸Ëþ¢ýÚŠýrmýc®ýž±þÑþÅúÿd³000000M COLA 00LHZIUÚ:91·h @0è8  éd&Fªªªÿ÷iãÿûøÌÿñ‹@h†@Àä@øz@û@1R@2>@ V@Ý@±@{;˜XÔvÿt™*ªªªÿžþ¹ßþsþS4þp˜þÐmÿcÒ@@ÜÉ@ž©@1q@v©@d@ñ)@),*ªªª@,Åÿ!Šþ0ûý~?ý(ÒýDýÇþžÍÿ§d@©"@{„@ó@UÉ@>ˆ@Ü7*ªªª@L—@©@ ÿŠ ÿ98ÿÆþöþì\þïéþó­ÿ ÿ$ÎÿZ“ÿ¬í@ ã*ªªª@iw@ч@-®@eÔ@sG@QÛ@ÿÔ@}ÀÿÓŽÿ+yþºˆþ‡ÊþŠÓþÄIÿ-L*ªªªÿÇÕ@zë@ É@Vý@S‡@ì@ä@Ñÿv~ÿ-þÀpþ¹™þèºÿ;¦ÿ²&*ªªª@8Ô@²q@Ê@;»@ #include #include #include #include #include #include #include "libmseed.h" static int ms_fread (char *buf, int size, int num, FILE *stream); /* Pack type parameters for the 8 defined types: * [type] : [hdrlen] [sizelen] [chksumlen] */ int8_t packtypes[9][3] = { {0, 0, 0}, {8, 8, 8}, {11, 8, 8}, {11, 8, 8}, {11, 8, 8}, {11, 8, 8}, {13, 8, 8}, {15, 8, 8}, {22, 15, 10}}; /********************************************************************* * Notes about packed files as read by ms_readmsr_main() * * In general a packed file includes a pack file identifier at the * very beginning, followed by pack header for a data block, followed * by the data block, followed by a chksum for the data block. The * pack header, data block and chksum are then repeated for each data * block in the file: * * ID HDR DATA CHKSUM HDR DATA CHKSUM * |----|-------|--....--|--------|-------|--....--|--------| ... * * |________ repeats ________| * * The HDR section contains fixed width ASCII fields identifying the * data in the next section and it's length in bytes. With this * information the offset of the next CHKSUM and HDR are completely * predictable. * * packtypes[type][0]: length of pack header length * packtypes[type][1]: length of size field in pack header * packtypes[type][2]: chksum length following data blocks, skipped * * Notes from seed_pack.h documenting the PQI and PLS pack types: * * ___________________________________________________________________ * There were earlier pack file types numbered 1 through 6. These have been discontinued. * Current file formats can be described as follows: * * Quality-Indexed Pack - Type 7: * _____10_____2__2___3_____8_______mod 256_______8_____2__2___3_____8_______mod 256_______8____ ... * |PQI- |q |lc|chn| size | ...data... | chksum |q |lc|chn| size | ...data... | chksum ... * parsing guide: * 10 | 15 hdr | xx | 8 | 15 hdr | xx * |+0|+2|+4 |+7 | * * * Large-Size Pack - Type 8: (for large channel blocks) * _____10_____2__2___3_____15_______mod 256_______8____2__2__2___3_____15_______mod 256_______8____ ... * |PLS-------|q |lc|chn| size | ...data... | chksum |--|q |lc|chn| size | ...data... | chksum ... * uniform parsing guide: * | 10 | 22 | xx | 10 | 22 | xx | * |+0|+2|+4 |+7 | * (note the use of hyphens after the PLS marker and just after the checksum. this will serve as a visual * aid when scanning between channel blocks and provide consistent 32 byte spacing between data blocks) * ___________________________________________________________________ * *********************************************************************/ /* Initialize the global file reading parameters */ MSFileParam gMSFileParam = {NULL, "", NULL, 0, 0, 0, 0, 0, 0, 0}; /********************************************************************** * ms_readmsr: * * This routine is a simple wrapper for ms_readmsr_main() that uses * the global file reading parameters. This routine is not thread * safe and cannot be used to read more than one file at a time. * * See the comments with ms_readmsr_main() for return values and * further description of arguments. *********************************************************************/ int ms_readmsr (MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, flag verbose) { MSFileParam *msfp = &gMSFileParam; return ms_readmsr_main (&msfp, ppmsr, msfile, reclen, fpos, last, skipnotdata, dataflag, NULL, verbose); } /* End of ms_readmsr() */ /********************************************************************** * ms_readmsr_r: * * This routine is a simple wrapper for ms_readmsr_main() that uses * the re-entrant capabilities. This routine is thread safe and can * be used to read more than one file at a time as long as separate * MSFileParam structures are used for each file. * * See the comments with ms_readmsr_main() for return values and * further description of arguments. *********************************************************************/ int ms_readmsr_r (MSFileParam **ppmsfp, MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, flag verbose) { return ms_readmsr_main (ppmsfp, ppmsr, msfile, reclen, fpos, last, skipnotdata, dataflag, NULL, verbose); } /* End of ms_readmsr_r() */ /********************************************************************** * ms_shift_msfp: * * A helper routine to shift (remove bytes from the beginning of) the * file reading buffer for a MSFP. The buffer length, reading offset * and file position indicators are all updated as necessary. * *********************************************************************/ static void ms_shift_msfp (MSFileParam *msfp, int shift) { if (!msfp) return; if (shift <= 0 && shift > msfp->readlen) { ms_log (2, "ms_shift_msfp(): Cannot shift buffer, shift: %d, readlen: %d, readoffset: %d\n", shift, msfp->readlen, msfp->readoffset); return; } memmove (msfp->rawrec, msfp->rawrec + shift, msfp->readlen - shift); msfp->readlen -= shift; if (shift < msfp->readoffset) { msfp->readoffset -= shift; } else { msfp->filepos += (shift - msfp->readoffset); msfp->readoffset = 0; } return; } /* End of ms_shift_msfp() */ /* Macro to calculate length of unprocessed buffer */ #define MSFPBUFLEN(MSFP) (MSFP->readlen - MSFP->readoffset) /* Macro to return current reading position */ #define MSFPREADPTR(MSFP) (MSFP->rawrec + MSFP->readoffset) /********************************************************************** * ms_readmsr_main: * * This routine will open and read, with subsequent calls, all * Mini-SEED records in specified file. * * All static file reading parameters are stored in a MSFileParam * struct and returned (via a pointer to a pointer) for the calling * routine to use in subsequent calls. A MSFileParam struct will be * allocated if necessary. This routine is thread safe and can be * used to read multiple files in parallel as long as the file reading * parameters are managed appropriately. * * If reclen is 0 or negative the length of every record is * automatically detected. For auto detection of record length the * record must include a 1000 blockette or be followed by a valid * record header or end of file. * * If *fpos is not NULL it will be updated to reflect the file * position (offset from the beginning in bytes) from where the * returned record was read. As a special case, if *fpos is not NULL * and the value it points to is less than 0 this will be interpreted * as a (positive) starting offset from which to begin reading data; * this feature does not work with packed files. * * If *last is not NULL it will be set to 1 when the last record in * the file is being returned, otherwise it will be 0. * * If the skipnotdata flag is true any data chunks read that do not * have valid data record indicators (D, R, Q, M, etc.) will be skipped. * * dataflag will be passed directly to msr_unpack(). * * If a Selections list is supplied it will be used to determine when * a section of data in a packed file may be skipped, packed files are * internal to the IRIS DMC. * * After reading all the records in a file the controlling program * should call it one last time with msfile set to NULL. This will * close the file and free allocated memory. * * Returns MS_NOERROR and populates an MSRecord struct at *ppmsr on * successful read, returns MS_ENDOFFILE on EOF, otherwise returns a * libmseed error code (listed in libmseed.h) and *ppmsr is set to * NULL. *********************************************************************/ int ms_readmsr_main (MSFileParam **ppmsfp, MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, Selections *selections, flag verbose) { MSFileParam *msfp; off_t packdatasize = 0; int packskipsize; int parseval = 0; int readsize = 0; int readcount = 0; int retcode = MS_NOERROR; if (!ppmsr) return MS_GENERROR; if (!ppmsfp) return MS_GENERROR; msfp = *ppmsfp; /* Initialize the file read parameters if needed */ if (!msfp) { msfp = (MSFileParam *)malloc (sizeof (MSFileParam)); if (msfp == NULL) { ms_log (2, "ms_readmsr_main(): Cannot allocate memory for MSFP\n"); return MS_GENERROR; } /* Redirect the supplied pointer to the allocated params */ *ppmsfp = msfp; msfp->fp = NULL; msfp->filename[0] = '\0'; msfp->rawrec = NULL; msfp->readlen = 0; msfp->readoffset = 0; msfp->packtype = 0; msfp->packhdroffset = 0; msfp->filepos = 0; msfp->filesize = 0; msfp->recordcount = 0; } /* When cleanup is requested */ if (msfile == NULL) { msr_free (ppmsr); if (msfp->fp != NULL) fclose (msfp->fp); if (msfp->rawrec != NULL) free (msfp->rawrec); /* If the file parameters are the global parameters reset them */ if (*ppmsfp == &gMSFileParam) { gMSFileParam.fp = NULL; gMSFileParam.filename[0] = '\0'; gMSFileParam.rawrec = NULL; gMSFileParam.readlen = 0; gMSFileParam.readoffset = 0; gMSFileParam.packtype = 0; gMSFileParam.packhdroffset = 0; gMSFileParam.filepos = 0; gMSFileParam.filesize = 0; gMSFileParam.recordcount = 0; } /* Otherwise free the MSFileParam */ else { free (*ppmsfp); *ppmsfp = NULL; } return MS_NOERROR; } /* Allocate reading buffer */ if (msfp->rawrec == NULL) { if (!(msfp->rawrec = (char *)malloc (MAXRECLEN))) { ms_log (2, "ms_readmsr_main(): Cannot allocate memory for read buffer\n"); return MS_GENERROR; } } /* Sanity check: track if we are reading the same file */ if (msfp->fp && strncmp (msfile, msfp->filename, sizeof (msfp->filename))) { ms_log (2, "ms_readmsr_main() called with a different file name without being reset\n"); /* Close previous file and reset needed variables */ if (msfp->fp != NULL) fclose (msfp->fp); msfp->fp = NULL; msfp->readlen = 0; msfp->readoffset = 0; msfp->packtype = 0; msfp->packhdroffset = 0; msfp->filepos = 0; msfp->filesize = 0; msfp->recordcount = 0; } /* Open the file if needed, redirect to stdin if file is "-" */ if (msfp->fp == NULL) { /* Store the filename for tracking */ strncpy (msfp->filename, msfile, sizeof (msfp->filename) - 1); msfp->filename[sizeof (msfp->filename) - 1] = '\0'; if (strcmp (msfile, "-") == 0) { msfp->fp = stdin; } else { if ((msfp->fp = fopen (msfile, "rb")) == NULL) { ms_log (2, "Cannot open file: %s (%s)\n", msfile, strerror (errno)); msr_free (ppmsr); return MS_GENERROR; } else { /* Determine file size */ struct stat sbuf; if (fstat (fileno (msfp->fp), &sbuf)) { ms_log (2, "Cannot open file: %s (%s)\n", msfile, strerror (errno)); msr_free (ppmsr); return MS_GENERROR; } msfp->filesize = sbuf.st_size; } } } /* Seek to a specified offset if requested */ if (fpos != NULL && *fpos < 0) { /* Only try to seek in real files, not stdin */ if (msfp->fp != stdin) { if (lmp_fseeko (msfp->fp, *fpos * -1, SEEK_SET)) { ms_log (2, "Cannot seek in file: %s (%s)\n", msfile, strerror (errno)); return MS_GENERROR; } msfp->filepos = *fpos * -1; msfp->readlen = 0; msfp->readoffset = 0; } } /* Zero the last record indicator */ if (last) *last = 0; /* Read data and search for records */ for (;;) { /* Read more data into buffer if not at EOF and buffer has less than MINRECLEN * or more data is needed for the current record detected in buffer. */ if (!feof (msfp->fp) && (MSFPBUFLEN (msfp) < MINRECLEN || parseval > 0)) { /* Reset offsets if no unprocessed data in buffer */ if (MSFPBUFLEN (msfp) <= 0) { msfp->readlen = 0; msfp->readoffset = 0; } /* Otherwise shift existing data to beginning of buffer */ else if (msfp->readoffset > 0) { ms_shift_msfp (msfp, msfp->readoffset); } /* Determine read size */ readsize = (MAXRECLEN - msfp->readlen); /* Read data into record buffer */ readcount = ms_fread (msfp->rawrec + msfp->readlen, 1, readsize, msfp->fp); if (readcount != readsize) { if (!feof (msfp->fp)) { ms_log (2, "Short read of %d bytes starting from %" PRId64 "\n", readsize, msfp->filepos); retcode = MS_GENERROR; break; } } /* Update read buffer length */ msfp->readlen += readcount; /* File position corresponding to start of buffer; not strictly necessary */ if (msfp->fp != stdin) msfp->filepos = lmp_ftello (msfp->fp) - msfp->readlen; } /* Test for packed file signature at the beginning of the file */ if (msfp->filepos == 0 && *(MSFPREADPTR (msfp)) == 'P' && MSFPBUFLEN (msfp) >= 48) { msfp->packtype = 0; /* Determine pack type, the negative pack type indicates initial header */ if (!memcmp ("PED", MSFPREADPTR (msfp), 3)) msfp->packtype = -1; else if (!memcmp ("PSD", MSFPREADPTR (msfp), 3)) msfp->packtype = -2; else if (!memcmp ("PLC", MSFPREADPTR (msfp), 3)) msfp->packtype = -6; else if (!memcmp ("PQI", MSFPREADPTR (msfp), 3)) msfp->packtype = -7; else if (!memcmp ("PLS", MSFPREADPTR (msfp), 3)) msfp->packtype = -8; if (verbose > 0) ms_log (1, "Detected packed file (%3.3s: type %d)\n", MSFPREADPTR (msfp), -msfp->packtype); } /* Read pack headers, initial and subsequent headers including (ignored) chksum values */ if (msfp->packtype && (msfp->packtype < 0 || msfp->filepos == msfp->packhdroffset) && MSFPBUFLEN (msfp) >= 48) { char hdrstr[30]; int64_t datasize; /* Determine bytes to skip before header: either initial ID block or type-specific chksum block */ packskipsize = (msfp->packtype < 0) ? 10 : packtypes[msfp->packtype][2]; if (msfp->packtype < 0) msfp->packtype = -msfp->packtype; /* Read pack length from pack header accounting for bytes that should be skipped */ memset (hdrstr, 0, sizeof (hdrstr)); memcpy (hdrstr, MSFPREADPTR (msfp) + (packtypes[msfp->packtype][0] + packskipsize - packtypes[msfp->packtype][1]), packtypes[msfp->packtype][1]); sscanf (hdrstr, " %" SCNd64, &datasize); packdatasize = (off_t)datasize; /* Next pack header = File position + skipsize + header size + data size * This offset is actually to the data block chksum which is skipped by the logic above, * the next pack header should directly follow the chksum. */ msfp->packhdroffset = msfp->filepos + packskipsize + packtypes[msfp->packtype][0] + packdatasize; if (verbose > 1) ms_log (1, "Read packed file header at offset %" PRId64 " (%d bytes follow), chksum offset: %" PRId64 "\n", (msfp->filepos + packskipsize), packdatasize, msfp->packhdroffset); /* Shift buffer to new reading offset (aligns records in buffer) */ ms_shift_msfp (msfp, msfp->readoffset + (packskipsize + packtypes[msfp->packtype][0])); } /* End of packed header processing */ /* Check for match if selections are supplied and pack header was read, */ /* only when enough data is in buffer and not reading from stdin pipe */ if (selections && msfp->packtype && packdatasize && MSFPBUFLEN (msfp) >= 48 && msfp->fp != stdin) { char srcname[100]; ms_recsrcname (MSFPREADPTR (msfp), srcname, 1); if (!ms_matchselect (selections, srcname, HPTERROR, HPTERROR, NULL)) { /* Update read position if next section is in buffer */ if (MSFPBUFLEN (msfp) >= (msfp->packhdroffset - msfp->filepos)) { if (verbose > 1) { ms_log (1, "Skipping (jump) packed section for %s (%d bytes) starting at offset %" PRId64 "\n", srcname, (msfp->packhdroffset - msfp->filepos), msfp->filepos); } msfp->readoffset += (msfp->packhdroffset - msfp->filepos); msfp->filepos = msfp->packhdroffset; packdatasize = 0; } /* Otherwise seek to next pack header and reset reading position */ else { if (verbose > 1) { ms_log (1, "Skipping (seek) packed section for %s (%d bytes) starting at offset %" PRId64 "\n", srcname, (msfp->packhdroffset - msfp->filepos), msfp->filepos); } if (lmp_fseeko (msfp->fp, msfp->packhdroffset, SEEK_SET)) { ms_log (2, "Cannot seek in file: %s (%s)\n", msfile, strerror (errno)); return MS_GENERROR; break; } msfp->filepos = msfp->packhdroffset; msfp->readlen = 0; msfp->readoffset = 0; packdatasize = 0; } /* Return to top of loop for proper pack header handling */ continue; } } /* End of selection processing */ /* Attempt to parse record from buffer */ if (MSFPBUFLEN (msfp) >= MINRECLEN) { int parselen = MSFPBUFLEN (msfp); /* Limit the parse length to offset of pack header if present in the buffer */ if (msfp->packhdroffset && msfp->packhdroffset < (msfp->filepos + MSFPBUFLEN (msfp))) parselen = msfp->packhdroffset - msfp->filepos; parseval = msr_parse (MSFPREADPTR (msfp), parselen, ppmsr, reclen, dataflag, verbose); /* Record detected and parsed */ if (parseval == 0) { if (verbose > 1) ms_log (1, "Read record length of %d bytes\n", (*ppmsr)->reclen); /* Test if this is the last record if file size is known (not pipe) */ if (last && msfp->filesize) if ((msfp->filesize - (msfp->filepos + (*ppmsr)->reclen)) < MINRECLEN) *last = 1; /* Return file position for this record */ if (fpos) *fpos = msfp->filepos; /* Update reading offset, file position and record count */ msfp->readoffset += (*ppmsr)->reclen; msfp->filepos += (*ppmsr)->reclen; msfp->recordcount++; retcode = MS_NOERROR; break; } else if (parseval < 0) { /* Skip non-data if requested */ if (skipnotdata) { if (verbose > 1) { if (MS_ISVALIDBLANK ((char *)MSFPREADPTR (msfp))) ms_log (1, "Skipped %d bytes of blank/noise record at byte offset %" PRId64 "\n", MINRECLEN, msfp->filepos); else ms_log (1, "Skipped %d bytes of non-data record at byte offset %" PRId64 "\n", MINRECLEN, msfp->filepos); } /* Skip MINRECLEN bytes, update reading offset and file position */ msfp->readoffset += MINRECLEN; msfp->filepos += MINRECLEN; } /* Parsing errors */ else { ms_log (2, "Cannot detect record at byte offset %" PRId64 ": %s\n", msfp->filepos, msfile); /* Print common errors and raw details if verbose */ ms_parse_raw (MSFPREADPTR (msfp), MSFPBUFLEN (msfp), verbose, -1); retcode = parseval; break; } } else /* parseval > 0 (found record but need more data) */ { /* Determine implied record length if needed */ int32_t impreclen = reclen; /* Check for parse hints that are larger than MAXRECLEN */ if ((MSFPBUFLEN (msfp) + parseval) > MAXRECLEN) { if (skipnotdata) { /* Skip MINRECLEN bytes, update reading offset and file position */ msfp->readoffset += MINRECLEN; msfp->filepos += MINRECLEN; } else { retcode = MS_OUTOFRANGE; break; } } /* Pack header check, if pack header offset is within buffer */ else if (impreclen <= 0 && msfp->packhdroffset && msfp->packhdroffset < (msfp->filepos + MSFPBUFLEN (msfp))) { impreclen = msfp->packhdroffset - msfp->filepos; /* Check that record length is within range and a power of 2. * Power of two if (X & (X - 1)) == 0 */ if (impreclen >= MINRECLEN && impreclen <= MAXRECLEN && (impreclen & (impreclen - 1)) == 0) { /* Set the record length implied by the next pack header */ reclen = impreclen; } else { ms_log (1, "Implied record length (%d) is invalid\n", impreclen); retcode = MS_NOTSEED; break; } } /* End of file check */ else if (impreclen <= 0 && feof (msfp->fp)) { impreclen = msfp->filesize - msfp->filepos; /* Check that record length is within range and a power of 2. * Power of two if (X & (X - 1)) == 0 */ if (impreclen >= MINRECLEN && impreclen <= MAXRECLEN && (impreclen & (impreclen - 1)) == 0) { /* Set the record length implied by the end of the file */ reclen = impreclen; } /* Otherwise a trucated record */ else { if (verbose) { if (msfp->filesize) ms_log (1, "Truncated record at byte offset %" PRId64 ", filesize %d: %s\n", msfp->filepos, msfp->filesize, msfile); else ms_log (1, "Truncated record at byte offset %" PRId64 "\n", msfp->filepos); } retcode = MS_ENDOFFILE; break; } } } } /* End of record detection */ /* Finished when within MINRECLEN from EOF and buffer less than MINRECLEN */ if ((msfp->filesize - msfp->filepos) < MINRECLEN && MSFPBUFLEN (msfp) < MINRECLEN) { if (msfp->recordcount == 0 && msfp->packtype == 0) { if (verbose > 0) ms_log (2, "%s: No data records read, not SEED?\n", msfile); retcode = MS_NOTSEED; } else { retcode = MS_ENDOFFILE; } break; } } /* End of reading, record detection and parsing loop */ /* Cleanup target MSRecord if returning an error */ if (retcode != MS_NOERROR) { msr_free (ppmsr); } return retcode; } /* End of ms_readmsr_main() */ /********************************************************************* * ms_readtraces: * * This is a simple wrapper for ms_readtraces_selection() that uses no * selections. * * See the comments with ms_readtraces_selection() for return values * and further description of arguments. *********************************************************************/ int ms_readtraces (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { return ms_readtraces_selection (ppmstg, msfile, reclen, timetol, sampratetol, NULL, dataquality, skipnotdata, dataflag, verbose); } /* End of ms_readtraces() */ /********************************************************************* * ms_readtraces_timewin: * * This is a wrapper for ms_readtraces_selection() that creates a * simple selection for a specified time window. * * See the comments with ms_readtraces_selection() for return values * and further description of arguments. *********************************************************************/ int ms_readtraces_timewin (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, hptime_t starttime, hptime_t endtime, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { Selections selection; SelectTime selecttime; selection.srcname[0] = '*'; selection.srcname[1] = '\0'; selection.timewindows = &selecttime; selection.next = NULL; selecttime.starttime = starttime; selecttime.endtime = endtime; selecttime.next = NULL; return ms_readtraces_selection (ppmstg, msfile, reclen, timetol, sampratetol, &selection, dataquality, skipnotdata, dataflag, verbose); } /* End of ms_readtraces_timewin() */ /********************************************************************* * ms_readtraces_selection: * * This routine will open and read all Mini-SEED records in specified * file and populate a trace group. This routine is thread safe. * * If reclen is <= 0 the length of every record is automatically * detected. * * If a Selections list is supplied it will be used to limit which * records are added to the trace group. * * Returns MS_NOERROR and populates an MSTraceGroup struct at *ppmstg * on successful read, otherwise returns a libmseed error code (listed * in libmseed.h). *********************************************************************/ int ms_readtraces_selection (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, Selections *selections, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { MSRecord *msr = 0; MSFileParam *msfp = 0; int retcode; if (!ppmstg) return MS_GENERROR; /* Initialize MSTraceGroup if needed */ if (!*ppmstg) { *ppmstg = mst_initgroup (*ppmstg); if (!*ppmstg) return MS_GENERROR; } /* Loop over the input file */ while ((retcode = ms_readmsr_main (&msfp, &msr, msfile, reclen, NULL, NULL, skipnotdata, dataflag, NULL, verbose)) == MS_NOERROR) { /* Test against selections if supplied */ if (selections) { char srcname[50]; hptime_t endtime; msr_srcname (msr, srcname, 1); endtime = msr_endtime (msr); if (ms_matchselect (selections, srcname, msr->starttime, endtime, NULL) == NULL) { continue; } } /* Add to trace group */ mst_addmsrtogroup (*ppmstg, msr, dataquality, timetol, sampratetol); } /* Reset return code to MS_NOERROR on successful read by ms_readmsr() */ if (retcode == MS_ENDOFFILE) retcode = MS_NOERROR; ms_readmsr_main (&msfp, &msr, NULL, 0, NULL, NULL, 0, 0, NULL, 0); return retcode; } /* End of ms_readtraces_selection() */ /********************************************************************* * ms_readtracelist: * * This is a simple wrapper for ms_readtracelist_selection() that uses * no selections. * * See the comments with ms_readtracelist_selection() for return * values and further description of arguments. *********************************************************************/ int ms_readtracelist (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { return ms_readtracelist_selection (ppmstl, msfile, reclen, timetol, sampratetol, NULL, dataquality, skipnotdata, dataflag, verbose); } /* End of ms_readtracelist() */ /********************************************************************* * ms_readtracelist_timewin: * * This is a wrapper for ms_readtraces_selection() that creates a * simple selection for a specified time window. * * See the comments with ms_readtraces_selection() for return values * and further description of arguments. *********************************************************************/ int ms_readtracelist_timewin (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, hptime_t starttime, hptime_t endtime, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { Selections selection; SelectTime selecttime; selection.srcname[0] = '*'; selection.srcname[1] = '\0'; selection.timewindows = &selecttime; selection.next = NULL; selecttime.starttime = starttime; selecttime.endtime = endtime; selecttime.next = NULL; return ms_readtracelist_selection (ppmstl, msfile, reclen, timetol, sampratetol, &selection, dataquality, skipnotdata, dataflag, verbose); } /* End of ms_readtracelist_timewin() */ /********************************************************************* * ms_readtracelist_selection: * * This routine will open and read all Mini-SEED records in specified * file and populate a trace list. This routine is thread safe. * * If reclen is <= 0 the length of every record is automatically * detected. * * If a Selections list is supplied it will be used to limit which * records are added to the trace list. * * Returns MS_NOERROR and populates an MSTraceList struct at *ppmstl * on successful read, otherwise returns a libmseed error code (listed * in libmseed.h). *********************************************************************/ int ms_readtracelist_selection (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, Selections *selections, flag dataquality, flag skipnotdata, flag dataflag, flag verbose) { MSRecord *msr = 0; MSFileParam *msfp = 0; int retcode; if (!ppmstl) return MS_GENERROR; /* Initialize MSTraceList if needed */ if (!*ppmstl) { *ppmstl = mstl_init (*ppmstl); if (!*ppmstl) return MS_GENERROR; } /* Loop over the input file */ while ((retcode = ms_readmsr_main (&msfp, &msr, msfile, reclen, NULL, NULL, skipnotdata, dataflag, NULL, verbose)) == MS_NOERROR) { /* Test against selections if supplied */ if (selections) { char srcname[50]; hptime_t endtime; msr_srcname (msr, srcname, 1); endtime = msr_endtime (msr); if (ms_matchselect (selections, srcname, msr->starttime, endtime, NULL) == NULL) { continue; } } /* Add to trace list */ mstl_addmsr (*ppmstl, msr, dataquality, 1, timetol, sampratetol); } /* Reset return code to MS_NOERROR on successful read by ms_readmsr() */ if (retcode == MS_ENDOFFILE) retcode = MS_NOERROR; ms_readmsr_main (&msfp, &msr, NULL, 0, NULL, NULL, 0, 0, NULL, 0); return retcode; } /* End of ms_readtracelist_selection() */ /********************************************************************* * ms_fread: * * A wrapper for fread that handles EOF and error conditions. * * Returns the return value from fread. *********************************************************************/ static int ms_fread (char *buf, int size, int num, FILE *stream) { int read = 0; read = (int)fread (buf, size, num, stream); if (read <= 0 && size && num) { if (ferror (stream)) ms_log (2, "ms_fread(): Cannot read input file\n"); else if (!feof (stream)) ms_log (2, "ms_fread(): Unknown return from fread()\n"); } return read; } /* End of ms_fread() */ /*************************************************************************** * ms_record_handler_int: * * Internal record handler. The handler data should be a pointer to * an open file descriptor to which records will be written. * ***************************************************************************/ static void ms_record_handler_int (char *record, int reclen, void *ofp) { if (fwrite (record, reclen, 1, (FILE *)ofp) != 1) { ms_log (2, "Error writing to output file\n"); } } /* End of ms_record_handler_int() */ /*************************************************************************** * msr_writemseed: * * Pack MSRecord data into Mini-SEED record(s) by calling msr_pack() and * write to a specified file. * * Returns the number of records written on success and -1 on error. ***************************************************************************/ int msr_writemseed (MSRecord *msr, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose) { FILE *ofp; char srcname[50]; char *perms = (overwrite) ? "wb" : "ab"; int packedrecords = 0; if (!msr || !msfile) return -1; /* Open output file or use stdout */ if (strcmp (msfile, "-") == 0) { ofp = stdout; } else if ((ofp = fopen (msfile, perms)) == NULL) { ms_log (1, "Cannot open output file %s: %s\n", msfile, strerror (errno)); return -1; } /* Pack the MSRecord */ if (msr->numsamples > 0) { msr->encoding = encoding; msr->reclen = reclen; msr->byteorder = byteorder; packedrecords = msr_pack (msr, &ms_record_handler_int, ofp, NULL, 1, verbose - 1); if (packedrecords < 0) { msr_srcname (msr, srcname, 1); ms_log (1, "Cannot write Mini-SEED for %s\n", srcname); } } /* Close file and return record count */ fclose (ofp); return (packedrecords >= 0) ? packedrecords : -1; } /* End of msr_writemseed() */ /*************************************************************************** * mst_writemseed: * * Pack MSTrace data into Mini-SEED records by calling mst_pack() and * write to a specified file. * * Returns the number of records written on success and -1 on error. ***************************************************************************/ int mst_writemseed (MSTrace *mst, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose) { FILE *ofp; char srcname[50]; char *perms = (overwrite) ? "wb" : "ab"; int packedrecords = 0; if (!mst || !msfile) return -1; /* Open output file or use stdout */ if (strcmp (msfile, "-") == 0) { ofp = stdout; } else if ((ofp = fopen (msfile, perms)) == NULL) { ms_log (1, "Cannot open output file %s: %s\n", msfile, strerror (errno)); return -1; } /* Pack the MSTrace */ if (mst->numsamples > 0) { packedrecords = mst_pack (mst, &ms_record_handler_int, ofp, reclen, encoding, byteorder, NULL, 1, verbose - 1, NULL); if (packedrecords < 0) { mst_srcname (mst, srcname, 1); ms_log (1, "Cannot write Mini-SEED for %s\n", srcname); } } /* Close file and return record count */ fclose (ofp); return (packedrecords >= 0) ? packedrecords : -1; } /* End of mst_writemseed() */ /*************************************************************************** * mst_writemseedgroup: * * Pack MSTraceGroup data into Mini-SEED records by calling mst_pack() * for each MSTrace in the group and write to a specified file. * * Returns the number of records written on success and -1 on error. ***************************************************************************/ int mst_writemseedgroup (MSTraceGroup *mstg, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose) { MSTrace *mst; FILE *ofp; char srcname[50]; char *perms = (overwrite) ? "wb" : "ab"; int trpackedrecords; int packedrecords = 0; if (!mstg || !msfile) return -1; /* Open output file or use stdout */ if (strcmp (msfile, "-") == 0) { ofp = stdout; } else if ((ofp = fopen (msfile, perms)) == NULL) { ms_log (1, "Cannot open output file %s: %s\n", msfile, strerror (errno)); return -1; } /* Pack each MSTrace in the group */ mst = mstg->traces; while (mst) { if (mst->numsamples <= 0) { mst = mst->next; continue; } trpackedrecords = mst_pack (mst, &ms_record_handler_int, ofp, reclen, encoding, byteorder, NULL, 1, verbose - 1, NULL); if (trpackedrecords < 0) { mst_srcname (mst, srcname, 1); ms_log (1, "Cannot write Mini-SEED for %s\n", srcname); } else { packedrecords += trpackedrecords; } mst = mst->next; } /* Close file and return record count */ fclose (ofp); return packedrecords; } /* End of mst_writemseedgroup() */ iris-edu-libmseed-4314359/genutils.c000066400000000000000000001354311422047135100172170ustar00rootroot00000000000000/*************************************************************************** * genutils.c * * Generic utility routines * * Written by Chad Trabant * ORFEUS/EC-Project MEREDIAN * IRIS Data Management Center * * modified: 2017.053 ***************************************************************************/ #include #include #include #include #include #include "libmseed.h" static hptime_t ms_time2hptime_int (int year, int day, int hour, int min, int sec, int usec); static struct tm *ms_gmtime_r (int64_t *timep, struct tm *result); /* A constant number of seconds between the NTP and Posix/Unix time epoch */ #define NTPPOSIXEPOCHDELTA 2208988800LL /* Global variable to hold a leap second list */ LeapSecond *leapsecondlist = NULL; /*************************************************************************** * ms_recsrcname: * * Generate a source name string for a specified raw data record in * the format: 'NET_STA_LOC_CHAN' or, if the quality flag is true: * 'NET_STA_LOC_CHAN_QUAL'. The passed srcname must have enough room * for the resulting string. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_recsrcname (char *record, char *srcname, flag quality) { struct fsdh_s *fsdh; char network[6]; char station[6]; char location[6]; char channel[6]; if (!record) return NULL; fsdh = (struct fsdh_s *)record; ms_strncpclean (network, fsdh->network, 2); ms_strncpclean (station, fsdh->station, 5); ms_strncpclean (location, fsdh->location, 2); ms_strncpclean (channel, fsdh->channel, 3); /* Build the source name string including the quality indicator*/ if (quality) sprintf (srcname, "%s_%s_%s_%s_%c", network, station, location, channel, fsdh->dataquality); /* Build the source name string without the quality indicator*/ else sprintf (srcname, "%s_%s_%s_%s", network, station, location, channel); return srcname; } /* End of ms_recsrcname() */ /*************************************************************************** * ms_splitsrcname: * * Split srcname into separate components: "NET_STA_LOC_CHAN[_QUAL]". * Memory for each component must already be allocated. If a specific * component is not desired set the appropriate argument to NULL. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_splitsrcname (char *srcname, char *net, char *sta, char *loc, char *chan, char *qual) { char *id; char *ptr, *top, *next; int sepcnt = 0; if (!srcname) return -1; /* Verify number of separating underscore characters */ id = srcname; while ((id = strchr (id, '_'))) { id++; sepcnt++; } /* Either 3 or 4 separating underscores are required */ if (sepcnt != 3 && sepcnt != 4) { return -1; } /* Duplicate srcname */ if (!(id = strdup (srcname))) { ms_log (2, "ms_splitsrcname(): Error duplicating srcname string"); return -1; } /* Network */ top = id; if ((ptr = strchr (top, '_'))) { next = ptr + 1; *ptr = '\0'; if (net) strcpy (net, top); top = next; } /* Station */ if ((ptr = strchr (top, '_'))) { next = ptr + 1; *ptr = '\0'; if (sta) strcpy (sta, top); top = next; } /* Location */ if ((ptr = strchr (top, '_'))) { next = ptr + 1; *ptr = '\0'; if (loc) strcpy (loc, top); top = next; } /* Channel & optional Quality */ if ((ptr = strchr (top, '_'))) { next = ptr + 1; *ptr = '\0'; if (chan) strcpy (chan, top); top = next; /* Quality */ if (*top && qual) { /* Quality is a single character */ *qual = *top; } } /* Otherwise only Channel */ else if (*top && chan) { strcpy (chan, top); } /* Free duplicated stream ID */ if (id) free (id); return 0; } /* End of ms_splitsrcname() */ /*************************************************************************** * ms_strncpclean: * * Copy up to 'length' characters from 'source' to 'dest' while * removing all spaces. The result is left justified and always null * terminated. The destination string must have enough room needed * for the non-space characters within 'length' and the null * terminator, a maximum of 'length + 1'. * * Returns the number of characters (not including the null terminator) in * the destination string. ***************************************************************************/ int ms_strncpclean (char *dest, const char *source, int length) { int sidx, didx; if (!dest) return 0; if (!source) { *dest = '\0'; return 0; } for (sidx = 0, didx = 0; sidx < length; sidx++) { if (*(source + sidx) == '\0') { break; } if (*(source + sidx) != ' ') { *(dest + didx) = *(source + sidx); didx++; } } *(dest + didx) = '\0'; return didx; } /* End of ms_strncpclean() */ /*************************************************************************** * ms_strncpcleantail: * * Copy up to 'length' characters from 'source' to 'dest' without any * trailing spaces. The result is left justified and always null * terminated. The destination string must have enough room needed * for the characters within 'length' and the null terminator, a * maximum of 'length + 1'. * * Returns the number of characters (not including the null terminator) in * the destination string. ***************************************************************************/ int ms_strncpcleantail (char *dest, const char *source, int length) { int idx, pretail; if (!dest) return 0; if (!source) { *dest = '\0'; return 0; } *(dest + length) = '\0'; pretail = 0; for (idx = length - 1; idx >= 0; idx--) { if (!pretail && *(source + idx) == ' ') { *(dest + idx) = '\0'; } else { pretail++; *(dest + idx) = *(source + idx); } } return pretail; } /* End of ms_strncpcleantail() */ /*************************************************************************** * ms_strncpopen: * * Copy 'length' characters from 'source' to 'dest', padding the right * side with spaces and leave open-ended. The result is left * justified and *never* null terminated (the open-ended part). The * destination string must have enough room for 'length' characters. * * Returns the number of characters copied from the source string. ***************************************************************************/ int ms_strncpopen (char *dest, const char *source, int length) { int didx; int dcnt = 0; int term = 0; if (!dest) return 0; if (!source) { for (didx = 0; didx < length; didx++) { *(dest + didx) = ' '; } return 0; } for (didx = 0; didx < length; didx++) { if (!term) if (*(source + didx) == '\0') term = 1; if (!term) { *(dest + didx) = *(source + didx); dcnt++; } else { *(dest + didx) = ' '; } } return dcnt; } /* End of ms_strncpopen() */ /*************************************************************************** * ms_doy2md: * * Compute the month and day-of-month from a year and day-of-year. * * Year is expected to be in the range 1800-5000, jday is expected to * be in the range 1-366, month will be in the range 1-12 and mday * will be in the range 1-31. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_doy2md (int year, int jday, int *month, int *mday) { int idx; int leap; int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; /* Sanity check for the supplied year */ if (year < 1800 || year > 5000) { ms_log (2, "ms_doy2md(): year (%d) is out of range\n", year); return -1; } /* Test for leap year */ leap = (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 1 : 0; /* Add a day to February if leap year */ if (leap) days[1]++; if (jday > 365 + leap || jday <= 0) { ms_log (2, "ms_doy2md(): day-of-year (%d) is out of range\n", jday); return -1; } for (idx = 0; idx < 12; idx++) { jday -= days[idx]; if (jday <= 0) { *month = idx + 1; *mday = days[idx] + jday; break; } } return 0; } /* End of ms_doy2md() */ /*************************************************************************** * ms_md2doy: * * Compute the day-of-year from a year, month and day-of-month. * * Year is expected to be in the range 1800-5000, month is expected to * be in the range 1-12, mday is expected to be in the range 1-31 and * jday will be in the range 1-366. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_md2doy (int year, int month, int mday, int *jday) { int idx; int leap; int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; /* Sanity check for the supplied parameters */ if (year < 1800 || year > 5000) { ms_log (2, "ms_md2doy(): year (%d) is out of range\n", year); return -1; } if (month < 1 || month > 12) { ms_log (2, "ms_md2doy(): month (%d) is out of range\n", month); return -1; } if (mday < 1 || mday > 31) { ms_log (2, "ms_md2doy(): day-of-month (%d) is out of range\n", mday); return -1; } /* Test for leap year */ leap = (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 1 : 0; /* Add a day to February if leap year */ if (leap) days[1]++; /* Check that the day-of-month jives with specified month */ if (mday > days[month - 1]) { ms_log (2, "ms_md2doy(): day-of-month (%d) is out of range for month %d\n", mday, month); return -1; } *jday = 0; month--; for (idx = 0; idx < 12; idx++) { if (idx == month) { *jday += mday; break; } *jday += days[idx]; } return 0; } /* End of ms_md2doy() */ /*************************************************************************** * ms_btime2hptime: * * Convert a binary SEED time structure to a high precision epoch time * (1/HPTMODULUS second ticks from the epoch). The algorithm used is * a specific version of a generalized function in GNU glibc. * * Returns a high precision epoch time on success and HPTERROR on * error. ***************************************************************************/ hptime_t ms_btime2hptime (BTime *btime) { hptime_t hptime; int shortyear; int a4, a100, a400; int intervening_leap_days; int days; if (!btime) return HPTERROR; shortyear = btime->year - 1900; a4 = (shortyear >> 2) + 475 - !(shortyear & 3); a100 = a4 / 25 - (a4 % 25 < 0); a400 = a100 >> 2; intervening_leap_days = (a4 - 492) - (a100 - 19) + (a400 - 4); days = (365 * (shortyear - 70) + intervening_leap_days + (btime->day - 1)); hptime = (hptime_t) (60 * (60 * ((hptime_t)24 * days + btime->hour) + btime->min) + btime->sec) * HPTMODULUS + (btime->fract * (HPTMODULUS / 10000)); return hptime; } /* End of ms_btime2hptime() */ /*************************************************************************** * ms_btime2isotimestr: * * Build a time string in ISO recommended format from a BTime struct. * * The provided isostimestr must have enough room for the resulting time * string of 25 characters, i.e. '2001-07-29T12:38:00.0000' + NULL. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_btime2isotimestr (BTime *btime, char *isotimestr) { int month = 0; int mday = 0; int ret; if (!isotimestr) return NULL; if (ms_doy2md (btime->year, btime->day, &month, &mday)) { ms_log (2, "ms_btime2isotimestr(): Error converting year %d day %d\n", btime->year, btime->day); return NULL; } ret = snprintf (isotimestr, 25, "%4d-%02d-%02dT%02d:%02d:%02d.%04d", btime->year, month, mday, btime->hour, btime->min, btime->sec, btime->fract); if (ret != 24) return NULL; else return isotimestr; } /* End of ms_btime2isotimestr() */ /*************************************************************************** * ms_btime2mdtimestr: * * Build a time string in month-day format from a BTime struct. * * The provided isostimestr must have enough room for the resulting time * string of 25 characters, i.e. '2001-07-29 12:38:00.0000' + NULL. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_btime2mdtimestr (BTime *btime, char *mdtimestr) { int month = 0; int mday = 0; int ret; if (!mdtimestr) return NULL; if (ms_doy2md (btime->year, btime->day, &month, &mday)) { ms_log (2, "ms_btime2mdtimestr(): Error converting year %d day %d\n", btime->year, btime->day); return NULL; } ret = snprintf (mdtimestr, 25, "%4d-%02d-%02d %02d:%02d:%02d.%04d", btime->year, month, mday, btime->hour, btime->min, btime->sec, btime->fract); if (ret != 24) return NULL; else return mdtimestr; } /* End of ms_btime2mdtimestr() */ /*************************************************************************** * ms_btime2seedtimestr: * * Build a SEED time string from a BTime struct. * * The provided seedtimestr must have enough room for the resulting time * string of 23 characters, i.e. '2001,195,12:38:00.0000' + NULL. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_btime2seedtimestr (BTime *btime, char *seedtimestr) { int ret; if (!seedtimestr) return NULL; ret = snprintf (seedtimestr, 23, "%4d,%03d,%02d:%02d:%02d.%04d", btime->year, btime->day, btime->hour, btime->min, btime->sec, btime->fract); if (ret != 22) return NULL; else return seedtimestr; } /* End of ms_btime2seedtimestr() */ /*************************************************************************** * ms_hptime2tomsusecoffset: * * Convert a high precision epoch time to a time value in tenths of * milliseconds (aka toms) and a microsecond offset (aka usecoffset). * * The tenths of milliseconds value will be rounded to the nearest * value having a microsecond offset value between -50 to +49. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_hptime2tomsusecoffset (hptime_t hptime, hptime_t *toms, int8_t *usecoffset) { if (toms == NULL || usecoffset == NULL) return -1; /* Split time into tenths of milliseconds and microseconds */ *toms = hptime / (HPTMODULUS / 10000); *usecoffset = (int8_t) (hptime - (*toms * (HPTMODULUS / 10000))); /* Round tenths and adjust microsecond offset to -50 to +49 range */ if (*usecoffset > 49 && *usecoffset < 100) { *toms += 1; *usecoffset -= 100; } else if (*usecoffset < -50 && *usecoffset > -100) { *toms -= 1; *usecoffset += 100; } /* Convert tenths of milliseconds to be in hptime_t (HPTMODULUS) units */ *toms *= (HPTMODULUS / 10000); return 0; } /* End of ms_hptime2tomsusecoffset() */ /*************************************************************************** * ms_hptime2btime: * * Convert a high precision epoch time to a SEED binary time * structure. The microseconds beyond the 1/10000 second range are * truncated and *not* rounded, this is intentional and necessary. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_hptime2btime (hptime_t hptime, BTime *btime) { struct tm tms; int64_t isec; int ifract; int bfract; if (btime == NULL) return -1; /* Reduce to Unix/POSIX epoch time and fractional seconds */ isec = MS_HPTIME2EPOCH (hptime); ifract = (int)(hptime - (isec * HPTMODULUS)); /* BTime only has 1/10000 second precision */ bfract = ifract / (HPTMODULUS / 10000); /* Adjust for negative epoch times, round back when needed */ if (hptime < 0 && ifract != 0) { /* Isolate microseconds between 1e-4 and 1e-6 precision and adjust bfract if not zero */ if (ifract - bfract * (HPTMODULUS / 10000)) bfract -= 1; isec -= 1; bfract = 10000 - (-bfract); } if (!(ms_gmtime_r (&isec, &tms))) return -1; btime->year = tms.tm_year + 1900; btime->day = tms.tm_yday + 1; btime->hour = tms.tm_hour; btime->min = tms.tm_min; btime->sec = tms.tm_sec; btime->unused = 0; btime->fract = (uint16_t)bfract; return 0; } /* End of ms_hptime2btime() */ /*************************************************************************** * ms_hptime2isotimestr: * * Build a time string in ISO recommended format from a high precision * epoch time. * * The provided isostimestr must have enough room for the resulting time * string of 27 characters, i.e. '2001-07-29T12:38:00.000000' + NULL. * * The 'subseconds' flag controls whenther the sub second portion of the * time is included or not. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_hptime2isotimestr (hptime_t hptime, char *isotimestr, flag subseconds) { struct tm tms; int64_t isec; int ifract; int ret; if (isotimestr == NULL) return NULL; /* Reduce to Unix/POSIX epoch time and fractional seconds */ isec = MS_HPTIME2EPOCH (hptime); ifract = (int)(hptime - (isec * HPTMODULUS)); /* Adjust for negative epoch times */ if (hptime < 0 && ifract != 0) { isec -= 1; ifract = HPTMODULUS - (-ifract); } if (!(ms_gmtime_r (&isec, &tms))) return NULL; if (subseconds) /* Assuming ifract has at least microsecond precision */ ret = snprintf (isotimestr, 27, "%4d-%02d-%02dT%02d:%02d:%02d.%06d", tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec, ifract); else ret = snprintf (isotimestr, 20, "%4d-%02d-%02dT%02d:%02d:%02d", tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec); if (ret != 26 && ret != 19) return NULL; else return isotimestr; } /* End of ms_hptime2isotimestr() */ /*************************************************************************** * ms_hptime2mdtimestr: * * Build a time string in month-day format from a high precision * epoch time. * * The provided mdtimestr must have enough room for the resulting time * string of 27 characters, i.e. '2001-07-29 12:38:00.000000' + NULL. * * The 'subseconds' flag controls whenther the sub second portion of the * time is included or not. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_hptime2mdtimestr (hptime_t hptime, char *mdtimestr, flag subseconds) { struct tm tms; int64_t isec; int ifract; int ret; if (mdtimestr == NULL) return NULL; /* Reduce to Unix/POSIX epoch time and fractional seconds */ isec = MS_HPTIME2EPOCH (hptime); ifract = (int)(hptime - (isec * HPTMODULUS)); /* Adjust for negative epoch times */ if (hptime < 0 && ifract != 0) { isec -= 1; ifract = HPTMODULUS - (-ifract); } if (!(ms_gmtime_r (&isec, &tms))) return NULL; if (subseconds) /* Assuming ifract has at least microsecond precision */ ret = snprintf (mdtimestr, 27, "%4d-%02d-%02d %02d:%02d:%02d.%06d", tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec, ifract); else ret = snprintf (mdtimestr, 20, "%4d-%02d-%02d %02d:%02d:%02d", tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, tms.tm_hour, tms.tm_min, tms.tm_sec); if (ret != 26 && ret != 19) return NULL; else return mdtimestr; } /* End of ms_hptime2mdtimestr() */ /*************************************************************************** * ms_hptime2seedtimestr: * * Build a SEED time string from a high precision epoch time. * * The provided seedtimestr must have enough room for the resulting time * string of 25 characters, i.e. '2001,195,12:38:00.000000\n'. * * The 'subseconds' flag controls whenther the sub second portion of the * time is included or not. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * ms_hptime2seedtimestr (hptime_t hptime, char *seedtimestr, flag subseconds) { struct tm tms; int64_t isec; int ifract; int ret; if (seedtimestr == NULL) return NULL; /* Reduce to Unix/POSIX epoch time and fractional seconds */ isec = MS_HPTIME2EPOCH (hptime); ifract = (int)(hptime - (isec * HPTMODULUS)); /* Adjust for negative epoch times */ if (hptime < 0 && ifract != 0) { isec -= 1; ifract = HPTMODULUS - (-ifract); } if (!(ms_gmtime_r (&isec, &tms))) return NULL; if (subseconds) /* Assuming ifract has at least microsecond precision */ ret = snprintf (seedtimestr, 25, "%4d,%03d,%02d:%02d:%02d.%06d", tms.tm_year + 1900, tms.tm_yday + 1, tms.tm_hour, tms.tm_min, tms.tm_sec, ifract); else ret = snprintf (seedtimestr, 18, "%4d,%03d,%02d:%02d:%02d", tms.tm_year + 1900, tms.tm_yday + 1, tms.tm_hour, tms.tm_min, tms.tm_sec); if (ret != 24 && ret != 17) return NULL; else return seedtimestr; } /* End of ms_hptime2seedtimestr() */ /*************************************************************************** * ms_time2hptime_int: * * Convert specified time values to a high precision epoch time. This * is an internal version which does no range checking, it is assumed * that checking the range for each value has already been done. * * Returns epoch time on success and HPTERROR on error. ***************************************************************************/ static hptime_t ms_time2hptime_int (int year, int day, int hour, int min, int sec, int usec) { BTime btime; hptime_t hptime; memset (&btime, 0, sizeof (BTime)); btime.day = 1; /* Convert integer seconds using ms_btime2hptime */ btime.year = (int16_t)year; btime.day = (int16_t)day; btime.hour = (uint8_t)hour; btime.min = (uint8_t)min; btime.sec = (uint8_t)sec; btime.fract = 0; hptime = ms_btime2hptime (&btime); if (hptime == HPTERROR) { ms_log (2, "ms_time2hptime(): Error converting with ms_btime2hptime()\n"); return HPTERROR; } /* Add the microseconds */ hptime += (hptime_t)usec * (1000000 / HPTMODULUS); return hptime; } /* End of ms_time2hptime_int() */ /*************************************************************************** * ms_time2hptime: * * Convert specified time values to a high precision epoch time. This * is essentially a frontend for ms_time2hptime that does range * checking for each input value. * * Expected ranges: * year : 1800 - 5000 * day : 1 - 366 * hour : 0 - 23 * min : 0 - 59 * sec : 0 - 60 * usec : 0 - 999999 * * Returns epoch time on success and HPTERROR on error. ***************************************************************************/ hptime_t ms_time2hptime (int year, int day, int hour, int min, int sec, int usec) { if (year < 1800 || year > 5000) { ms_log (2, "ms_time2hptime(): Error with year value: %d\n", year); return HPTERROR; } if (day < 1 || day > 366) { ms_log (2, "ms_time2hptime(): Error with day value: %d\n", day); return HPTERROR; } if (hour < 0 || hour > 23) { ms_log (2, "ms_time2hptime(): Error with hour value: %d\n", hour); return HPTERROR; } if (min < 0 || min > 59) { ms_log (2, "ms_time2hptime(): Error with minute value: %d\n", min); return HPTERROR; } if (sec < 0 || sec > 60) { ms_log (2, "ms_time2hptime(): Error with second value: %d\n", sec); return HPTERROR; } if (usec < 0 || usec > 999999) { ms_log (2, "ms_time2hptime(): Error with microsecond value: %d\n", usec); return HPTERROR; } return ms_time2hptime_int (year, day, hour, min, sec, usec); } /* End of ms_time2hptime() */ /*************************************************************************** * ms_seedtimestr2hptime: * * Convert a SEED time string (day-of-year style) to a high precision * epoch time. The time format expected is * "YYYY[,DDD,HH,MM,SS.FFFFFF]", the delimiter can be a dash [-], * comma [,], colon [:] or period [.]. Additionally a [T] or space * may be used to seprate the day and hour fields. The fractional * seconds ("FFFFFF") must begin with a period [.] if present. * * The time string can be "short" in which case the omitted values are * assumed to be zero (with the exception of DDD which is assumed to * be 1): "YYYY,DDD,HH" assumes MM, SS and FFFF are 0. The year is * required, otherwise there wouldn't be much for a date. * * Ranges are checked for each value. * * Returns epoch time on success and HPTERROR on error. ***************************************************************************/ hptime_t ms_seedtimestr2hptime (char *seedtimestr) { int fields; int year = 0; int day = 1; int hour = 0; int min = 0; int sec = 0; float fusec = 0.0; int usec = 0; fields = sscanf (seedtimestr, "%d%*[-,:.]%d%*[-,:.Tt ]%d%*[-,:.]%d%*[-,:.]%d%f", &year, &day, &hour, &min, &sec, &fusec); /* Convert fractional seconds to microseconds */ if (fusec != 0.0) { usec = (int)(fusec * 1000000.0 + 0.5); } if (fields < 1) { ms_log (2, "ms_seedtimestr2hptime(): Error converting time string: %s\n", seedtimestr); return HPTERROR; } if (year < 1800 || year > 5000) { ms_log (2, "ms_seedtimestr2hptime(): Error with year value: %d\n", year); return HPTERROR; } if (day < 1 || day > 366) { ms_log (2, "ms_seedtimestr2hptime(): Error with day value: %d\n", day); return HPTERROR; } if (hour < 0 || hour > 23) { ms_log (2, "ms_seedtimestr2hptime(): Error with hour value: %d\n", hour); return HPTERROR; } if (min < 0 || min > 59) { ms_log (2, "ms_seedtimestr2hptime(): Error with minute value: %d\n", min); return HPTERROR; } if (sec < 0 || sec > 60) { ms_log (2, "ms_seedtimestr2hptime(): Error with second value: %d\n", sec); return HPTERROR; } if (usec < 0 || usec > 999999) { ms_log (2, "ms_seedtimestr2hptime(): Error with fractional second value: %d\n", usec); return HPTERROR; } return ms_time2hptime_int (year, day, hour, min, sec, usec); } /* End of ms_seedtimestr2hptime() */ /*************************************************************************** * ms_timestr2hptime: * * Convert a generic time string to a high precision epoch time. The * time format expected is "YYYY[/MM/DD HH:MM:SS.FFFF]", the delimiter * can be a dash [-], comma[,], slash [/], colon [:], or period [.]. * Additionally a 'T' or space may be used between the date and time * fields. The fractional seconds ("FFFFFF") must begin with a period * [.] if present. * * The time string can be "short" in which case the omitted values are * assumed to be zero (with the exception of month and day which are * assumed to be 1): "YYYY/MM/DD" assumes HH, MM, SS and FFFF are 0. * The year is required, otherwise there wouldn't be much for a date. * * Ranges are checked for each value. * * Returns epoch time on success and HPTERROR on error. ***************************************************************************/ hptime_t ms_timestr2hptime (char *timestr) { int fields; int year = 0; int mon = 1; int mday = 1; int day = 1; int hour = 0; int min = 0; int sec = 0; float fusec = 0.0; int usec = 0; fields = sscanf (timestr, "%d%*[-,/:.]%d%*[-,/:.]%d%*[-,/:.Tt ]%d%*[-,/:.]%d%*[-,/:.]%d%f", &year, &mon, &mday, &hour, &min, &sec, &fusec); /* Convert fractional seconds to microseconds */ if (fusec != 0.0) { usec = (int)(fusec * 1000000.0 + 0.5); } if (fields < 1) { ms_log (2, "ms_timestr2hptime(): Error converting time string: %s\n", timestr); return HPTERROR; } if (year < 1800 || year > 5000) { ms_log (2, "ms_timestr2hptime(): Error with year value: %d\n", year); return HPTERROR; } if (mon < 1 || mon > 12) { ms_log (2, "ms_timestr2hptime(): Error with month value: %d\n", mon); return HPTERROR; } if (mday < 1 || mday > 31) { ms_log (2, "ms_timestr2hptime(): Error with day value: %d\n", mday); return HPTERROR; } /* Convert month and day-of-month to day-of-year */ if (ms_md2doy (year, mon, mday, &day)) { return HPTERROR; } if (hour < 0 || hour > 23) { ms_log (2, "ms_timestr2hptime(): Error with hour value: %d\n", hour); return HPTERROR; } if (min < 0 || min > 59) { ms_log (2, "ms_timestr2hptime(): Error with minute value: %d\n", min); return HPTERROR; } if (sec < 0 || sec > 60) { ms_log (2, "ms_timestr2hptime(): Error with second value: %d\n", sec); return HPTERROR; } if (usec < 0 || usec > 999999) { ms_log (2, "ms_timestr2hptime(): Error with fractional second value: %d\n", usec); return HPTERROR; } return ms_time2hptime_int (year, day, hour, min, sec, usec); } /* End of ms_timestr2hptime() */ /*************************************************************************** * ms_nomsamprate: * * Calculate a sample rate from SEED sample rate factor and multiplier * as stored in the fixed section header of data records. * * Returns the positive sample rate. ***************************************************************************/ double ms_nomsamprate (int factor, int multiplier) { double samprate = 0.0; if (factor > 0) samprate = (double)factor; else if (factor < 0) samprate = -1.0 / (double)factor; if (multiplier > 0) samprate = samprate * (double)multiplier; else if (multiplier < 0) samprate = -1.0 * (samprate / (double)multiplier); return samprate; } /* End of ms_nomsamprate() */ /*************************************************************************** * ms_readleapseconds: * * Read leap seconds from a file indicated by the specified * environment variable and populate the global leapsecondlist. * * Returns positive number of leap seconds read, -1 on file read * error, and -2 when the environment variable is not set. ***************************************************************************/ int ms_readleapseconds (char *envvarname) { char *filename; if ((filename = getenv (envvarname))) { return ms_readleapsecondfile (filename); } return -2; } /* End of ms_readleapseconds() */ /*************************************************************************** * ms_readleapsecondfile: * * Read leap seconds from the specified file and populate the global * leapsecondlist. The file is expected to be standard IETF leap * second list format. The list is usually available from: * https://www.ietf.org/timezones/data/leap-seconds.list * * Returns positive number of leap seconds read on success and -1 on error. ***************************************************************************/ int ms_readleapsecondfile (char *filename) { FILE *fp = NULL; LeapSecond *ls = NULL; LeapSecond *lastls = NULL; int64_t expires; char readline[200]; char *cp; int64_t leapsecond; int TAIdelta; int fields; int count = 0; if (!filename) return -1; if (!(fp = fopen (filename, "rb"))) { ms_log (2, "Cannot open leap second file %s: %s\n", filename, strerror (errno)); return -1; } /* Free existing leapsecondlist */ while (leapsecondlist != NULL) { LeapSecond *next = leapsecondlist->next; free(leapsecondlist); leapsecondlist = next; } while (fgets (readline, sizeof (readline) - 1, fp)) { /* Guarantee termination */ readline[sizeof (readline) - 1] = '\0'; /* Terminate string at first newline character if any */ if ((cp = strchr (readline, '\n'))) *cp = '\0'; /* Skip empty lines */ if (!strlen (readline)) continue; /* Check for and parse expiration date */ if (!strncmp (readline, "#@", 2)) { expires = 0; fields = sscanf (readline, "#@ %" SCNd64, &expires); if (fields == 1) { /* Convert expires to Unix epoch */ expires = expires - NTPPOSIXEPOCHDELTA; /* Compare expire time to current time */ if (time (NULL) > expires) { char timestr[100]; ms_hptime2mdtimestr (MS_EPOCH2HPTIME (expires), timestr, 0); ms_log (1, "Warning: leap second file (%s) has expired as of %s\n", filename, timestr); } } continue; } /* Skip comment lines */ if (*readline == '#') continue; fields = sscanf (readline, "%" SCNd64 " %d ", &leapsecond, &TAIdelta); if (fields == 2) { if ((ls = malloc (sizeof (LeapSecond))) == NULL) { ms_log (2, "Cannot allocate LeapSecond, out of memory?\n"); return -1; } /* Convert NTP epoch time to Unix epoch time and then to HPT */ ls->leapsecond = MS_EPOCH2HPTIME ((leapsecond - NTPPOSIXEPOCHDELTA)); ls->TAIdelta = TAIdelta; ls->next = NULL; count++; /* Add leap second to global list */ if (!leapsecondlist) { leapsecondlist = ls; lastls = ls; } else { lastls->next = ls; lastls = ls; } } else { ms_log (1, "Unrecognized leap second file line: '%s'\n", readline); } } if (ferror (fp)) { ms_log (2, "Error reading leap second file (%s): %s\n", filename, strerror (errno)); } fclose (fp); return count; } /* End of ms_readleapsecondfile() */ /*************************************************************************** * ms_reduce_rate: * * Reduce the specified sample rate into two "factors" (in some cases * the second factor is actually a divisor). * * Integer rates between 1 and 32767 can be represented exactly. * * Integer rates higher than 32767 will be matched as closely as * possible with the deviation becoming larger as the integers reach * (32767 * 32767). * * Non-integer rates between 32767.0 and 1.0/32767.0 are represented * exactly when possible and approximated otherwise. * * Non-integer rates greater than 32767 or less than 1/32767 are not supported. * * Returns 0 on success and -1 on error. ***************************************************************************/ int ms_reduce_rate (double samprate, int16_t *factor1, int16_t *factor2) { int num; int den; int32_t intsamprate = (int32_t) (samprate + 0.5); int32_t searchfactor1; int32_t searchfactor2; int32_t closestfactor; int32_t closestdiff; int32_t diff; /* Handle case of integer sample values. */ if (ms_dabs (samprate - intsamprate) < 0.0000001) { /* If integer sample rate is less than range of 16-bit int set it directly */ if (intsamprate <= 32767) { *factor1 = intsamprate; *factor2 = 1; return 0; } /* If integer sample rate is within the maximum possible nominal rate */ else if (intsamprate <= (32767 * 32767)) { /* Determine the closest factors that represent the sample rate. * The approximation gets worse as the values increase. */ searchfactor1 = (int)(1.0 / ms_rsqrt64 (samprate)); closestdiff = searchfactor1; closestfactor = searchfactor1; while ((intsamprate % searchfactor1) != 0) { searchfactor1 -= 1; /* Track the factor that generates the closest match */ searchfactor2 = intsamprate / searchfactor1; diff = intsamprate - (searchfactor1 * searchfactor2); if (diff < closestdiff) { closestdiff = diff; closestfactor = searchfactor1; } /* If the next iteration would create a factor beyond the limit * we accept the closest factor */ if ((intsamprate / (searchfactor1 - 1)) > 32767) { searchfactor1 = closestfactor; break; } } searchfactor2 = intsamprate / searchfactor1; if (searchfactor1 <= 32767 && searchfactor2 <= 32767) { *factor1 = searchfactor1; *factor2 = searchfactor2; return 0; } } } /* Handle case of non-integer less than 16-bit int range */ else if (samprate <= 32767.0) { /* For samples/seconds, determine, potentially approximate, numerator and denomiator */ ms_ratapprox (samprate, &num, &den, 32767, 1e-8); /* Negate the factor2 to denote a division operation */ *factor1 = (int16_t)num; *factor2 = (int16_t)-den; return 0; } return -1; } /* End of ms_reduce_rate() */ /*************************************************************************** * ms_genfactmult: * * Generate an appropriate SEED sample rate factor and multiplier from * a double precision sample rate. * * If the samplerate > 0.0 it is expected to be a rate in SAMPLES/SECOND. * If the samplerate < 0.0 it is expected to be a period in SECONDS/SAMPLE. * * Results use SAMPLES/SECOND notation when sample rate >= 1.0 * Results use SECONDS/SAMPLE notation when samles rates < 1.0 * * Returns 0 on success and -1 on error or calculation not possible. ***************************************************************************/ int ms_genfactmult (double samprate, int16_t *factor, int16_t *multiplier) { int16_t factor1; int16_t factor2; if (!factor || !multiplier) return -1; /* Convert sample period to sample rate */ if (samprate < 0.0) samprate = -1.0 / samprate; /* Handle special case of zero */ if (samprate == 0.0) { *factor = 0; *multiplier = 0; return 0; } /* Handle sample rates >= 1.0 with the SAMPLES/SECOND representation */ else if (samprate >= 1.0) { if (ms_reduce_rate (samprate, &factor1, &factor2) == 0) { *factor = factor1; *multiplier = factor2; return 0; } } /* Handle sample rates < 1 with the SECONDS/SAMPLE representation */ else { /* Reduce rate as a sample period and invert factor/multiplier */ if (ms_reduce_rate (1.0 / samprate, &factor1, &factor2) == 0) { *factor = -factor1; *multiplier = -factor2; return 0; } } return -1; } /* End of ms_genfactmult() */ /*************************************************************************** * ms_ratapprox: * * Find an approximate rational number for a real through continued * fraction expansion. Given a double precsion 'real' find a * numerator (num) and denominator (den) whose absolute values are not * larger than 'maxval' while trying to reach a specified 'precision'. * * Returns the number of iterations performed. ***************************************************************************/ int ms_ratapprox (double real, int *num, int *den, int maxval, double precision) { double realj, preal; char pos; int pnum, pden; int iterations = 1; int Aj1, Aj2, Bj1, Bj2; int bj = 0; int Aj = 0; int Bj = 1; if (real >= 0.0) { pos = 1; realj = real; } else { pos = 0; realj = -real; } preal = realj; bj = (int)(realj + precision); realj = 1 / (realj - bj); Aj = bj; Aj1 = 1; Bj = 1; Bj1 = 0; *num = pnum = Aj; *den = pden = Bj; if (!pos) *num = -*num; while (ms_dabs (preal - (double)Aj / (double)Bj) > precision && Aj < maxval && Bj < maxval) { Aj2 = Aj1; Aj1 = Aj; Bj2 = Bj1; Bj1 = Bj; bj = (int)(realj + precision); realj = 1 / (realj - bj); Aj = bj * Aj1 + Aj2; Bj = bj * Bj1 + Bj2; *num = pnum; *den = pden; if (!pos) *num = -*num; pnum = Aj; pden = Bj; iterations++; } if (pnum < maxval && pden < maxval) { *num = pnum; *den = pden; if (!pos) *num = -*num; } return iterations; } /*************************************************************************** * ms_bigendianhost: * * Determine the byte order of the host machine. Due to the lack of * portable defines to determine host byte order this run-time test is * provided. The code below actually tests for little-endianess, the * only other alternative is assumed to be big endian. * * Returns 0 if the host is little endian, otherwise 1. ***************************************************************************/ int ms_bigendianhost (void) { int16_t host = 1; return !(*((int8_t *)(&host))); } /* End of ms_bigendianhost() */ /*************************************************************************** * ms_dabs: * * Determine the absolute value of an input double, actually just test * if the input double is positive multiplying by -1.0 if not and * return it. * * Returns the positive value of input double. ***************************************************************************/ double ms_dabs (double val) { if (val < 0.0) val *= -1.0; return val; } /* End of ms_dabs() */ /*************************************************************************** * ms_rsqrt64: * * An optimized reciprocal square root calculation from: * Matthew Robertson (2012). "A Brief History of InvSqrt" * https://cs.uwaterloo.ca/~m32rober/rsqrt.pdf * * Further reference and description: * https://en.wikipedia.org/wiki/Fast_inverse_square_root * * Modifications: * Add 2 more iterations of Newton's method to increase accuracy, * specifically for large values. * Use memcpy instead of assignment through differing pointer types. * * Returns 0 if the host is little endian, otherwise 1. ***************************************************************************/ double ms_rsqrt64 (double val) { uint64_t i; double x2; double y; x2 = val * 0.5; y = val; memcpy (&i, &y, sizeof(i)); i = 0x5fe6eb50c7b537a9ULL - (i >> 1); memcpy (&y, &i, sizeof(y)); y = y * (1.5 - (x2 * y * y)); y = y * (1.5 - (x2 * y * y)); y = y * (1.5 - (x2 * y * y)); return y; } /* End of ms_rsqrt64() */ /*************************************************************************** * ms_gmtime_r: * * An internal version of gmtime_r() that is 64-bit compliant and * works with years beyond 2038. * * The original was called pivotal_gmtime_r() by Paul Sheer, all * required copyright and other hoohas are below. Modifications were * made to integrate the original to this code base, avoid name * collisions and formatting so I could read it. * * Returns a pointer to the populated tm struct on success and NULL on error. ***************************************************************************/ /* pivotal_gmtime_r - a replacement for gmtime/localtime/mktime that works around the 2038 bug on 32-bit systems. (Version 4) Copyright (C) 2009 Paul Sheer Redistribution and use in source form, with or without modification, is permitted provided that the above copyright notice, this list of conditions, the following disclaimer, and the following char array are retained. Redistribution and use in binary form must reproduce an acknowledgment: 'With software provided by http://2038bug.com/' in the documentation and/or other materials provided with the distribution, and wherever such acknowledgments are usually accessible in Your program. This software is provided "AS IS" and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THIS SOFTWARE IS WITH YOU. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the copyright owners be liable for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of the use of this software including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from copyright owners' negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. */ const char pivotal_gmtime_r_stamp_lm[] = "pivotal_gmtime_r. Copyright (C) 2009 Paul Sheer. Terms and " "conditions apply. Visit http://2038bug.com/ for more info."; static const int tm_days[4][13] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}, }; #define TM_LEAP_CHECK(n) ((!(((n) + 1900) % 400) || (!(((n) + 1900) % 4) && (((n) + 1900) % 100))) != 0) #define TM_WRAP(a, b, m) ((a) = ((a) < 0) ? ((b)--, (a) + (m)) : (a)) static struct tm * ms_gmtime_r (int64_t *timep, struct tm *result) { int v_tm_sec, v_tm_min, v_tm_hour, v_tm_mon, v_tm_wday, v_tm_tday; int leap; long m; int64_t tv; if (!timep || !result) return NULL; tv = *timep; v_tm_sec = ((int64_t)tv % (int64_t)60); tv /= 60; v_tm_min = ((int64_t)tv % (int64_t)60); tv /= 60; v_tm_hour = ((int64_t)tv % (int64_t)24); tv /= 24; v_tm_tday = (int)tv; TM_WRAP (v_tm_sec, v_tm_min, 60); TM_WRAP (v_tm_min, v_tm_hour, 60); TM_WRAP (v_tm_hour, v_tm_tday, 24); if ((v_tm_wday = (v_tm_tday + 4) % 7) < 0) v_tm_wday += 7; m = (long)v_tm_tday; if (m >= 0) { result->tm_year = 70; leap = TM_LEAP_CHECK (result->tm_year); while (m >= (long)tm_days[leap + 2][12]) { m -= (long)tm_days[leap + 2][12]; result->tm_year++; leap = TM_LEAP_CHECK (result->tm_year); } v_tm_mon = 0; while (m >= (long)tm_days[leap][v_tm_mon]) { m -= (long)tm_days[leap][v_tm_mon]; v_tm_mon++; } } else { result->tm_year = 69; leap = TM_LEAP_CHECK (result->tm_year); while (m < (long)-tm_days[leap + 2][12]) { m += (long)tm_days[leap + 2][12]; result->tm_year--; leap = TM_LEAP_CHECK (result->tm_year); } v_tm_mon = 11; while (m < (long)-tm_days[leap][v_tm_mon]) { m += (long)tm_days[leap][v_tm_mon]; v_tm_mon--; } m += (long)tm_days[leap][v_tm_mon]; } result->tm_mday = (int)m + 1; result->tm_yday = tm_days[leap + 2][v_tm_mon] + m; result->tm_sec = v_tm_sec; result->tm_min = v_tm_min; result->tm_hour = v_tm_hour; result->tm_mon = v_tm_mon; result->tm_wday = v_tm_wday; return result; } /* End of ms_gmtime_r() */ iris-edu-libmseed-4314359/gswap.c000066400000000000000000000043211422047135100164770ustar00rootroot00000000000000/*************************************************************************** * gswap.c: * * Functions for generalized, in-place byte swapping between LSBF and * MSBF byte orders. * * Some standard integer types are needed, namely uint8_t and * uint32_t, (these are normally declared by including inttypes.h or * stdint.h). Each function expects its input to be a void pointer * to a quantity of the appropriate size. * * There are two versions of most routines. The memory aligned versions * (gswapXa) are aliases of the other versions (gswapX) provided for backwards * compatibility. There is no difference between them. * * Written by Chad Trabant, * IRIS Data Management Center * * Version: 2010.006 ***************************************************************************/ #include "libmseed.h" /* Swap routines that work on any (aligned or not) quantities */ void ms_gswap2 (void *data2) { uint16_t dat; memcpy (&dat, data2, 2); dat = ((dat & 0xff00) >> 8) | ((dat & 0x00ff) << 8); memcpy (data2, &dat, 2); } void ms_gswap3 (void *data3) { uint8_t dat[3]; uint8_t temp; memcpy (&dat, data3, 3); temp = dat[0]; dat[0] = dat[2]; dat[2] = temp; memcpy (data3, &dat, 3); } void ms_gswap4 (void *data4) { uint32_t dat; memcpy (&dat, data4, 4); dat = ((dat & 0xff000000) >> 24) | ((dat & 0x000000ff) << 24) | ((dat & 0x00ff0000) >> 8) | ((dat & 0x0000ff00) << 8); memcpy (data4, &dat, 4); } void ms_gswap8 (void *data8) { uint64_t dat; memcpy (&dat, data8, sizeof(uint64_t)); dat = ((dat & 0xff00000000000000) >> 56) | ((dat & 0x00000000000000ff) << 56) | ((dat & 0x00ff000000000000) >> 40) | ((dat & 0x000000000000ff00) << 40) | ((dat & 0x0000ff0000000000) >> 24) | ((dat & 0x0000000000ff0000) << 24) | ((dat & 0x000000ff00000000) >> 8) | ((dat & 0x00000000ff000000) << 8); memcpy (data8, &dat, sizeof(uint64_t)); } /* Swap routines that work on memory aligned quantities are the same as the * generic routines. The symbols below exist for backwards compatibility. */ void ms_gswap2a (void *data2) { ms_gswap2 (data2); } void ms_gswap4a (void *data4) { ms_gswap4 (data4); } void ms_gswap8a (void *data8) { ms_gswap8 (data8); } iris-edu-libmseed-4314359/libmseed.def000066400000000000000000000035051422047135100174610ustar00rootroot00000000000000LIBRARY libmseed.dll EXPORTS msr_parse msr_parse_selection msr_unpack msr_pack msr_pack_header msr_init msr_free msr_free_blktchain msr_addblockette msr_normalize_header msr_duplicate msr_samprate msr_nomsamprate msr_starttime msr_starttime_uc msr_endtime msr_srcname msr_print msr_host_latency ms_detect ms_parse_raw mst_init mst_free mst_initgroup mst_freegroup mst_findmatch mst_findadjacent mst_addmsr mst_addspan mst_addmsrtogroup mst_addtracetogroup mst_groupheal mst_groupsort mst_srcname mst_printtracelist mst_printsynclist mst_printgaplist mst_pack mst_packgroup mstl_init mstl_free mstl_addmsr mstl_printtracelist mstl_printsynclist mstl_printgaplist ms_readmsr ms_readmsr_r ms_readmsr_main ms_readtraces ms_readtraces_timewin ms_readtraces_selection ms_readtracelist ms_readtracelist_timewin ms_readtracelist_selection msr_writemseed mst_writemseed mst_writemseedgroup ms_recsrcname ms_splitsrcname ms_strncpclean ms_strncpopen ms_doy2md ms_md2doy ms_btime2hptime ms_btime2isotimestr ms_btime2mdtimestr ms_btime2seedtimestr ms_hptime2btime ms_hptime2isotimestr ms_hptime2mdtimestr ms_hptime2seedtimestr ms_time2hptime ms_seedtimestr2hptime ms_timestr2hptime ms_nomsamprate ms_genfactmult ms_ratapprox ms_bigendianhost ms_dabs ms_samplesize ms_encodingstr ms_blktdesc ms_blktlen ms_errorstr ms_log ms_log_l ms_loginit ms_loginit_l ms_matchselect msr_matchselect ms_addselect ms_addselect_comp ms_readselectionsfile ms_freeselections ms_printselections ms_gswap2 ms_gswap3 ms_gswap4 ms_gswap8 ms_gswap2a ms_gswap4a ms_gswap8a LM_SIZEOF_OFF_T iris-edu-libmseed-4314359/libmseed.h000066400000000000000000001030261422047135100171510ustar00rootroot00000000000000/*************************************************************************** * libmseed.h: * * Interface declarations for the Mini-SEED library (libmseed). * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License (GNU-LGPL) for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software. * If not, see . * * Copyright (C) 2022 Chad Trabant * IRIS Data Management Center ***************************************************************************/ #ifndef LIBMSEED_H #define LIBMSEED_H 1 #ifdef __cplusplus extern "C" { #endif #define LIBMSEED_VERSION "2.19.8" #define LIBMSEED_RELEASE "2022.087" /* C99 standard headers */ #include #include #include #include #include #include /* This library uses structs that map to SEED header/blockette structures that are required to have a layout exactly as specified, i.e. no padding. If "ATTRIBUTE_PACKED" is defined at compile time (e.g. -DATTRIBUTE_PACKED) the preprocessor will use the define below to add the "packed" attribute to effected structs. This attribute is supported by GCC and increasingly more compilers. */ #if defined(ATTRIBUTE_PACKED) #define LMP_PACKED __attribute__((packed)) #else #define LMP_PACKED #endif /* Set platform specific defines */ #if defined(__linux__) || defined(__linux) || defined(__CYGWIN__) #define LMP_LINUX 1 #define LMP_GLIBC2 1 /* Deprecated */ #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) #define LMP_BSD 1 #elif defined(__sun__) || defined(__sun) #define LMP_SOLARIS 1 #elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) #define LMP_WIN 1 #define LMP_WIN32 1 /* Deprecated */ #endif /* Set platform specific features */ #if defined(LMP_WIN) #include #include /* For MSVC 2012 and earlier define standard int types, otherwise use inttypes.h */ #if defined(_MSC_VER) && _MSC_VER <= 1700 typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int int16_t; typedef unsigned short int uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; #else #include #endif /* For MSVC define PRId64 and SCNd64 if needed */ #if defined(_MSC_VER) #if !defined(PRId64) #define PRId64 "I64d" #endif #if !defined(SCNd64) #define SCNd64 "I64d" #endif #define snprintf _snprintf #define vsnprintf _vsnprintf #define strcasecmp _stricmp #define strncasecmp _strnicmp #define strtoull _strtoui64 #define strdup _strdup #define fileno _fileno #endif /* Extras needed for MinGW */ #if defined(__MINGW32__) || defined(__MINGW64__) #include #define fstat _fstat #define stat _stat #endif #else #include #include #endif extern int LM_SIZEOF_OFF_T; /* Size of off_t data type determined at build time */ #define MINRECLEN 128 /* Minimum Mini-SEED record length, 2^7 bytes */ /* Note: the SEED specification minimum is 256 */ #define MAXRECLEN 1048576 /* Maximum Mini-SEED record length, 2^20 bytes */ /* SEED data encoding types */ #define DE_ASCII 0 #define DE_INT16 1 #define DE_INT32 3 #define DE_FLOAT32 4 #define DE_FLOAT64 5 #define DE_STEIM1 10 #define DE_STEIM2 11 #define DE_GEOSCOPE24 12 #define DE_GEOSCOPE163 13 #define DE_GEOSCOPE164 14 #define DE_CDSN 16 #define DE_SRO 30 #define DE_DWWSSN 32 /* Library return and error code values, error values should always be negative */ #define MS_ENDOFFILE 1 /* End of file reached return value */ #define MS_NOERROR 0 /* No error */ #define MS_GENERROR -1 /* Generic unspecified error */ #define MS_NOTSEED -2 /* Data not SEED */ #define MS_WRONGLENGTH -3 /* Length of data read was not correct */ #define MS_OUTOFRANGE -4 /* SEED record length out of range */ #define MS_UNKNOWNFORMAT -5 /* Unknown data encoding format */ #define MS_STBADCOMPFLAG -6 /* Steim, invalid compression flag(s) */ /* Define the high precision time tick interval as 1/modulus seconds */ /* Default modulus of 1000000 defines tick interval as a microsecond */ #define HPTMODULUS 1000000 /* Error code for routines that normally return a high precision time. * The time value corresponds to '1902/1/1 00:00:00.000000' with the * default HPTMODULUS */ #define HPTERROR -2145916800000000LL /* Macros to scale between Unix/POSIX epoch time & high precision time */ #define MS_EPOCH2HPTIME(X) (X) * (hptime_t) HPTMODULUS #define MS_HPTIME2EPOCH(X) (X) / HPTMODULUS /* Macro to test a character for data record indicators */ #define MS_ISDATAINDICATOR(X) (X=='D' || X=='R' || X=='Q' || X=='M') /* Macro to test default sample rate tolerance: abs(1-sr1/sr2) < 0.0001 */ #define MS_ISRATETOLERABLE(A,B) (ms_dabs (1.0 - (A / B)) < 0.0001) /* Macro to test for sane year and day values, used primarily to * determine if byte order swapping is needed. * * Year : between 1900 and 2100 * Day : between 1 and 366 * * This test is non-unique (non-deterministic) for days 1, 256 and 257 * in the year 2056 because the swapped values are also within range. */ #define MS_ISVALIDYEARDAY(Y,D) (Y >= 1900 && Y <= 2100 && D >= 1 && D <= 366) /* Macro to test memory for a SEED data record signature by checking * SEED data record header values at known byte offsets to determine * if the memory contains a valid record. * * Offset = Value * [0-5] = Digits, spaces or NULL, SEED sequence number * 6 = Data record quality indicator * 7 = Space or NULL [not valid SEED] * 24 = Start hour (0-23) * 25 = Start minute (0-59) * 26 = Start second (0-60) * * Usage: * MS_ISVALIDHEADER ((char *)X) X buffer must contain at least 27 bytes */ #define MS_ISVALIDHEADER(X) ( \ (isdigit ((int) *(X)) || *(X) == ' ' || !*(X) ) && \ (isdigit ((int) *(X+1)) || *(X+1) == ' ' || !*(X+1) ) && \ (isdigit ((int) *(X+2)) || *(X+2) == ' ' || !*(X+2) ) && \ (isdigit ((int) *(X+3)) || *(X+3) == ' ' || !*(X+3) ) && \ (isdigit ((int) *(X+4)) || *(X+4) == ' ' || !*(X+4) ) && \ (isdigit ((int) *(X+5)) || *(X+5) == ' ' || !*(X+5) ) && \ MS_ISDATAINDICATOR(*(X+6)) && \ (*(X+7) == ' ' || *(X+7) == '\0') && \ (int)(*(X+24)) >= 0 && (int)(*(X+24)) <= 23 && \ (int)(*(X+25)) >= 0 && (int)(*(X+25)) <= 59 && \ (int)(*(X+26)) >= 0 && (int)(*(X+26)) <= 60 ) /* Macro to test memory for a blank/noise SEED data record signature * by checking for a valid SEED sequence number and padding characters * to determine if the memory contains a valid blank/noise record. * * Offset = Value * [0-5] = Digits or NULL, SEED sequence number * [6-47] = Space character (ASCII 32), remainder of fixed header * * Usage: * MS_ISVALIDBLANK ((char *)X) X buffer must contain at least 27 bytes */ #define MS_ISVALIDBLANK(X) ( \ (isdigit ((int) *(X)) || !*(X) ) && \ (isdigit ((int) *(X+1)) || !*(X+1) ) && \ (isdigit ((int) *(X+2)) || !*(X+2) ) && \ (isdigit ((int) *(X+3)) || !*(X+3) ) && \ (isdigit ((int) *(X+4)) || !*(X+4) ) && \ (isdigit ((int) *(X+5)) || !*(X+5) ) && \ (*(X+6) ==' ') && (*(X+7) ==' ') && (*(X+8) ==' ') && \ (*(X+9) ==' ') && (*(X+10)==' ') && (*(X+11)==' ') && \ (*(X+12)==' ') && (*(X+13)==' ') && (*(X+14)==' ') && \ (*(X+15)==' ') && (*(X+16)==' ') && (*(X+17)==' ') && \ (*(X+18)==' ') && (*(X+19)==' ') && (*(X+20)==' ') && \ (*(X+21)==' ') && (*(X+22)==' ') && (*(X+23)==' ') && \ (*(X+24)==' ') && (*(X+25)==' ') && (*(X+26)==' ') && \ (*(X+27)==' ') && (*(X+28)==' ') && (*(X+29)==' ') && \ (*(X+30)==' ') && (*(X+31)==' ') && (*(X+32)==' ') && \ (*(X+33)==' ') && (*(X+34)==' ') && (*(X+35)==' ') && \ (*(X+36)==' ') && (*(X+37)==' ') && (*(X+38)==' ') && \ (*(X+39)==' ') && (*(X+40)==' ') && (*(X+41)==' ') && \ (*(X+42)==' ') && (*(X+43)==' ') && (*(X+44)==' ') && \ (*(X+45)==' ') && (*(X+46)==' ') && (*(X+47)==' ') ) /* A simple bitwise AND test to return 0 or 1 */ #define bit(x,y) (x&y)?1:0 /* Require a large (>= 64-bit) integer type for hptime_t */ typedef int64_t hptime_t; /* A single byte flag type */ typedef int8_t flag; /* SEED binary time */ typedef struct btime_s { uint16_t year; uint16_t day; uint8_t hour; uint8_t min; uint8_t sec; uint8_t unused; uint16_t fract; } LMP_PACKED BTime; /* Fixed section data of header */ struct fsdh_s { char sequence_number[6]; char dataquality; char reserved; char station[5]; char location[2]; char channel[3]; char network[2]; BTime start_time; uint16_t numsamples; int16_t samprate_fact; int16_t samprate_mult; uint8_t act_flags; uint8_t io_flags; uint8_t dq_flags; uint8_t numblockettes; int32_t time_correct; uint16_t data_offset; uint16_t blockette_offset; } LMP_PACKED; /* Blockette 100, Sample Rate (without header) */ struct blkt_100_s { float samprate; int8_t flags; uint8_t reserved[3]; } LMP_PACKED; /* Blockette 200, Generic Event Detection (without header) */ struct blkt_200_s { float amplitude; float period; float background_estimate; uint8_t flags; uint8_t reserved; BTime time; char detector[24]; } LMP_PACKED; /* Blockette 201, Murdock Event Detection (without header) */ struct blkt_201_s { float amplitude; float period; float background_estimate; uint8_t flags; uint8_t reserved; BTime time; uint8_t snr_values[6]; uint8_t loopback; uint8_t pick_algorithm; char detector[24]; } LMP_PACKED; /* Blockette 300, Step Calibration (without header) */ struct blkt_300_s { BTime time; uint8_t numcalibrations; uint8_t flags; uint32_t step_duration; uint32_t interval_duration; float amplitude; char input_channel[3]; uint8_t reserved; uint32_t reference_amplitude; char coupling[12]; char rolloff[12]; } LMP_PACKED; /* Blockette 310, Sine Calibration (without header) */ struct blkt_310_s { BTime time; uint8_t reserved1; uint8_t flags; uint32_t duration; float period; float amplitude; char input_channel[3]; uint8_t reserved2; uint32_t reference_amplitude; char coupling[12]; char rolloff[12]; } LMP_PACKED; /* Blockette 320, Pseudo-random Calibration (without header) */ struct blkt_320_s { BTime time; uint8_t reserved1; uint8_t flags; uint32_t duration; float ptp_amplitude; char input_channel[3]; uint8_t reserved2; uint32_t reference_amplitude; char coupling[12]; char rolloff[12]; char noise_type[8]; } LMP_PACKED; /* Blockette 390, Generic Calibration (without header) */ struct blkt_390_s { BTime time; uint8_t reserved1; uint8_t flags; uint32_t duration; float amplitude; char input_channel[3]; uint8_t reserved2; } LMP_PACKED; /* Blockette 395, Calibration Abort (without header) */ struct blkt_395_s { BTime time; uint8_t reserved[2]; } LMP_PACKED; /* Blockette 400, Beam (without header) */ struct blkt_400_s { float azimuth; float slowness; uint16_t configuration; uint8_t reserved[2]; } LMP_PACKED; /* Blockette 405, Beam Delay (without header) */ struct blkt_405_s { uint16_t delay_values[1]; }; /* Blockette 500, Timing (without header) */ struct blkt_500_s { float vco_correction; BTime time; int8_t usec; uint8_t reception_qual; uint32_t exception_count; char exception_type[16]; char clock_model[32]; char clock_status[128]; } LMP_PACKED; /* Blockette 1000, Data Only SEED (without header) */ struct blkt_1000_s { uint8_t encoding; uint8_t byteorder; uint8_t reclen; uint8_t reserved; } LMP_PACKED; /* Blockette 1001, Data Extension (without header) */ struct blkt_1001_s { uint8_t timing_qual; int8_t usec; uint8_t reserved; uint8_t framecnt; } LMP_PACKED; /* Blockette 2000, Opaque Data (without header) */ struct blkt_2000_s { uint16_t length; uint16_t data_offset; uint32_t recnum; uint8_t byteorder; uint8_t flags; uint8_t numheaders; char payload[1]; } LMP_PACKED; /* Blockette chain link, generic linkable blockette index */ typedef struct blkt_link_s { uint16_t blktoffset; /* Offset to this blockette */ uint16_t blkt_type; /* Blockette type */ uint16_t next_blkt; /* Offset to next blockette */ void *blktdata; /* Blockette data */ uint16_t blktdatalen; /* Length of blockette data in bytes */ struct blkt_link_s *next; } BlktLink; typedef struct StreamState_s { int64_t packedrecords; /* Count of packed records */ int64_t packedsamples; /* Count of packed samples */ int32_t lastintsample; /* Value of last integer sample packed */ flag comphistory; /* Control use of lastintsample for compression history */ } StreamState; typedef struct MSRecord_s { char *record; /* Mini-SEED record */ int32_t reclen; /* Length of Mini-SEED record in bytes */ /* Pointers to SEED data record structures */ struct fsdh_s *fsdh; /* Fixed Section of Data Header */ BlktLink *blkts; /* Root of blockette chain */ struct blkt_100_s *Blkt100; /* Blockette 100, if present */ struct blkt_1000_s *Blkt1000; /* Blockette 1000, if present */ struct blkt_1001_s *Blkt1001; /* Blockette 1001, if present */ /* Common header fields in accessible form */ int32_t sequence_number; /* SEED record sequence number */ char network[11]; /* Network designation, NULL terminated */ char station[11]; /* Station designation, NULL terminated */ char location[11]; /* Location designation, NULL terminated */ char channel[11]; /* Channel designation, NULL terminated */ char dataquality; /* Data quality indicator */ hptime_t starttime; /* Record start time, corrected (first sample) */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in record */ int8_t encoding; /* Data encoding format */ int8_t byteorder; /* Original/Final byte order of record */ /* Data sample fields */ void *datasamples; /* Data samples, 'numsamples' of type 'sampletype'*/ int64_t numsamples; /* Number of data samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ /* Stream oriented state information */ StreamState *ststate; /* Stream processing state information */ } MSRecord; /* Container for a continuous trace, linkable */ typedef struct MSTrace_s { char network[11]; /* Network designation, NULL terminated */ char station[11]; /* Station designation, NULL terminated */ char location[11]; /* Location designation, NULL terminated */ char channel[11]; /* Channel designation, NULL terminated */ char dataquality; /* Data quality indicator */ char type; /* MSTrace type code */ hptime_t starttime; /* Time of first sample */ hptime_t endtime; /* Time of last sample */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in trace coverage */ void *datasamples; /* Data samples, 'numsamples' of type 'sampletype' */ int64_t numsamples; /* Number of data samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ void *prvtptr; /* Private pointer for general use, unused by libmseed */ StreamState *ststate; /* Stream processing state information */ struct MSTrace_s *next; /* Pointer to next trace */ } MSTrace; /* Container for a group (chain) of traces */ typedef struct MSTraceGroup_s { int32_t numtraces; /* Number of MSTraces in the trace chain */ struct MSTrace_s *traces; /* Root of the trace chain */ } MSTraceGroup; /* Container for a continuous trace segment, linkable */ typedef struct MSTraceSeg_s { hptime_t starttime; /* Time of first sample */ hptime_t endtime; /* Time of last sample */ double samprate; /* Nominal sample rate (Hz) */ int64_t samplecnt; /* Number of samples in trace coverage */ void *datasamples; /* Data samples, 'numsamples' of type 'sampletype'*/ int64_t numsamples; /* Number of data samples in datasamples */ char sampletype; /* Sample type code: a, i, f, d */ void *prvtptr; /* Private pointer for general use, unused by libmseed */ struct MSTraceSeg_s *prev; /* Pointer to previous segment */ struct MSTraceSeg_s *next; /* Pointer to next segment */ } MSTraceSeg; /* Container for a trace ID, linkable */ typedef struct MSTraceID_s { char network[11]; /* Network designation, NULL terminated */ char station[11]; /* Station designation, NULL terminated */ char location[11]; /* Location designation, NULL terminated */ char channel[11]; /* Channel designation, NULL terminated */ char dataquality; /* Data quality indicator */ char srcname[45]; /* Source name (Net_Sta_Loc_Chan_Qual), NULL terminated */ char type; /* Trace type code */ hptime_t earliest; /* Time of earliest sample */ hptime_t latest; /* Time of latest sample */ void *prvtptr; /* Private pointer for general use, unused by libmseed */ int32_t numsegments; /* Number of segments for this ID */ struct MSTraceSeg_s *first; /* Pointer to first of list of segments */ struct MSTraceSeg_s *last; /* Pointer to last of list of segments */ struct MSTraceID_s *next; /* Pointer to next trace */ } MSTraceID; /* Container for a continuous trace segment, linkable */ typedef struct MSTraceList_s { int32_t numtraces; /* Number of traces in list */ struct MSTraceID_s *traces; /* Pointer to list of traces */ struct MSTraceID_s *last; /* Pointer to last used trace in list */ } MSTraceList; /* Data selection structure time window definition containers */ typedef struct SelectTime_s { hptime_t starttime; /* Earliest data for matching channels */ hptime_t endtime; /* Latest data for matching channels */ struct SelectTime_s *next; } SelectTime; /* Data selection structure definition containers */ typedef struct Selections_s { char srcname[100]; /* Matching (globbing) source name: Net_Sta_Loc_Chan_Qual */ struct SelectTime_s *timewindows; struct Selections_s *next; } Selections; /* Global variables (defined in pack.c) and macros to set/force * pack byte orders */ extern flag packheaderbyteorder; extern flag packdatabyteorder; #define MS_PACKHEADERBYTEORDER(X) do { packheaderbyteorder = (X); } while(0) #define MS_PACKDATABYTEORDER(X) do { packdatabyteorder = (X); } while(0) /* Global variables (defined in unpack.c) and macros to set/force * unpack byte orders */ extern flag unpackheaderbyteorder; extern flag unpackdatabyteorder; #define MS_UNPACKHEADERBYTEORDER(X) do { unpackheaderbyteorder = (X); } while(0) #define MS_UNPACKDATABYTEORDER(X) do { unpackdatabyteorder = (X); } while(0) /* Global variables (defined in unpack.c) and macros to set/force * encoding and fallback encoding */ extern int unpackencodingformat; extern int unpackencodingfallback; #define MS_UNPACKENCODINGFORMAT(X) do { unpackencodingformat = (X); } while(0) #define MS_UNPACKENCODINGFALLBACK(X) do { unpackencodingfallback = (X); } while(0) /* Mini-SEED record related functions */ extern int msr_parse (char *record, int recbuflen, MSRecord **ppmsr, int reclen, flag dataflag, flag verbose); extern int msr_parse_selection ( char *recbuf, int recbuflen, int64_t *offset, MSRecord **ppmsr, int reclen, Selections *selections, flag dataflag, flag verbose ); extern int msr_unpack (char *record, int reclen, MSRecord **ppmsr, flag dataflag, flag verbose); extern int msr_pack (MSRecord *msr, void (*record_handler) (char *, int, void *), void *handlerdata, int64_t *packedsamples, flag flush, flag verbose ); extern int msr_pack_header (MSRecord *msr, flag normalize, flag verbose); extern int msr_unpack_data (MSRecord *msr, int swapflag, flag verbose); extern MSRecord* msr_init (MSRecord *msr); extern void msr_free (MSRecord **ppmsr); extern void msr_free_blktchain (MSRecord *msr); extern BlktLink* msr_addblockette (MSRecord *msr, char *blktdata, int length, int blkttype, int chainpos); extern int msr_normalize_header (MSRecord *msr, flag verbose); extern MSRecord* msr_duplicate (MSRecord *msr, flag datadup); extern double msr_samprate (MSRecord *msr); extern double msr_nomsamprate (MSRecord *msr); extern hptime_t msr_starttime (MSRecord *msr); extern hptime_t msr_starttime_uc (MSRecord *msr); extern hptime_t msr_endtime (MSRecord *msr); extern char* msr_srcname (MSRecord *msr, char *srcname, flag quality); extern void msr_print (MSRecord *msr, flag details); extern double msr_host_latency (MSRecord *msr); extern int ms_detect (const char *record, int recbuflen); extern int ms_parse_raw (char *record, int maxreclen, flag details, flag swapflag); /* MSTrace related functions */ extern MSTrace* mst_init (MSTrace *mst); extern void mst_free (MSTrace **ppmst); extern MSTraceGroup* mst_initgroup (MSTraceGroup *mstg); extern void mst_freegroup (MSTraceGroup **ppmstg); extern MSTrace* mst_findmatch (MSTrace *startmst, char dataquality, char *network, char *station, char *location, char *channel); extern MSTrace* mst_findadjacent (MSTraceGroup *mstg, flag *whence, char dataquality, char *network, char *station, char *location, char *channel, double samprate, double sampratetol, hptime_t starttime, hptime_t endtime, double timetol); extern int mst_addmsr (MSTrace *mst, MSRecord *msr, flag whence); extern int mst_addspan (MSTrace *mst, hptime_t starttime, hptime_t endtime, void *datasamples, int64_t numsamples, char sampletype, flag whence); extern MSTrace* mst_addmsrtogroup (MSTraceGroup *mstg, MSRecord *msr, flag dataquality, double timetol, double sampratetol); extern MSTrace* mst_addtracetogroup (MSTraceGroup *mstg, MSTrace *mst); extern int mst_groupheal (MSTraceGroup *mstg, double timetol, double sampratetol); extern int mst_groupsort (MSTraceGroup *mstg, flag quality); extern int mst_convertsamples (MSTrace *mst, char type, flag truncate); extern char * mst_srcname (MSTrace *mst, char *srcname, flag quality); extern void mst_printtracelist (MSTraceGroup *mstg, flag timeformat, flag details, flag gaps); extern void mst_printsynclist ( MSTraceGroup *mstg, char *dccid, flag subsecond ); extern void mst_printgaplist (MSTraceGroup *mstg, flag timeformat, double *mingap, double *maxgap); extern int mst_pack (MSTrace *mst, void (*record_handler) (char *, int, void *), void *handlerdata, int reclen, flag encoding, flag byteorder, int64_t *packedsamples, flag flush, flag verbose, MSRecord *mstemplate); extern int mst_packgroup (MSTraceGroup *mstg, void (*record_handler) (char *, int, void *), void *handlerdata, int reclen, flag encoding, flag byteorder, int64_t *packedsamples, flag flush, flag verbose, MSRecord *mstemplate); /* MSTraceList related functions */ extern MSTraceList * mstl_init ( MSTraceList *mstl ); extern void mstl_free ( MSTraceList **ppmstl, flag freeprvtptr ); extern MSTraceSeg * mstl_addmsr ( MSTraceList *mstl, MSRecord *msr, flag dataquality, flag autoheal, double timetol, double sampratetol ); extern int mstl_convertsamples ( MSTraceSeg *seg, char type, flag truncate ); extern void mstl_printtracelist ( MSTraceList *mstl, flag timeformat, flag details, flag gaps ); extern void mstl_printsynclist ( MSTraceList *mstl, char *dccid, flag subsecond ); extern void mstl_printgaplist (MSTraceList *mstl, flag timeformat, double *mingap, double *maxgap); /* Reading Mini-SEED records from files */ typedef struct MSFileParam_s { FILE *fp; char filename[512]; char *rawrec; int readlen; int readoffset; int packtype; off_t packhdroffset; off_t filepos; off_t filesize; int recordcount; } MSFileParam; extern int ms_readmsr (MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readmsr_r (MSFileParam **ppmsfp, MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readmsr_main (MSFileParam **ppmsfp, MSRecord **ppmsr, const char *msfile, int reclen, off_t *fpos, int *last, flag skipnotdata, flag dataflag, Selections *selections, flag verbose); extern int ms_readtraces (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readtraces_timewin (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, hptime_t starttime, hptime_t endtime, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readtraces_selection (MSTraceGroup **ppmstg, const char *msfile, int reclen, double timetol, double sampratetol, Selections *selections, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readtracelist (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readtracelist_timewin (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, hptime_t starttime, hptime_t endtime, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int ms_readtracelist_selection (MSTraceList **ppmstl, const char *msfile, int reclen, double timetol, double sampratetol, Selections *selections, flag dataquality, flag skipnotdata, flag dataflag, flag verbose); extern int msr_writemseed ( MSRecord *msr, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose ); extern int mst_writemseed ( MSTrace *mst, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose ); extern int mst_writemseedgroup ( MSTraceGroup *mstg, const char *msfile, flag overwrite, int reclen, flag encoding, flag byteorder, flag verbose ); /* General use functions */ extern char* ms_recsrcname (char *record, char *srcname, flag quality); extern int ms_splitsrcname (char *srcname, char *net, char *sta, char *loc, char *chan, char *qual); extern int ms_strncpclean (char *dest, const char *source, int length); extern int ms_strncpcleantail (char *dest, const char *source, int length); extern int ms_strncpopen (char *dest, const char *source, int length); extern int ms_doy2md (int year, int jday, int *month, int *mday); extern int ms_md2doy (int year, int month, int mday, int *jday); extern hptime_t ms_btime2hptime (BTime *btime); extern char* ms_btime2isotimestr (BTime *btime, char *isotimestr); extern char* ms_btime2mdtimestr (BTime *btime, char *mdtimestr); extern char* ms_btime2seedtimestr (BTime *btime, char *seedtimestr); extern int ms_hptime2tomsusecoffset (hptime_t hptime, hptime_t *toms, int8_t *usecoffset); extern int ms_hptime2btime (hptime_t hptime, BTime *btime); extern char* ms_hptime2isotimestr (hptime_t hptime, char *isotimestr, flag subsecond); extern char* ms_hptime2mdtimestr (hptime_t hptime, char *mdtimestr, flag subsecond); extern char* ms_hptime2seedtimestr (hptime_t hptime, char *seedtimestr, flag subsecond); extern hptime_t ms_time2hptime (int year, int day, int hour, int min, int sec, int usec); extern hptime_t ms_seedtimestr2hptime (char *seedtimestr); extern hptime_t ms_timestr2hptime (char *timestr); extern double ms_nomsamprate (int factor, int multiplier); extern int ms_genfactmult (double samprate, int16_t *factor, int16_t *multiplier); extern int ms_ratapprox (double real, int *num, int *den, int maxval, double precision); extern int ms_bigendianhost (void); extern double ms_dabs (double val); extern double ms_rsqrt64 (double val); /* Lookup functions */ extern uint8_t ms_samplesize (const char sampletype); extern char* ms_encodingstr (const char encoding); extern char* ms_blktdesc (uint16_t blkttype); extern uint16_t ms_blktlen (uint16_t blkttype, const char *blktdata, flag swapflag); extern char * ms_errorstr (int errorcode); /* Logging facility */ #define MAX_LOG_MSG_LENGTH 200 /* Maximum length of log messages */ /* Logging parameters */ typedef struct MSLogParam_s { void (*log_print)(char*); const char *logprefix; void (*diag_print)(char*); const char *errprefix; } MSLogParam; extern int ms_log (int level, ...); extern int ms_log_l (MSLogParam *logp, int level, ...); extern void ms_loginit (void (*log_print)(char*), const char *logprefix, void (*diag_print)(char*), const char *errprefix); extern MSLogParam *ms_loginit_l (MSLogParam *logp, void (*log_print)(char*), const char *logprefix, void (*diag_print)(char*), const char *errprefix); /* Selection functions */ extern Selections *ms_matchselect (Selections *selections, char *srcname, hptime_t starttime, hptime_t endtime, SelectTime **ppselecttime); extern Selections *msr_matchselect (Selections *selections, MSRecord *msr, SelectTime **ppselecttime); extern int ms_addselect (Selections **ppselections, char *srcname, hptime_t starttime, hptime_t endtime); extern int ms_addselect_comp (Selections **ppselections, char *net, char* sta, char *loc, char *chan, char *qual, hptime_t starttime, hptime_t endtime); extern int ms_readselectionsfile (Selections **ppselections, char *filename); extern void ms_freeselections (Selections *selections); extern void ms_printselections (Selections *selections); /* Leap second declarations, implementation in gentutils.c */ typedef struct LeapSecond_s { hptime_t leapsecond; int32_t TAIdelta; struct LeapSecond_s *next; } LeapSecond; extern LeapSecond *leapsecondlist; extern int ms_readleapseconds (char *envvarname); extern int ms_readleapsecondfile (char *filename); /* Generic byte swapping routines */ extern void ms_gswap2 ( void *data2 ); extern void ms_gswap3 ( void *data3 ); extern void ms_gswap4 ( void *data4 ); extern void ms_gswap8 ( void *data8 ); /* Generic byte swapping routines for memory aligned quantities; names exist * for backwards compatibility, but are the same as the generic routines. */ #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined (__clang__) __attribute__ ((deprecated("Use ms_gswap2 instead."))) extern void ms_gswap2a ( void *data2 ); __attribute__ ((deprecated("Use ms_gswap4 instead."))) extern void ms_gswap4a ( void *data4 ); __attribute__ ((deprecated("Use ms_gswap8 instead."))) extern void ms_gswap8a ( void *data8 ); #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320) __declspec(deprecated("Use ms_gswap2 instead.")) extern void ms_gswap2a ( void *data2 ); __declspec(deprecated("Use ms_gswap4 instead.")) extern void ms_gswap4a ( void *data4 ); __declspec(deprecated("Use ms_gswap8 instead.")) extern void ms_gswap8a ( void *data8 ); #else extern void ms_gswap2a ( void *data2 ); extern void ms_gswap4a ( void *data4 ); extern void ms_gswap8a ( void *data8 ); #endif /* Byte swap macro for the BTime struct */ #define MS_SWAPBTIME(x) \ do { \ ms_gswap2 (x.year); \ ms_gswap2 (x.day); \ ms_gswap2 (x.fract); \ } while (0) /* Platform portable functions */ extern off_t lmp_ftello (FILE *stream); extern int lmp_fseeko (FILE *stream, off_t offset, int whence); #ifdef __cplusplus } #endif #endif /* LIBMSEED_H */ iris-edu-libmseed-4314359/libmseed.map000066400000000000000000000004231422047135100174740ustar00rootroot00000000000000{ global: ms_*; msr_*; mst_*; mstl_*; packheaderbyteorder; packdatabyteorder; unpackheaderbyteorder; unpackdatabyteorder; unpackencodingformat; unpackencodingfallback; LM_SIZEOF_OFF_T; local: *; }; iris-edu-libmseed-4314359/lmplatform.c000066400000000000000000000026361422047135100175420ustar00rootroot00000000000000/*************************************************************************** * lmplatform.c: * * Platform portability routines. * * modified: 2017.118 ***************************************************************************/ /* Define _LARGEFILE_SOURCE to get ftello/fseeko on some systems (Linux) */ #define _LARGEFILE_SOURCE 1 #include "libmseed.h" /* Size of off_t data type as determined at build time */ int LM_SIZEOF_OFF_T = sizeof(off_t); /*************************************************************************** * lmp_ftello: * * Return the current file position for the specified descriptor using * the system's closest match to the POSIX ftello. ***************************************************************************/ off_t lmp_ftello (FILE *stream) { #if defined(LMP_WIN) return (off_t)ftell (stream); #else return (off_t)ftello (stream); #endif } /* End of lmp_ftello() */ /*************************************************************************** * lmp_fseeko: * * Seek to a specific file position for the specified descriptor using * the system's closest match to the POSIX fseeko. ***************************************************************************/ int lmp_fseeko (FILE *stream, off_t offset, int whence) { #if defined(LMP_WIN) return (int)fseek (stream, (long int)offset, whence); #else return (int)fseeko (stream, offset, whence); #endif } /* End of lmp_fseeko() */ iris-edu-libmseed-4314359/logging.c000066400000000000000000000212311422047135100170030ustar00rootroot00000000000000/*************************************************************************** * logging.c * * Log handling routines for libmseed * * Chad Trabant * IRIS Data Management Center * * modified: 2014.197 ***************************************************************************/ #include #include #include #include #include "libmseed.h" void ms_loginit_main (MSLogParam *logp, void (*log_print) (char *), const char *logprefix, void (*diag_print) (char *), const char *errprefix); int ms_log_main (MSLogParam *logp, int level, va_list *varlist); /* Initialize the global logging parameters */ MSLogParam gMSLogParam = {NULL, NULL, NULL, NULL}; /*************************************************************************** * ms_loginit: * * Initialize the global logging parameters. * * See ms_loginit_main() description for usage. ***************************************************************************/ void ms_loginit (void (*log_print) (char *), const char *logprefix, void (*diag_print) (char *), const char *errprefix) { ms_loginit_main (&gMSLogParam, log_print, logprefix, diag_print, errprefix); } /* End of ms_loginit() */ /*************************************************************************** * ms_loginit_l: * * Initialize MSLogParam specific logging parameters. If the logging parameters * have not been initialized (log == NULL) new parameter space will * be allocated. * * See ms_loginit_main() description for usage. * * Returns a pointer to the created/re-initialized MSLogParam struct * on success and NULL on error. ***************************************************************************/ MSLogParam * ms_loginit_l (MSLogParam *logp, void (*log_print) (char *), const char *logprefix, void (*diag_print) (char *), const char *errprefix) { MSLogParam *llog; if (logp == NULL) { llog = (MSLogParam *)malloc (sizeof (MSLogParam)); if (llog == NULL) { ms_log (2, "ms_loginit_l(): Cannot allocate memory\n"); return NULL; } llog->log_print = NULL; llog->logprefix = NULL; llog->diag_print = NULL; llog->errprefix = NULL; } else { llog = logp; } ms_loginit_main (llog, log_print, logprefix, diag_print, errprefix); return llog; } /* End of ms_loginit_l() */ /*************************************************************************** * ms_loginit_main: * * Initialize the logging subsystem. Given values determine how ms_log() * and ms_log_l() emit messages. * * This function modifies the logging parameters in the passed MSLogParam. * * Any log/error printing functions indicated must except a single * argument, namely a string (char *). The ms_log() and * ms_log_r() functions format each message and then pass the result * on to the log/error printing functions. * * If the log/error prefixes have been set they will be pre-pended to the * message. * * Use NULL for the function pointers or the prefixes if they should not * be changed from previously set or default values. The default behavior * of the logging subsystem is given in the example below. * * Example: ms_loginit_main (0, (void*)&printf, NULL, (void*)&printf, "error: "); ***************************************************************************/ void ms_loginit_main (MSLogParam *logp, void (*log_print) (char *), const char *logprefix, void (*diag_print) (char *), const char *errprefix) { if (!logp) return; if (log_print) logp->log_print = log_print; if (logprefix) { if (strlen (logprefix) >= MAX_LOG_MSG_LENGTH) { ms_log_l (logp, 2, "%s", "log message prefix is too large\n"); } else { logp->logprefix = logprefix; } } if (diag_print) logp->diag_print = diag_print; if (errprefix) { if (strlen (errprefix) >= MAX_LOG_MSG_LENGTH) { ms_log_l (logp, 2, "%s", "error message prefix is too large\n"); } else { logp->errprefix = errprefix; } } return; } /* End of ms_loginit_main() */ /*************************************************************************** * ms_log: * * A wrapper to ms_log_main() that uses the global logging parameters. * * See ms_log_main() description for return values. ***************************************************************************/ int ms_log (int level, ...) { int retval; va_list varlist; va_start (varlist, level); retval = ms_log_main (&gMSLogParam, level, &varlist); va_end (varlist); return retval; } /* End of ms_log() */ /*************************************************************************** * ms_log_l: * * A wrapper to ms_log_main() that uses the logging parameters in a * supplied MSLogParam. If the supplied pointer is NULL the global logging * parameters will be used. * * See ms_log_main() description for return values. ***************************************************************************/ int ms_log_l (MSLogParam *logp, int level, ...) { int retval; va_list varlist; MSLogParam *llog; if (!logp) llog = &gMSLogParam; else llog = logp; va_start (varlist, level); retval = ms_log_main (llog, level, &varlist); va_end (varlist); return retval; } /* End of ms_log_l() */ /*************************************************************************** * ms_log_main: * * A standard logging/printing routine. * * The function uses logging parameters specified in the supplied * MSLogParam. * * This function expects 2+ arguments: message level, fprintf format, * and fprintf arguments. * * Three levels are recognized: * 0 : Normal log messages, printed using log_print with logprefix * 1 : Diagnostic messages, printed using diag_print with logprefix * 2+ : Error messagess, printed using diag_print with errprefix * * This function builds the log/error message and passes to it as a * string (char *) to the functions defined with ms_loginit() or * ms_loginit_l(). If the log/error printing functions have not been * defined messages will be printed with fprintf, log messages to * stdout and error messages to stderr. * * If the log/error prefix's have been set with ms_loginit() or * ms_loginit_l() they will be pre-pended to the message. * * All messages will be truncated to the MAX_LOG_MSG_LENGTH, this includes * any set prefix. * * Returns the number of characters formatted on success, and a * a negative value on error. ***************************************************************************/ int ms_log_main (MSLogParam *logp, int level, va_list *varlist) { static char message[MAX_LOG_MSG_LENGTH]; int retvalue = 0; int presize; const char *format; if (!logp) { fprintf (stderr, "ms_log_main() called without specifying log parameters"); return -1; } message[0] = '\0'; format = va_arg (*varlist, const char *); if (level >= 2) /* Error message */ { if (logp->errprefix != NULL) { strncpy (message, logp->errprefix, MAX_LOG_MSG_LENGTH); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; } else { strncpy (message, "Error: ", MAX_LOG_MSG_LENGTH); } presize = strlen (message); retvalue = vsnprintf (&message[presize], MAX_LOG_MSG_LENGTH - presize, format, *varlist); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; if (logp->diag_print != NULL) { logp->diag_print (message); } else { fprintf (stderr, "%s", message); } } else if (level == 1) /* Diagnostic message */ { if (logp->logprefix != NULL) { strncpy (message, logp->logprefix, MAX_LOG_MSG_LENGTH); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; } presize = strlen (message); retvalue = vsnprintf (&message[presize], MAX_LOG_MSG_LENGTH - presize, format, *varlist); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; if (logp->diag_print != NULL) { logp->diag_print (message); } else { fprintf (stderr, "%s", message); } } else if (level == 0) /* Normal log message */ { if (logp->logprefix != NULL) { strncpy (message, logp->logprefix, MAX_LOG_MSG_LENGTH); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; } presize = strlen (message); retvalue = vsnprintf (&message[presize], MAX_LOG_MSG_LENGTH - presize, format, *varlist); message[MAX_LOG_MSG_LENGTH - 1] = '\0'; if (logp->log_print != NULL) { logp->log_print (message); } else { fprintf (stdout, "%s", message); } } return retvalue; } /* End of ms_log_main() */ iris-edu-libmseed-4314359/lookup.c000066400000000000000000000125751422047135100167010ustar00rootroot00000000000000/*************************************************************************** * lookup.c: * * Generic lookup routines for Mini-SEED information. * * Written by Chad Trabant, ORFEUS/EC-Project MEREDIAN * * modified: 2006.346 ***************************************************************************/ #include #include "libmseed.h" /*************************************************************************** * ms_samplesize(): * * Returns the sample size based on type code or 0 for unknown. ***************************************************************************/ uint8_t ms_samplesize (const char sampletype) { switch (sampletype) { case 'a': return 1; case 'i': case 'f': return 4; case 'd': return 8; default: return 0; } /* end switch */ } /* End of ms_samplesize() */ /*************************************************************************** * ms_encodingstr(): * * Returns a string describing a data encoding format. ***************************************************************************/ char * ms_encodingstr (const char encoding) { switch (encoding) { case 0: return "ASCII text"; case 1: return "16 bit integers"; case 2: return "24 bit integers"; case 3: return "32 bit integers"; case 4: return "IEEE floating point"; case 5: return "IEEE double precision float"; case 10: return "STEIM 1 Compression"; case 11: return "STEIM 2 Compression"; case 12: return "GEOSCOPE Muxed 24 bit int"; case 13: return "GEOSCOPE Muxed 16/3 bit gain/exp"; case 14: return "GEOSCOPE Muxed 16/4 bit gain/exp"; case 15: return "US National Network compression"; case 16: return "CDSN 16 bit gain ranged"; case 17: return "Graefenberg 16 bit gain ranged"; case 18: return "IPG - Strasbourg 16 bit gain"; case 19: return "STEIM 3 Compression"; case 30: return "SRO Gain Ranged Format"; case 31: return "HGLP Format"; case 32: return "DWWSSN Format"; case 33: return "RSTN 16 bit gain ranged"; default: return "Unknown format code"; } /* end switch */ } /* End of ms_encodingstr() */ /*************************************************************************** * ms_blktdesc(): * * Return a string describing a given blockette type or NULL if the * type is unknown. ***************************************************************************/ char * ms_blktdesc (uint16_t blkttype) { switch (blkttype) { case 100: return "Sample Rate"; case 200: return "Generic Event Detection"; case 201: return "Murdock Event Detection"; case 300: return "Step Calibration"; case 310: return "Sine Calibration"; case 320: return "Pseudo-random Calibration"; case 390: return "Generic Calibration"; case 395: return "Calibration Abort"; case 400: return "Beam"; case 500: return "Timing"; case 1000: return "Data Only SEED"; case 1001: return "Data Extension"; case 2000: return "Opaque Data"; } /* end switch */ return NULL; } /* End of ms_blktdesc() */ /*************************************************************************** * ms_blktlen(): * * Returns the total length of a given blockette type in bytes or 0 if * type unknown. ***************************************************************************/ uint16_t ms_blktlen (uint16_t blkttype, const char *blkt, flag swapflag) { uint16_t blktlen = 0; switch (blkttype) { case 100: /* Sample Rate */ blktlen = 12; break; case 200: /* Generic Event Detection */ blktlen = 28; break; case 201: /* Murdock Event Detection */ blktlen = 36; break; case 300: /* Step Calibration */ blktlen = 32; break; case 310: /* Sine Calibration */ blktlen = 32; break; case 320: /* Pseudo-random Calibration */ blktlen = 28; break; case 390: /* Generic Calibration */ blktlen = 28; break; case 395: /* Calibration Abort */ blktlen = 16; break; case 400: /* Beam */ blktlen = 16; break; case 500: /* Timing */ blktlen = 8; break; case 1000: /* Data Only SEED */ blktlen = 8; break; case 1001: /* Data Extension */ blktlen = 8; break; case 2000: /* Opaque Data */ /* First 2-byte field after the blockette header is the length */ if (blkt) { memcpy ((void *)&blktlen, blkt + 4, sizeof (int16_t)); if (swapflag) ms_gswap2 (&blktlen); } break; } /* end switch */ return blktlen; } /* End of ms_blktlen() */ /*************************************************************************** * ms_errorstr(): * * Return a string describing a given libmseed error code or NULL if the * code is unknown. ***************************************************************************/ char * ms_errorstr (int errorcode) { switch (errorcode) { case MS_ENDOFFILE: return "End of file reached"; case MS_NOERROR: return "No error"; case MS_GENERROR: return "Generic error"; case MS_NOTSEED: return "No SEED data detected"; case MS_WRONGLENGTH: return "Length of data read does not match record length"; case MS_OUTOFRANGE: return "SEED record length out of range"; case MS_UNKNOWNFORMAT: return "Unknown data encoding format"; case MS_STBADCOMPFLAG: return "Bad Steim compression flag(s) detected"; } /* end switch */ return NULL; } /* End of ms_blktdesc() */ iris-edu-libmseed-4314359/mseed.pc.in000066400000000000000000000005171422047135100172430ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: @PACKAGE_NAME@ Description: The Mini-SEED library provides a framework for manipulation of SEED (Standard for the Exchange of Earthquake Data) data records. URL: @PACKAGE_URL@ Version: @VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lmseed iris-edu-libmseed-4314359/msrutils.c000066400000000000000000001273641422047135100172550ustar00rootroot00000000000000/*************************************************************************** * msrutils.c: * * Generic routines to operate on Mini-SEED records. * * Written by Chad Trabant * ORFEUS/EC-Project MEREDIAN * IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include "libmseed.h" /*************************************************************************** * msr_init: * * Initialize and return an MSRecord struct, allocating memory if * needed. If memory for the fsdh and datasamples fields has been * allocated the pointers will be retained for reuse. If a blockette * chain is present all associated memory will be released. * * Returns a pointer to a MSRecord struct on success or NULL on error. ***************************************************************************/ MSRecord * msr_init (MSRecord *msr) { void *fsdh = 0; void *datasamples = 0; if (!msr) { msr = (MSRecord *)malloc (sizeof (MSRecord)); } else { fsdh = msr->fsdh; datasamples = msr->datasamples; if (msr->blkts) msr_free_blktchain (msr); if (msr->ststate) free (msr->ststate); } if (msr == NULL) { ms_log (2, "msr_init(): Cannot allocate memory\n"); return NULL; } memset (msr, 0, sizeof (MSRecord)); msr->fsdh = fsdh; msr->datasamples = datasamples; msr->reclen = -1; msr->samplecnt = -1; msr->byteorder = -1; msr->encoding = -1; return msr; } /* End of msr_init() */ /*************************************************************************** * msr_free: * * Free all memory associated with a MSRecord struct. ***************************************************************************/ void msr_free (MSRecord **ppmsr) { if (ppmsr != NULL && *ppmsr != 0) { /* Free fixed section header if populated */ if ((*ppmsr)->fsdh) free ((*ppmsr)->fsdh); /* Free blockette chain if populated */ if ((*ppmsr)->blkts) msr_free_blktchain (*ppmsr); /* Free datasamples if present */ if ((*ppmsr)->datasamples) free ((*ppmsr)->datasamples); /* Free stream processing state if present */ if ((*ppmsr)->ststate) free ((*ppmsr)->ststate); free (*ppmsr); *ppmsr = NULL; } } /* End of msr_free() */ /*************************************************************************** * msr_free_blktchain: * * Free all memory associated with a blockette chain in a MSRecord * struct and set MSRecord->blkts to NULL. Also reset the shortcut * blockette pointers. ***************************************************************************/ void msr_free_blktchain (MSRecord *msr) { if (msr) { if (msr->blkts) { BlktLink *bc = msr->blkts; BlktLink *nb = NULL; while (bc) { nb = bc->next; if (bc->blktdata) free (bc->blktdata); free (bc); bc = nb; } msr->blkts = 0; } msr->Blkt100 = 0; msr->Blkt1000 = 0; msr->Blkt1001 = 0; } } /* End of msr_free_blktchain() */ /*************************************************************************** * msr_addblockette: * * Add a blockette to the blockette chain of an MSRecord. 'blktdata' * should be the body of the blockette type 'blkttype' of 'length' * bytes without the blockette header (type and next offsets). The * 'chainpos' value controls which end of the chain the blockette is * added to. If 'chainpos' is 0 the blockette will be added to the * end of the chain (last blockette), other wise it will be added to * the beginning of the chain (first blockette). * * Returns a pointer to the BlktLink added to the chain on success and * NULL on error. ***************************************************************************/ BlktLink * msr_addblockette (MSRecord *msr, char *blktdata, int length, int blkttype, int chainpos) { BlktLink *blkt; if (!msr) return NULL; blkt = msr->blkts; if (blkt) { if (chainpos != 0) { blkt = (BlktLink *)malloc (sizeof (BlktLink)); blkt->next = msr->blkts; msr->blkts = blkt; } else { /* Find the last blockette */ while (blkt && blkt->next) { blkt = blkt->next; } blkt->next = (BlktLink *)malloc (sizeof (BlktLink)); blkt = blkt->next; blkt->next = 0; } if (blkt == NULL) { ms_log (2, "msr_addblockette(): Cannot allocate memory\n"); return NULL; } } else { msr->blkts = (BlktLink *)malloc (sizeof (BlktLink)); if (msr->blkts == NULL) { ms_log (2, "msr_addblockette(): Cannot allocate memory\n"); return NULL; } blkt = msr->blkts; blkt->next = 0; } blkt->blktoffset = 0; blkt->blkt_type = blkttype; blkt->next_blkt = 0; blkt->blktdata = (char *)malloc (length); if (blkt->blktdata == NULL) { ms_log (2, "msr_addblockette(): Cannot allocate memory\n"); return NULL; } memcpy (blkt->blktdata, blktdata, length); blkt->blktdatalen = length; /* Setup the shortcut pointer for common blockettes */ switch (blkttype) { case 100: msr->Blkt100 = blkt->blktdata; break; case 1000: msr->Blkt1000 = blkt->blktdata; break; case 1001: msr->Blkt1001 = blkt->blktdata; break; } return blkt; } /* End of msr_addblockette() */ /*************************************************************************** * msr_normalize_header: * * Normalize header values between the MSRecord struct and the * associated fixed-section of the header and blockettes. Essentially * this updates the SEED structured data in the MSRecord.fsdh struct * and MSRecord.blkts chain with values stored at the MSRecord level. * * Returns the header length in bytes on success or -1 on error. ***************************************************************************/ int msr_normalize_header (MSRecord *msr, flag verbose) { struct blkt_link_s *cur_blkt; hptime_t hptimems; int8_t usecoffset; char seqnum[16]; int offset = 0; int blktcnt = 0; int reclenexp = 0; int reclenfind; if (!msr) return -1; /* Get start time rounded to tenths of milliseconds and microsecond offset */ ms_hptime2tomsusecoffset (msr->starttime, &hptimems, &usecoffset); /* Update values in fixed section of data header */ if (msr->fsdh) { if (verbose > 2) ms_log (1, "Normalizing fixed section of data header\n"); /* Roll-over sequence number if necessary */ if (msr->sequence_number > 999999) msr->sequence_number = 1; /* Update values in the MSRecord.fsdh struct */ snprintf (seqnum, sizeof(seqnum), "%06d", msr->sequence_number); memcpy (msr->fsdh->sequence_number, seqnum, 6); msr->fsdh->dataquality = msr->dataquality; msr->fsdh->reserved = ' '; ms_strncpopen (msr->fsdh->network, msr->network, 2); ms_strncpopen (msr->fsdh->station, msr->station, 5); ms_strncpopen (msr->fsdh->location, msr->location, 2); ms_strncpopen (msr->fsdh->channel, msr->channel, 3); ms_hptime2btime (hptimems, &(msr->fsdh->start_time)); /* Determine the factor and multipler for sample rate */ if (ms_genfactmult (msr->samprate, &(msr->fsdh->samprate_fact), &(msr->fsdh->samprate_mult))) { if (verbose > 1) ms_log (1, "Sampling rate out of range, cannot generate factor & multiplier: %g\n", msr->samprate); msr->fsdh->samprate_fact = 0; msr->fsdh->samprate_mult = 0; } offset += 48; if (msr->blkts) msr->fsdh->blockette_offset = offset; else msr->fsdh->blockette_offset = 0; } /* Traverse blockette chain and perform necessary updates */ cur_blkt = msr->blkts; if (cur_blkt && verbose > 2) ms_log (1, "Normalizing blockette chain\n"); while (cur_blkt) { offset += 4; if (cur_blkt->blkt_type == 100 && msr->Blkt100) { msr->Blkt100->samprate = (float)msr->samprate; offset += sizeof (struct blkt_100_s); } else if (cur_blkt->blkt_type == 1000 && msr->Blkt1000) { msr->Blkt1000->byteorder = msr->byteorder; msr->Blkt1000->encoding = msr->encoding; /* Calculate the record length as an exponent of 2 */ for (reclenfind = 1, reclenexp = 1; reclenfind <= MAXRECLEN; reclenexp++) { reclenfind *= 2; if (reclenfind == msr->reclen) break; } if (reclenfind != msr->reclen) { ms_log (2, "msr_normalize_header(): Record length %d is not a power of 2\n", msr->reclen); return -1; } msr->Blkt1000->reclen = reclenexp; offset += sizeof (struct blkt_1000_s); } else if (cur_blkt->blkt_type == 1001) { msr->Blkt1001->usec = usecoffset; offset += sizeof (struct blkt_1001_s); } blktcnt++; cur_blkt = cur_blkt->next; } if (msr->fsdh) msr->fsdh->numblockettes = blktcnt; return offset; } /* End of msr_normalize_header() */ /*************************************************************************** * msr_duplicate: * * Duplicate an MSRecord struct including the fixed-section data * header and blockette chain. If the datadup flag is true and the * source MSRecord has associated data samples copy them as well. * * Returns a pointer to a new MSRecord on success and NULL on error. ***************************************************************************/ MSRecord * msr_duplicate (MSRecord *msr, flag datadup) { MSRecord *dupmsr = 0; int samplesize = 0; if (!msr) return NULL; /* Allocate target MSRecord structure */ if ((dupmsr = msr_init (NULL)) == NULL) return NULL; /* Copy MSRecord structure */ memcpy (dupmsr, msr, sizeof (MSRecord)); /* Reset pointers to not alias memory held by other structures */ dupmsr->fsdh = NULL; dupmsr->blkts = NULL; dupmsr->datasamples = NULL; dupmsr->ststate = NULL; /* Copy fixed-section data header structure */ if (msr->fsdh) { /* Allocate memory for new FSDH structure */ if ((dupmsr->fsdh = (struct fsdh_s *)malloc (sizeof (struct fsdh_s))) == NULL) { ms_log (2, "msr_duplicate(): Error allocating memory\n"); msr_free (&dupmsr); return NULL; } /* Copy the contents */ memcpy (dupmsr->fsdh, msr->fsdh, sizeof (struct fsdh_s)); } /* Copy the blockette chain */ if (msr->blkts) { BlktLink *blkt = msr->blkts; BlktLink *next = NULL; dupmsr->blkts = 0; while (blkt) { next = blkt->next; /* Add blockette to chain of new MSRecord */ if (msr_addblockette (dupmsr, blkt->blktdata, blkt->blktdatalen, blkt->blkt_type, 0) == NULL) { ms_log (2, "msr_duplicate(): Error adding blockettes\n"); msr_free (&dupmsr); return NULL; } blkt = next; } } /* Copy data samples if requested and available */ if (datadup && msr->datasamples) { /* Determine size of samples in bytes */ samplesize = ms_samplesize (msr->sampletype); if (samplesize == 0) { ms_log (2, "msr_duplicate(): unrecognized sample type: '%c'\n", msr->sampletype); msr_free (&dupmsr); return NULL; } /* Allocate memory for new data array */ if ((dupmsr->datasamples = (void *)malloc ((size_t) (msr->numsamples * samplesize))) == NULL) { ms_log (2, "msr_duplicate(): Error allocating memory\n"); msr_free (&dupmsr); return NULL; } /* Copy the data array */ memcpy (dupmsr->datasamples, msr->datasamples, ((size_t) (msr->numsamples * samplesize))); } /* Otherwise make sure the sample array and count are zero */ else { dupmsr->datasamples = 0; dupmsr->numsamples = 0; } return dupmsr; } /* End of msr_duplicate() */ /*************************************************************************** * msr_samprate: * * Calculate and return a double precision sample rate for the * specified MSRecord. If a Blockette 100 was included and parsed, * the "Actual sample rate" (field 3) will be returned, otherwise a * nominal sample rate will be calculated from the sample rate factor * and multiplier in the fixed section data header. * * Returns the positive sample rate on success and -1.0 on error. ***************************************************************************/ double msr_samprate (MSRecord *msr) { if (!msr) return -1.0; if (msr->Blkt100) return (double)msr->Blkt100->samprate; else return msr_nomsamprate (msr); } /* End of msr_samprate() */ /*************************************************************************** * msr_nomsamprate: * * Calculate a double precision nominal sample rate from the sample * rate factor and multiplier in the FSDH struct of the specified * MSRecord. * * Returns the positive sample rate on success and -1.0 on error. ***************************************************************************/ double msr_nomsamprate (MSRecord *msr) { if (!msr) return -1.0; return ms_nomsamprate (msr->fsdh->samprate_fact, msr->fsdh->samprate_mult); } /* End of msr_nomsamprate() */ /*************************************************************************** * msr_starttime: * * Convert a btime struct of a FSDH struct of a MSRecord (the record * start time) into a high precision epoch time and apply time * corrections if any are specified in the header and bit 1 of the * activity flags indicates that it has not already been applied. If * a Blockette 1001 is included and has been parsed the microseconds * of field 4 are also applied. * * Returns a high precision epoch time on success and HPTERROR on * error. ***************************************************************************/ hptime_t msr_starttime (MSRecord *msr) { hptime_t starttime = msr_starttime_uc (msr); if (!msr || starttime == HPTERROR) return HPTERROR; /* Check if a correction is included and if it has been applied, bit 1 of activity flags indicates if it has been appiled */ if (msr->fsdh->time_correct != 0 && !(msr->fsdh->act_flags & 0x02)) { starttime += (hptime_t)msr->fsdh->time_correct * (HPTMODULUS / 10000); } /* Apply microsecond precision in a parsed Blockette 1001 */ if (msr->Blkt1001) { starttime += (hptime_t)msr->Blkt1001->usec * (HPTMODULUS / 1000000); } return starttime; } /* End of msr_starttime() */ /*************************************************************************** * msr_starttime_uc: * * Convert a btime struct of a FSDH struct of a MSRecord (the record * start time) into a high precision epoch time. This time has no * correction(s) applied to it. * * Returns a high precision epoch time on success and HPTERROR on * error. ***************************************************************************/ hptime_t msr_starttime_uc (MSRecord *msr) { if (!msr) return HPTERROR; if (!msr->fsdh) return HPTERROR; return ms_btime2hptime (&msr->fsdh->start_time); } /* End of msr_starttime_uc() */ /*************************************************************************** * msr_endtime: * * Calculate the time of the last sample in the record; this is the * actual last sample time and *not* the time "covered" by the last * sample. * * On the epoch time scale the value of a leap second is the same as * the second following the leap second, without external information * the values are ambiguous. * * Leap second handling: when a record completely contains a leap * second, starts before and ends after, the calculated end time will * be adjusted (reduced) by one second. * * Returns the time of the last sample as a high precision epoch time * on success and HPTERROR on error. ***************************************************************************/ hptime_t msr_endtime (MSRecord *msr) { hptime_t span = 0; LeapSecond *lslist = leapsecondlist; if (!msr) return HPTERROR; if (msr->samprate > 0.0 && msr->samplecnt > 0) span = (hptime_t) (((double)(msr->samplecnt - 1) / msr->samprate * HPTMODULUS) + 0.5); /* Check if the record contains a leap second, if list is available */ if (lslist) { while (lslist) { if (lslist->leapsecond > msr->starttime && lslist->leapsecond <= (msr->starttime + span - HPTMODULUS)) { span -= HPTMODULUS; break; } lslist = lslist->next; } } else { /* If a positive leap second occurred during this record as denoted by * bit 4 of the activity flags being set, reduce the end time to match * the now shifted UTC time. */ if (msr->fsdh) if (msr->fsdh->act_flags & 0x10) span -= HPTMODULUS; } return (msr->starttime + span); } /* End of msr_endtime() */ /*************************************************************************** * msr_srcname: * * Generate a source name string for a specified MSRecord in the * format: 'NET_STA_LOC_CHAN' or, if the quality flag is true: * 'NET_STA_LOC_CHAN_QUAL'. The passed srcname must have enough room * for the resulting string. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * msr_srcname (MSRecord *msr, char *srcname, flag quality) { char *src = srcname; char *cp = srcname; if (!msr || !srcname) return NULL; /* Build the source name string */ cp = msr->network; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = msr->station; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = msr->location; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = msr->channel; while (*cp) { *src++ = *cp++; } if (quality) { *src++ = '_'; *src++ = msr->dataquality; } *src = '\0'; return srcname; } /* End of msr_srcname() */ /*************************************************************************** * msr_print: * * Prints header values in an MSRecord struct, if 'details' is greater * than 0 then detailed information about each blockette is printed. * If 'details' is greater than 1 very detailed information is * printed. If no FSDH (msr->fsdh) is present only a single line with * basic information is printed. ***************************************************************************/ void msr_print (MSRecord *msr, flag details) { double nomsamprate; char srcname[50]; char time[25]; char b; int idx; if (!msr) return; /* Generate a source name string */ srcname[0] = '\0'; msr_srcname (msr, srcname, 0); /* Generate a start time string */ ms_hptime2seedtimestr (msr->starttime, time, 1); /* Report information in the fixed header */ if (details > 0 && msr->fsdh) { nomsamprate = msr_nomsamprate (msr); ms_log (0, "%s, %06d, %c\n", srcname, msr->sequence_number, msr->dataquality); ms_log (0, " start time: %s\n", time); ms_log (0, " number of samples: %d\n", msr->fsdh->numsamples); ms_log (0, " sample rate factor: %d (%.10g samples per second)\n", msr->fsdh->samprate_fact, nomsamprate); ms_log (0, " sample rate multiplier: %d\n", msr->fsdh->samprate_mult); if (details > 1) { /* Activity flags */ b = msr->fsdh->act_flags; ms_log (0, " activity flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Calibration signals present\n"); if (b & 0x02) ms_log (0, " [Bit 1] Time correction applied\n"); if (b & 0x04) ms_log (0, " [Bit 2] Beginning of an event, station trigger\n"); if (b & 0x08) ms_log (0, " [Bit 3] End of an event, station detrigger\n"); if (b & 0x10) ms_log (0, " [Bit 4] A positive leap second happened in this record\n"); if (b & 0x20) ms_log (0, " [Bit 5] A negative leap second happened in this record\n"); if (b & 0x40) ms_log (0, " [Bit 6] Event in progress\n"); if (b & 0x80) ms_log (0, " [Bit 7] Undefined bit set\n"); /* I/O and clock flags */ b = msr->fsdh->io_flags; ms_log (0, " I/O and clock flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Station volume parity error possibly present\n"); if (b & 0x02) ms_log (0, " [Bit 1] Long record read (possibly no problem)\n"); if (b & 0x04) ms_log (0, " [Bit 2] Short record read (record padded)\n"); if (b & 0x08) ms_log (0, " [Bit 3] Start of time series\n"); if (b & 0x10) ms_log (0, " [Bit 4] End of time series\n"); if (b & 0x20) ms_log (0, " [Bit 5] Clock locked\n"); if (b & 0x40) ms_log (0, " [Bit 6] Undefined bit set\n"); if (b & 0x80) ms_log (0, " [Bit 7] Undefined bit set\n"); /* Data quality flags */ b = msr->fsdh->dq_flags; ms_log (0, " data quality flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Amplifier saturation detected\n"); if (b & 0x02) ms_log (0, " [Bit 1] Digitizer clipping detected\n"); if (b & 0x04) ms_log (0, " [Bit 2] Spikes detected\n"); if (b & 0x08) ms_log (0, " [Bit 3] Glitches detected\n"); if (b & 0x10) ms_log (0, " [Bit 4] Missing/padded data present\n"); if (b & 0x20) ms_log (0, " [Bit 5] Telemetry synchronization error\n"); if (b & 0x40) ms_log (0, " [Bit 6] A digital filter may be charging\n"); if (b & 0x80) ms_log (0, " [Bit 7] Time tag is questionable\n"); } ms_log (0, " number of blockettes: %d\n", msr->fsdh->numblockettes); ms_log (0, " time correction: %ld\n", (long int)msr->fsdh->time_correct); ms_log (0, " data offset: %d\n", msr->fsdh->data_offset); ms_log (0, " first blockette offset: %d\n", msr->fsdh->blockette_offset); } else { ms_log (0, "%s, %06d, %c, %d, %" PRId64 " samples, %-.10g Hz, %s\n", srcname, msr->sequence_number, msr->dataquality, msr->reclen, msr->samplecnt, msr->samprate, time); } /* Report information in the blockette chain */ if (details > 0 && msr->blkts) { BlktLink *cur_blkt = msr->blkts; while (cur_blkt) { if (cur_blkt->blkt_type == 100) { struct blkt_100_s *blkt_100 = (struct blkt_100_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " actual sample rate: %.10g\n", blkt_100->samprate); if (details > 1) { b = blkt_100->flags; ms_log (0, " undefined flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); ms_log (0, " reserved bytes (3): %u,%u,%u\n", blkt_100->reserved[0], blkt_100->reserved[1], blkt_100->reserved[2]); } } else if (cur_blkt->blkt_type == 200) { struct blkt_200_s *blkt_200 = (struct blkt_200_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " signal amplitude: %g\n", blkt_200->amplitude); ms_log (0, " signal period: %g\n", blkt_200->period); ms_log (0, " background estimate: %g\n", blkt_200->background_estimate); if (details > 1) { b = blkt_200->flags; ms_log (0, " event detection flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] 1: Dilatation wave\n"); else ms_log (0, " [Bit 0] 0: Compression wave\n"); if (b & 0x02) ms_log (0, " [Bit 1] 1: Units after deconvolution\n"); else ms_log (0, " [Bit 1] 0: Units are digital counts\n"); if (b & 0x04) ms_log (0, " [Bit 2] Bit 0 is undetermined\n"); ms_log (0, " reserved byte: %u\n", blkt_200->reserved); } ms_btime2seedtimestr (&blkt_200->time, time); ms_log (0, " signal onset time: %s\n", time); ms_log (0, " detector name: %.24s\n", blkt_200->detector); } else if (cur_blkt->blkt_type == 201) { struct blkt_201_s *blkt_201 = (struct blkt_201_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " signal amplitude: %g\n", blkt_201->amplitude); ms_log (0, " signal period: %g\n", blkt_201->period); ms_log (0, " background estimate: %g\n", blkt_201->background_estimate); b = blkt_201->flags; ms_log (0, " event detection flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] 1: Dilation wave\n"); else ms_log (0, " [Bit 0] 0: Compression wave\n"); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_201->reserved); ms_btime2seedtimestr (&blkt_201->time, time); ms_log (0, " signal onset time: %s\n", time); ms_log (0, " SNR values: "); for (idx = 0; idx < 6; idx++) ms_log (0, "%u ", blkt_201->snr_values[idx]); ms_log (0, "\n"); ms_log (0, " loopback value: %u\n", blkt_201->loopback); ms_log (0, " pick algorithm: %u\n", blkt_201->pick_algorithm); ms_log (0, " detector name: %.24s\n", blkt_201->detector); } else if (cur_blkt->blkt_type == 300) { struct blkt_300_s *blkt_300 = (struct blkt_300_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_btime2seedtimestr (&blkt_300->time, time); ms_log (0, " calibration start time: %s\n", time); ms_log (0, " number of calibrations: %u\n", blkt_300->numcalibrations); b = blkt_300->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] First pulse is positive\n"); if (b & 0x02) ms_log (0, " [Bit 1] Calibration's alternate sign\n"); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); ms_log (0, " step duration: %u\n", blkt_300->step_duration); ms_log (0, " interval duration: %u\n", blkt_300->interval_duration); ms_log (0, " signal amplitude: %g\n", blkt_300->amplitude); ms_log (0, " input signal channel: %.3s", blkt_300->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_300->reserved); ms_log (0, " reference amplitude: %u\n", blkt_300->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_300->coupling); ms_log (0, " rolloff: %.12s\n", blkt_300->rolloff); } else if (cur_blkt->blkt_type == 310) { struct blkt_310_s *blkt_310 = (struct blkt_310_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_btime2seedtimestr (&blkt_310->time, time); ms_log (0, " calibration start time: %s\n", time); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_310->reserved1); b = blkt_310->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); if (b & 0x10) ms_log (0, " [Bit 4] Peak-to-peak amplitude\n"); if (b & 0x20) ms_log (0, " [Bit 5] Zero-to-peak amplitude\n"); if (b & 0x40) ms_log (0, " [Bit 6] RMS amplitude\n"); ms_log (0, " calibration duration: %u\n", blkt_310->duration); ms_log (0, " signal period: %g\n", blkt_310->period); ms_log (0, " signal amplitude: %g\n", blkt_310->amplitude); ms_log (0, " input signal channel: %.3s", blkt_310->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_310->reserved2); ms_log (0, " reference amplitude: %u\n", blkt_310->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_310->coupling); ms_log (0, " rolloff: %.12s\n", blkt_310->rolloff); } else if (cur_blkt->blkt_type == 320) { struct blkt_320_s *blkt_320 = (struct blkt_320_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_btime2seedtimestr (&blkt_320->time, time); ms_log (0, " calibration start time: %s\n", time); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_320->reserved1); b = blkt_320->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); if (b & 0x10) ms_log (0, " [Bit 4] Random amplitudes\n"); ms_log (0, " calibration duration: %u\n", blkt_320->duration); ms_log (0, " peak-to-peak amplitude: %g\n", blkt_320->ptp_amplitude); ms_log (0, " input signal channel: %.3s", blkt_320->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_320->reserved2); ms_log (0, " reference amplitude: %u\n", blkt_320->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_320->coupling); ms_log (0, " rolloff: %.12s\n", blkt_320->rolloff); ms_log (0, " noise type: %.8s\n", blkt_320->noise_type); } else if (cur_blkt->blkt_type == 390) { struct blkt_390_s *blkt_390 = (struct blkt_390_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_btime2seedtimestr (&blkt_390->time, time); ms_log (0, " calibration start time: %s\n", time); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_390->reserved1); b = blkt_390->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); ms_log (0, " calibration duration: %u\n", blkt_390->duration); ms_log (0, " signal amplitude: %g\n", blkt_390->amplitude); ms_log (0, " input signal channel: %.3s", blkt_390->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_390->reserved2); } else if (cur_blkt->blkt_type == 395) { struct blkt_395_s *blkt_395 = (struct blkt_395_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_btime2seedtimestr (&blkt_395->time, time); ms_log (0, " calibration end time: %s\n", time); if (details > 1) ms_log (0, " reserved bytes (2): %u,%u\n", blkt_395->reserved[0], blkt_395->reserved[1]); } else if (cur_blkt->blkt_type == 400) { struct blkt_400_s *blkt_400 = (struct blkt_400_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " beam azimuth (degrees): %g\n", blkt_400->azimuth); ms_log (0, " beam slowness (sec/degree): %g\n", blkt_400->slowness); ms_log (0, " configuration: %u\n", blkt_400->configuration); if (details > 1) ms_log (0, " reserved bytes (2): %u,%u\n", blkt_400->reserved[0], blkt_400->reserved[1]); } else if (cur_blkt->blkt_type == 405) { struct blkt_405_s *blkt_405 = (struct blkt_405_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s, incomplete)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " first delay value: %u\n", blkt_405->delay_values[0]); } else if (cur_blkt->blkt_type == 500) { struct blkt_500_s *blkt_500 = (struct blkt_500_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " VCO correction: %g%%\n", blkt_500->vco_correction); ms_btime2seedtimestr (&blkt_500->time, time); ms_log (0, " time of exception: %s\n", time); ms_log (0, " usec: %d\n", blkt_500->usec); ms_log (0, " reception quality: %u%%\n", blkt_500->reception_qual); ms_log (0, " exception count: %u\n", blkt_500->exception_count); ms_log (0, " exception type: %.16s\n", blkt_500->exception_type); ms_log (0, " clock model: %.32s\n", blkt_500->clock_model); ms_log (0, " clock status: %.128s\n", blkt_500->clock_status); } else if (cur_blkt->blkt_type == 1000) { struct blkt_1000_s *blkt_1000 = (struct blkt_1000_s *)cur_blkt->blktdata; int recsize; char order[40]; /* Calculate record size in bytes as 2^(blkt_1000->rec_len) */ recsize = (unsigned int)1 << blkt_1000->reclen; /* Big or little endian? */ if (blkt_1000->byteorder == 0) strncpy (order, "Little endian", sizeof (order) - 1); else if (blkt_1000->byteorder == 1) strncpy (order, "Big endian", sizeof (order) - 1); else strncpy (order, "Unknown value", sizeof (order) - 1); ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " encoding: %s (val:%u)\n", (char *)ms_encodingstr (blkt_1000->encoding), blkt_1000->encoding); ms_log (0, " byte order: %s (val:%u)\n", order, blkt_1000->byteorder); ms_log (0, " record length: %d (val:%u)\n", recsize, blkt_1000->reclen); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_1000->reserved); } else if (cur_blkt->blkt_type == 1001) { struct blkt_1001_s *blkt_1001 = (struct blkt_1001_s *)cur_blkt->blktdata; ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " timing quality: %u%%\n", blkt_1001->timing_qual); ms_log (0, " micro second: %d\n", blkt_1001->usec); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_1001->reserved); ms_log (0, " frame count: %u\n", blkt_1001->framecnt); } else if (cur_blkt->blkt_type == 2000) { struct blkt_2000_s *blkt_2000 = (struct blkt_2000_s *)cur_blkt->blktdata; char order[40]; /* Big or little endian? */ if (blkt_2000->byteorder == 0) strncpy (order, "Little endian", sizeof (order) - 1); else if (blkt_2000->byteorder == 1) strncpy (order, "Big endian", sizeof (order) - 1); else strncpy (order, "Unknown value", sizeof (order) - 1); ms_log (0, " BLOCKETTE %u: (%s)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); ms_log (0, " blockette length: %u\n", blkt_2000->length); ms_log (0, " data offset: %u\n", blkt_2000->data_offset); ms_log (0, " record number: %u\n", blkt_2000->recnum); ms_log (0, " byte order: %s (val:%u)\n", order, blkt_2000->byteorder); b = blkt_2000->flags; ms_log (0, " data flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (details > 1) { if (b & 0x01) ms_log (0, " [Bit 0] 1: Stream oriented\n"); else ms_log (0, " [Bit 0] 0: Record oriented\n"); if (b & 0x02) ms_log (0, " [Bit 1] 1: Blockette 2000s may NOT be packaged\n"); else ms_log (0, " [Bit 1] 0: Blockette 2000s may be packaged\n"); if (!(b & 0x04) && !(b & 0x08)) ms_log (0, " [Bits 2-3] 00: Complete blockette\n"); else if (!(b & 0x04) && (b & 0x08)) ms_log (0, " [Bits 2-3] 01: First blockette in span\n"); else if ((b & 0x04) && (b & 0x08)) ms_log (0, " [Bits 2-3] 11: Continuation blockette in span\n"); else if ((b & 0x04) && !(b & 0x08)) ms_log (0, " [Bits 2-3] 10: Final blockette in span\n"); if (!(b & 0x10) && !(b & 0x20)) ms_log (0, " [Bits 4-5] 00: Not file oriented\n"); else if (!(b & 0x10) && (b & 0x20)) ms_log (0, " [Bits 4-5] 01: First blockette of file\n"); else if ((b & 0x10) && !(b & 0x20)) ms_log (0, " [Bits 4-5] 10: Continuation of file\n"); else if ((b & 0x10) && (b & 0x20)) ms_log (0, " [Bits 4-5] 11: Last blockette of file\n"); } ms_log (0, " number of headers: %u\n", blkt_2000->numheaders); /* Crude display of the opaque data headers */ if (details > 1) ms_log (0, " headers: %.*s\n", (blkt_2000->data_offset - 15), blkt_2000->payload); } else { ms_log (0, " BLOCKETTE %u: (%s, not parsed)\n", cur_blkt->blkt_type, ms_blktdesc (cur_blkt->blkt_type)); ms_log (0, " next blockette: %u\n", cur_blkt->next_blkt); } cur_blkt = cur_blkt->next; } } } /* End of msr_print() */ /*************************************************************************** * msr_host_latency: * * Calculate the latency based on the host time in UTC accounting for * the time covered using the number of samples and sample rate; in * other words, the difference between the host time and the time of * the last sample in the specified Mini-SEED record. * * Double precision is returned, but the true precision is dependent * on the accuracy of the host system clock among other things. * * Returns seconds of latency or 0.0 on error (indistinguishable from * 0.0 latency). ***************************************************************************/ double msr_host_latency (MSRecord *msr) { double span = 0.0; /* Time covered by the samples */ double epoch; /* Current epoch time */ double latency = 0.0; time_t tv; if (msr == NULL) return 0.0; /* Calculate the time covered by the samples */ if (msr->samprate > 0.0 && msr->samplecnt > 0) span = (1.0 / msr->samprate) * (msr->samplecnt - 1); /* Grab UTC time according to the system clock */ epoch = (double)time (&tv); /* Now calculate the latency */ latency = epoch - ((double)msr->starttime / HPTMODULUS) - span; return latency; } /* End of msr_host_latency() */ iris-edu-libmseed-4314359/pack.c000066400000000000000000000745061422047135100163100ustar00rootroot00000000000000/*************************************************************************** * pack.c: * * Generic routines to pack Mini-SEED records using an MSrecord as a * header template and data source. * * Written by Chad Trabant, * IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include "libmseed.h" #include "packdata.h" /* Function(s) internal to this file */ static int msr_pack_header_raw (MSRecord *msr, char *rawrec, int maxheaderlen, flag swapflag, flag normalize, struct blkt_1001_s **blkt1001, char *srcname, flag verbose); static int msr_update_header (MSRecord *msr, char *rawrec, flag swapflag, struct blkt_1001_s *blkt1001, char *srcname, flag verbose); static int msr_pack_data (void *dest, void *src, int maxsamples, int maxdatabytes, int32_t *lastintsample, flag comphistory, char sampletype, flag encoding, flag swapflag, char *srcname, flag verbose); /* Header and data byte order flags controlled by environment variables */ /* -2 = not checked, -1 = checked but not set, or 0 = LE and 1 = BE */ flag packheaderbyteorder = -2; flag packdatabyteorder = -2; /*************************************************************************** * msr_pack: * * Pack data into SEED data records. Using the record header values * in the MSRecord as a template the common header fields are packed * into the record header, blockettes in the blockettes chain are * packed and data samples are packed in the encoding format indicated * by the MSRecord->encoding field. A Blockette 1000 will be added if * one is not present. * * The MSRecord->datasamples array and MSRecord->numsamples value will * not be changed by this routine. It is the responsibility of the * calling routine to adjust the data buffer if desired. * * As each record is filled and finished they are passed to * record_handler which expects 1) a char * to the record, 2) the * length of the record and 3) a pointer supplied by the original * caller containing optional private data (handlerdata). It is the * responsibility of record_handler to process the record, the memory * will be re-used or freed when record_handler returns. * * If the flush flag != 0 all of the data will be packed into data * records even though the last one will probably not be filled. * * Default values are: data record & quality indicator = 'D', record * length = 4096, encoding = 11 (Steim2) and byteorder = 1 (MSBF). * The defaults are triggered when the the msr->dataquality is 0 or * msr->reclen, msr->encoding and msr->byteorder are -1 respectively. * * Returns the number of records created on success and -1 on error. ***************************************************************************/ int msr_pack (MSRecord *msr, void (*record_handler) (char *, int, void *), void *handlerdata, int64_t *packedsamples, flag flush, flag verbose) { uint16_t *HPnumsamples; uint16_t *HPdataoffset; struct blkt_1001_s *HPblkt1001 = NULL; char *rawrec; char *envvariable; char srcname[50]; flag headerswapflag = 0; flag dataswapflag = 0; int samplesize; int headerlen; int dataoffset; int maxdatabytes; int maxsamples; int recordcnt = 0; int packsamples, packoffset; int64_t totalpackedsamples; hptime_t segstarttime; if (!msr) return -1; if (!record_handler) { ms_log (2, "msr_pack(): record_handler() function pointer not set!\n"); return -1; } /* Allocate stream processing state space if needed */ if (!msr->ststate) { msr->ststate = (StreamState *)malloc (sizeof (StreamState)); if (!msr->ststate) { ms_log (2, "msr_pack(): Could not allocate memory for StreamState\n"); return -1; } memset (msr->ststate, 0, sizeof (StreamState)); } /* Generate source name for MSRecord */ if (msr_srcname (msr, srcname, 1) == NULL) { ms_log (2, "msr_unpack_data(): Cannot generate srcname\n"); return MS_GENERROR; } /* Track original segment start time for new start time calculation */ segstarttime = msr->starttime; /* Read possible environmental variables that force byteorder */ if (packheaderbyteorder == -2) { if ((envvariable = getenv ("PACK_HEADER_BYTEORDER"))) { if (*envvariable != '0' && *envvariable != '1') { ms_log (2, "Environment variable PACK_HEADER_BYTEORDER must be set to '0' or '1'\n"); return -1; } else if (*envvariable == '0') { packheaderbyteorder = 0; if (verbose > 2) ms_log (1, "PACK_HEADER_BYTEORDER=0, packing little-endian header\n"); } else { packheaderbyteorder = 1; if (verbose > 2) ms_log (1, "PACK_HEADER_BYTEORDER=1, packing big-endian header\n"); } } else { packheaderbyteorder = -1; } } if (packdatabyteorder == -2) { if ((envvariable = getenv ("PACK_DATA_BYTEORDER"))) { if (*envvariable != '0' && *envvariable != '1') { ms_log (2, "Environment variable PACK_DATA_BYTEORDER must be set to '0' or '1'\n"); return -1; } else if (*envvariable == '0') { packdatabyteorder = 0; if (verbose > 2) ms_log (1, "PACK_DATA_BYTEORDER=0, packing little-endian data samples\n"); } else { packdatabyteorder = 1; if (verbose > 2) ms_log (1, "PACK_DATA_BYTEORDER=1, packing big-endian data samples\n"); } } else { packdatabyteorder = -1; } } /* Set default indicator, record length, byte order and encoding if needed */ if (msr->dataquality == 0) msr->dataquality = 'D'; if (msr->reclen == -1) msr->reclen = 4096; if (msr->byteorder == -1) msr->byteorder = 1; if (msr->encoding == -1) msr->encoding = DE_STEIM2; /* Cleanup/reset sequence number */ if (msr->sequence_number <= 0 || msr->sequence_number > 999999) msr->sequence_number = 1; if (msr->reclen < MINRECLEN || msr->reclen > MAXRECLEN) { ms_log (2, "msr_pack(%s): Record length is out of range: %d\n", srcname, msr->reclen); return -1; } if (msr->numsamples <= 0) { ms_log (2, "msr_pack(%s): No samples to pack\n", srcname); return -1; } samplesize = ms_samplesize (msr->sampletype); if (!samplesize) { ms_log (2, "msr_pack(%s): Unknown sample type '%c'\n", srcname, msr->sampletype); return -1; } /* Sanity check for msr/quality indicator */ if (!MS_ISDATAINDICATOR (msr->dataquality)) { ms_log (2, "msr_pack(%s): Record header & quality indicator unrecognized: '%c'\n", srcname, msr->dataquality); ms_log (2, "msr_pack(%s): Packing failed.\n", srcname); return -1; } /* Allocate space for data record */ rawrec = (char *)malloc (msr->reclen); if (rawrec == NULL) { ms_log (2, "msr_pack(%s): Cannot allocate memory\n", srcname); return -1; } /* Set header pointers to known offsets into FSDH */ HPnumsamples = (uint16_t *)(rawrec + 30); HPdataoffset = (uint16_t *)(rawrec + 44); /* Check to see if byte swapping is needed */ if (msr->byteorder != ms_bigendianhost ()) headerswapflag = dataswapflag = 1; /* Check if byte order is forced */ if (packheaderbyteorder >= 0) { headerswapflag = (msr->byteorder != packheaderbyteorder) ? 1 : 0; } if (packdatabyteorder >= 0) { dataswapflag = (msr->byteorder != packdatabyteorder) ? 1 : 0; } if (verbose > 2) { if (headerswapflag && dataswapflag) ms_log (1, "%s: Byte swapping needed for packing of header and data samples\n", srcname); else if (headerswapflag) ms_log (1, "%s: Byte swapping needed for packing of header\n", srcname); else if (dataswapflag) ms_log (1, "%s: Byte swapping needed for packing of data samples\n", srcname); else ms_log (1, "%s: Byte swapping NOT needed for packing\n", srcname); } /* Add a blank 1000 Blockette if one is not present, the blockette values will be populated in msr_pack_header_raw()/msr_normalize_header() */ if (!msr->Blkt1000) { struct blkt_1000_s blkt1000; memset (&blkt1000, 0, sizeof (struct blkt_1000_s)); if (verbose > 2) ms_log (1, "%s: Adding 1000 Blockette\n", srcname); if (!msr_addblockette (msr, (char *)&blkt1000, sizeof (struct blkt_1000_s), 1000, 0)) { ms_log (2, "msr_pack(%s): Error adding 1000 Blockette\n", srcname); free (rawrec); return -1; } } headerlen = msr_pack_header_raw (msr, rawrec, msr->reclen, headerswapflag, 1, &HPblkt1001, srcname, verbose); if (headerlen == -1) { ms_log (2, "msr_pack(%s): Error packing header\n", srcname); free (rawrec); return -1; } /* Determine offset to encoded data */ if (msr->encoding == DE_STEIM1 || msr->encoding == DE_STEIM2) { dataoffset = 64; while (dataoffset < headerlen) dataoffset += 64; /* Zero memory between blockettes and data if any */ memset (rawrec + headerlen, 0, dataoffset - headerlen); } else { dataoffset = headerlen; } *HPdataoffset = (uint16_t)dataoffset; if (headerswapflag) ms_gswap2 (HPdataoffset); /* Determine the max data bytes and sample count */ maxdatabytes = msr->reclen - dataoffset; if (msr->encoding == DE_STEIM1) { maxsamples = (int)(maxdatabytes / 64) * STEIM1_FRAME_MAX_SAMPLES; } else if (msr->encoding == DE_STEIM2) { maxsamples = (int)(maxdatabytes / 64) * STEIM2_FRAME_MAX_SAMPLES; } else { maxsamples = maxdatabytes / samplesize; } /* Pack samples into records */ *HPnumsamples = 0; totalpackedsamples = 0; packoffset = 0; if (packedsamples) *packedsamples = 0; while ((msr->numsamples - totalpackedsamples) > maxsamples || flush) { packsamples = msr_pack_data (rawrec + dataoffset, (char *)msr->datasamples + packoffset, (int)(msr->numsamples - totalpackedsamples), maxdatabytes, &msr->ststate->lastintsample, msr->ststate->comphistory, msr->sampletype, msr->encoding, dataswapflag, srcname, verbose); if (packsamples < 0) { ms_log (2, "msr_pack(%s): Error packing data samples\n", srcname); free (rawrec); return -1; } packoffset += packsamples * samplesize; /* Update number of samples */ *HPnumsamples = (uint16_t)packsamples; if (headerswapflag) ms_gswap2 (HPnumsamples); if (verbose > 0) ms_log (1, "%s: Packed %d samples\n", srcname, packsamples); /* Send record to handler */ record_handler (rawrec, msr->reclen, handlerdata); totalpackedsamples += packsamples; if (packedsamples) *packedsamples = totalpackedsamples; msr->ststate->packedsamples += packsamples; /* Update record header for next record */ msr->sequence_number = (msr->sequence_number >= 999999) ? 1 : msr->sequence_number + 1; if (msr->samprate > 0) msr->starttime = segstarttime + (hptime_t) (totalpackedsamples / msr->samprate * HPTMODULUS + 0.5); msr_update_header (msr, rawrec, headerswapflag, HPblkt1001, srcname, verbose); recordcnt++; msr->ststate->packedrecords++; /* Set compression history flag for subsequent records (Steim encodings) */ if (!msr->ststate->comphistory) msr->ststate->comphistory = 1; if (totalpackedsamples >= msr->numsamples) break; } if (verbose > 2) ms_log (1, "%s: Packed %d total samples\n", srcname, totalpackedsamples); free (rawrec); return recordcnt; } /* End of msr_pack() */ /*************************************************************************** * msr_pack_header: * * Pack data header/blockettes into the SEED record at * MSRecord->record. Unlike msr_pack no default values are applied, * the header structures are expected to be self describing and no * Blockette 1000 will be added. This routine is only useful for * re-packing a record header. * * Returns the header length in bytes on success and -1 on error. ***************************************************************************/ int msr_pack_header (MSRecord *msr, flag normalize, flag verbose) { char srcname[50]; char *envvariable; flag headerswapflag = 0; int headerlen; int maxheaderlen; if (!msr) return -1; /* Generate source name for MSRecord */ if (msr_srcname (msr, srcname, 1) == NULL) { ms_log (2, "msr_unpack_data(): Cannot generate srcname\n"); return MS_GENERROR; } /* Read possible environmental variables that force byteorder */ if (packheaderbyteorder == -2) { if ((envvariable = getenv ("PACK_HEADER_BYTEORDER"))) { if (*envvariable != '0' && *envvariable != '1') { ms_log (2, "Environment variable PACK_HEADER_BYTEORDER must be set to '0' or '1'\n"); return -1; } else if (*envvariable == '0') { packheaderbyteorder = 0; if (verbose > 2) ms_log (1, "PACK_HEADER_BYTEORDER=0, packing little-endian header\n"); } else { packheaderbyteorder = 1; if (verbose > 2) ms_log (1, "PACK_HEADER_BYTEORDER=1, packing big-endian header\n"); } } else { packheaderbyteorder = -1; } } if (msr->reclen < MINRECLEN || msr->reclen > MAXRECLEN) { ms_log (2, "msr_pack_header(%s): record length is out of range: %d\n", srcname, msr->reclen); return -1; } if (msr->byteorder != 0 && msr->byteorder != 1) { ms_log (2, "msr_pack_header(%s): byte order is not defined correctly: %d\n", srcname, msr->byteorder); return -1; } if (msr->fsdh) { maxheaderlen = (msr->fsdh->data_offset > 0) ? msr->fsdh->data_offset : msr->reclen; } else { maxheaderlen = msr->reclen; } /* Check to see if byte swapping is needed */ if (msr->byteorder != ms_bigendianhost ()) headerswapflag = 1; /* Check if byte order is forced */ if (packheaderbyteorder >= 0) { headerswapflag = (msr->byteorder != packheaderbyteorder) ? 1 : 0; } if (verbose > 2) { if (headerswapflag) ms_log (1, "%s: Byte swapping needed for packing of header\n", srcname); else ms_log (1, "%s: Byte swapping NOT needed for packing of header\n", srcname); } headerlen = msr_pack_header_raw (msr, msr->record, maxheaderlen, headerswapflag, normalize, NULL, srcname, verbose); return headerlen; } /* End of msr_pack_header() */ /*************************************************************************** * msr_pack_header_raw: * * Pack data header/blockettes into the specified SEED data record. * * Returns the header length in bytes on success or -1 on error. ***************************************************************************/ static int msr_pack_header_raw (MSRecord *msr, char *rawrec, int maxheaderlen, flag swapflag, flag normalize, struct blkt_1001_s **blkt1001, char *srcname, flag verbose) { struct blkt_link_s *cur_blkt; struct fsdh_s *fsdh; int16_t offset; int blktcnt = 0; int nextoffset; if (!msr || !rawrec) return -1; /* Make sure a fixed section of data header is available */ if (!msr->fsdh) { msr->fsdh = (struct fsdh_s *)calloc (1, sizeof (struct fsdh_s)); if (msr->fsdh == NULL) { ms_log (2, "msr_pack_header_raw(%s): Cannot allocate memory\n", srcname); return -1; } } /* Update the SEED structures associated with the MSRecord */ if (normalize) if (msr_normalize_header (msr, verbose) < 0) { ms_log (2, "msr_pack_header_raw(%s): error normalizing header values\n", srcname); return -1; } if (verbose > 2) ms_log (1, "%s: Packing fixed section of data header\n", srcname); if (maxheaderlen > msr->reclen) { ms_log (2, "msr_pack_header_raw(%s): maxheaderlen of %d is beyond record length of %d\n", srcname, maxheaderlen, msr->reclen); return -1; } if (maxheaderlen < (int)sizeof (struct fsdh_s)) { ms_log (2, "msr_pack_header_raw(%s): maxheaderlen of %d is too small, must be >= %d\n", srcname, maxheaderlen, sizeof (struct fsdh_s)); return -1; } fsdh = (struct fsdh_s *)rawrec; offset = 48; /* Roll-over sequence number if necessary */ if (msr->sequence_number > 999999) msr->sequence_number = 1; /* Copy FSDH associated with the MSRecord into the record */ memcpy (fsdh, msr->fsdh, sizeof (struct fsdh_s)); /* Swap byte order? */ if (swapflag) { MS_SWAPBTIME (&fsdh->start_time); ms_gswap2 (&fsdh->numsamples); ms_gswap2 (&fsdh->samprate_fact); ms_gswap2 (&fsdh->samprate_mult); ms_gswap4 (&fsdh->time_correct); ms_gswap2 (&fsdh->data_offset); ms_gswap2 (&fsdh->blockette_offset); } /* Traverse blockette chain and pack blockettes at 'offset' */ cur_blkt = msr->blkts; while (cur_blkt && offset < maxheaderlen) { /* Check that the blockette fits */ if ((offset + 4 + cur_blkt->blktdatalen) > maxheaderlen) { ms_log (2, "msr_pack_header_raw(%s): header exceeds maxheaderlen of %d\n", srcname, maxheaderlen); break; } /* Pack blockette type and leave space for next offset */ memcpy (rawrec + offset, &cur_blkt->blkt_type, 2); if (swapflag) ms_gswap2 (rawrec + offset); nextoffset = offset + 2; offset += 4; if (cur_blkt->blkt_type == 100) { struct blkt_100_s *blkt_100 = (struct blkt_100_s *)(rawrec + offset); memcpy (blkt_100, cur_blkt->blktdata, sizeof (struct blkt_100_s)); offset += sizeof (struct blkt_100_s); if (swapflag) { ms_gswap4 (&blkt_100->samprate); } } else if (cur_blkt->blkt_type == 200) { struct blkt_200_s *blkt_200 = (struct blkt_200_s *)(rawrec + offset); memcpy (blkt_200, cur_blkt->blktdata, sizeof (struct blkt_200_s)); offset += sizeof (struct blkt_200_s); if (swapflag) { ms_gswap4 (&blkt_200->amplitude); ms_gswap4 (&blkt_200->period); ms_gswap4 (&blkt_200->background_estimate); MS_SWAPBTIME (&blkt_200->time); } } else if (cur_blkt->blkt_type == 201) { struct blkt_201_s *blkt_201 = (struct blkt_201_s *)(rawrec + offset); memcpy (blkt_201, cur_blkt->blktdata, sizeof (struct blkt_201_s)); offset += sizeof (struct blkt_201_s); if (swapflag) { ms_gswap4 (&blkt_201->amplitude); ms_gswap4 (&blkt_201->period); ms_gswap4 (&blkt_201->background_estimate); MS_SWAPBTIME (&blkt_201->time); } } else if (cur_blkt->blkt_type == 300) { struct blkt_300_s *blkt_300 = (struct blkt_300_s *)(rawrec + offset); memcpy (blkt_300, cur_blkt->blktdata, sizeof (struct blkt_300_s)); offset += sizeof (struct blkt_300_s); if (swapflag) { MS_SWAPBTIME (&blkt_300->time); ms_gswap4 (&blkt_300->step_duration); ms_gswap4 (&blkt_300->interval_duration); ms_gswap4 (&blkt_300->amplitude); ms_gswap4 (&blkt_300->reference_amplitude); } } else if (cur_blkt->blkt_type == 310) { struct blkt_310_s *blkt_310 = (struct blkt_310_s *)(rawrec + offset); memcpy (blkt_310, cur_blkt->blktdata, sizeof (struct blkt_310_s)); offset += sizeof (struct blkt_310_s); if (swapflag) { MS_SWAPBTIME (&blkt_310->time); ms_gswap4 (&blkt_310->duration); ms_gswap4 (&blkt_310->period); ms_gswap4 (&blkt_310->amplitude); ms_gswap4 (&blkt_310->reference_amplitude); } } else if (cur_blkt->blkt_type == 320) { struct blkt_320_s *blkt_320 = (struct blkt_320_s *)(rawrec + offset); memcpy (blkt_320, cur_blkt->blktdata, sizeof (struct blkt_320_s)); offset += sizeof (struct blkt_320_s); if (swapflag) { MS_SWAPBTIME (&blkt_320->time); ms_gswap4 (&blkt_320->duration); ms_gswap4 (&blkt_320->ptp_amplitude); ms_gswap4 (&blkt_320->reference_amplitude); } } else if (cur_blkt->blkt_type == 390) { struct blkt_390_s *blkt_390 = (struct blkt_390_s *)(rawrec + offset); memcpy (blkt_390, cur_blkt->blktdata, sizeof (struct blkt_390_s)); offset += sizeof (struct blkt_390_s); if (swapflag) { MS_SWAPBTIME (&blkt_390->time); ms_gswap4 (&blkt_390->duration); ms_gswap4 (&blkt_390->amplitude); } } else if (cur_blkt->blkt_type == 395) { struct blkt_395_s *blkt_395 = (struct blkt_395_s *)(rawrec + offset); memcpy (blkt_395, cur_blkt->blktdata, sizeof (struct blkt_395_s)); offset += sizeof (struct blkt_395_s); if (swapflag) { MS_SWAPBTIME (&blkt_395->time); } } else if (cur_blkt->blkt_type == 400) { struct blkt_400_s *blkt_400 = (struct blkt_400_s *)(rawrec + offset); memcpy (blkt_400, cur_blkt->blktdata, sizeof (struct blkt_400_s)); offset += sizeof (struct blkt_400_s); if (swapflag) { ms_gswap4 (&blkt_400->azimuth); ms_gswap4 (&blkt_400->slowness); ms_gswap2 (&blkt_400->configuration); } } else if (cur_blkt->blkt_type == 405) { struct blkt_405_s *blkt_405 = (struct blkt_405_s *)(rawrec + offset); memcpy (blkt_405, cur_blkt->blktdata, sizeof (struct blkt_405_s)); offset += sizeof (struct blkt_405_s); if (swapflag) { ms_gswap2 (&blkt_405->delay_values); } if (verbose > 0) { ms_log (1, "msr_pack_header_raw(%s): WARNING Blockette 405 cannot be fully supported\n", srcname); } } else if (cur_blkt->blkt_type == 500) { struct blkt_500_s *blkt_500 = (struct blkt_500_s *)(rawrec + offset); memcpy (blkt_500, cur_blkt->blktdata, sizeof (struct blkt_500_s)); offset += sizeof (struct blkt_500_s); if (swapflag) { ms_gswap4 (&blkt_500->vco_correction); MS_SWAPBTIME (&blkt_500->time); ms_gswap4 (&blkt_500->exception_count); } } else if (cur_blkt->blkt_type == 1000) { struct blkt_1000_s *blkt_1000 = (struct blkt_1000_s *)(rawrec + offset); memcpy (blkt_1000, cur_blkt->blktdata, sizeof (struct blkt_1000_s)); offset += sizeof (struct blkt_1000_s); /* This guarantees that the byte order is in sync with msr_pack() */ if (packdatabyteorder >= 0) blkt_1000->byteorder = packdatabyteorder; } else if (cur_blkt->blkt_type == 1001) { struct blkt_1001_s *blkt_1001 = (struct blkt_1001_s *)(rawrec + offset); memcpy (blkt_1001, cur_blkt->blktdata, sizeof (struct blkt_1001_s)); offset += sizeof (struct blkt_1001_s); /* Track location of Blockette 1001 if requested */ if (blkt1001) *blkt1001 = blkt_1001; } else if (cur_blkt->blkt_type == 2000) { struct blkt_2000_s *blkt_2000 = (struct blkt_2000_s *)(rawrec + offset); memcpy (blkt_2000, cur_blkt->blktdata, cur_blkt->blktdatalen); offset += cur_blkt->blktdatalen; if (swapflag) { ms_gswap2 (&blkt_2000->length); ms_gswap2 (&blkt_2000->data_offset); ms_gswap4 (&blkt_2000->recnum); } /* Nothing done to pack the opaque headers and data, they should already be packed into the blockette payload */ } else { memcpy (rawrec + offset, cur_blkt->blktdata, cur_blkt->blktdatalen); offset += cur_blkt->blktdatalen; } /* Pack the offset to the next blockette */ if (cur_blkt->next) { memcpy (rawrec + nextoffset, &offset, 2); if (swapflag) ms_gswap2 (rawrec + nextoffset); } else { memset (rawrec + nextoffset, 0, 2); } blktcnt++; cur_blkt = cur_blkt->next; } fsdh->numblockettes = blktcnt; if (verbose > 2) ms_log (1, "%s: Packed %d blockettes\n", srcname, blktcnt); return offset; } /* End of msr_pack_header_raw() */ /*************************************************************************** * msr_update_header: * * Update the header values that change between records: start time, * sequence number, etc. * * Returns 0 on success or -1 on error. ***************************************************************************/ static int msr_update_header (MSRecord *msr, char *rawrec, flag swapflag, struct blkt_1001_s *blkt1001, char *srcname, flag verbose) { struct fsdh_s *fsdh; hptime_t hptimems; int8_t usecoffset; char seqnum[16]; if (!msr || !rawrec) return -1; if (verbose > 2) ms_log (1, "%s: Updating fixed section of data header\n", srcname); fsdh = (struct fsdh_s *)rawrec; /* Pack values into the fixed section of header */ snprintf (seqnum, sizeof(seqnum), "%06d", msr->sequence_number); memcpy (fsdh->sequence_number, seqnum, 6); /* Get start time rounded to tenths of milliseconds and microsecond offset */ ms_hptime2tomsusecoffset (msr->starttime, &hptimems, &usecoffset); /* Update fixed-section start time */ ms_hptime2btime (hptimems, &(fsdh->start_time)); /* Swap byte order? */ if (swapflag) { MS_SWAPBTIME (&fsdh->start_time); } /* Update microsecond offset value if Blockette 1001 is present */ if (msr->Blkt1001 && blkt1001) { /* Update microseconds offset in blockette chain entry */ msr->Blkt1001->usec = usecoffset; /* Update microseconds offset in packed header */ blkt1001->usec = usecoffset; } return 0; } /* End of msr_update_header() */ /************************************************************************ * msr_pack_data: * * Pack Mini-SEED data samples. The input data samples specified as * 'src' will be packed with 'encoding' format and placed in 'dest'. * * If a pointer to a 32-bit integer sample is provided in the * argument 'lastintsample' and 'comphistory' is true the sample * value will be used to seed the difference buffer for Steim1/2 * encoding and provide a compression history. It will also be * updated with the last sample packed in order to be used with a * subsequent call to this routine. * * Return number of samples packed on success and a negative on error. ************************************************************************/ static int msr_pack_data (void *dest, void *src, int maxsamples, int maxdatabytes, int32_t *lastintsample, flag comphistory, char sampletype, flag encoding, flag swapflag, char *srcname, flag verbose) { int nsamples; int32_t *intbuff; int32_t d0; /* Check for encode debugging environment variable */ if (getenv ("ENCODE_DEBUG")) encodedebug = 1; /* Decide if this is a format that we can encode */ switch (encoding) { case DE_ASCII: if (sampletype != 'a') { ms_log (2, "%s: Sample type must be ascii (a) for ASCII text encoding not '%c'\n", srcname, sampletype); return -1; } if (verbose > 1) ms_log (1, "%s: Packing ASCII data\n", srcname); nsamples = msr_encode_text (src, maxsamples, dest, maxdatabytes); break; case DE_INT16: if (sampletype != 'i') { ms_log (2, "%s: Sample type must be integer (i) for INT16 encoding not '%c'\n", srcname, sampletype); return -1; } if (verbose > 1) ms_log (1, "%s: Packing INT16 data samples\n", srcname); nsamples = msr_encode_int16 (src, maxsamples, dest, maxdatabytes, swapflag); break; case DE_INT32: if (sampletype != 'i') { ms_log (2, "%s: Sample type must be integer (i) for INT32 encoding not '%c'\n", srcname, sampletype); return -1; } if (verbose > 1) ms_log (1, "%s: Packing INT32 data samples\n", srcname); nsamples = msr_encode_int32 (src, maxsamples, dest, maxdatabytes, swapflag); break; case DE_FLOAT32: if (sampletype != 'f') { ms_log (2, "%s: Sample type must be float (f) for FLOAT32 encoding not '%c'\n", srcname, sampletype); return -1; } if (verbose > 1) ms_log (1, "%s: Packing FLOAT32 data samples\n", srcname); nsamples = msr_encode_float32 (src, maxsamples, dest, maxdatabytes, swapflag); break; case DE_FLOAT64: if (sampletype != 'd') { ms_log (2, "%s: Sample type must be double (d) for FLOAT64 encoding not '%c'\n", srcname, sampletype); return -1; } if (verbose > 1) ms_log (1, "%s: Packing FLOAT64 data samples\n", srcname); nsamples = msr_encode_float64 (src, maxsamples, dest, maxdatabytes, swapflag); break; case DE_STEIM1: if (sampletype != 'i') { ms_log (2, "%s: Sample type must be integer (i) for Steim1 compression not '%c'\n", srcname, sampletype); return -1; } intbuff = (int32_t *)src; /* If a previous sample is supplied use it for compression history otherwise cold-start */ d0 = (lastintsample && comphistory) ? (intbuff[0] - *lastintsample) : 0; if (verbose > 1) ms_log (1, "%s: Packing Steim1 data frames\n", srcname); nsamples = msr_encode_steim1 (src, maxsamples, dest, maxdatabytes, d0, swapflag); /* If a previous sample is supplied update it with the last sample value */ if (lastintsample && nsamples > 0) *lastintsample = intbuff[nsamples - 1]; break; case DE_STEIM2: if (sampletype != 'i') { ms_log (2, "%s: Sample type must be integer (i) for Steim2 compression not '%c'\n", srcname, sampletype); return -1; } intbuff = (int32_t *)src; /* If a previous sample is supplied use it for compression history otherwise cold-start */ d0 = (lastintsample && comphistory) ? (intbuff[0] - *lastintsample) : 0; if (verbose > 1) ms_log (1, "%s: Packing Steim2 data frames\n", srcname); nsamples = msr_encode_steim2 (src, maxsamples, dest, maxdatabytes, d0, srcname, swapflag); /* If a previous sample is supplied update it with the last sample value */ if (lastintsample && nsamples > 0) *lastintsample = intbuff[nsamples - 1]; break; default: ms_log (2, "%s: Unable to pack format %d\n", srcname, encoding); return -1; } return nsamples; } /* End of msr_pack_data() */ iris-edu-libmseed-4314359/packdata.c000066400000000000000000000527051422047135100171370ustar00rootroot00000000000000/*********************************************************************** * Routines for packing text/ASCII, INT_16, INT_32, FLOAT_32, FLOAT_64, * STEIM1 and STEIM2 data records. * * modified: 2017.053 ************************************************************************/ #include #include #include #include "libmseed.h" #include "packdata.h" /* Control for printing debugging information */ int encodedebug = 0; /************************************************************************ * msr_encode_text: * * Encode text data and place in supplied buffer. Pad any space * remaining in output buffer with zeros. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_text (char *input, int samplecount, char *output, int outputlength) { int length; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; /* Determine minimum of input or output */ length = (samplecount < outputlength) ? samplecount : outputlength; memcpy (output, input, length); outputlength -= length; if (outputlength > 0) memset (output + length, 0, outputlength); return length; } /* End of msr_encode_text() */ /************************************************************************ * msr_encode_int16: * * Encode 16-bit integer data from an array of 32-bit integers and * place in supplied buffer. Swap if requested. Pad any space * remaining in output buffer with zeros. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_int16 (int32_t *input, int samplecount, int16_t *output, int outputlength, int swapflag) { int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int16_t); idx++) { output[idx] = (int16_t)input[idx]; if (swapflag) ms_gswap2 (&output[idx]); outputlength -= sizeof (int16_t); } if (outputlength) memset (&output[idx], 0, outputlength); return idx; } /* End of msr_encode_int16() */ /************************************************************************ * msr_encode_int32: * * Encode 32-bit integer data from an array of 32-bit integers and * place in supplied buffer. Swap if requested. Pad any space * remaining in output buffer with zeros. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_int32 (int32_t *input, int samplecount, int32_t *output, int outputlength, int swapflag) { int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { output[idx] = input[idx]; if (swapflag) ms_gswap4 (&output[idx]); outputlength -= sizeof (int32_t); } if (outputlength) memset (&output[idx], 0, outputlength); return idx; } /* End of msr_encode_int32() */ /************************************************************************ * msr_encode_float32: * * Encode 32-bit float data from an array of 32-bit floats and place * in supplied buffer. Swap if requested. Pad any space remaining in * output buffer with zeros. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_float32 (float *input, int samplecount, float *output, int outputlength, int swapflag) { int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (float); idx++) { output[idx] = input[idx]; if (swapflag) ms_gswap4 (&output[idx]); outputlength -= sizeof (float); } if (outputlength) memset (&output[idx], 0, outputlength); return idx; } /* End of msr_encode_float32() */ /************************************************************************ * msr_encode_float64: * * Encode 64-bit float data from an array of 64-bit doubles and place * in supplied buffer. Swap if requested. Pad any space remaining in * output buffer with zeros. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_float64 (double *input, int samplecount, double *output, int outputlength, int swapflag) { int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (double); idx++) { output[idx] = input[idx]; if (swapflag) ms_gswap8 (&output[idx]); outputlength -= sizeof (double); } if (outputlength) memset (&output[idx], 0, outputlength); return idx; } /* End of msr_encode_float64() */ /* Macro to determine number of bits needed to represent VALUE in * the following bit widths: 4,5,6,8,10,15,16,30,32 and set RESULT. */ #define BITWIDTH(VALUE, RESULT) \ if (VALUE >= -8 && VALUE <= 7) \ RESULT = 4; \ else if (VALUE >= -16 && VALUE <= 15) \ RESULT = 5; \ else if (VALUE >= -32 && VALUE <= 31) \ RESULT = 6; \ else if (VALUE >= -128 && VALUE <= 127) \ RESULT = 8; \ else if (VALUE >= -512 && VALUE <= 511) \ RESULT = 10; \ else if (VALUE >= -16384 && VALUE <= 16383) \ RESULT = 15; \ else if (VALUE >= -32768 && VALUE <= 32767) \ RESULT = 16; \ else if (VALUE >= -536870912 && VALUE <= 536870911) \ RESULT = 30; \ else \ RESULT = 32; /************************************************************************ * msr_encode_steim1: * * Encode Steim1 data frames from an array of 32-bit integers and * place in supplied buffer. Swap if requested. Pad any space * remaining in output buffer with zeros. * * diff0 is the first difference in the sequence and relates the first * sample to the sample previous to it (not available to this * function). It should be set to 0 if this value is not known. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_steim1 (int32_t *input, int samplecount, int32_t *output, int outputlength, int32_t diff0, int swapflag) { int32_t *frameptr; /* Frame pointer in output */ int32_t *Xnp = NULL; /* Reverse integration constant, aka last sample */ int32_t diffs[4]; int32_t bitwidth[4]; int diffcount = 0; int inputidx = 0; int outputsamples = 0; int maxframes = outputlength / 64; int packedsamples = 0; int frameidx; int startnibble; int widx; int idx; union dword { int8_t d8[4]; int16_t d16[2]; int32_t d32; } * word; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; if (encodedebug) ms_log (1, "Encoding Steim1 frames, samples: %d, max frames: %d, swapflag: %d\n", samplecount, maxframes, swapflag); /* Add first difference to buffers */ diffs[0] = diff0; BITWIDTH (diffs[0], bitwidth[0]); diffcount = 1; for (frameidx = 0; frameidx < maxframes && outputsamples < samplecount; frameidx++) { frameptr = output + (16 * frameidx); /* Set 64-byte frame to 0's */ memset (frameptr, 0, 64); /* Save forward integration constant (X0), pointer to reverse integration constant (Xn) * and set the starting nibble index depending on frame. */ if (frameidx == 0) { frameptr[1] = input[0]; if (encodedebug) ms_log (1, "Frame %d: X0=%d\n", frameidx, frameptr[1]); if (swapflag) ms_gswap4 (&frameptr[1]); Xnp = &frameptr[2]; startnibble = 3; /* First frame: skip nibbles, X0, and Xn */ } else { startnibble = 1; /* Subsequent frames: skip nibbles */ if (encodedebug) ms_log (1, "Frame %d\n", frameidx); } for (widx = startnibble; widx < 16 && outputsamples < samplecount; widx++) { if (diffcount < 4) { /* Shift diffs and related bit widths to beginning of buffers */ for (idx = 0; idx < diffcount; idx++) { diffs[idx] = diffs[packedsamples + idx]; bitwidth[idx] = bitwidth[packedsamples + idx]; } /* Add new diffs and determine bit width needed to represent */ for (idx = diffcount; idx < 4 && inputidx < (samplecount - 1); idx++, inputidx++) { diffs[idx] = *(input + inputidx + 1) - *(input + inputidx); BITWIDTH (diffs[idx], bitwidth[idx]); diffcount++; } } /* Determine optimal packing by checking, in-order: * 4 x 8-bit differences * 2 x 16-bit differences * 1 x 32-bit difference */ word = (union dword *)&frameptr[widx]; packedsamples = 0; /* 4 x 8-bit differences */ if (diffcount == 4 && bitwidth[0] <= 8 && bitwidth[1] <= 8 && bitwidth[2] <= 8 && bitwidth[3] <= 8) { if (encodedebug) ms_log (1, " W%02d: 01=4x8b %d %d %d %d\n", widx, diffs[0], diffs[1], diffs[2], diffs[3]); word->d8[0] = diffs[0]; word->d8[1] = diffs[1]; word->d8[2] = diffs[2]; word->d8[3] = diffs[3]; /* 2-bit nibble is 0b01 (0x1) */ frameptr[0] |= 0x1ul << (30 - 2 * widx); packedsamples = 4; } /* 2 x 16-bit differences */ else if (diffcount >= 2 && bitwidth[0] <= 16 && bitwidth[1] <= 16) { if (encodedebug) ms_log (1, " W%02d: 2=2x16b %d %d\n", widx, diffs[0], diffs[1]); word->d16[0] = diffs[0]; word->d16[1] = diffs[1]; if (swapflag) { ms_gswap2 (&word->d16[0]); ms_gswap2 (&word->d16[1]); } /* 2-bit nibble is 0b10 (0x2) */ frameptr[0] |= 0x2ul << (30 - 2 * widx); packedsamples = 2; } /* 1 x 32-bit difference */ else { if (encodedebug) ms_log (1, " W%02d: 3=1x32b %d\n", widx, diffs[0]); frameptr[widx] = diffs[0]; if (swapflag) ms_gswap4 (&frameptr[widx]); /* 2-bit nibble is 0b11 (0x3) */ frameptr[0] |= 0x3ul << (30 - 2 * widx); packedsamples = 1; } diffcount -= packedsamples; outputsamples += packedsamples; } /* Done with words in frame */ /* Swap word with nibbles */ if (swapflag) ms_gswap4 (&frameptr[0]); } /* Done with frames */ /* Set Xn (reverse integration constant) in first frame to last sample */ if (Xnp) *Xnp = *(input + outputsamples - 1); if (swapflag) ms_gswap4 (Xnp); /* Pad any remaining bytes */ if ((frameidx * 64) < outputlength) memset (output + (frameidx * 16), 0, outputlength - (frameidx * 64)); return outputsamples; } /* End of msr_encode_steim1() */ /************************************************************************ * msr_encode_steim2: * * Encode Steim2 data frames from an array of 32-bit integers and * place in supplied buffer. Swap if requested. Pad any space * remaining in output buffer with zeros. * * diff0 is the first difference in the sequence and relates the first * sample to the sample previous to it (not available to this * function). It should be set to 0 if this value is not known. * * Return number of samples in output buffer on success, -1 on failure. ************************************************************************/ int msr_encode_steim2 (int32_t *input, int samplecount, int32_t *output, int outputlength, int32_t diff0, char *srcname, int swapflag) { uint32_t *frameptr; /* Frame pointer in output */ int32_t *Xnp = NULL; /* Reverse integration constant, aka last sample */ int32_t diffs[7]; int32_t bitwidth[7]; int diffcount = 0; int inputidx = 0; int outputsamples = 0; int maxframes = outputlength / 64; int packedsamples = 0; int frameidx; int startnibble; int widx; int idx; union dword { int8_t d8[4]; int16_t d16[2]; int32_t d32; } * word; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; if (encodedebug) ms_log (1, "Encoding Steim2 frames, samples: %d, max frames: %d, swapflag: %d\n", samplecount, maxframes, swapflag); /* Add first difference to buffers */ diffs[0] = diff0; BITWIDTH (diffs[0], bitwidth[0]); diffcount = 1; for (frameidx = 0; frameidx < maxframes && outputsamples < samplecount; frameidx++) { frameptr = (uint32_t *)output + (16 * frameidx); /* Set 64-byte frame to 0's */ memset (frameptr, 0, 64); /* Save forward integration constant (X0), pointer to reverse integration constant (Xn) * and set the starting nibble index depending on frame. */ if (frameidx == 0) { frameptr[1] = input[0]; if (encodedebug) ms_log (1, "Frame %d: X0=%d\n", frameidx, frameptr[1]); if (swapflag) ms_gswap4 (&frameptr[1]); Xnp = (int32_t *)&frameptr[2]; startnibble = 3; /* First frame: skip nibbles, X0, and Xn */ } else { startnibble = 1; /* Subsequent frames: skip nibbles */ if (encodedebug) ms_log (1, "Frame %d\n", frameidx); } for (widx = startnibble; widx < 16 && outputsamples < samplecount; widx++) { if (diffcount < 7) { /* Shift diffs and related bit widths to beginning of buffers */ for (idx = 0; idx < diffcount; idx++) { diffs[idx] = diffs[packedsamples + idx]; bitwidth[idx] = bitwidth[packedsamples + idx]; } /* Add new diffs and determine bit width needed to represent */ for (idx = diffcount; idx < 7 && inputidx < (samplecount - 1); idx++, inputidx++) { diffs[idx] = *(input + inputidx + 1) - *(input + inputidx); BITWIDTH (diffs[idx], bitwidth[idx]); diffcount++; } } /* Determine optimal packing by checking, in-order: * 7 x 4-bit differences * 6 x 5-bit differences * 5 x 6-bit differences * 4 x 8-bit differences * 3 x 10-bit differences * 2 x 15-bit differences * 1 x 30-bit difference */ packedsamples = 0; /* 7 x 4-bit differences */ if (diffcount == 7 && bitwidth[0] <= 4 && bitwidth[1] <= 4 && bitwidth[2] <= 4 && bitwidth[3] <= 4 && bitwidth[4] <= 4 && bitwidth[5] <= 4 && bitwidth[6] <= 4) { if (encodedebug) ms_log (1, " W%02d: 11,10=7x4b %d %d %d %d %d %d %d\n", widx, diffs[0], diffs[1], diffs[2], diffs[3], diffs[4], diffs[5], diffs[6]); /* Mask the values, shift to proper location and set in word */ frameptr[widx] = ((uint32_t)diffs[6] & 0xFul); frameptr[widx] |= ((uint32_t)diffs[5] & 0xFul) << 4; frameptr[widx] |= ((uint32_t)diffs[4] & 0xFul) << 8; frameptr[widx] |= ((uint32_t)diffs[3] & 0xFul) << 12; frameptr[widx] |= ((uint32_t)diffs[2] & 0xFul) << 16; frameptr[widx] |= ((uint32_t)diffs[1] & 0xFul) << 20; frameptr[widx] |= ((uint32_t)diffs[0] & 0xFul) << 24; /* 2-bit decode nibble is 0b10 (0x2) */ frameptr[widx] |= 0x2ul << 30; /* 2-bit nibble is 0b11 (0x3) */ frameptr[0] |= 0x3ul << (30 - 2 * widx); packedsamples = 7; } /* 6 x 5-bit differences */ else if (diffcount >= 6 && bitwidth[0] <= 5 && bitwidth[1] <= 5 && bitwidth[2] <= 5 && bitwidth[3] <= 5 && bitwidth[4] <= 5 && bitwidth[5] <= 5) { if (encodedebug) ms_log (1, " W%02d: 11,01=6x5b %d %d %d %d %d %d\n", widx, diffs[0], diffs[1], diffs[2], diffs[3], diffs[4], diffs[5]); /* Mask the values, shift to proper location and set in word */ frameptr[widx] = ((uint32_t)diffs[5] & 0x1Ful); frameptr[widx] |= ((uint32_t)diffs[4] & 0x1Ful) << 5; frameptr[widx] |= ((uint32_t)diffs[3] & 0x1Ful) << 10; frameptr[widx] |= ((uint32_t)diffs[2] & 0x1Ful) << 15; frameptr[widx] |= ((uint32_t)diffs[1] & 0x1Ful) << 20; frameptr[widx] |= ((uint32_t)diffs[0] & 0x1Ful) << 25; /* 2-bit decode nibble is 0b01 (0x1) */ frameptr[widx] |= 0x1ul << 30; /* 2-bit nibble is 0b11 (0x3) */ frameptr[0] |= 0x3ul << (30 - 2 * widx); packedsamples = 6; } /* 5 x 6-bit differences */ else if (diffcount >= 5 && bitwidth[0] <= 6 && bitwidth[1] <= 6 && bitwidth[2] <= 6 && bitwidth[3] <= 6 && bitwidth[4] <= 6) { if (encodedebug) ms_log (1, " W%02d: 11,00=5x6b %d %d %d %d %d\n", widx, diffs[0], diffs[1], diffs[2], diffs[3], diffs[4]); /* Mask the values, shift to proper location and set in word */ frameptr[widx] = ((uint32_t)diffs[4] & 0x3Ful); frameptr[widx] |= ((uint32_t)diffs[3] & 0x3Ful) << 6; frameptr[widx] |= ((uint32_t)diffs[2] & 0x3Ful) << 12; frameptr[widx] |= ((uint32_t)diffs[1] & 0x3Ful) << 18; frameptr[widx] |= ((uint32_t)diffs[0] & 0x3Ful) << 24; /* 2-bit decode nibble is 0b00, nothing to set */ /* 2-bit nibble is 0b11 (0x3) */ frameptr[0] |= 0x3ul << (30 - 2 * widx); packedsamples = 5; } /* 4 x 8-bit differences */ else if (diffcount >= 4 && bitwidth[0] <= 8 && bitwidth[1] <= 8 && bitwidth[2] <= 8 && bitwidth[3] <= 8) { if (encodedebug) ms_log (1, " W%02d: 01=4x8b %d %d %d %d\n", widx, diffs[0], diffs[1], diffs[2], diffs[3]); word = (union dword *)&frameptr[widx]; word->d8[0] = diffs[0]; word->d8[1] = diffs[1]; word->d8[2] = diffs[2]; word->d8[3] = diffs[3]; /* 2-bit nibble is 0b01, only need to set 2nd bit */ frameptr[0] |= 0x1ul << (30 - 2 * widx); packedsamples = 4; } /* 3 x 10-bit differences */ else if (diffcount >= 3 && bitwidth[0] <= 10 && bitwidth[1] <= 10 && bitwidth[2] <= 10) { if (encodedebug) ms_log (1, " W%02d: 10,11=3x10b %d %d %d\n", widx, diffs[0], diffs[1], diffs[2]); /* Mask the values, shift to proper location and set in word */ frameptr[widx] = ((uint32_t)diffs[2] & 0x3FFul); frameptr[widx] |= ((uint32_t)diffs[1] & 0x3FFul) << 10; frameptr[widx] |= ((uint32_t)diffs[0] & 0x3FFul) << 20; /* 2-bit decode nibble is 0b11 (0x3) */ frameptr[widx] |= 0x3ul << 30; /* 2-bit nibble is 0b10 (0x2) */ frameptr[0] |= 0x2ul << (30 - 2 * widx); packedsamples = 3; } /* 2 x 15-bit differences */ else if (diffcount >= 2 && bitwidth[0] <= 15 && bitwidth[1] <= 15) { if (encodedebug) ms_log (1, " W%02d: 10,10=2x15b %d %d\n", widx, diffs[0], diffs[1]); /* Mask the values, shift to proper location and set in word */ frameptr[widx] = ((uint32_t)diffs[1] & 0x7FFFul); frameptr[widx] |= ((uint32_t)diffs[0] & 0x7FFFul) << 15; /* 2-bit decode nibble is 0b10 (0x2) */ frameptr[widx] |= 0x2ul << 30; /* 2-bit nibble is 0b10 (0x2) */ frameptr[0] |= 0x2ul << (30 - 2 * widx); packedsamples = 2; } /* 1 x 30-bit difference */ else if (diffcount >= 1 && bitwidth[0] <= 30) { if (encodedebug) ms_log (1, " W%02d: 10,01=1x30b %d\n", widx, diffs[0]); /* Mask the value and set in word */ frameptr[widx] = ((uint32_t)diffs[0] & 0x3FFFFFFFul); /* 2-bit decode nibble is 0b01 (0x1) */ frameptr[widx] |= 0x1ul << 30; /* 2-bit nibble is 0b10 (0x2) */ frameptr[0] |= 0x2ul << (30 - 2 * widx); packedsamples = 1; } else { ms_log (2, "msr_encode_steim2(%s): Unable to represent difference in <= 30 bits\n", srcname); return -1; } /* Swap encoded word except for 4x8-bit samples */ if (swapflag && packedsamples != 4) ms_gswap4 (&frameptr[widx]); diffcount -= packedsamples; outputsamples += packedsamples; } /* Done with words in frame */ /* Swap word with nibbles */ if (swapflag) ms_gswap4 (&frameptr[0]); } /* Done with frames */ /* Set Xn (reverse integration constant) in first frame to last sample */ if (Xnp) *Xnp = *(input + outputsamples - 1); if (swapflag) ms_gswap4 (Xnp); /* Pad any remaining bytes */ if ((frameidx * 64) < outputlength) memset (output + (frameidx * 16), 0, outputlength - (frameidx * 64)); return outputsamples; } /* End of msr_encode_steim2() */ iris-edu-libmseed-4314359/packdata.h000066400000000000000000000031151422047135100171330ustar00rootroot00000000000000/*************************************************************************** * packdata.h: * * Interface declarations for the Mini-SEED packing routines in * packdata.c * * modified: 2016.273 ***************************************************************************/ #ifndef PACKDATA_H #define PACKDATA_H 1 #ifdef __cplusplus extern "C" { #endif #define STEIM1_FRAME_MAX_SAMPLES 60 #define STEIM2_FRAME_MAX_SAMPLES 105 /* Control for printing debugging information, declared in packdata.c */ extern int encodedebug; extern int msr_encode_text (char *input, int samplecount, char *output, int outputlength); extern int msr_encode_int16 (int32_t *input, int samplecount, int16_t *output, int outputlength, int swapflag); extern int msr_encode_int32 (int32_t *input, int samplecount, int32_t *output, int outputlength, int swapflag); extern int msr_encode_float32 (float *input, int samplecount, float *output, int outputlength, int swapflag); extern int msr_encode_float64 (double *input, int samplecount, double *output, int outputlength, int swapflag); extern int msr_encode_steim1 (int32_t *input, int samplecount, int32_t *output, int outputlength, int32_t diff0, int swapflag); extern int msr_encode_steim2 (int32_t *input, int samplecount, int32_t *output, int outputlength, int32_t diff0, char *srcname, int swapflag); #ifdef __cplusplus } #endif #endif iris-edu-libmseed-4314359/parseutils.c000066400000000000000000001317401422047135100175570ustar00rootroot00000000000000/*************************************************************************** * * Routines to parse Mini-SEED. * * Written by Chad Trabant * IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include #include "libmseed.h" /********************************************************************** * msr_parse: * * This routine will attempt to parse (detect and unpack) a Mini-SEED * record from a specified memory buffer and populate a supplied * MSRecord structure. * * If reclen is less than or equal to 0 the length of record is * automatically detected otherwise reclen should be the correct * record length. * * For auto detection of record length the record should include a * 1000 blockette or be followed by another record header in the * buffer. * * dataflag will be passed directly to msr_unpack(). * * Return values: * 0 : Success, populates the supplied MSRecord. * >0 : Data record detected but not enough data is present, the * return value is a hint of how many more bytes are needed. * <0 : libmseed error code (listed in libmseed.h) is returned. *********************************************************************/ int msr_parse (char *record, int recbuflen, MSRecord **ppmsr, int reclen, flag dataflag, flag verbose) { int detlen = 0; int retcode = 0; if (!ppmsr) return MS_GENERROR; if (!record) return MS_GENERROR; /* Sanity check: record length cannot be larger than buffer */ if (reclen > 0 && reclen > recbuflen) { ms_log (2, "ms_parse() Record length (%d) cannot be larger than buffer (%d)\n", reclen, recbuflen); return MS_GENERROR; } /* Autodetect the record length */ if (reclen <= 0) { detlen = ms_detect (record, recbuflen); /* No data record detected */ if (detlen < 0) { return MS_NOTSEED; } /* Found record but could not determine length */ if (detlen == 0) { return MINRECLEN; } if (verbose > 2) { ms_log (1, "Detected record length of %d bytes\n", detlen); } reclen = detlen; } /* Check that record length is in supported range */ if (reclen < MINRECLEN || reclen > MAXRECLEN) { ms_log (2, "Record length is out of range: %d (allowed: %d to %d)\n", reclen, MINRECLEN, MAXRECLEN); return MS_OUTOFRANGE; } /* Check if more data is required, return hint */ if (reclen > recbuflen) { if (verbose > 2) ms_log (1, "Detected %d byte record, need %d more bytes\n", reclen, (reclen - recbuflen)); return (reclen - recbuflen); } /* Unpack record */ if ((retcode = msr_unpack (record, reclen, ppmsr, dataflag, verbose)) != MS_NOERROR) { msr_free (ppmsr); return retcode; } return MS_NOERROR; } /* End of msr_parse() */ /********************************************************************** * msr_parse_selection: * * This routine wraps msr_parse() to parse and return the first record * from a memory buffer that matches optional Selections. If the * selections pointer is NULL the effect is to search the buffer for * the first parsable record. * * The offset value specifies the starting offset in the buffer and, * on success, the offset in the buffer to record parsed. * * The caller should manage the value of the offset in two ways: * * 1) on subsequent calls after a record has been parsed the caller * should increment the offset by the record length returned or * properly manipulate the record buffer pointer, buffer length and * offset to the same effect. * * 2) when the end of the buffer is reached MS_GENERROR (-1) is * returned, the caller should check the offset value against the * record buffer length to determine when the entire buffer has been * searched. * * Return values: same as msr_parse() except that MS_GENERROR is * returned when end-of-buffer is reached. *********************************************************************/ int msr_parse_selection (char *recbuf, int recbuflen, int64_t *offset, MSRecord **ppmsr, int reclen, Selections *selections, flag dataflag, flag verbose) { int retval = MS_GENERROR; int unpackretval; flag dataswapflag = 0; flag bigendianhost = ms_bigendianhost (); if (!ppmsr) return MS_GENERROR; if (!recbuf) return MS_GENERROR; if (!offset) return MS_GENERROR; while (*offset < recbuflen) { retval = msr_parse (recbuf + *offset, (int)(recbuflen - *offset), ppmsr, reclen, 0, verbose); if (retval) { if (verbose) ms_log (2, "Error parsing record at offset %" PRId64 "\n", *offset); *offset += MINRECLEN; } else { if (selections && !msr_matchselect (selections, *ppmsr, NULL)) { *offset += (*ppmsr)->reclen; retval = MS_GENERROR; } else { if (dataflag) { /* If BE host and LE data need swapping */ if (bigendianhost && (*ppmsr)->byteorder == 0) dataswapflag = 1; /* If LE host and BE data (or bad byte order value) need swapping */ else if (!bigendianhost && (*ppmsr)->byteorder > 0) dataswapflag = 1; unpackretval = msr_unpack_data (*ppmsr, dataswapflag, verbose); if (unpackretval < 0) return unpackretval; else (*ppmsr)->numsamples = unpackretval; } break; } } } return retval; } /* End of msr_parse_selection() */ /******************************************************************** * ms_detect: * * Determine SEED data record length with the following steps: * * 1) determine that the buffer contains a SEED data record by * verifying known signatures (fields with known limited values) * * 2) search the record up to recbuflen bytes for a 1000 blockette. * * 3) If no blockette 1000 is found search at MINRECLEN-byte offsets * for the fixed section of the next header or blank/noise record, * thereby implying the record length. * * Returns: * -1 : data record not detected or error * 0 : data record detected but could not determine length * >0 : size of the record in bytes *********************************************************************/ int ms_detect (const char *record, int recbuflen) { uint16_t blkt_offset; /* Byte offset for next blockette */ uint8_t swapflag = 0; /* Byte swapping flag */ uint8_t foundlen = 0; /* Found record length */ int32_t reclen = -1; /* Size of record in bytes */ uint16_t blkt_type; uint16_t next_blkt; struct fsdh_s *fsdh; struct blkt_1000_s *blkt_1000; const char *nextfsdh; /* Buffer must be at least 48 bytes (the fixed section) */ if (recbuflen < 48) return -1; /* Check for valid fixed section of header */ if (!MS_ISVALIDHEADER (record)) return -1; fsdh = (struct fsdh_s *)record; /* Check to see if byte swapping is needed by checking for sane year and day */ if (!MS_ISVALIDYEARDAY (fsdh->start_time.year, fsdh->start_time.day)) swapflag = 1; blkt_offset = fsdh->blockette_offset; /* Swap order of blkt_offset if needed */ if (swapflag) ms_gswap2 (&blkt_offset); /* Loop through blockettes as long as number is non-zero and viable */ while (blkt_offset != 0 && blkt_offset <= recbuflen) { memcpy (&blkt_type, record + blkt_offset, 2); memcpy (&next_blkt, record + blkt_offset + 2, 2); if (swapflag) { ms_gswap2 (&blkt_type); ms_gswap2 (&next_blkt); } /* Found a 1000 blockette, not truncated */ if (blkt_type == 1000 && (int)(blkt_offset + 4 + sizeof (struct blkt_1000_s)) <= recbuflen) { blkt_1000 = (struct blkt_1000_s *)(record + blkt_offset + 4); foundlen = 1; /* Calculate record size in bytes as 2^(blkt_1000->reclen) */ reclen = (unsigned int)1 << blkt_1000->reclen; break; } /* Safety check for invalid offset */ if (next_blkt != 0 && (next_blkt < 4 || (next_blkt - 4) <= blkt_offset)) { ms_log (2, "Invalid blockette offset (%d) less than or equal to current offset (%d)\n", next_blkt, blkt_offset); return -1; } blkt_offset = next_blkt; } /* If record length was not determined by a 1000 blockette scan the buffer * and search for the next record */ if (reclen == -1) { nextfsdh = record + MINRECLEN; /* Check for record header or blank/noise record at MINRECLEN byte offsets */ while (((nextfsdh - record) + 48) < recbuflen) { if (MS_ISVALIDHEADER (nextfsdh) || MS_ISVALIDBLANK (nextfsdh)) { foundlen = 1; reclen = nextfsdh - record; break; } nextfsdh += MINRECLEN; } } if (!foundlen) return 0; else return reclen; } /* End of ms_detect() */ /*************************************************************************** * ms_parse_raw: * * Parse and verify a SEED data record header (fixed section and * blockettes) at the lowest level, printing error messages for * invalid header values and optionally print raw header values. The * memory at 'record' is assumed to be a Mini-SEED record. Not every * possible test is performed, common errors and those causing * libmseed parsing to fail should be detected. * * The 'details' argument is interpreted as follows: * * details: * 0 = only print error messages for invalid header fields * 1 = print basic fields in addition to invalid field errors * 2 = print all fields in addition to invalid field errors * * The 'swapflag' argument is interpreted as follows: * * swapflag: * 1 = swap multibyte quantities * 0 = do no swapping * -1 = autodetect byte order using year test, swap if needed * * Any byte swapping performed by this routine is applied directly to * the memory reference by the record pointer. * * This routine is primarily intended to diagnose invalid Mini-SEED headers. * * Returns 0 when no errors were detected or a positive count of * errors detected. ***************************************************************************/ int ms_parse_raw (char *record, int maxreclen, flag details, flag swapflag) { struct fsdh_s *fsdh; double nomsamprate; char srcname[50]; char *X; char b; int retval = 0; int b1000encoding = -1; int b1000reclen = -1; int endofblockettes = -1; int idx; if (!record) return 1; /* Generate a source name string */ srcname[0] = '\0'; ms_recsrcname (record, srcname, 1); fsdh = (struct fsdh_s *)record; /* Check to see if byte swapping is needed by testing the year and day */ if (swapflag == -1 && !MS_ISVALIDYEARDAY (fsdh->start_time.year, fsdh->start_time.day)) swapflag = 1; else swapflag = 0; if (details > 1) { if (swapflag == 1) ms_log (0, "Swapping multi-byte quantities in header\n"); else ms_log (0, "Not swapping multi-byte quantities in header\n"); } /* Swap byte order */ if (swapflag) { MS_SWAPBTIME (&fsdh->start_time); ms_gswap2 (&fsdh->numsamples); ms_gswap2 (&fsdh->samprate_fact); ms_gswap2 (&fsdh->samprate_mult); ms_gswap4 (&fsdh->time_correct); ms_gswap2 (&fsdh->data_offset); ms_gswap2 (&fsdh->blockette_offset); } /* Validate fixed section header fields */ X = record; /* Pointer of convenience */ /* Check record sequence number, 6 ASCII digits */ if (!isdigit ((int)*(X)) || !isdigit ((int)*(X + 1)) || !isdigit ((int)*(X + 2)) || !isdigit ((int)*(X + 3)) || !isdigit ((int)*(X + 4)) || !isdigit ((int)*(X + 5))) { ms_log (2, "%s: Invalid sequence number: '%c%c%c%c%c%c'\n", srcname, X, X + 1, X + 2, X + 3, X + 4, X + 5); retval++; } /* Check header/quality indicator */ if (!MS_ISDATAINDICATOR (*(X + 6))) { ms_log (2, "%s: Invalid header indicator (DRQM): '%c'\n", srcname, X + 6); retval++; } /* Check reserved byte, space or NULL */ if (!(*(X + 7) == ' ' || *(X + 7) == '\0')) { ms_log (2, "%s: Invalid fixed section reserved byte (Space): '%c'\n", srcname, X + 7); retval++; } /* Check station code, 5 alphanumerics or spaces */ if (!(isalnum ((unsigned char)*(X + 8)) || *(X + 8) == ' ') || !(isalnum ((unsigned char)*(X + 9)) || *(X + 9) == ' ') || !(isalnum ((unsigned char)*(X + 10)) || *(X + 10) == ' ') || !(isalnum ((unsigned char)*(X + 11)) || *(X + 11) == ' ') || !(isalnum ((unsigned char)*(X + 12)) || *(X + 12) == ' ')) { ms_log (2, "%s: Invalid station code: '%c%c%c%c%c'\n", srcname, X + 8, X + 9, X + 10, X + 11, X + 12); retval++; } /* Check location ID, 2 alphanumerics or spaces */ if (!(isalnum ((unsigned char)*(X + 13)) || *(X + 13) == ' ') || !(isalnum ((unsigned char)*(X + 14)) || *(X + 14) == ' ')) { ms_log (2, "%s: Invalid location ID: '%c%c'\n", srcname, X + 13, X + 14); retval++; } /* Check channel codes, 3 alphanumerics or spaces */ if (!(isalnum ((unsigned char)*(X + 15)) || *(X + 15) == ' ') || !(isalnum ((unsigned char)*(X + 16)) || *(X + 16) == ' ') || !(isalnum ((unsigned char)*(X + 17)) || *(X + 17) == ' ')) { ms_log (2, "%s: Invalid channel codes: '%c%c%c'\n", srcname, X + 15, X + 16, X + 17); retval++; } /* Check network code, 2 alphanumerics or spaces */ if (!(isalnum ((unsigned char)*(X + 18)) || *(X + 18) == ' ') || !(isalnum ((unsigned char)*(X + 19)) || *(X + 19) == ' ')) { ms_log (2, "%s: Invalid network code: '%c%c'\n", srcname, X + 18, X + 19); retval++; } /* Check start time fields */ if (fsdh->start_time.year < 1900 || fsdh->start_time.year > 2100) { ms_log (2, "%s: Unlikely start year (1900-2100): '%d'\n", srcname, fsdh->start_time.year); retval++; } if (fsdh->start_time.day < 1 || fsdh->start_time.day > 366) { ms_log (2, "%s: Invalid start day (1-366): '%d'\n", srcname, fsdh->start_time.day); retval++; } if (fsdh->start_time.hour > 23) { ms_log (2, "%s: Invalid start hour (0-23): '%d'\n", srcname, fsdh->start_time.hour); retval++; } if (fsdh->start_time.min > 59) { ms_log (2, "%s: Invalid start minute (0-59): '%d'\n", srcname, fsdh->start_time.min); retval++; } if (fsdh->start_time.sec > 60) { ms_log (2, "%s: Invalid start second (0-60): '%d'\n", srcname, fsdh->start_time.sec); retval++; } if (fsdh->start_time.fract > 9999) { ms_log (2, "%s: Invalid start fractional seconds (0-9999): '%d'\n", srcname, fsdh->start_time.fract); retval++; } /* Check number of samples, max samples in 4096-byte Steim-2 encoded record: 6601 */ if (fsdh->numsamples > 20000) { ms_log (2, "%s: Unlikely number of samples (>20000): '%d'\n", srcname, fsdh->numsamples); retval++; } /* Sanity check that there is space for blockettes when both data and blockettes are present */ if (fsdh->numsamples > 0 && fsdh->numblockettes > 0 && fsdh->data_offset <= fsdh->blockette_offset) { ms_log (2, "%s: No space for %d blockettes, data offset: %d, blockette offset: %d\n", srcname, fsdh->numblockettes, fsdh->data_offset, fsdh->blockette_offset); retval++; } /* Print raw header details */ if (details >= 1) { /* Determine nominal sample rate */ nomsamprate = ms_nomsamprate (fsdh->samprate_fact, fsdh->samprate_mult); /* Print header values */ ms_log (0, "RECORD -- %s\n", srcname); ms_log (0, " sequence number: '%c%c%c%c%c%c'\n", fsdh->sequence_number[0], fsdh->sequence_number[1], fsdh->sequence_number[2], fsdh->sequence_number[3], fsdh->sequence_number[4], fsdh->sequence_number[5]); ms_log (0, " data quality indicator: '%c'\n", fsdh->dataquality); if (details > 0) ms_log (0, " reserved: '%c'\n", fsdh->reserved); ms_log (0, " station code: '%c%c%c%c%c'\n", fsdh->station[0], fsdh->station[1], fsdh->station[2], fsdh->station[3], fsdh->station[4]); ms_log (0, " location ID: '%c%c'\n", fsdh->location[0], fsdh->location[1]); ms_log (0, " channel codes: '%c%c%c'\n", fsdh->channel[0], fsdh->channel[1], fsdh->channel[2]); ms_log (0, " network code: '%c%c'\n", fsdh->network[0], fsdh->network[1]); ms_log (0, " start time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", fsdh->start_time.year, fsdh->start_time.day, fsdh->start_time.hour, fsdh->start_time.min, fsdh->start_time.sec, fsdh->start_time.fract, fsdh->start_time.unused); ms_log (0, " number of samples: %d\n", fsdh->numsamples); ms_log (0, " sample rate factor: %d (%.10g samples per second)\n", fsdh->samprate_fact, nomsamprate); ms_log (0, " sample rate multiplier: %d\n", fsdh->samprate_mult); /* Print flag details if requested */ if (details > 1) { /* Activity flags */ b = fsdh->act_flags; ms_log (0, " activity flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Calibration signals present\n"); if (b & 0x02) ms_log (0, " [Bit 1] Time correction applied\n"); if (b & 0x04) ms_log (0, " [Bit 2] Beginning of an event, station trigger\n"); if (b & 0x08) ms_log (0, " [Bit 3] End of an event, station detrigger\n"); if (b & 0x10) ms_log (0, " [Bit 4] A positive leap second happened in this record\n"); if (b & 0x20) ms_log (0, " [Bit 5] A negative leap second happened in this record\n"); if (b & 0x40) ms_log (0, " [Bit 6] Event in progress\n"); if (b & 0x80) ms_log (0, " [Bit 7] Undefined bit set\n"); /* I/O and clock flags */ b = fsdh->io_flags; ms_log (0, " I/O and clock flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Station volume parity error possibly present\n"); if (b & 0x02) ms_log (0, " [Bit 1] Long record read (possibly no problem)\n"); if (b & 0x04) ms_log (0, " [Bit 2] Short record read (record padded)\n"); if (b & 0x08) ms_log (0, " [Bit 3] Start of time series\n"); if (b & 0x10) ms_log (0, " [Bit 4] End of time series\n"); if (b & 0x20) ms_log (0, " [Bit 5] Clock locked\n"); if (b & 0x40) ms_log (0, " [Bit 6] Undefined bit set\n"); if (b & 0x80) ms_log (0, " [Bit 7] Undefined bit set\n"); /* Data quality flags */ b = fsdh->dq_flags; ms_log (0, " data quality flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] Amplifier saturation detected\n"); if (b & 0x02) ms_log (0, " [Bit 1] Digitizer clipping detected\n"); if (b & 0x04) ms_log (0, " [Bit 2] Spikes detected\n"); if (b & 0x08) ms_log (0, " [Bit 3] Glitches detected\n"); if (b & 0x10) ms_log (0, " [Bit 4] Missing/padded data present\n"); if (b & 0x20) ms_log (0, " [Bit 5] Telemetry synchronization error\n"); if (b & 0x40) ms_log (0, " [Bit 6] A digital filter may be charging\n"); if (b & 0x80) ms_log (0, " [Bit 7] Time tag is questionable\n"); } ms_log (0, " number of blockettes: %d\n", fsdh->numblockettes); ms_log (0, " time correction: %ld\n", (long int)fsdh->time_correct); ms_log (0, " data offset: %d\n", fsdh->data_offset); ms_log (0, " first blockette offset: %d\n", fsdh->blockette_offset); } /* Done printing raw header details */ /* Validate and report information in the blockette chain */ if (fsdh->blockette_offset > 46 && fsdh->blockette_offset < maxreclen) { int blkt_offset = fsdh->blockette_offset; int blkt_count = 0; int blkt_length; uint16_t blkt_type; uint16_t next_blkt; char *blkt_desc; /* Traverse blockette chain */ while (blkt_offset != 0 && blkt_offset < maxreclen) { /* Every blockette has a similar 4 byte header: type and next */ memcpy (&blkt_type, record + blkt_offset, 2); memcpy (&next_blkt, record + blkt_offset + 2, 2); if (swapflag) { ms_gswap2 (&blkt_type); ms_gswap2 (&next_blkt); } /* Print common header fields */ if (details >= 1) { blkt_desc = ms_blktdesc (blkt_type); ms_log (0, " BLOCKETTE %u: (%s)\n", blkt_type, (blkt_desc) ? blkt_desc : "Unknown"); ms_log (0, " next blockette: %u\n", next_blkt); } blkt_length = ms_blktlen (blkt_type, record + blkt_offset, swapflag); if (blkt_length == 0) { ms_log (2, "%s: Unknown blockette length for type %d\n", srcname, blkt_type); retval++; } /* Track end of blockette chain */ endofblockettes = blkt_offset + blkt_length - 1; /* Sanity check that the blockette is contained in the record */ if (endofblockettes > maxreclen) { ms_log (2, "%s: Blockette type %d at offset %d with length %d does not fix in record (%d)\n", srcname, blkt_type, blkt_offset, blkt_length, maxreclen); retval++; break; } if (blkt_type == 100) { struct blkt_100_s *blkt_100 = (struct blkt_100_s *)(record + blkt_offset + 4); if (swapflag) ms_gswap4 (&blkt_100->samprate); if (details >= 1) { ms_log (0, " actual sample rate: %.10g\n", blkt_100->samprate); if (details > 1) { b = blkt_100->flags; ms_log (0, " undefined flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); ms_log (0, " reserved bytes (3): %u,%u,%u\n", blkt_100->reserved[0], blkt_100->reserved[1], blkt_100->reserved[2]); } } } else if (blkt_type == 200) { struct blkt_200_s *blkt_200 = (struct blkt_200_s *)(record + blkt_offset + 4); if (swapflag) { ms_gswap4 (&blkt_200->amplitude); ms_gswap4 (&blkt_200->period); ms_gswap4 (&blkt_200->background_estimate); MS_SWAPBTIME (&blkt_200->time); } if (details >= 1) { ms_log (0, " signal amplitude: %g\n", blkt_200->amplitude); ms_log (0, " signal period: %g\n", blkt_200->period); ms_log (0, " background estimate: %g\n", blkt_200->background_estimate); if (details > 1) { b = blkt_200->flags; ms_log (0, " event detection flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] 1: Dilatation wave\n"); else ms_log (0, " [Bit 0] 0: Compression wave\n"); if (b & 0x02) ms_log (0, " [Bit 1] 1: Units after deconvolution\n"); else ms_log (0, " [Bit 1] 0: Units are digital counts\n"); if (b & 0x04) ms_log (0, " [Bit 2] Bit 0 is undetermined\n"); ms_log (0, " reserved byte: %u\n", blkt_200->reserved); } ms_log (0, " signal onset time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_200->time.year, blkt_200->time.day, blkt_200->time.hour, blkt_200->time.min, blkt_200->time.sec, blkt_200->time.fract, blkt_200->time.unused); ms_log (0, " detector name: %.24s\n", blkt_200->detector); } } else if (blkt_type == 201) { struct blkt_201_s *blkt_201 = (struct blkt_201_s *)(record + blkt_offset + 4); if (swapflag) { ms_gswap4 (&blkt_201->amplitude); ms_gswap4 (&blkt_201->period); ms_gswap4 (&blkt_201->background_estimate); MS_SWAPBTIME (&blkt_201->time); } if (details >= 1) { ms_log (0, " signal amplitude: %g\n", blkt_201->amplitude); ms_log (0, " signal period: %g\n", blkt_201->period); ms_log (0, " background estimate: %g\n", blkt_201->background_estimate); b = blkt_201->flags; ms_log (0, " event detection flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] 1: Dilation wave\n"); else ms_log (0, " [Bit 0] 0: Compression wave\n"); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_201->reserved); ms_log (0, " signal onset time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_201->time.year, blkt_201->time.day, blkt_201->time.hour, blkt_201->time.min, blkt_201->time.sec, blkt_201->time.fract, blkt_201->time.unused); ms_log (0, " SNR values: "); for (idx = 0; idx < 6; idx++) ms_log (0, "%u ", blkt_201->snr_values[idx]); ms_log (0, "\n"); ms_log (0, " loopback value: %u\n", blkt_201->loopback); ms_log (0, " pick algorithm: %u\n", blkt_201->pick_algorithm); ms_log (0, " detector name: %.24s\n", blkt_201->detector); } } else if (blkt_type == 300) { struct blkt_300_s *blkt_300 = (struct blkt_300_s *)(record + blkt_offset + 4); if (swapflag) { MS_SWAPBTIME (&blkt_300->time); ms_gswap4 (&blkt_300->step_duration); ms_gswap4 (&blkt_300->interval_duration); ms_gswap4 (&blkt_300->amplitude); ms_gswap4 (&blkt_300->reference_amplitude); } if (details >= 1) { ms_log (0, " calibration start time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_300->time.year, blkt_300->time.day, blkt_300->time.hour, blkt_300->time.min, blkt_300->time.sec, blkt_300->time.fract, blkt_300->time.unused); ms_log (0, " number of calibrations: %u\n", blkt_300->numcalibrations); b = blkt_300->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x01) ms_log (0, " [Bit 0] First pulse is positive\n"); if (b & 0x02) ms_log (0, " [Bit 1] Calibration's alternate sign\n"); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); ms_log (0, " step duration: %u\n", blkt_300->step_duration); ms_log (0, " interval duration: %u\n", blkt_300->interval_duration); ms_log (0, " signal amplitude: %g\n", blkt_300->amplitude); ms_log (0, " input signal channel: %.3s", blkt_300->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_300->reserved); ms_log (0, " reference amplitude: %u\n", blkt_300->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_300->coupling); ms_log (0, " rolloff: %.12s\n", blkt_300->rolloff); } } else if (blkt_type == 310) { struct blkt_310_s *blkt_310 = (struct blkt_310_s *)(record + blkt_offset + 4); if (swapflag) { MS_SWAPBTIME (&blkt_310->time); ms_gswap4 (&blkt_310->duration); ms_gswap4 (&blkt_310->period); ms_gswap4 (&blkt_310->amplitude); ms_gswap4 (&blkt_310->reference_amplitude); } if (details >= 1) { ms_log (0, " calibration start time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_310->time.year, blkt_310->time.day, blkt_310->time.hour, blkt_310->time.min, blkt_310->time.sec, blkt_310->time.fract, blkt_310->time.unused); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_310->reserved1); b = blkt_310->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); if (b & 0x10) ms_log (0, " [Bit 4] Peak-to-peak amplitude\n"); if (b & 0x20) ms_log (0, " [Bit 5] Zero-to-peak amplitude\n"); if (b & 0x40) ms_log (0, " [Bit 6] RMS amplitude\n"); ms_log (0, " calibration duration: %u\n", blkt_310->duration); ms_log (0, " signal period: %g\n", blkt_310->period); ms_log (0, " signal amplitude: %g\n", blkt_310->amplitude); ms_log (0, " input signal channel: %.3s", blkt_310->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_310->reserved2); ms_log (0, " reference amplitude: %u\n", blkt_310->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_310->coupling); ms_log (0, " rolloff: %.12s\n", blkt_310->rolloff); } } else if (blkt_type == 320) { struct blkt_320_s *blkt_320 = (struct blkt_320_s *)(record + blkt_offset + 4); if (swapflag) { MS_SWAPBTIME (&blkt_320->time); ms_gswap4 (&blkt_320->duration); ms_gswap4 (&blkt_320->ptp_amplitude); ms_gswap4 (&blkt_320->reference_amplitude); } if (details >= 1) { ms_log (0, " calibration start time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_320->time.year, blkt_320->time.day, blkt_320->time.hour, blkt_320->time.min, blkt_320->time.sec, blkt_320->time.fract, blkt_320->time.unused); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_320->reserved1); b = blkt_320->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); if (b & 0x10) ms_log (0, " [Bit 4] Random amplitudes\n"); ms_log (0, " calibration duration: %u\n", blkt_320->duration); ms_log (0, " peak-to-peak amplitude: %g\n", blkt_320->ptp_amplitude); ms_log (0, " input signal channel: %.3s", blkt_320->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_320->reserved2); ms_log (0, " reference amplitude: %u\n", blkt_320->reference_amplitude); ms_log (0, " coupling: %.12s\n", blkt_320->coupling); ms_log (0, " rolloff: %.12s\n", blkt_320->rolloff); ms_log (0, " noise type: %.8s\n", blkt_320->noise_type); } } else if (blkt_type == 390) { struct blkt_390_s *blkt_390 = (struct blkt_390_s *)(record + blkt_offset + 4); if (swapflag) { MS_SWAPBTIME (&blkt_390->time); ms_gswap4 (&blkt_390->duration); ms_gswap4 (&blkt_390->amplitude); } if (details >= 1) { ms_log (0, " calibration start time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_390->time.year, blkt_390->time.day, blkt_390->time.hour, blkt_390->time.min, blkt_390->time.sec, blkt_390->time.fract, blkt_390->time.unused); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_390->reserved1); b = blkt_390->flags; ms_log (0, " calibration flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (b & 0x04) ms_log (0, " [Bit 2] Calibration was automatic\n"); if (b & 0x08) ms_log (0, " [Bit 3] Calibration continued from previous record(s)\n"); ms_log (0, " calibration duration: %u\n", blkt_390->duration); ms_log (0, " signal amplitude: %g\n", blkt_390->amplitude); ms_log (0, " input signal channel: %.3s", blkt_390->input_channel); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_390->reserved2); } } else if (blkt_type == 395) { struct blkt_395_s *blkt_395 = (struct blkt_395_s *)(record + blkt_offset + 4); if (swapflag) { MS_SWAPBTIME (&blkt_395->time); } if (details >= 1) { ms_log (0, " calibration end time: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_395->time.year, blkt_395->time.day, blkt_395->time.hour, blkt_395->time.min, blkt_395->time.sec, blkt_395->time.fract, blkt_395->time.unused); if (details > 1) ms_log (0, " reserved bytes (2): %u,%u\n", blkt_395->reserved[0], blkt_395->reserved[1]); } } else if (blkt_type == 400) { struct blkt_400_s *blkt_400 = (struct blkt_400_s *)(record + blkt_offset + 4); if (swapflag) { ms_gswap4 (&blkt_400->azimuth); ms_gswap4 (&blkt_400->slowness); ms_gswap4 (&blkt_400->configuration); } if (details >= 1) { ms_log (0, " beam azimuth (degrees): %g\n", blkt_400->azimuth); ms_log (0, " beam slowness (sec/degree): %g\n", blkt_400->slowness); ms_log (0, " configuration: %u\n", blkt_400->configuration); if (details > 1) ms_log (0, " reserved bytes (2): %u,%u\n", blkt_400->reserved[0], blkt_400->reserved[1]); } } else if (blkt_type == 405) { struct blkt_405_s *blkt_405 = (struct blkt_405_s *)(record + blkt_offset + 4); uint16_t firstvalue = blkt_405->delay_values[0]; /* Work on a private copy */ if (swapflag) ms_gswap2 (&firstvalue); if (details >= 1) ms_log (0, " first delay value: %u\n", firstvalue); } else if (blkt_type == 500) { struct blkt_500_s *blkt_500 = (struct blkt_500_s *)(record + blkt_offset + 4); if (swapflag) { ms_gswap4 (&blkt_500->vco_correction); MS_SWAPBTIME (&blkt_500->time); ms_gswap4 (&blkt_500->exception_count); } if (details >= 1) { ms_log (0, " VCO correction: %g%%\n", blkt_500->vco_correction); ms_log (0, " time of exception: %d,%d,%d:%d:%d.%04d (unused: %d)\n", blkt_500->time.year, blkt_500->time.day, blkt_500->time.hour, blkt_500->time.min, blkt_500->time.sec, blkt_500->time.fract, blkt_500->time.unused); ms_log (0, " usec: %d\n", blkt_500->usec); ms_log (0, " reception quality: %u%%\n", blkt_500->reception_qual); ms_log (0, " exception count: %u\n", blkt_500->exception_count); ms_log (0, " exception type: %.16s\n", blkt_500->exception_type); ms_log (0, " clock model: %.32s\n", blkt_500->clock_model); ms_log (0, " clock status: %.128s\n", blkt_500->clock_status); } } else if (blkt_type == 1000) { struct blkt_1000_s *blkt_1000 = (struct blkt_1000_s *)(record + blkt_offset + 4); char order[40]; /* Calculate record size in bytes as 2^(blkt_1000->rec_len) */ b1000reclen = (unsigned int)1 << blkt_1000->reclen; /* Big or little endian? */ if (blkt_1000->byteorder == 0) strncpy (order, "Little endian", sizeof (order) - 1); else if (blkt_1000->byteorder == 1) strncpy (order, "Big endian", sizeof (order) - 1); else strncpy (order, "Unknown value", sizeof (order) - 1); if (details >= 1) { ms_log (0, " encoding: %s (val:%u)\n", (char *)ms_encodingstr (blkt_1000->encoding), blkt_1000->encoding); ms_log (0, " byte order: %s (val:%u)\n", order, blkt_1000->byteorder); ms_log (0, " record length: %d (val:%u)\n", b1000reclen, blkt_1000->reclen); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_1000->reserved); } /* Save encoding format */ b1000encoding = blkt_1000->encoding; /* Sanity check encoding format */ if (!(b1000encoding >= 0 && b1000encoding <= 5) && !(b1000encoding >= 10 && b1000encoding <= 19) && !(b1000encoding >= 30 && b1000encoding <= 33)) { ms_log (2, "%s: Blockette 1000 encoding format invalid (0-5,10-19,30-33): %d\n", srcname, b1000encoding); retval++; } /* Sanity check byte order flag */ if (blkt_1000->byteorder != 0 && blkt_1000->byteorder != 1) { ms_log (2, "%s: Blockette 1000 byte order flag invalid (0 or 1): %d\n", srcname, blkt_1000->byteorder); retval++; } } else if (blkt_type == 1001) { struct blkt_1001_s *blkt_1001 = (struct blkt_1001_s *)(record + blkt_offset + 4); if (details >= 1) { ms_log (0, " timing quality: %u%%\n", blkt_1001->timing_qual); ms_log (0, " micro second: %d\n", blkt_1001->usec); if (details > 1) ms_log (0, " reserved byte: %u\n", blkt_1001->reserved); ms_log (0, " frame count: %u\n", blkt_1001->framecnt); } } else if (blkt_type == 2000) { struct blkt_2000_s *blkt_2000 = (struct blkt_2000_s *)(record + blkt_offset + 4); char order[40]; if (swapflag) { ms_gswap2 (&blkt_2000->length); ms_gswap2 (&blkt_2000->data_offset); ms_gswap4 (&blkt_2000->recnum); } /* Big or little endian? */ if (blkt_2000->byteorder == 0) strncpy (order, "Little endian", sizeof (order) - 1); else if (blkt_2000->byteorder == 1) strncpy (order, "Big endian", sizeof (order) - 1); else strncpy (order, "Unknown value", sizeof (order) - 1); if (details >= 1) { ms_log (0, " blockette length: %u\n", blkt_2000->length); ms_log (0, " data offset: %u\n", blkt_2000->data_offset); ms_log (0, " record number: %u\n", blkt_2000->recnum); ms_log (0, " byte order: %s (val:%u)\n", order, blkt_2000->byteorder); b = blkt_2000->flags; ms_log (0, " data flags: [%u%u%u%u%u%u%u%u] 8 bits\n", bit (b, 0x01), bit (b, 0x02), bit (b, 0x04), bit (b, 0x08), bit (b, 0x10), bit (b, 0x20), bit (b, 0x40), bit (b, 0x80)); if (details > 1) { if (b & 0x01) ms_log (0, " [Bit 0] 1: Stream oriented\n"); else ms_log (0, " [Bit 0] 0: Record oriented\n"); if (b & 0x02) ms_log (0, " [Bit 1] 1: Blockette 2000s may NOT be packaged\n"); else ms_log (0, " [Bit 1] 0: Blockette 2000s may be packaged\n"); if (!(b & 0x04) && !(b & 0x08)) ms_log (0, " [Bits 2-3] 00: Complete blockette\n"); else if (!(b & 0x04) && (b & 0x08)) ms_log (0, " [Bits 2-3] 01: First blockette in span\n"); else if ((b & 0x04) && (b & 0x08)) ms_log (0, " [Bits 2-3] 11: Continuation blockette in span\n"); else if ((b & 0x04) && !(b & 0x08)) ms_log (0, " [Bits 2-3] 10: Final blockette in span\n"); if (!(b & 0x10) && !(b & 0x20)) ms_log (0, " [Bits 4-5] 00: Not file oriented\n"); else if (!(b & 0x10) && (b & 0x20)) ms_log (0, " [Bits 4-5] 01: First blockette of file\n"); else if ((b & 0x10) && !(b & 0x20)) ms_log (0, " [Bits 4-5] 10: Continuation of file\n"); else if ((b & 0x10) && (b & 0x20)) ms_log (0, " [Bits 4-5] 11: Last blockette of file\n"); } ms_log (0, " number of headers: %u\n", blkt_2000->numheaders); /* Crude display of the opaque data headers */ if (details > 1) ms_log (0, " headers: %.*s\n", (blkt_2000->data_offset - 15), blkt_2000->payload); } } else { ms_log (2, "%s: Unrecognized blockette type: %d\n", srcname, blkt_type); retval++; } /* Sanity check the next blockette offset */ if (next_blkt && next_blkt <= endofblockettes) { ms_log (2, "%s: Next blockette offset (%d) is within current blockette ending at byte %d\n", srcname, next_blkt, endofblockettes); blkt_offset = 0; } else { blkt_offset = next_blkt; } blkt_count++; } /* End of looping through blockettes */ /* Check that the blockette offset is within the maximum record size */ if (blkt_offset > maxreclen) { ms_log (2, "%s: Blockette offset (%d) beyond maximum record length (%d)\n", srcname, blkt_offset, maxreclen); retval++; } /* Check that the data and blockette offsets are within the record */ if (b1000reclen && fsdh->data_offset > b1000reclen) { ms_log (2, "%s: Data offset (%d) beyond record length (%d)\n", srcname, fsdh->data_offset, b1000reclen); retval++; } if (b1000reclen && fsdh->blockette_offset > b1000reclen) { ms_log (2, "%s: Blockette offset (%d) beyond record length (%d)\n", srcname, fsdh->blockette_offset, b1000reclen); retval++; } /* Check that the data offset is beyond the end of the blockettes */ if (fsdh->numsamples && fsdh->data_offset <= endofblockettes) { ms_log (2, "%s: Data offset (%d) is within blockette chain (end of blockettes: %d)\n", srcname, fsdh->data_offset, endofblockettes); retval++; } /* Check that the correct number of blockettes were parsed */ if (fsdh->numblockettes != blkt_count) { ms_log (2, "%s: Specified number of blockettes (%d) not equal to those parsed (%d)\n", srcname, fsdh->numblockettes, blkt_count); retval++; } } return retval; } /* End of ms_parse_raw() */ iris-edu-libmseed-4314359/selection.c000066400000000000000000000427351422047135100173560ustar00rootroot00000000000000/*************************************************************************** * selection.c: * * Generic routines to manage selection lists. * * Written by Chad Trabant unless otherwise noted * IRIS Data Management Center * * modified: 2014.197 ***************************************************************************/ #include #include #include #include #include #include "libmseed.h" static int ms_globmatch (char *string, char *pattern); /*************************************************************************** * ms_matchselect: * * Test the specified parameters for a matching selection entry. The * srcname parameter may contain globbing characters. The NULL value * (matching any times) for the start and end times is HPTERROR. * * Return Selections pointer to matching entry on successful match and * NULL for no match or error. ***************************************************************************/ Selections * ms_matchselect (Selections *selections, char *srcname, hptime_t starttime, hptime_t endtime, SelectTime **ppselecttime) { Selections *findsl = NULL; SelectTime *findst = NULL; SelectTime *matchst = NULL; if (selections) { findsl = selections; while (findsl) { if (ms_globmatch (srcname, findsl->srcname)) { findst = findsl->timewindows; while (findst) { if (starttime != HPTERROR && findst->starttime != HPTERROR && (starttime < findst->starttime && !(starttime <= findst->starttime && endtime >= findst->starttime))) { findst = findst->next; continue; } else if (endtime != HPTERROR && findst->endtime != HPTERROR && (endtime > findst->endtime && !(starttime <= findst->endtime && endtime >= findst->endtime))) { findst = findst->next; continue; } matchst = findst; break; } } if (matchst) break; else findsl = findsl->next; } } if (ppselecttime) *ppselecttime = matchst; return (matchst) ? findsl : NULL; } /* End of ms_matchselect() */ /*************************************************************************** * msr_matchselect: * * A simple wrapper for calling ms_matchselect() using details from a * MSRecord struct. * * Return Selections pointer to matching entry on successful match and * NULL for no match or error. ***************************************************************************/ Selections * msr_matchselect (Selections *selections, MSRecord *msr, SelectTime **ppselecttime) { char srcname[50]; hptime_t endtime; if (!selections || !msr) return NULL; msr_srcname (msr, srcname, 1); endtime = msr_endtime (msr); return ms_matchselect (selections, srcname, msr->starttime, endtime, ppselecttime); } /* End of msr_matchselect() */ /*************************************************************************** * ms_addselect: * * Add select parameters to a specified selection list. The srcname * argument may contain globbing parameters. The NULL value (matching * any value) for the start and end times is HPTERROR. * * Return 0 on success and -1 on error. ***************************************************************************/ int ms_addselect (Selections **ppselections, char *srcname, hptime_t starttime, hptime_t endtime) { Selections *newsl = NULL; SelectTime *newst = NULL; if (!ppselections || !srcname) return -1; /* Allocate new SelectTime and populate */ if (!(newst = (SelectTime *)calloc (1, sizeof (SelectTime)))) { ms_log (2, "Cannot allocate memory\n"); return -1; } newst->starttime = starttime; newst->endtime = endtime; /* Add new Selections struct to begining of list */ if (!*ppselections) { /* Allocate new Selections and populate */ if (!(newsl = (Selections *)calloc (1, sizeof (Selections)))) { ms_log (2, "Cannot allocate memory\n"); return -1; } strncpy (newsl->srcname, srcname, sizeof (newsl->srcname)); newsl->srcname[sizeof (newsl->srcname) - 1] = '\0'; /* Add new Selections struct as first in list */ *ppselections = newsl; newsl->timewindows = newst; } else { Selections *findsl = *ppselections; Selections *matchsl = 0; /* Search for matching Selectlink entry */ while (findsl) { if (!strcmp (findsl->srcname, srcname)) { matchsl = findsl; break; } findsl = findsl->next; } if (matchsl) { /* Add time window selection to beginning of window list */ newst->next = matchsl->timewindows; matchsl->timewindows = newst; } else { /* Allocate new Selections and populate */ if (!(newsl = (Selections *)calloc (1, sizeof (Selections)))) { ms_log (2, "Cannot allocate memory\n"); return -1; } strncpy (newsl->srcname, srcname, sizeof (newsl->srcname)); newsl->srcname[sizeof (newsl->srcname) - 1] = '\0'; /* Add new Selections to beginning of list */ newsl->next = *ppselections; *ppselections = newsl; newsl->timewindows = newst; } } return 0; } /* End of ms_addselect() */ /*************************************************************************** * ms_addselect_comp: * * Add select parameters to a specified selection list based on * separate name components. The network, station, location, channel * and quality arguments may contain globbing parameters. The NULL * value (matching any value) for the start and end times is HPTERROR. * * If any of the naming parameters are not supplied (pointer is NULL) * a wildcard for all matches is substituted. As a special case, if * the location ID (loc) is set to "--" to match a space-space/blank * ID it will be translated to an empty string to match libmseed's * notation. * * Return 0 on success and -1 on error. ***************************************************************************/ int ms_addselect_comp (Selections **ppselections, char *net, char *sta, char *loc, char *chan, char *qual, hptime_t starttime, hptime_t endtime) { char srcname[100]; char selnet[20]; char selsta[20]; char selloc[20]; char selchan[20]; char selqual[20]; if (!ppselections) return -1; if (net) { strncpy (selnet, net, sizeof (selnet)); selnet[sizeof (selnet) - 1] = '\0'; } else strcpy (selnet, "*"); if (sta) { strncpy (selsta, sta, sizeof (selsta)); selsta[sizeof (selsta) - 1] = '\0'; } else strcpy (selsta, "*"); if (loc) { /* Test for special case blank location ID */ if (!strcmp (loc, "--")) selloc[0] = '\0'; else { strncpy (selloc, loc, sizeof (selloc)); selloc[sizeof (selloc) - 1] = '\0'; } } else strcpy (selloc, "*"); if (chan) { strncpy (selchan, chan, sizeof (selchan)); selchan[sizeof (selchan) - 1] = '\0'; } else strcpy (selchan, "*"); if (qual) { strncpy (selqual, qual, sizeof (selqual)); selqual[sizeof (selqual) - 1] = '\0'; } else strcpy (selqual, "?"); /* Create the srcname globbing match for this entry */ snprintf (srcname, sizeof (srcname), "%s_%s_%s_%s_%s", selnet, selsta, selloc, selchan, selqual); /* Add selection to list */ if (ms_addselect (ppselections, srcname, starttime, endtime)) return -1; return 0; } /* End of ms_addselect_comp() */ /*************************************************************************** * ms_readselectionsfile: * * Read a list of data selections from a file and them to the * specified selections list. On errors this routine will leave * allocated memory unreachable (leaked), it is expected that this is * a program failing condition. * * As a special case if the filename is "-", selection lines will be * read from stdin. * * Returns count of selections added on success and -1 on error. ***************************************************************************/ int ms_readselectionsfile (Selections **ppselections, char *filename) { FILE *fp; hptime_t starttime; hptime_t endtime; char selectline[200]; char *selnet; char *selsta; char *selloc; char *selchan; char *selqual; char *selstart; char *selend; char *cp; char next; int selectcount = 0; int linecount = 0; if (!ppselections || !filename) return -1; if (strcmp (filename, "-")) { if (!(fp = fopen (filename, "rb"))) { ms_log (2, "Cannot open file %s: %s\n", filename, strerror (errno)); return -1; } } else { /* Use stdin as special case */ fp = stdin; } while (fgets (selectline, sizeof (selectline) - 1, fp)) { selnet = 0; selsta = 0; selloc = 0; selchan = 0; selqual = 0; selstart = 0; selend = 0; linecount++; /* Guarantee termination */ selectline[sizeof (selectline) - 1] = '\0'; /* End string at first newline character if any */ if ((cp = strchr (selectline, '\n'))) *cp = '\0'; /* Skip empty lines */ if (!strlen (selectline)) continue; /* Skip comment lines */ if (*selectline == '#') continue; /* Parse: identify components of selection and terminate */ cp = selectline; next = 1; while (*cp) { if (*cp == ' ' || *cp == '\t') { *cp = '\0'; next = 1; } else if (*cp == '#') { *cp = '\0'; break; } else if (next && !selnet) { selnet = cp; next = 0; } else if (next && !selsta) { selsta = cp; next = 0; } else if (next && !selloc) { selloc = cp; next = 0; } else if (next && !selchan) { selchan = cp; next = 0; } else if (next && !selqual) { selqual = cp; next = 0; } else if (next && !selstart) { selstart = cp; next = 0; } else if (next && !selend) { selend = cp; next = 0; } else if (next) { *cp = '\0'; break; } cp++; } /* Skip line if network, station, location and channel are not defined */ if (!selnet || !selsta || !selloc || !selchan) { ms_log (2, "[%s] Skipping data selection line number %d\n", filename, linecount); continue; } if (selstart) { starttime = ms_seedtimestr2hptime (selstart); if (starttime == HPTERROR) { ms_log (2, "Cannot convert data selection start time (line %d): %s\n", linecount, selstart); return -1; } } else { starttime = HPTERROR; } if (selend) { endtime = ms_seedtimestr2hptime (selend); if (endtime == HPTERROR) { ms_log (2, "Cannot convert data selection end time (line %d): %s\n", linecount, selend); return -1; } } else { endtime = HPTERROR; } /* Add selection to list */ if (ms_addselect_comp (ppselections, selnet, selsta, selloc, selchan, selqual, starttime, endtime)) { ms_log (2, "[%s] Error adding selection on line %d\n", filename, linecount); return -1; } selectcount++; } if (fp != stdin) fclose (fp); return selectcount; } /* End of ms_readselectionsfile() */ /*************************************************************************** * ms_freeselections: * * Free all memory associated with a Selections struct. ***************************************************************************/ void ms_freeselections (Selections *selections) { Selections *select; Selections *selectnext; SelectTime *selecttime; SelectTime *selecttimenext; if (selections) { select = selections; while (select) { selectnext = select->next; selecttime = select->timewindows; while (selecttime) { selecttimenext = selecttime->next; free (selecttime); selecttime = selecttimenext; } free (select); select = selectnext; } } } /* End of ms_freeselections() */ /*************************************************************************** * ms_printselections: * * Print the selections list using the ms_log() facility. ***************************************************************************/ void ms_printselections (Selections *selections) { Selections *select; SelectTime *selecttime; char starttime[50]; char endtime[50]; if (!selections) return; select = selections; while (select) { ms_log (0, "Selection: %s\n", select->srcname); selecttime = select->timewindows; while (selecttime) { if (selecttime->starttime != HPTERROR) ms_hptime2seedtimestr (selecttime->starttime, starttime, 1); else strncpy (starttime, "No start time", sizeof (starttime) - 1); if (selecttime->endtime != HPTERROR) ms_hptime2seedtimestr (selecttime->endtime, endtime, 1); else strncpy (endtime, "No end time", sizeof (endtime) - 1); ms_log (0, " %30s %30s\n", starttime, endtime); selecttime = selecttime->next; } select = select->next; } } /* End of ms_printselections() */ /*********************************************************************** * robust glob pattern matcher * ozan s. yigit/dec 1994 * public domain * * glob patterns: * * matches zero or more characters * ? matches any single character * [set] matches any character in the set * [^set] matches any character NOT in the set * where a set is a group of characters or ranges. a range * is written as two characters seperated with a hyphen: a-z denotes * all characters between a to z inclusive. * [-set] set matches a literal hypen and any character in the set * []set] matches a literal close bracket and any character in the set * * char matches itself except where char is '*' or '?' or '[' * \char matches char, including any pattern character * * examples: * a*c ac abc abbc ... * a?c acc abc aXc ... * a[a-z]c aac abc acc ... * a[-a-z]c a-c aac abc ... * * Revision 1.4 2004/12/26 12:38:00 ct * Changed function name (amatch -> globmatch), variables and * formatting for clarity. Also add matching header globmatch.h. * * Revision 1.3 1995/09/14 23:24:23 oz * removed boring test/main code. * * Revision 1.2 94/12/11 10:38:15 oz * charset code fixed. it is now robust and interprets all * variations of charset [i think] correctly, including [z-a] etc. * * Revision 1.1 94/12/08 12:45:23 oz * Initial revision ***********************************************************************/ #define GLOBMATCH_TRUE 1 #define GLOBMATCH_FALSE 0 #define GLOBMATCH_NEGATE '^' /* std char set negation char */ /*********************************************************************** * ms_globmatch: * * Check if a string matches a globbing pattern. * * Return 0 if string does not match pattern and non-zero otherwise. **********************************************************************/ static int ms_globmatch (char *string, char *pattern) { int negate; int match; int c; while (*pattern) { if (!*string && *pattern != '*') return GLOBMATCH_FALSE; switch (c = *pattern++) { case '*': while (*pattern == '*') pattern++; if (!*pattern) return GLOBMATCH_TRUE; if (*pattern != '?' && *pattern != '[' && *pattern != '\\') while (*string && *pattern != *string) string++; while (*string) { if (ms_globmatch (string, pattern)) return GLOBMATCH_TRUE; string++; } return GLOBMATCH_FALSE; case '?': if (*string) break; return GLOBMATCH_FALSE; /* set specification is inclusive, that is [a-z] is a, z and * everything in between. this means [z-a] may be interpreted * as a set that contains z, a and nothing in between. */ case '[': if (*pattern != GLOBMATCH_NEGATE) negate = GLOBMATCH_FALSE; else { negate = GLOBMATCH_TRUE; pattern++; } match = GLOBMATCH_FALSE; while (!match && (c = *pattern++)) { if (!*pattern) return GLOBMATCH_FALSE; if (*pattern == '-') /* c-c */ { if (!*++pattern) return GLOBMATCH_FALSE; if (*pattern != ']') { if (*string == c || *string == *pattern || (*string > c && *string < *pattern)) match = GLOBMATCH_TRUE; } else { /* c-] */ if (*string >= c) match = GLOBMATCH_TRUE; break; } } else /* cc or c] */ { if (c == *string) match = GLOBMATCH_TRUE; if (*pattern != ']') { if (*pattern == *string) match = GLOBMATCH_TRUE; } else break; } } if (negate == match) return GLOBMATCH_FALSE; /* If there is a match, skip past the charset and continue on */ while (*pattern && *pattern != ']') pattern++; if (!*pattern++) /* oops! */ return GLOBMATCH_FALSE; break; case '\\': if (*pattern) c = *pattern++; default: if (c != *string) return GLOBMATCH_FALSE; break; } string++; } return !*string; } /* End of ms_globmatch() */ iris-edu-libmseed-4314359/test/000077500000000000000000000000001422047135100161715ustar00rootroot00000000000000iris-edu-libmseed-4314359/test/Makefile000066400000000000000000000030531422047135100176320ustar00rootroot00000000000000# This Makefile requires GNU make, sometimes available as gmake. # # A simple test suite for libmseed. # See README for description. # # Build environment can be configured the following # environment variables: # CC : Specify the C compiler to use # CFLAGS : Specify compiler options to use # Required compiler parameters CFLAGS += -I.. LDFLAGS = -L.. LDLIBS = -lmseed SRCS := $(sort $(wildcard *.c)) BINS := $(SRCS:%.c=%) TESTS := $(sort $(wildcard *.test)) TESTOUTS := $(TESTS:%.test=%.test.out) # ASCII color coding for test results, green for PASSED and red for FAILED PASSED := \033[0;32mPASSED\033[0m FAILED := \033[0;31mFAILED\033[0m TESTCOUNT := 0 test all: $(BINS) $(TESTOUTS) @printf '%d tests conducted\n' $(TESTCOUNT) # Build programs and check for executable $(BINS) : % : %.c @$(eval TESTCOUNT=$(shell echo $$(($(TESTCOUNT)+1)))) @$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS); exit 0; @if test -x $@; \ then printf '$(PASSED) Building $<\n'; \ else printf '$(FAILED) Building $<\n'; exit 1; \ fi # Run test scripts, create %.test.out files and compare to %.test.ref references $(TESTOUTS) : %.test.out : %.test $(BINS) FORCE @$(eval TESTCOUNT=$(shell echo $$(($(TESTCOUNT)+1)))) @$(shell ./$< > $@ 2>&1) @diff $<.ref $@ >/dev/null; \ if [ $$? -eq 0 ]; \ then printf '$(PASSED) Test $<\n'; \ else printf '$(FAILED) Test $<, Compare $<.ref $@\n'; \ exit 0; \ fi clean: @rm -f $(BINS) $(TESTOUTS) # Any targets using this empty FORCE rule as a prerequisite will always run FORCE: iris-edu-libmseed-4314359/test/README000066400000000000000000000007561422047135100170610ustar00rootroot00000000000000== The libmseed test suite == General mechanics: Each *.c file is compiled into an executable, linking options for libmseed are included. The test passes if an executable is produced. Each *.test file must be an executable (e.g. shell script) and have a companion *.test.ref reference file. The *.test file is executed, the output saved to *.test.out and compared to the reference. If the files match the test passes. The executables are built first as they are used in the later tests. iris-edu-libmseed-4314359/test/data/000077500000000000000000000000001422047135100171025ustar00rootroot00000000000000iris-edu-libmseed-4314359/test/data/CDSN-encoded.mseed000066400000000000000000000100001422047135100222360ustar00rootroot00000000000000000000Q TEST BHEXXÂh -Ìà@0è Ÿ¨›„¬Ëɲ“}‡£¢•“ŸÆíþüôâë O P = %  9 d h U > / J • Ç ¹ Ž l e w ‘ ™ ˜ – ¤ ½ » ¥ ” „ z † ¤ ¨ œ ~ z † ‰  j M , % 9 J E !öÖÄÏàåÑÇËÉÒÔ· ¥ª§ÃÑ´—›Ãÿ Ô«Äù õîêßì  I X /öè C ^ \ ] t š g F C Y r “   d t ¢ º ^ % ) D ` i v q i m ° § w E 1 9 [ d ` G 6 8 < E L L 7 % ! + . ; = #õãîçÍÁÉÛëíÓ¹·Öþ òìíßÝ÷      ' 7 9 < = C O Y ` h n q l f ` W a z v Q 3 2 E ` m \ I > > 2 / $ ðö ôÙÎÜëé•{y¶¹‘dGDXifcXCCOF87=0D^flodoŒ‘ ¸ÀÃÃÔþ     $ X ‚ „ ^ @ W ˜ Õ à Ô Ñ Û ø! ! ç Å ° ² Ü!!.! ä Ë Ô Û Ö Å ¬ t a [ [ R /    0 @ Û®ŒŸØùãÁ£Ž¤¬Œrg[Ut”¡Çë 4 V <úð¸ÔÏ¥–ÅêìÝçá¿“’Ø ; Š ¼ Ë ¥ k 5 âÔ  8 O C ñû ? { œ ª ¡ u _ T S D ð˺»Â¸A-qÈã®wn§  ¥!!2! þ! ! ï Ç ä!"!F!6!!!D!’!À!•!%  y o œ í! Õ ¬ Ð þ ã — d Q d à à Ò W o • ˆ c ? ÝÚðøÏ€?fÙ Ôn?O`J *18<A;I]Z¸„«tcîü?ƒ´¾ž‹®ÖÔÍ  Z p >öËÀå  6 ? ^ ‰ ³ Ó è ú ú ß ® ¬ ç! û î þ!!3!-!! õ ø ñ Õ   x ‚ ¢ · » ± ˜ w M ¸œ²ØÔ”`MNO.ë©£êPš—d:6\©ŠaC.#:\s“ª£Ÿ·ÁÃÔîö  4 3 4 4 E u ™ n )  - c ‚ b  ) , & %   6 s ¡ ¨ ’ Œ ‹ ƒ ¦ Ä î!! ø æ È ¨ ­ Í Ü é õ ê ¿ ž Œ ƒ | h V R < ÜÀÆé  ó˽Ìé  : ; ×¶³ÊàØ»†L.U¤Õ×¹«Äì  ñø " I F åã H i I   ) \ ƒ ƒ l e z ¢ ¾ ¾ ^ * ( M x u N õÝû  3 õâèþ * 7 #   2 U K   * B ^ q N ,   : | ” p a p ^ P T S T Z ^ g ‘ ² ¥ › Œ e ? ; A K S H 0 = G F G T I 6 . Ü«•™Ï - d @ àñ  %ú¿¬¹æ 3 m n 4ùâîóÀo7+;WdguŒªžwTNcuw^W{µÉ¸¦ŸŸ­Æ×ÜÉ·Ìñ  ùð ! üèæþ 0 Y V &üßê  4 ,      óÙÎî     $ 3 8  I h m R $   G € v > éò   D h a H < R “ Ñ ö ù ä Ö à ú! é » « ­ º Ñ Ò ¥ y w  ‡ ‘ ‚ ` a u o c Y 8     ôÐÕÜÀ¾àñäѵoZfŒ™˜Ÿ«¤œ”‡xz…š¸Å§– ¡ŽŠ‰|pZR¯¸°­ª¸äùõàËÑ 6 /  $ ) C v Œ … ~ v Ž Æ!! ý Õ ¸ Ê!!3!@!?!I!T!W![!T!O!I!@!+!! !!!! !!! õ ÿ!! é Í » ¾ È ² „ K * ) ; 9 úíäßäÙ¾Ÿ•“’ƒX, B_T1íï ü#! %OpyoUUp”µÁÈÉÎáøü   + 9 _ r V H _ r ¨ ­ Ÿ « ° º × ä ¿ ’ u f … µ Ê ° “ ‘ ¦ Ä » „ O 3 @ P N 8 2 3 / + ( ìÔÑî  íÕ³¤¾íûñÞÒ×èæìæÔÀºÀÉÑÓØèíßÏÊ·§ºæ  1 !öÝô   ÚËì ûæÓµ¬»È͹–„¥ÉÀ¦–š³ßÿ뾟¯ÔìóáÕè  . "øð  - N e \ D T y ‡ ƒ ` m … – § Ñ Ö Ñ × Á ¢ ³ Ó Ú Ù Ó · § » È Ä ¬ { S Z u € k @ * Y u ] íî  3 *ûÉÎ 9 ? Á Ç < = Úý 8 Z Q #þ  V ‡ „ [ !   B _ ] <   C a \ 6 ×ì  . Ø®¾ãù輂®éûÙ§–½ð ÿ“›ÑêëÚ·©»ã ÿÏÇá $ ) ìï  N i F  ' R g e U R _ | £ £ § ° Ã Ó Ë ¸ « ¼ Ù ì Ü ¹ · Ë Õ å ã × Ò Þ ã Õ º œ Œ ˜ ¼  ¨ [ L c k N !    ÿṫ±½¹«˜zohVFIMB4ýø÷ü&ùÿ/JD4:P\r€}„°¸¹ÎÞÜô # J R ? ! * e ˜ ¡ q a p ° È ¨ m ] | º é × – a ^ ‡ Ã Ñ ­ b L h ‡ p = " C q z S ø 2 ; óâö  7 &úåì 1 )ï¶³Ù  æ¼­²ÂŹ¥ž¢ª¯¹ÆÈ¸®¾ÐÚßÝÅ©²ä * Z N þ  L p t _ G S w • • | s   × Ì Ÿ ˆ ‘ ³ Ô Ù ­ ƒ | Ð ä ¸ z U c ” ¼ § q X ^ { ª ™ W + 8 A V c O + ' ' ' . , ý  / 1 ( ë     ù ! ) * &  ! 5 @ @ (   ! ) ? K > 0 2 5 : 4 #     + )  úü  ó×ÀÆÐËÀ«“œÁ÷°˜™Ðõß¶—±Î×ÉËĸËÛÒÓçæì  ù  $ $ # 0 8 . !   / N Z H *  ! I e W 8 ( > [ l e <  9 R t h 2  - V u =  H q z V   7 V d R ÷  [ u Oô¬Á # a X ªt£û !ÿ¬fc§èì³sg‡¼Ó®vc}µáäȹÁÏö   ûø  & : : I S N V f _ _  † x v e W [ i k m n N J c p d P -  3 E T A ø  ? B âÀÕ ! ÞÃÈç óŦ²Üúî²nbŸä è´ˆ“·ÔÍÎÆ¹Í÷ ýéÕÙ * D F 2 % C e x Š r  ® Ï ä ò ë Ù á ô ú!!!! !!!! !!$!4!:! è á ì ý! ì ² Œ Š µ ¨ x ? ' 0 A 4 ̬±³¶šnMD>3! ýÿ 422;Firis-edu-libmseed-4314359/test/data/DWWSSN-encoded.mseed000066400000000000000000000100001422047135100225340ustar00rootroot00000000000000000000M TEST LHEXX¼h €à@0è  ÿ÷ÿîÿíÿù ""#(-1,#$*.268842/,$    ÿÿÿõÿïÿòÿöÿùÿ÷ÿòÿòÿöÿýÿûÿñÿêÿéÿìÿòÿôÿôÿòÿíÿéÿçÿêÿðÿðÿíÿêÿéÿéÿëÿíÿíÿëÿêÿëÿïÿôÿü  #)/,"   ÿÿÿöÿõÿü ÿþÿñÿîÿñÿõÿðÿàÿÐÿÊÿÑÿÝÿèÿçÿßÿ×ÿÕÿÕÿÒÿÊÿ¿ÿ¼ÿÁÿÍÿÒÿÑÿÌÿÎÿ×ÿÞÿàÿÙÿÒÿÓÿÚÿãÿêÿîÿðÿîÿèÿÝÿÏÿ½ÿ¥ÿ…ÿ_ÿ5ÿ þëþÐþ·þ›þ~þjþbþmþ…þ§þÍþøÿ+ÿiÿ­ÿò1išÆë#?Ymyƒ„‚wk[G1óßÌ»°¨¤ž•„p^N@3*# ÿõÿîÿêÿçÿàÿÖÿÎÿÈÿÈÿÉÿÆÿÁÿ¹ÿµÿ¶ÿ¾ÿÆÿÆÿ½ÿ±ÿ¬ÿ¯ÿ´ÿ³ÿªÿ¡ÿŸÿ¦ÿ³ÿ½ÿÀÿ¾ÿ½ÿÁÿÊÿÑÿÓÿÍÿÃÿ½ÿ¼ÿ¼ÿ¼ÿºÿ»ÿÄÿÐÿØÿÜÿÙÿÓÿÍÿÈÿÊÿÔÿäÿñÿöÿôÿïÿëÿíÿñÿôÿðÿìÿìÿõÿúÿïÿæÿåÿîÿûÿÿÿöÿòÿðÿðÿîÿìÿëÿëÿïÿóÿðÿîÿíÿòÿüÿýÿ÷ÿóÿøÿüÿîÿäÿåÿîÿúÿýÿöÿïÿîÿðÿóÿôÿóÿñÿïÿîÿðÿø  ÿþÿøÿù  ÿ÷ÿðÿìÿëÿòÿûÿúÿöÿóÿôÿöÿùÿøÿóÿñÿòÿùÿúÿú  ÿøÿñÿñÿùÿøÿíÿåÿçÿíÿóÿôÿóÿóÿõÿûÿÿÿüÿóÿëÿãÿàÿàÿáÿæÿïÿþ $-/-+,19@C>4'  ÿýÿý "'),274.&#&-442,+044+ÿ÷ÿðÿñÿöÿûÿúÿôÿðÿïÿñÿôÿóÿîÿæÿáÿßÿÝÿÞÿáÿèÿðÿöÿôÿòÿñÿòÿ÷ÿùÿûÿúÿ÷ÿõÿóÿñÿòÿôÿû  ÿüÿòÿëÿëÿóÿþ  ÿ÷ÿðÿíÿëÿëÿëÿìÿòÿøÿúÿóÿêÿåÿèÿîÿïÿçÿÛÿÖÿÚÿäÿíÿîÿìÿëÿðÿ÷ÿþÿþÿùÿîÿæÿåÿéÿîÿðÿòÿöÿúÿûÿöÿóÿõÿúÿÿÿûÿñÿéÿêÿôÿýÿþ ÿýÿõÿðÿîÿæÿÛÿÐÿÈÿÈÿÇÿÇÿÆÿÆÿÈÿÌÿÍÿÉÿÅÿÉÿÓÿÜÿãÿãÿàÿßÿåÿìÿòÿõÿõÿõÿöÿøÿùÿöÿóÿöÿüÿþÿúÿùÿúÿüÿùÿñÿéÿãÿæÿìÿïÿéÿÞÿØÿÙÿáÿìÿôÿôÿîÿèÿçÿëÿòÿóÿíÿãÿÜÿÝÿäÿïÿùÿþÿÿÿÿÿÿ   ÿÿÿþÿûÿúÿû ÿÿÿúÿöÿý   ÿÿÿþ      ÿöÿåÿÖÿÉÿ»ÿ¬ÿžÿÿ„ÿ|ÿtÿnÿhÿ_ÿSÿEÿ=ÿ9ÿ:ÿ;ÿ?ÿMÿdÿ}ÿšÿ°ÿÅÿã 2Tjx…˜­ÄÙê÷ýþýû÷ïæÛÎÁ± ‘…yrdN6" ÿýÿùÿùÿúÿúÿõÿéÿÜÿÓÿÑÿ×ÿáÿëÿôÿÿ !(069<BHG=0()02)  ÿþÿüÿûÿúÿ÷ÿøÿþ ÿýÿñÿèÿäÿéÿìÿëÿéÿìÿóÿùÿùÿñÿæÿâÿàÿßÿØÿËÿÀÿºÿ¼ÿÂÿÇÿÉÿÆÿ¿ÿ¸ÿ³ÿ²ÿ³ÿµÿ·ÿ¹ÿ½ÿÈÿ×ÿåÿîÿïÿìÿïÿú %! !ÿÿÿùÿñÿçÿÝÿÖÿÓÿÔÿÚÿãÿîÿùÿÿÿúÿñÿéÿäÿßÿßÿàÿçÿòÿûÿùÿïÿçÿåÿçÿêÿëÿðÿ÷ÿþÿýÿúÿû #++& ÿúÿøÿùÿþ%)'  ÿÿÿþ ÿþÿýÿÿÿÿÿüÿöÿõÿúÿúÿòÿìÿìÿðÿôÿøÿøÿúÿÿÿüÿðÿçÿàÿÝÿÜÿÚÿÜÿäÿîÿ÷ÿ÷ÿòÿîÿìÿíÿïÿôÿüÿûÿúÿÿ ÿÿ  ÿõÿíÿèÿèÿìÿïÿñÿóÿõÿ÷ÿøÿöÿñÿîÿîÿøÿþÿöÿôÿ÷ÿü    ÿþÿíÿâÿßÿÞÿßÿÞÿÜÿÝÿáÿçÿîÿóÿùÿýÿüÿùÿöÿú  ÿúÿüÿüÿùÿúÿüÿüÿüÿýÿÿ     ÿÿÿúÿöÿ÷ÿûÿúÿôÿîÿìÿìÿìÿíÿîÿô&$ ÿÿ   ÿþÿù $*.00,# ÿÿ  !$ ÿûÿóÿîÿðÿù ÿÿÿüÿùÿêÿãÿæÿïÿõÿöÿôÿôÿ÷ÿùÿùÿöÿïÿéÿçÿéÿòÿúÿÿ   #   ÿþÿùÿòÿîÿíÿîÿîÿíÿðÿïÿðÿîÿëÿèÿçÿëÿïÿòÿïÿêÿåÿäÿêÿóÿúÿûÿ÷ÿòÿôÿú  ÿòÿâÿÚÿÕÿØÿØÿÙÿÛÿàÿëÿöÿÿÿþÿúÿõÿöÿúÿùÿæÿÒÿÅÿÄÿÌÿÙÿáÿçÿíÿ÷ÿüÿúÿúÿùÿõÿíÿçÿãÿàÿÜÿÖÿÑÿÍÿÉÿÉÿÎÿÓÿÙÿÝÿáÿçÿîÿóÿõÿ÷ÿüÿúÿùÿüÿúÿïÿëÿìÿñÿôÿñÿêÿåÿèÿìÿóÿû % ÿüÿ÷ÿòÿíÿäÿÝÿÚÿÛÿâÿìÿóÿôÿóÿîÿíÿïÿòÿöÿøÿøÿõÿïÿèÿäÿãÿâÿßÿÜÿÞÿéÿú ÿÿÿøÿðÿíÿö ÿüÿëÿÞÿÓÿÌÿÈÿËÿÒÿÝÿçÿñÿúÿýÿïÿáÿÙÿÖÿØÿÛÿäÿò '% ÿýÿûÿý  ÿþÿýÿýÿû    ÿþÿý  ÿþ ÿÿÿúÿøÿ÷ÿõÿóÿóÿ÷ ÿýÿúÿöÿñÿìÿëÿòÿÿÿòÿíÿôÿÿÿøÿíÿåÿæÿð ÿõÿðÿñÿòÿíÿåÿßÿÞÿáÿãÿâÿàÿßÿàÿäÿéÿéÿæÿàÿÞÿàÿæÿéÿçÿßÿÚÿÛÿáÿèÿëÿêÿíÿõÿýÿüÿúÿôÿðÿðÿõÿùÿöÿòÿñÿõ ÿùÿòÿ÷ ÿ÷ÿõÿûÿøÿóÿõÿûÿýÿùÿðÿçÿäÿêÿ÷ÿÿÿýÿõÿìÿêÿðÿú  #+,&!ÿòÿáÿÙÿÞÿìÿû%8JVXTPRUSH4ÿùÿëÿÝÿÊÿ¼ÿ³ÿ±ÿ·ÿÁÿÍÿÙÿäÿñÿþ ";SdnkcZQH:$ÿóÿæÿàÿßÿÞÿÛÿÝÿãÿïÿþ $2?LPKC;5469=??BGMLiris-edu-libmseed-4314359/test/data/Float32-encoded.mseed000066400000000000000000000100001422047135100227210ustar00rootroot00000000000000000001D TEST VHEXXÂh !Èðÿö@0è8 鿈¿Š¿Š¿Š¿Š¿Š¿‹¿‹¿‹¿‹¿Œ¿Œ¿Œ¿Œ¿‹¿‹¿‰¿ˆ¿ˆ¿‡¿‡¿‡¿‡¿‡¿ˆ¿Š¿Œ¿Ž¿¿¿¿¿¿Œ¿‹¿‹¿Š¿‹¿Œ¿Ž¿¿‘¿’¿”¿•¿˜¿›¿ž¿¡¿£¿¥¿¦¿¥¿¦¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿§¿¦¿¥¿£¿¡¿ ¿ž¿œ¿š¿˜¿–¿”¿“¿‘¿¿Ž¿¿‰¿‡¿„¿ƒ¿‚¿‚¿¿¿€¿~¿z¿x¿x¿v¿v¿t¿r¿r¿v¿x¿|¿~¿~¿~¿z¿v¿p¿h¿b¿^¿^¿\¿\¿\¿^¿`¿f¿h¿n¿p¿r¿t¿r¿p¿p¿n¿j¿j¿n¿n¿p¿r¿r¿p¿p¿n¿j¿f¿d¿^¿\¿X¿T¿T¿V¿Z¿\¿^¿^¿`¿`¿`¿d¿f¿j¿n¿p¿t¿v¿z¿€¿‚¿„¿†¿‡¿ˆ¿‡¿‡¿‡¿ˆ¿‹¿¿¿¿¿¿¿¿¿¿‹¿Š¿‰¿‰¿‡¿ˆ¿‹¿¿¿’¿•¿•¿—¿–¿–¿”¿“¿‘¿¿¿¿¿¿‘¿”¿–¿˜¿™¿š¿™¿˜¿”¿“¿’¿’¿‘¿“¿“¿“¿’¿¿¿’¿“¿•¿˜¿™¿—¿–¿•¿”¿”¿—¿™¿¿ ¿¡¿ ¿Ÿ¿ž¿œ¿›¿›¿¿ž¿Ÿ¿Ÿ¿ ¿ ¿Ÿ¿ ¿¡¿¡¿¢¿£¿¡¿ ¿ž¿¿¿¿Ÿ¿ ¿ ¿¡¿ ¿ ¿Ÿ¿ ¿Ÿ¿Ÿ¿¿¿›¿š¿›¿›¿œ¿¿¿œ¿š¿˜¿—¿—¿–¿–¿–¿—¿˜¿š¿œ¿œ¿œ¿¿¿¿›¿š¿™¿˜¿–¿•¿’¿¿Ž¿‹¿‰¿ˆ¿‡¿‡¿ˆ¿‹¿‹¿¿Ž¿¿¿¿Ž¿¿Œ¿‹¿Š¿Š¿Š¿Œ¿Œ¿Ž¿¿’¿•¿—¿˜¿˜¿˜¿™¿›¿¿ ¿¢¿¥¿¦¿§¿§¿¨¿ª¿ª¿ª¿©¿§¿§¿¦¿¦¿¥¿¤¿£¿ ¿¿˜¿•¿‘¿¿¿¿¿¿Š¿‡¿…¿ƒ¿ƒ¿‚¿¿‚¿‚¿ƒ¿‚¿¿€¿€¿z¿v¿p¿l¿h¿d¿b¿`¿\¿Z¿Z¿Z¿\¿^¿^¿^¿`¿`¿\¿X¿V¿V¿T¿V¿Z¿\¿^¿\¿Z¿X¿X¿Z¿\¿b¿d¿f¿h¿h¿h¿h¿f¿f¿d¿f¿d¿h¿j¿l¿n¿n¿l¿h¿f¿^¿X¿V¿\¿b¿l¿v¿|¿€¿‚¿ƒ¿ƒ¿ƒ¿„¿†¿‡¿‡¿†¿„¿‚¿€¿|¿z¿v¿p¿j¿b¿`¿`¿f¿l¿v¿~¿ƒ¿…¿„¿¿z¿v¿r¿p¿n¿n¿p¿p¿p¿r¿v¿|¿~¿€¿€¿€¿€¿~¿~¿~¿€¿‚¿‚¿¿‚¿„¿‡¿Š¿Š¿ˆ¿„¿€¿v¿r¿n¿n¿l¿n¿r¿x¿~¿‚¿„¿…¿„¿„¿„¿ƒ¿ƒ¿ƒ¿„¿„¿…¿…¿„¿…¿„¿ƒ¿ƒ¿ƒ¿†¿ˆ¿Œ¿‘¿–¿™¿š¿™¿›¿¿ ¿ ¿¡¿ ¿¿˜¿”¿‘¿¿‹¿‰¿ˆ¿‰¿‹¿¿Ž¿¿‹¿Š¿‹¿‰¿Š¿‰¿‡¿†¿…¿ƒ¿¿€¿~¿~¿~¿~¿~¿~¿~¿~¿|¿x¿r¿n¿j¿f¿b¿`¿d¿f¿j¿n¿n¿n¿n¿j¿f¿b¿b¿`¿\¿X¿T¿T¿V¿Z¿^¿`¿f¿f¿f¿d¿`¿^¿^¿`¿^¿^¿^¿b¿d¿f¿f¿d¿`¿^¿^¿^¿^¿^¿^¿^¿b¿f¿j¿n¿r¿x¿|¿€¿¿¿€¿~¿|¿|¿~¿¿„¿…¿…¿„¿¿z¿v¿v¿t¿v¿|¿|¿~¿‚¿‡¿‰¿¿¿Ž¿‹¿‰¿‰¿‰¿‹¿Œ¿Œ¿¿¿¿¿¿Ž¿¿¿¿¿‘¿‘¿¿¿¿¿¿¿¿¿Ž¿Œ¿‹¿‰¿‡¿…¿…¿„¿„¿„¿‡¿ˆ¿‹¿Ž¿¿¿¿Ž¿¿¿¿¿‘¿“¿•¿—¿–¿–¿–¿“¿‘¿Ž¿Œ¿Œ¿‹¿‹¿¿¿¿‘¿¿¿¿‹¿Š¿‡¿†¿ƒ¿¿z¿v¿t¿t¿v¿z¿¿…¿‰¿Œ¿¿•¿—¿š¿¿Ÿ¿¡¿¢¿£¿¤¿¤¿¢¿Ÿ¿œ¿›¿š¿™¿š¿œ¿Ÿ¿¢¿¥¿¦¿¥¿£¿Ÿ¿ž¿›¿™¿™¿š¿™¿™¿š¿›¿œ¿œ¿œ¿š¿—¿’¿¿ˆ¿…¿„¿…¿†¿ˆ¿Š¿‹¿Œ¿‹¿Š¿ˆ¿‡¿…¿„¿ƒ¿ƒ¿…¿ˆ¿‹¿¿¿“¿—¿—¿—¿˜¿¿£¿§¿«¿­¿¬¿©¿¦¿£¿¡¿¡¿¡¿¢¿£¿£¿¢¿ž¿™¿”¿¿¿Œ¿Œ¿¿Ž¿Ž¿Œ¿Š¿‰¿ˆ¿‰¿‹¿Š¿‰¿ˆ¿†¿…¿„¿…¿†¿†¿†¿ƒ¿¿|¿t¿n¿h¿d¿`¿^¿^¿^¿^¿`¿d¿f¿j¿j¿h¿f¿`¿X¿P¿H¿B¿@¿@¿B¿F¿L¿T¿\¿b¿j¿j¿l¿n¿n¿r¿t¿z¿|¿€¿€¿€¿~¿|¿x¿v¿v¿t¿v¿v¿v¿t¿t¿v¿v¿|¿|¿‚¿…¿ˆ¿Œ¿’¿—¿˜¿™¿˜¿–¿”¿’¿‘¿‘¿‘¿‘¿¿¿¿Œ¿‹¿‰¿‰¿Š¿‹¿Ž¿¿‘¿“¿“¿’¿’¿’¿’¿”¿˜¿›¿¿Ÿ¿Ÿ¿œ¿™¿–¿•¿“¿“¿“¿•¿–¿–¿•¿”¿‘¿¿¿Œ¿Œ¿‹¿‰¿‡¿„¿‚¿‚¿‚¿†¿‹¿‘¿•¿˜¿š¿›¿š¿™¿—¿•¿“¿‘¿¿¿‹¿‰iris-edu-libmseed-4314359/test/data/Float64-encoded.mseed000066400000000000000000000100001422047135100227260ustar00rootroot00000000000000000001D TEST VHEXXÂh !Èøÿö@0è8 é¿ñ¿ñ@¿ñ@¿ñ@¿ñ@¿ñ@¿ñ`¿ñ`¿ñ`¿ñ`¿ñ€¿ñ€¿ñ€¿ñ€¿ñ`¿ñ`¿ñ ¿ñ¿ñ¿ðà¿ðà¿ðà¿ðà¿ðà¿ñ¿ñ@¿ñ€¿ñÀ¿ñà¿ò¿ò¿ò¿ñà¿ñ€¿ñ`¿ñ`¿ñ@¿ñ`¿ñ€¿ñÀ¿ò¿ò ¿ò@¿ò€¿ò ¿ó¿ó`¿óÀ¿ô ¿ô`¿ô ¿ôÀ¿ô ¿ôÀ¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôà¿ôÀ¿ô ¿ô`¿ô ¿ô¿óÀ¿ó€¿ó@¿ó¿òÀ¿ò€¿ò`¿ò ¿ò¿ñÀ¿ñ ¿ñ ¿ðà¿ð€¿ð`¿ð@¿ð@¿ð ¿ð ¿ð¿ïÀ¿ï@¿ï¿ï¿îÀ¿îÀ¿î€¿î@¿î@¿îÀ¿ï¿ï€¿ïÀ¿ïÀ¿ïÀ¿ï@¿îÀ¿î¿í¿ì@¿ëÀ¿ëÀ¿ë€¿ë€¿ë€¿ëÀ¿ì¿ìÀ¿í¿íÀ¿î¿î@¿î€¿î@¿î¿î¿íÀ¿í@¿í@¿íÀ¿íÀ¿î¿î@¿î@¿î¿î¿íÀ¿í@¿ìÀ¿ì€¿ëÀ¿ë€¿ë¿ê€¿ê€¿êÀ¿ë@¿ë€¿ëÀ¿ëÀ¿ì¿ì¿ì¿ì€¿ìÀ¿í@¿íÀ¿î¿î€¿îÀ¿ï@¿ð¿ð@¿ð€¿ðÀ¿ðà¿ñ¿ðà¿ðà¿ðà¿ñ¿ñ`¿ñ ¿ñà¿ñà¿ò¿ñà¿ñà¿ñà¿ñ ¿ñ ¿ñ`¿ñ@¿ñ ¿ñ ¿ðà¿ñ¿ñ`¿ñ ¿ò¿ò@¿ò ¿ò ¿òà¿òÀ¿òÀ¿ò€¿ò`¿ò ¿ò¿ñà¿ñà¿ñà¿ò¿ò ¿ò€¿òÀ¿ó¿ó ¿ó@¿ó ¿ó¿ò€¿ò`¿ò@¿ò@¿ò ¿ò`¿ò`¿ò`¿ò@¿ò¿ò¿ò@¿ò`¿ò ¿ó¿ó ¿òà¿òÀ¿ò ¿ò€¿ò€¿òà¿ó ¿ó ¿ô¿ô ¿ô¿óà¿óÀ¿ó€¿ó`¿ó`¿ó ¿óÀ¿óà¿óà¿ô¿ô¿óà¿ô¿ô ¿ô ¿ô@¿ô`¿ô ¿ô¿óÀ¿ó ¿ó ¿ó ¿óà¿ô¿ô¿ô ¿ô¿ô¿óà¿ô¿óà¿óà¿ó ¿ó ¿ó`¿ó@¿ó`¿ó`¿ó€¿ó ¿ó ¿ó€¿ó@¿ó¿òà¿òà¿òÀ¿òÀ¿òÀ¿òà¿ó¿ó@¿ó€¿ó€¿ó€¿ó ¿ó ¿ó ¿ó`¿ó@¿ó ¿ó¿òÀ¿ò ¿ò@¿ò¿ñÀ¿ñ`¿ñ ¿ñ¿ðà¿ðà¿ñ¿ñ`¿ñ`¿ñ ¿ñÀ¿ñà¿ñà¿ñà¿ñÀ¿ñ ¿ñ€¿ñ`¿ñ@¿ñ@¿ñ@¿ñ€¿ñ€¿ñÀ¿ò¿ò@¿ò ¿òà¿ó¿ó¿ó¿ó ¿ó`¿ó ¿ô¿ô@¿ô ¿ôÀ¿ôà¿ôà¿õ¿õ@¿õ@¿õ@¿õ ¿ôà¿ôà¿ôÀ¿ôÀ¿ô ¿ô€¿ô`¿ô¿ó ¿ó¿ò ¿ò ¿ò¿ò¿ò¿ñà¿ñ ¿ñ@¿ðà¿ð ¿ð`¿ð`¿ð@¿ð ¿ð@¿ð@¿ð`¿ð@¿ð ¿ð¿ð¿ï@¿îÀ¿î¿í€¿í¿ì€¿ì@¿ì¿ë€¿ë@¿ë@¿ë@¿ë€¿ëÀ¿ëÀ¿ëÀ¿ì¿ì¿ë€¿ë¿êÀ¿êÀ¿ê€¿êÀ¿ë@¿ë€¿ëÀ¿ë€¿ë@¿ë¿ë¿ë@¿ë€¿ì@¿ì€¿ìÀ¿í¿í¿í¿í¿ìÀ¿ìÀ¿ì€¿ìÀ¿ì€¿í¿í@¿í€¿íÀ¿íÀ¿í€¿í¿ìÀ¿ëÀ¿ë¿êÀ¿ë€¿ì@¿í€¿îÀ¿ï€¿ð¿ð@¿ð`¿ð`¿ð`¿ð€¿ðÀ¿ðà¿ðà¿ðÀ¿ð€¿ð@¿ð¿ï€¿ï@¿îÀ¿î¿í@¿ì@¿ì¿ì¿ìÀ¿í€¿îÀ¿ïÀ¿ð`¿ð ¿ð€¿ð ¿ï@¿îÀ¿î@¿î¿íÀ¿íÀ¿î¿î¿î¿î@¿îÀ¿ï€¿ïÀ¿ð¿ð¿ð¿ð¿ïÀ¿ïÀ¿ïÀ¿ð¿ð@¿ð@¿ð ¿ð@¿ð€¿ðàiris-edu-libmseed-4314359/test/data/GEOSCOPE-16bit-3exp-encoded.mseed000066400000000000000000000100001422047135100245130ustar00rootroot00000000000000000000D TEST VHEXXÂh !Èàÿö@0è8 éwxwvwvwvwvwvwuwuwuwuwtwtwtwtwuwuwwwxwxwywywywywywxwvwtwrwqwpwpwpwqwtwuwuwvwuwtwrwpwownwlwkwhwewbw_w]w[wZw[wZwYwYwYwYwYwYwYwYwYwYwYwYwYwYwYwYwZw[w]w_w`wbwdwfwhwjwlwmwowpwrwswwwyw|w}w~w~www€wwƒw„w„w…w…w†w‡w‡w…w„w‚wwwwƒw…wˆwŒww‘w‘w’w’w’w‘wwwŒw‰wˆw‡w†w‡wˆwˆw‰w‹w‹w‰w‰wˆw‡w‡wˆwˆw‰w‹wwŽw‘w’w”w–w–w•w“w’w‘w‘wwwwŽww‹w‰wˆw†w…wƒw€w~w|wzwywxwywywywxwuwswqwqwpwqwqwqwswswuwvwwwwwywxwuwswpwnwkwkwiwjwjwlwmwowpwqwqwqwpwowlwjwhwgwfwgwhwlwmwnwnwowmwmwmwnwpwpwnwmwkwhwgwiwjwkwlwlwiwgwcw`w_w`wawbwdwewewcwbwawaw`w`waw`w_w_w^w]w_w`wbwcwcwcwaw`w`w_w`w`waw`wawawcwcwewfwewewdwcwcwdwfwhwiwiwjwjwjwiwhwfwdwdwdwcwcwcwewfwgwhwjwkwnwpwrwuwwwxwywywxwuwuwswrwqwqwqwrwswtwuwvwvwvwtwtwrwpwnwkwiwhwhwhwgwewcw`w^w[wZwYwYwXwVwVwVwWwYwYwZwZw[w\w]w`wcwhwkwowpwpwpwqwswvwyw{w}w}w~ww~w~w}w~ww€w€wƒw…wˆwŠwŒwŽwww’w“w“w“w’w‘w‘w‘www’w”w•w•w–w•w“w’w‘w’w“w”w”w“w’wwŽwwŒwŒwŒwŒwwwŽwwŽwŒw‹wŠw‰w‰wŠwŒww‘w”w•w’wwŠw…w‚w€w~w}w}w}w|wzwywywzw|w~w€w‚wƒw…wˆw‹wwwwwŠw…ww}w{w|wwƒw…w‡wˆw‰w‰wˆwˆwˆw‡w…w‚ww€w€w€w€wwww€w~w~ww~w|wywvwvwxw|w€w…w‡w‰w‰wŠw‰w‡w„ww~w|w{w|w|w|w}w}w}w|w|w{w{w|w{w|w}w}w}wzwxwtwowjwgwfwgwewcw`w`w_w`wcwhwlwowswuwwwxwwwuwswrwswuwvwuwwwvwwwywzw{w}ww€wwwwwwwww‚w„w‡w‰w‹wwwwŽww‹w‰w‰w‰w‰w‹wwwww’w”w–w–w•w“w‘wwwwwŽww‘w‘ww‘w‘w‘wwŽwwwŽww‘w‘w‘w‘w‘w‘w‘www‹w‰w‡w„w‚w€www€ww‚w‚www|w{w{w|wwƒw…w…w†w…w‚w‚ww~wywwwswqwrwuwwwwwwwuwtwtwswqwqwqwqwrwqwqwqwpwowowpwpwpwqwqwqwqwqwrwtwuwwwyw{w{w|w|w|wywxwuwrwqwpwqwrwswswswqwowmwkwiwjwjwjwmwowrwtwtwuwuwswqwpwowpwqwswuwvwywzw}wwƒw…w†w†w…wƒww{wwwtwpwkwiwfwcwaw_w^w]w\w\w^wawdwewfwgwfwdwaw^w[wZw[w]wawbwewgwgwfwgwgwfwewdwdwdwfwiwnwswxw{w|w{wzwxwvwuwtwuwvwxwyw{w|w}w}w{wxwuwswpwmwiwiwiwhwcw]wYwUwSwTwWwZw]w_w_w_w^w]w]w^wbwgwlwqwswtwtwswrwrwtwvwwwxwwwuwvwwwxwzw{w|w{wzwzwzw}ww‚w†w‰wŒwŽww‘w‘w‘w‘wwŽww‹w‹wŒwww”w˜wœwŸw w wŸwwšw–w’ww‹w‹wŠw‰w‰w‡w†wƒw‚w€w€w€ww‚w„w…w…w†w…w…w…w†w†w…w…w‚w‚w~w{wxwtwnwiwhwgwhwjwlwnwowowowowpwqwswtwuwwwwwvwuwrwqwowmwmwnwnwnwnwlwhwewcwawawdwgwjwkwmwmwmwkwjwjwkwlwowqwswtwtwuwwwyw|w~w~w~wzwuwowkwhwfwewfwgwiwkwmwowpwswuwwwxwyw{w|w}w|w{wywwwuwuwwwzw|w€w‚wƒw„w„wƒwƒwƒw…w‡wˆwˆw‹wŽw‘w”w”w”w’w‘wŽwŠw‡wƒw‚w‚w…wˆww’w—w›wŸw¡w£w£w¢w¡wžwœw™w–w”w’wŽw‹w‡wƒw}wywuwswswswuwwwywzw{w}w}w~w}w~w}w{wxwuwswqwqwpwqwswvwyw~ww…wˆwŒwŒw‹w‰w‡w„w‚w€w€wwƒw†w‰wŒwŽwww‘w‘w’w’w’w‘wwwŒw‰wˆw…ww~w{wywzw}w€w…w‹ww•w™w›wžwžwwœw›w™w–w”w’w‘wwwŠw‰w…w„w‚ww€w€www|w{wxwuwswqwpwowpwpwowowowowpwowpwpwqwrwrwrwswswtwuwwwxwwwwwxwwwvwwwxwyw|ww€w‚w‚w‚ww~w|wxwuwtwqwpwpwpwpwrwswuwyw{w}wwwww}w{wywvwswqwpwpwqwqwswuwwwxwywzwywywvwtwrwqwnwlwjwiwhwgwgwgwhwiwkwnwrwuwxw|w~ww„w†w‰wŒww‘w”w–w™wšw›wwŸw w¢w¤w¤w¤w¤w£w¡w¡w wŸwwœw™w—w•w“w‘wwwŽwŒwŒw‹wŠwˆw‡w…w„wƒw‚wwww~w}w{wywvwtwrwqwowowowpwpwrwtwuwxwzw|ww€www‚wƒwƒwƒw‚wƒww€w~w|wzwywwwvwuwtwswrwqwpwowowownwnwmwlwkwjwgwewcwaw_w]w[wZwYwXwYwXwYwZw\w^w`wcwewgwiwkwmwqwswuwyw|w~ww‚wƒwƒwƒw„w„w„w„w…w†w‡w‰wŠw‹wŒwŒwwwwwŽwww‘w’w”w—w˜wšwšw›w›w›w™w˜w—w—w•w”w“w“wwwŽwŽwŒwŒw‹w‹wŒwwwww’w”w•w—w˜w›wžw¡w¤w¦w§w§w¦w£w¡wžw›w˜w”w’wwŽwŒwŠw‰w‰w‰w‰w‰w‰wŠw‹wŒwŒwŽwww’w“w•w–w–w–w•w”w’w‘wŽw‹wˆw…ww~wzwwwuwrwpwnwlwkwjwjwiwhwhwgwhwhwhwiwjwkwlwmwowowpwqwqwqwqwqwqwrwrwtwuwxwzw|w}w~w~ww~ww~wwww~w~w}w{wywwwtwqwmwlwiwgwewcwbwawawbwcwewfwgwiwjwjwkwjwjwiwiwgwfwfwfwgwhwiwlwnwqwtwvwyw|ww€ww‚wƒwƒw„w„w„w„wƒwww}wzwxwuwtwrwqwpwqwqwtwuwwwzw}w€wwƒw…w…w†w‡w‡wˆwˆw‡w‡w‡w‡wˆwˆwˆw‰wŠw‹wŒwwwŽwwŽwwwŒw‹wŠwŠwŠw‰w‰w‰wˆwˆwˆwˆw‡w†w†w‡w‡w†w†w†w…w…w…w„wƒw‚www}w{wywvwtwswqwownwnwnwnwowqwqwtwvwxwyw{w}www‚w„w…w†w‡w†w†w…w„wƒwƒw‚wwwww€ww~w}w}w|w{wywvwtwqwmwjwgwewcw`w_w]w]w\w\w[wZwYwYwXwVwUwTwSwQwQwOwOwOwOwOwNwMwLwKwJwJwIwIwJwKwMwNwPwRwSwTwWwWwVwVwWwWwWwYwXwWwWwVwUwTwTwSwSwTwTwUwWwXwZw\w_wawdwfwhwiwjwkwlwmwmwmwlwlwlwlwjwjwiwhwhwhwhwhwiwiwiwiwiwhwgwfwdwcwbwbwaw`w_w`wawbwcwewhwkwmwqwswuwwwzw|w}w~w€wwwƒw„w…w‡wˆw‰wŒwwww’w”w•w•w˜w›ww w¢w£w¤w¥w¥w¥w¤w£w£w£w¢w¡w wŸwwœw›w›wšw™wšw›wœwœwžwŸw w w w¢w¡w¡w¡w wŸwŸwŸwžwžwww›w™w˜w˜w˜w—w–w–w•w•w”w“w’wwwŽww‹wŠw‰wˆwˆw†w…w„wƒw‚wƒwƒwƒwƒw…w†wˆw‰w‹wŒwwwwŒw‹w‰w‡w„ww~w{wvwswnwjwgwcw_w]wZwWwVwTwSwSwRwQwQwPwPwPwQwRwSwUwWwYw[w]w`wbwdwewgwiwkwmwnwowpwpwpwownwnwlwlwlwkwkwkwkwkwkiris-edu-libmseed-4314359/test/data/Int16-encoded.mseed000066400000000000000000000100001422047135100224100ustar00rootroot00000000000000000001M TEST LHEXX¼h €à80è ÿ÷ÿîÿíÿù ""#(-1,#$*.268842/,$    ÿÿÿõÿïÿòÿöÿùÿ÷ÿòÿòÿöÿýÿûÿñÿêÿéÿìÿòÿôÿôÿòÿíÿéÿçÿêÿðÿðÿíÿêÿéÿéÿëÿíÿíÿëÿêÿëÿïÿôÿü  #)/,"   ÿÿÿöÿõÿü ÿþÿñÿîÿñÿõÿðÿàÿÐÿÊÿÑÿÝÿèÿçÿßÿ×ÿÕÿÕÿÒÿÊÿ¿ÿ¼ÿÁÿÍÿÒÿÑÿÌÿÎÿ×ÿÞÿàÿÙÿÒÿÓÿÚÿãÿêÿîÿðÿîÿèÿÝÿÏÿ½ÿ¥ÿ…ÿ_ÿ5ÿ þëþÐþ·þ›þ~þjþbþmþ…þ§þÍþøÿ+ÿiÿ­ÿò1išÆë#?Ymyƒ„‚wk[G1óßÌ»°¨¤ž•„p^N@3*# ÿõÿîÿêÿçÿàÿÖÿÎÿÈÿÈÿÉÿÆÿÁÿ¹ÿµÿ¶ÿ¾ÿÆÿÆÿ½ÿ±ÿ¬ÿ¯ÿ´ÿ³ÿªÿ¡ÿŸÿ¦ÿ³ÿ½ÿÀÿ¾ÿ½ÿÁÿÊÿÑÿÓÿÍÿÃÿ½ÿ¼ÿ¼ÿ¼ÿºÿ»ÿÄÿÐÿØÿÜÿÙÿÓÿÍÿÈÿÊÿÔÿäÿñÿöÿôÿïÿëÿíÿñÿôÿðÿìÿìÿõÿúÿïÿæÿåÿîÿûÿÿÿöÿòÿðÿðÿîÿìÿëÿëÿïÿóÿðÿîÿíÿòÿüÿýÿ÷ÿóÿøÿüÿîÿäÿåÿîÿúÿýÿöÿïÿîÿðÿóÿôÿóÿñÿïÿîÿðÿø  ÿþÿøÿù  ÿ÷ÿðÿìÿëÿòÿûÿúÿöÿóÿôÿöÿùÿøÿóÿñÿòÿùÿúÿú  ÿøÿñÿñÿùÿøÿíÿåÿçÿíÿóÿôÿóÿóÿõÿûÿÿÿüÿóÿëÿãÿàÿàÿáÿæÿïÿþ $-/-+,19@C>4'  ÿýÿý "'),274.&#&-442,+044+ÿ÷ÿðÿñÿöÿûÿúÿôÿðÿïÿñÿôÿóÿîÿæÿáÿßÿÝÿÞÿáÿèÿðÿöÿôÿòÿñÿòÿ÷ÿùÿûÿúÿ÷ÿõÿóÿñÿòÿôÿû  ÿüÿòÿëÿëÿóÿþ  ÿ÷ÿðÿíÿëÿëÿëÿìÿòÿøÿúÿóÿêÿåÿèÿîÿïÿçÿÛÿÖÿÚÿäÿíÿîÿìÿëÿðÿ÷ÿþÿþÿùÿîÿæÿåÿéÿîÿðÿòÿöÿúÿûÿöÿóÿõÿúÿÿÿûÿñÿéÿêÿôÿýÿþ ÿýÿõÿðÿîÿæÿÛÿÐÿÈÿÈÿÇÿÇÿÆÿÆÿÈÿÌÿÍÿÉÿÅÿÉÿÓÿÜÿãÿãÿàÿßÿåÿìÿòÿõÿõÿõÿöÿøÿùÿöÿóÿöÿüÿþÿúÿùÿúÿüÿùÿñÿéÿãÿæÿìÿïÿéÿÞÿØÿÙÿáÿìÿôÿôÿîÿèÿçÿëÿòÿóÿíÿãÿÜÿÝÿäÿïÿùÿþÿÿÿÿÿÿ   ÿÿÿþÿûÿúÿû ÿÿÿúÿöÿý   ÿÿÿþ      ÿöÿåÿÖÿÉÿ»ÿ¬ÿžÿÿ„ÿ|ÿtÿnÿhÿ_ÿSÿEÿ=ÿ9ÿ:ÿ;ÿ?ÿMÿdÿ}ÿšÿ°ÿÅÿã 2Tjx…˜­ÄÙê÷ýþýû÷ïæÛÎÁ± ‘…yrdN6" ÿýÿùÿùÿúÿúÿõÿéÿÜÿÓÿÑÿ×ÿáÿëÿôÿÿ !(069<BHG=0()02)  ÿþÿüÿûÿúÿ÷ÿøÿþ ÿýÿñÿèÿäÿéÿìÿëÿéÿìÿóÿùÿùÿñÿæÿâÿàÿßÿØÿËÿÀÿºÿ¼ÿÂÿÇÿÉÿÆÿ¿ÿ¸ÿ³ÿ²ÿ³ÿµÿ·ÿ¹ÿ½ÿÈÿ×ÿåÿîÿïÿìÿïÿú %! !ÿÿÿùÿñÿçÿÝÿÖÿÓÿÔÿÚÿãÿîÿùÿÿÿúÿñÿéÿäÿßÿßÿàÿçÿòÿûÿùÿïÿçÿåÿçÿêÿëÿðÿ÷ÿþÿýÿúÿû #++& ÿúÿøÿùÿþ%)'  ÿÿÿþ ÿþÿýÿÿÿÿÿüÿöÿõÿúÿúÿòÿìÿìÿðÿôÿøÿøÿúÿÿÿüÿðÿçÿàÿÝÿÜÿÚÿÜÿäÿîÿ÷ÿ÷ÿòÿîÿìÿíÿïÿôÿüÿûÿúÿÿ ÿÿ  ÿõÿíÿèÿèÿìÿïÿñÿóÿõÿ÷ÿøÿöÿñÿîÿîÿøÿþÿöÿôÿ÷ÿü    ÿþÿíÿâÿßÿÞÿßÿÞÿÜÿÝÿáÿçÿîÿóÿùÿýÿüÿùÿöÿú  ÿúÿüÿüÿùÿúÿüÿüÿüÿýÿÿ     ÿÿÿúÿöÿ÷ÿûÿúÿôÿîÿìÿìÿìÿíÿîÿô&$ ÿÿ   ÿþÿù $*.00,# ÿÿ  !$ ÿûÿóÿîÿðÿù ÿÿÿüÿùÿêÿãÿæÿïÿõÿöÿôÿôÿ÷ÿùÿùÿöÿïÿéÿçÿéÿòÿúÿÿ   #   ÿþÿùÿòÿîÿíÿîÿîÿíÿðÿïÿðÿîÿëÿèÿçÿëÿïÿòÿïÿêÿåÿäÿêÿóÿúÿûÿ÷ÿòÿôÿú  ÿòÿâÿÚÿÕÿØÿØÿÙÿÛÿàÿëÿöÿÿÿþÿúÿõÿöÿúÿùÿæÿÒÿÅÿÄÿÌÿÙÿáÿçÿíÿ÷ÿüÿúÿúÿùÿõÿíÿçÿãÿàÿÜÿÖÿÑÿÍÿÉÿÉÿÎÿÓÿÙÿÝÿáÿçÿîÿóÿõÿ÷ÿüÿúÿùÿüÿúÿïÿëÿìÿñÿôÿñÿêÿåÿèÿìÿóÿû % ÿüÿ÷ÿòÿíÿäÿÝÿÚÿÛÿâÿìÿóÿôÿóÿîÿíÿïÿòÿöÿøÿøÿõÿïÿèÿäÿãÿâÿßÿÜÿÞÿéÿú ÿÿÿøÿðÿíÿö ÿüÿëÿÞÿÓÿÌÿÈÿËÿÒÿÝÿçÿñÿúÿýÿïÿáÿÙÿÖÿØÿÛÿäÿò '% ÿýÿûÿý  ÿþÿýÿýÿû    ÿþÿý  ÿþ ÿÿÿúÿøÿ÷ÿõÿóÿóÿ÷ ÿýÿúÿöÿñÿìÿëÿòÿÿÿòÿíÿôÿÿÿøÿíÿåÿæÿð ÿõÿðÿñÿòÿíÿåÿßÿÞÿáÿãÿâÿàÿßÿàÿäÿéÿéÿæÿàÿÞÿàÿæÿéÿçÿßÿÚÿÛÿáÿèÿëÿêÿíÿõÿýÿüÿúÿôÿðÿðÿõÿùÿöÿòÿñÿõ ÿùÿòÿ÷ ÿ÷ÿõÿûÿøÿóÿõÿûÿýÿùÿðÿçÿäÿêÿ÷ÿÿÿýÿõÿìÿêÿðÿú  #+,&!ÿòÿáÿÙÿÞÿìÿû%8JVXTPRUSH4ÿùÿëÿÝÿÊÿ¼ÿ³ÿ±ÿ·ÿÁÿÍÿÙÿäÿñÿþ ";SdnkcZQH:$ÿóÿæÿàÿßÿÞÿÛÿÝÿãÿïÿþ $2?LPKC;5469=??BGMLiris-edu-libmseed-4314359/test/data/Int32-1024byte.mseed000066400000000000000000000020001422047135100222600ustar00rootroot00000000000000000001R TEST 00LHZXXÚ:48·ð@0è8 é'ÿü{½ÿü‚¶ÿüv ÿü]KÿüNªÿü?ûÿüV†ÿü†ÿü‰tÿü‚Dÿü„›ÿünÿüQºÿüHBÿüZÿüsPÿün°ÿü^Mÿüo|ÿüŠ/ÿüs‡ÿüM¦ÿüMÿüU©ÿüW ÿüV§ÿüJ=ÿüGÿüWãÿü\ŸÿüWôÿü^ÉÿüyÝÿü±ÿüÊØÿü§¸ÿüŠCÿüv¹ÿüS|ÿü61ÿü(ÿüAtÿühºÿüvÿüˆÿü€5ÿüc¹ÿüsÿü„.ÿüy1ÿüwUÿü}©ÿü‘zÿü¤˜ÿü‰ºÿüvÿüpšÿüJhÿüEÿüQØÿü:Bÿü=.ÿüiÿüt»ÿü^"ÿüyÿüœrÿü…ÿüb´ÿüaÿü—!ÿüµFÿüêÿü´^ÿüljÿü­Cÿü‹Gÿüe}ÿünÚÿü`Øÿü ºÿüÿü“VÿüêíÿýgÿüòÙÿý <ÿý3,ÿýI4ÿýH¶ÿü¹yÿû¬AÿúÛcÿú–ÿúÑ ÿûÿü/@ÿü6ÿûæ’ÿûºŠÿûù²ÿü\¸ÿüÏDÿüþMÿüÛ1ÿüÍÿü•Eÿü9›ÿü)‰ÿü¡ÿûˆLÿûvÿû‰Õÿû oÿúâÿû ýÿûHKÿû„ÿûö‹ÿüyíÿüë¼ÿý“!ÿþDÿþ£ÿýøìÿýŸ"ÿý ÿü©+ÿü]qÿü+0ÿüâÿü¸@ÿü¤úÿü2€ÿûccÿûooÿü ¦ÿüœÿûÇ¡ÿûžÈÿûùÿü‰,ÿüôpÿýDÿüë/ÿüo2ÿý-ÿýùÔÿýÚîÿýæÿüTÿûx3ÿúJlÿú€¯ÿûžSÿûÐ)ÿü\ÿü ÿü͉ÿýt ÿþš–ÿÿU%ÿÿôÿýÿèÿüì?ÿüÿûJRÿúú½ÿûyOÿüÿýVrÿýÀkÿþ÷ÿý¥¶ÿý~ºÿý}ÿüàþÿüTËÿûùmÿûÿüôUÿü•±ÿüEÎÿû˯ÿûÆkÿü®ÿüFÿü(kÿü˜ÿý¸ÿüÞûÿüª'ÿü¢cÿük ÿü?½ÿü–/ÿý*ÿý3|ÿüæÁÿüÄ'ÿü–ÿü:ÿü2ÿüTÂÿüj%ÿüg5ÿü›†ÿüÄ`ÿüµÿüyèÿü^ ÿüj™ÿü<5ÿüjÿüb\ÿüÚÿüà2ÿü²ÿü¬ƒÿüŠ£ÿüb5ÿüK¡ÿüÿûæÝÿûþ ÿüÿü Uÿüæÿürlÿý=žÿýÜ•ÿýÊÈÿýk·ÿýCÿü‘ÿûáSÿûÆYÿû¥»ÿûI”ÿûf÷ÿûÝÿüEÈÿü¢gÿüèÙÿüþsÿüÝÐÿü«jÿüeÏÿü42ÿü5öÿüõÿü¸ÿü_Øÿü“éÿü·‚ÿüæ-ÿüÇ'ÿüwÿüfÿûÖ"ÿûè ÿûýsÿûè½ÿûÑUÿû×’ÿûù:ÿü µÿü0ÄÿüK©ÿüTèÿü¶dÿýäÿüÃ.ÿüy¶ÿüqÕÿüg$ÿüeÿüpoÿü_±ÿü9Uÿü=#ÿü…¿ÿü„\ÿü'ÿû´¢ÿû»ÿûÌYÿü!,ÿü˜]ÿüÀOÿüÊdÿüÒ ÿüŽýÿüH;ÿüOòÿü=ÿü¯ÿûøsÿü*•ÿüˆ’ÿü™æÿüpcÿü–Ôÿü­ëÿüYÿü$¤ÿü>kÿü<}ÿü< ÿü©ÿý!¢ÿý&­ÿüõ^ÿüÄAÿü¥¤ÿü›QÿüëÿüÀÆÿýÿüèÊÿü õÿürÿüPjÿü8"ÿûß{ÿûÿûe+ÿûF¿ÿû^!ÿûÌ?ÿüVpÿüÛ™ÿý“ÿý(_ÿý4¡ÿüú$ÿüÕÿüìÿüÕcÿüf-ÿûûÄÿûÍgÿû °ÿû´ÿûÃAÿûôêÿü ¼ÿü.wÿül†ÿü¼ÿý ”ÿýLÙÿýgÿÿý=pÿüßmÿü£ÛÿüdBÿûú¯ÿû¦vÿûdüÿûlCÿû¿ÿü(ùÿü”ÿüÎþÿýBÿý'ÿý ¦ÿý Gÿýkÿüåmÿüèrÿü÷Ôÿü­|ÿüzÿü`bÿü@ŽÿüBÓÿü:¿ÿü>UÿüC¯ÿüMÚÿücÿü}Ðÿüpàÿü´FÿüàÿüÇÿü¢°ÿüjóÿü‘ÿû¶ ÿû8îÿû4ÿû¤\ÿûü!ÿü'ÿü:pÿüo6ÿüÉßÿýVÿý65ÿý-#ÿýÙÿüÚîÿüuÜÿüðÿûÍÜÿûËiÿü2 ÿü­ÄÿüìTÿṳ̈ÿü`ÿü+UÿüPcÿü%ÿû….ÿû’ÿûHëÿû±Íÿü±ÿüPGÿüFÿü’)ÿüžíÿü|MÿüF#ÿüoÿüªÿÿüƒÿüVŠÿüH…ÿüD5ÿü„ÿü´°ÿüšÈÿügWÿüEÿüÂÿûßlÿûÖÎÿüwÿü&çÿüêÿüÿü$ÿü#Wÿü›ÿüÜÿü)µÿüzåÿüà­ÿý-lÿý*HÿüîCÿüËêÿüÓ1ÿüÆÚÿü³õÿü¯Aÿü®±ÿü·¡ÿüÕ2ÿüôÿüÝžÿüçnÿý+{ÿýÿü×6ÿü»†ÿü­¢ÿüÆ+ÿüÑüÿü”xÿüOÖÿü-üÿü †ÿüDÿûè+ÿû¼nÿûÄ»ÿü™ÿüu¢ÿü‚ÿü9ÿü«!ÿü»Œÿü¨ÿü¬ÿÿü®¼ÿü~·ÿü|¶ÿü¯úÿü´ ÿüÁTÿüÇ3ÿüp”ÿü¡ÿû­Mÿû¾–ÿüNeÿüyÿü´ÿûÍ¡ÿûÞÿûî¿ÿûþÿü Uÿü/ãÿü5Œÿü#ØÿûÒ›ÿû‘`ÿûƒ„ÿûSÿûÿû[ˆÿûáÂÿüvÿûÍÿûÁÿû¼gÿû–ÿûyìÿûtìÿûw†ÿû©ïÿûøŽÿüV—ÿüáÚÿýp$ÿþ¯ÿþÜ’ÿÿUæÿÿ†”ÿÿlÂÿþòzÿþ2ÿýGMÿüZ»ÿûÙ‰ÿûÆâÿû°Ñÿû¨žÿûÜWÿü2.ÿüv”ÿüzœÿüXpÿüuÿüºÿü¢žÿüˆÄÿüŒPÿü@cÿü Cÿü4§ÿûé•ÿû@ÿû‹ÕÿûÊ3ÿü8"ÿü Úÿüó>ÿý©ÿüòyÿý¯ÿýi¹ÿýGƒÿý2óÿýÆÿü‘ÿü' ÿûáuÿûU˜ÿúÍSÿúò¯ÿûš{ÿüFÿüŽ(ÿý‘°ÿþœ)ÿÿg¥ÿÿÅTÿÿ¦ÓÿÿW@ÿÿM¦ÿÿx0iris-edu-libmseed-4314359/test/data/Int32-256byte.mseed000066400000000000000000000004001422047135100222100ustar00rootroot00000000000000000001R TEST 00LHZXXÚ:2·0@0è8é'ÿü‚Wÿül—ÿü^ÿü_†ÿüoôÿüŠ ÿürÿü™Gÿü…ÿüŒ©ÿü£?ÿü—ˆÿüfPÿü=äÿü:´ÿü,_ÿü!Xÿü(Þÿü!Cÿü-†ÿüBÿüNsÿür­ÿüŽÿü‹ÿü’4ÿü£~ÿü²aÿüÄìÿüÉáÿü±[ÿüŠ ÿümÚÿüaÿüP‡ÿüLæÿülPÿüŠÿüŸ×ÿü aÿü‡.ÿü‹³ÿü ÿühÿüIéÿüDkÿüD;ÿüA÷iris-edu-libmseed-4314359/test/data/Int32-4096byte.mseed000066400000000000000000000100001422047135100222730ustar00rootroot00000000000000000001R TEST 00LHZXXÚ: ·ð@0è8 é'ÿÿ‹zÿÿµOÿÿÑ(ÿÿxJÿþËAÿýÍÆÿü’Zÿû‘'ÿú@ÿùnJÿø&‰ÿ÷+¬ÿö–]ÿõÙçÿõ\pÿõá±ÿ÷!*ÿømÿù„¦ÿú|Hÿû=;ÿüÿýÓÿýß³ÿþ…9ÿþåÿþ¥ ÿýæ%ÿüÉäÿû„~ÿúMžÿù™^ÿùÃŽÿú@2ÿúßDÿû‘—ÿûØÿü$iÿüÉ¡ÿý~cÿþ\Iÿÿ[ÐâG®B)/ÿÿÌOÿÿ>ˆÿþ§lÿþ1ÄÿýÅÛÿý‚ÿü~ÿüs`ÿü6-ÿû¨ÿû@Ðÿû.+ÿûhÿû³“ÿû̧ÿûìlÿü&zÿûÃÐÿúüñÿúÝØÿûpšÿün$ÿýaŒÿýá"ÿþ-…ÿþ]Rÿþu­ÿþ”!ÿþÿþ2Cÿý”<ÿýOÿüË$ÿüŒaÿüPmÿü*6ÿü_Cÿü’:ÿü6yÿû‘fÿûÛÿú¼ïÿú)ïÿùyPÿøÑÂÿø^‡ÿøi°ÿù —ÿùî2ÿú~ðÿúæÿû€*ÿüêÿü„Èÿý¡ÿý0ÿývÕÿý$çÿüþ3ÿý#­ÿý…Ñÿýì®ÿþ0,ÿþWÿþu’ÿþaÿþ2¾ÿþDÿý±þÿýüÿü›3ÿüuAÿüO0ÿûüRÿû÷ÿü›ÿûõMÿûì ÿü*´ÿüÊfÿýdÂÿý`uÿýbÿý’ÿý ‰ÿüÞ’ÿü¿åÿüŒŽÿüŠÐÿü·Àÿüتÿý'ÿý‡•ÿýÈäÿþÿþ3‰ÿþ";ÿýã\ÿý¹çÿývUÿýˆÿü¾ÿü”šÿüBØÿûOÿú`ÿÿúbÿú}×ÿú$%ÿú&ÿú]Hÿú[ÿúš?ÿûWÐÿü];ÿýÿý[ÿýÈwÿýÙèÿýX¼ÿý29ÿý>„ÿýMÿý­žÿý’–ÿüÍVÿüEbÿüG¶ÿünÆÿü+Xÿûz ÿû ÿû5Šÿû}®ÿû]×ÿûJMÿûR\ÿû”5ÿü!xÿüLwÿüµÿüE^ÿüæWÿý† ÿýË<ÿýbÿüÂnÿûÞÿûC[ÿû®ÿû,(ÿûŽËÿû¤âÿûW ÿû*öÿû#GÿúÏ ÿú_ÎÿúD`ÿú„­ÿúÁGÿúâpÿûNÐÿü)ÿüo‘ÿüVtÿûô`ÿûƒ@ÿúî!ÿútÿúJ¼ÿúÊÿù®bÿùÈüÿúm¶ÿû66ÿûþÁÿüÍ·ÿýTÕÿý’ÿý©ÿýººÿþ@ÿþ)~ÿýÚzÿýõÿûø²ÿûaõÿû¶ÿú÷"ÿûR,ÿûÿ,ÿüïÖÿý¨ìÿýÍVÿý°%ÿýWŸÿü•ÿû ÑÿúòŽÿúÜfÿû)§ÿûÖZÿüôgÿýÿÿþú2ÿÿÔwÿÿû ÿÿ•†ÿþÒÚÿý·]ÿü™¾ÿû„vÿú¢Êÿú\Xÿú‚0ÿú½ôÿû`ÿû`Lÿûš¾ÿûÄ ÿü =ÿü†wÿý!YÿýXüÿýªÿüÐÿÿü®Vÿü†KÿüVÚÿüRÌÿü^ÿülÿü”lÿüÀ}ÿüÎÿýøÿý~ÿý¬ÝÿýÅpÿýôRÿýξÿýj‡ÿýÿüìßÿý/¬ÿý©=ÿýõ—ÿþ2ÿþ2Fÿþ.ìÿþ·ÿýä¿ÿý²óÿýKêÿüà†ÿüµòÿüµçÿüèþÿý#ÿý$Øÿý£ÿüýBÿýŽÿý-RÿýwgÿýÚYÿþ%*ÿþ•RÿÿÿþþÍÿþ´¹ÿþnŒÿþÙÿý”ˆÿüïÆÿüGÕÿûسÿûCêÿú”ŽÿúdÿùÜ<ÿú.cÿú›Íÿú Àÿú¤¸ÿúííÿû#Uÿû-åÿû4ÿûA~ÿû`ÿûBƒÿû'uÿûOÿû¹Êÿû•žÿûQrÿúÝDÿúYCÿùÙÂÿùhÿùJ=ÿùW—ÿù3²ÿù,Žÿù~tÿùê©ÿú='ÿú\oÿúK«ÿú&2ÿùýÿú4ñÿúü‹ÿû}¯ÿûwÿûvnÿû†ÕÿûÍ@ÿüs;ÿüüÿüûHÿü…õÿûíÇÿû¤¤ÿû~ÿúØÿùûšÿùyXÿù2Ýÿù ÐÿùEgÿùä5ÿú‹éÿûŒÿüèSÿýÏÿþiëÿþùQÿÿc´-õ&ç¬óäT&dmT`oÿÿ£ãÿþ¨ÿþƒÿýé`ÿýØ ÿýìÍÿþ{3ÿÿ Íÿÿúÿþúuÿÿ8]ÿÿ’ ÿÿ¾I–h¦fÿÿ#ÀÿýÚ3ÿü¢‡ÿüNöÿü“ìÿü–eÿüHÞÿû®ÐÿúÎÞÿúGKÿúH×ÿúS>ÿúCüÿú˜•ÿûqdÿü`‰ÿýƒˆÿþ¯QÿÿkýÿÿÁ ÿÿÁ ÿÿÁ†ÿÿ†nÿÿÑÿþ»–ÿþf:ÿýù®ÿýkÿüe!ÿûžBÿûõÿúp\ÿùØÍÿù˜ÿøgÿøQ]ÿø£Îÿù$3ÿù¼ ÿú>KÿúŽöÿúuxÿùóéÿùt}ÿù@îÿù=zÿùe‚ÿúÙÿûlèÿüòÝÿýíFÿþ$Ëÿýì»ÿýÿÿýØàÿýÚYÿýeÂÿü³_ÿüdÿüsÄÿüi_ÿü@Mÿü4ÿü\ÿüc÷ÿý#ÿýUoÿýN.ÿý;ÿü¤^ÿü]:ÿüS]ÿüQëÿü8Jÿûä0ÿûlVÿûÿú»uÿú »ÿúvÞÿúDƒÿú‚Âÿû{ÿûŒ¤ÿûÛSÿü= ÿüž¨ÿüبÿüð¢ÿüöÿüø+ÿý ÿüì™ÿü¯÷ÿüŸÿü«ÿü‰íÿüYpÿü> ÿü/ŒÿüN½ÿüwÒÿüD$ÿûºWÿû9"ÿúçMÿúºeÿú½ŸÿúÆúÿúìÿû\±ÿû¤pÿû±‹ÿû¨WÿûGáÿú» ÿú?dÿùðlÿùóÿú,ÿú˜þÿûE£ÿüçÿüÓ:ÿýÓÿþÐ ÿÿZèÿÿª5ÿÿå*ÿÿÀwÿÿIÿþÐõÿþ€&ÿþ4xÿýưÿý/cÿüb£ÿûv¨ÿú²ÿú2´ÿùÓbÿù¡ˆÿùÇ`ÿú#•ÿú²‚ÿû¥ÀÿüÄÔÿýÄ#ÿþÈ:ÿÿÏe„ÒÊÅÀÅg6ÿÿÕÿÿ?ˆÿþž‚ÿý̧ÿü´{ÿûƒ!ÿú„âÿùô®ÿùõÓÿú\fÿúÝöÿû‹„ÿücdÿüîoÿý ºÿüâÿüÈÿü|uÿü^±ÿüKÿû¿vÿûŠÿûˆ¦ÿûÌíÿûñ¢ÿû¨Tÿûnšÿû«™ÿûüwÿü<Äÿü€œÿü¡Ÿÿü²ÿüAÿü33ÿûÄ÷ÿû%ÿû€µÿû.îÿúÃ0ÿúm9ÿú&Tÿùùöÿúiÿúˆzÿû ÿûCÿûÉžÿü KÿüŒnÿý <ÿý¨`ÿþNøÿþÆÿþÃ<ÿþˆ¹ÿþ4 ÿýÀÁÿýcÐÿýQ‹ÿý”Rÿþ®ÿþ£hÿþì~ÿþé]ÿþØÿþÐÿþ­Ñÿþ|•ÿþcYÿþkßÿþoïÿþ/óÿý¯Pÿý4+ÿüÖ ÿü‡Êÿü|®ÿüÎÝÿýJ›ÿýÓÿþgGÿÿ¬ÿÿ„þÿÿ˜ÓÿÿYEÿþïWÿþL9ÿýsTÿüo×ÿûsmÿúÖÅÿú ÿú§3ÿú¸©ÿú©ÿú|šÿú5mÿùâ;ÿù”ÿù£ÿø[ªÿ÷·áÿ÷NDÿ÷?ÿ÷‰·ÿ÷ùPÿø¸ÿù&œÿùÅìÿú—ÿûP(ÿû±!ÿû¼°ÿû·âÿûéTÿü>‡ÿü‹šÿü»•ÿü°ÿü¨÷ÿüuÜÿü/dÿü ðÿüÿûácÿû¹ýÿû¶"ÿû®ÿûÅùÿûÀ$ÿû¿cÿûÈ%ÿûÚ—ÿüƒÿür·ÿý>Öÿþ‡ÿþ‘ÿþìçÿÿ¢ÿÿ+«ÿÿäÿþÇpÿþpÿþQÿý¦¬ÿýi!ÿýZaÿý(‡ÿüíÏÿüÓÿü²uÿüz¼ÿüPBÿü6®ÿûö4ÿûwGÿúýÿúÒ¸ÿúÙ-ÿú¨Wÿú<Ôÿùõhÿùòéÿú ÿú4/ÿú£½ÿû]£ÿü9ÿÿý ¿ÿýÇpÿþkÿþêõÿÿ9ºÿÿLÿÿ8šÿÿéÿþÉCÿþ\ÿþWbÿþ+ÿýËÿýpDÿýâÿüÐaÿü”GÿüŒÿü¼ÖÿüøTÿý©ÿý•ÿüß°ÿü}ÿü¸ÿû»Ìÿû•íÿû¾Yÿü4ßÿü±‘ÿüÞ²ÿüéŒÿüò­ÿüµTÿü?€ÿûÖ_ÿûzÿû(×ÿúý¯ÿû ŽÿûRRÿû©¾ÿûárÿüEÿü"¼ÿû÷ÿû¾ÿûžÂÿû|yÿûDøÿúöÿúȈÿúîÚÿû>pÿû¬ÿü:ÿü–ÿüÒÿü[§ÿü'>ÿüXÿüÅÿüÑÿýQhÿþ”ÿþbÿþeÿþBbÿýÿ.ÿý•Kÿý%uÿü›¢ÿûøñÿûyÆÿûdÿúóÄÿû&ñÿû¡ºÿü+õÿü¢ûÿüúÿý$\ÿý&èÿý/;ÿýKNÿýOˆÿý! ÿüÚ­ÿüœúÿüs™ÿüfÿülgÿü|=ÿü™+ÿüŠÍÿüûÿûqÿúö^ÿúÉoÿúâúÿûXÿûD»ÿû]ÿûujÿû},ÿûZØÿû6Êÿû*rÿûÛÿûùÿû0 ÿûNþÿû^úÿû?ƒÿû xÿú÷1ÿû …ÿû¸ÿúüÑÿû„ÿûG ÿû˜¬ÿû½Èÿû¹rÿû¦<ÿû“bÿûŸnÿûéÿÿüG"ÿü{#ÿü˜ ÿüºŸÿüÙÙÿüÿîÿý5 ÿýdÿýtÜÿýeçÿýhñÿý›ÿýÀYÿý‘áÿý*ÿü¦:ÿü†–ÿü˜^ÿü¼$ÿý±ÿýûÿþ)+ÿþˆõÿþ›%ÿþyDÿþ4Èÿýìùÿý̘ÿýËgÿýÖ®ÿýö+ÿþ!Xÿþ6_ÿþÇÿý¦æÿýÿü ‘ÿü9ÀÿûôâÿûÓ`ÿûÁEÿû½Mÿû±¼ÿûvÿû+•ÿúÿ\ÿúåÿÿúÒ=ÿúÆÿúÌ7ÿúê®ÿû>ÿû<½ÿû[¯ÿûwºÿû“Ëÿû¯IÿûÊíÿûîµÿü#ÿüY,ÿü~Áÿü´áÿý Óÿý‰®ÿýĹÿýõqÿþ ãÿþBšÿþC>ÿýøÕÿý|îÿüäÿüAÄÿûÚ:ÿû¸±ÿû¹‚ÿûÍ…ÿûâÖÿûúÿü6 ÿü£/ÿýŠÿý,kÿüæíÿürnÿûÿ•ÿû­LÿûŽyÿû©¥ÿüUÿü‡†ÿý¡ÿý”Óÿýì/ÿþiÿþ\ÿý˜%ÿüÿ=ÿüošÿüŒÿûËúÿûÚèÿüßÿüW:ÿü…Øÿü¢ìÿü¹ÆÿüͰÿü½ÿük¼ÿûõÖÿû†bÿû@ ÿûA½ÿûuÿûÇ–ÿüSÿý:ÿýÖKÿþE†ÿþb!ÿþIÕÿþXÿý¤‡ÿýG ÿüÿ;ÿüÑ|ÿüÇ.ÿüå„ÿýôÿý=EÿýB ÿý¥ÿüÍÿü^sÿûñiÿû¥«ÿûoÈÿûhOÿû¥eÿülÿüVGÿü’þiris-edu-libmseed-4314359/test/data/Int32-512byte.mseed000066400000000000000000000010001422047135100222000ustar00rootroot00000000000000000001R TEST 00LHZXXÚ:3·p@0è8 é'ÿüMìÿüc$ÿür¨ÿü‚…ÿü†‰ÿüƒÿüŒ:ÿü€ÿübÛÿüNdÿü.gÿüXÿü# ÿü0ÿüIßÿüjßÿüˆÝÿü–Õÿü–3ÿüòÿüx¹ÿüX˜ÿüCçÿü>Ãÿü<ÏÿüF©ÿüZ»ÿü`›ÿülNÿüz‡ÿüv ÿüp@ÿük)ÿüqCÿü†*ÿüŒ³ÿüˆËÿü…!ÿüwlÿüpcÿüu7ÿütÿülfÿü^ÿüPQÿüLéÿüX;ÿübdÿücÿüiÿüs,ÿüyÿü{qÿüvÿü` ÿüGÁÿü*0ÿü ²ÿü„ÿü<¾ÿüaÿü…Ïÿü óÿü­Ñÿü£*ÿü‘/ÿüx9ÿü\fÿüR­ÿüF‚ÿü7?ÿü7‘ÿü=£ÿüG†ÿüb“ÿü}ÿü†õÿü‘§ÿüÿü€æÿüvžÿüeÜÿüU-ÿüRvÿüS3ÿüUôÿü\ÿüg±ÿüyÑÿüŽ‹ÿü—%ÿüˆžÿüu³ÿüe§ÿüXçÿü]vÿüg@ÿüi.ÿüb?ÿüOŒÿüLÒÿüapÿül©ÿüoGÿüqôÿür ÿüwÿüMÿüùÿüÿü„"ÿüzèiris-edu-libmseed-4314359/test/data/Int32-8192byte.mseed000066400000000000000000000200001422047135100222750ustar00rootroot00000000000000000001R TEST 00LHZXXÚ:·ð@0è8 é'ÿüÇÿüøøÿý&@ÿý>þÿý eÿüêÿüÍÿü¯0ÿü}ãÿüL;ÿü0ÿü@¶ÿü}ÁÿüÇòÿüý$ÿý‡ÿýDÿýŠÿýŽÿý Öÿý˜ÿý}ÿüÙÿürêÿü £ÿû®ÂÿûY›ÿû=ÿúëPÿúÞŸÿúØ’ÿúÎoÿú¶¹ÿú…¡ÿú=Dÿùî~ÿùɼÿùñ@ÿúKÖÿúÈ?ÿûm1ÿü(ËÿüÐÿý@Sÿý‚”ÿý½Ôÿýò‰ÿþ”ÿýáäÿýzsÿüäýÿüQsÿûéeÿûÚ”ÿü8bÿüÜoÿý†zÿý÷4ÿþÊÿýá1ÿý£~ÿýcÿÿý ÿü¡}ÿü6ÿû̪ÿûpîÿû:'ÿû9.ÿûeKÿûÄPÿüNKÿüÎ:ÿý.gÿýxnÿý¯ÿýΪÿýÄ¥ÿý‘ÆÿýKèÿýëÿüÀ?ÿü†ÇÿüPËÿü,ûÿü+ñÿü83ÿü#ÿûÚïÿû}öÿû;úÿû0ÿûa°ÿûÅMÿü:Íÿü¤Ïÿü÷èÿýJîÿý¿.ÿþGóÿþºGÿþó´ÿþçÒÿþ°ÙÿþuÿþHfÿþ.¼ÿþ4ÿþÌÿýîÃÿýÊ¢ÿý½ÿýg&ÿým_ÿý†äÿý‰ÿýNÿüòFÿüíÿüOÃÿümÿûÞÿû»{ÿû¨ÿû‘Ìÿûkqÿû;ÿûcÿúÈÿú‰¿ÿúKµÿú3£ÿúQaÿúˆ¶ÿúÈÿûuÿûb‚ÿû°±ÿûѳÿûÅ]ÿû¯ ÿûšÆÿû™bÿûÄÇÿü ¶ÿüfôÿüæÿý„¿ÿþ!0ÿþ‘§ÿþ£ŒÿþRkÿýцÿýHÿüÜYÿü´“ÿüÒnÿýëÿýuÿý˼ÿþ ^ÿþ!Zÿýüÿý›_ÿý”ÿüpvÿû¾ÿû ÿúQ¿ÿùžbÿù¸ÿø˜ÿøOäÿø@“ÿøbcÿø«cÿøñüÿù)eÿùhnÿùÊXÿúXzÿúêMÿûU·ÿûˆ,ÿû‚íÿûY`ÿû#ôÿûÿúò³ÿúçíÿúÙ³ÿú¾óÿú²ÿúÌÿúúâÿû;Oÿû‘IÿûòGÿü`ïÿüâÿý{4ÿþ Óÿþ¿oÿÿ\^ÿÿï^9¡Ù±þ’“MøÿÿØ‚ÿÿ$êÿþNÆÿýˆòÿüìÿümšÿûèÇÿûN@ÿú²àÿú72ÿúùÿú÷ÿúKÿú|ÿú£ƒÿúÓcÿû·ÿûg¿ÿû»!ÿüÿüjþÿüÄ6ÿýqÿüúTÿü³WÿüLóÿûà!ÿûzlÿû\ÿúÃÿúx7ÿúJžÿú?îÿú7µÿúßÿùÞ]ÿùÌÿùî”ÿú/6ÿú‰)ÿúõ¯ÿû\»ÿû»÷ÿü …ÿü1Bÿü3Sÿü—ÿûñÎÿûîùÿü ™ÿü2¯ÿü`«ÿü§®ÿýóÿý¶²ÿþXÈÿþâKÿÿ5ëÿÿCôÿÿ°ÿþÐÿÿþg`ÿýñ7ÿý„ÿý?xÿý.-ÿýGÿýv8ÿý¦kÿýìÿþVÖÿþÉâÿÿ'\ÿÿ^Fÿÿh*ÿÿC5ÿþë‘ÿþiâÿýéPÿý•/ÿýh¢ÿýNpÿý6Pÿý cÿü¾Ìÿü9Àÿûˆ~ÿúØŽÿú9dÿùª[ÿùCÏÿù*ÿùs¸ÿúñÿú“PÿûðÿûJ)ÿûjaÿûgÿû7ÿúÑÇÿúbIÿú1ïÿúZ(ÿúÓ ÿû×ÿüj„ÿýD¡ÿþ³ÿþ“vÿþùªÿÿYøÿÿ¿55EÀÇL´YÆ6S{rHÿÿkðÿþnÿý‡ÿüØTÿü:œÿû¬‚ÿû/XÿúÙ]ÿúËGÿúîRÿû bÿû”ÿûoÿúÏvÿú{ ÿúÿù§VÿùF²ÿøñ_ÿø—«ÿø1žÿ÷Ù˜ÿ÷¨õÿ÷ œÿ÷ÐmÿøLmÿù\ÿùÿÿúò†ÿûÄ8ÿü\Òÿü§[ÿü³÷ÿü¦ÒÿüŠÿüuÇÿüƒ‚ÿü£®ÿüÀ‡ÿüátÿý†ÿýs@ÿýãÿþiRÿÿÿÿûpUô¥+ú5>ÐHåÿ^üÿÿr¾ÿþSíÿý%ˆÿü"‰ÿûw|ÿûœÿû •ÿûSŽÿûíçÿüºÿÿýš¢ÿþ_þÿþÙpÿþù ÿþÊOÿþQiÿýš>ÿüÁòÿûê9ÿû/ðÿú¨çÿúmœÿú{Fÿú®NÿúíºÿûÁÿû'©ÿû GÿúêÿúÄBÿúŸ^ÿúŠÿú–HÿúÆÿû QÿûNQÿû†Úÿû§@ÿû±ÿû–^ÿû8sÿúŒöÿù¡ÿÿøœÕÿ÷°ÆÿöýõÿöŒ)ÿönGÿö¼ ÿ÷b¸ÿø@öÿùAOÿúM¡ÿûcÿüv~ÿýj>ÿþ2?ÿþÐKÿÿQ^ÿÿÁ,JfQ¢ûÞý#`o Ç×7d»N)áwY ¥’» –]Oþ Ù«›__Ý',dþ˜WÿÿÑÌÿÿ!€ÿþ–ÿþ.LÿýÉGÿý:oÿümVÿûhÿúJBÿùC§ÿø€Âÿø—ÿøéÿø-RÿøxÓÿøÊ5ÿù Sÿù3Eÿù3ÿù †ÿøÌÿøš|ÿøƒ,ÿø†Zÿø®%ÿøôZÿù;?ÿùp ÿù•–ÿù§ÿù£Hÿù“¾ÿùzKÿùXÔÿù4Zÿùrÿøó{ÿøÚlÿøÆ¢ÿø¿ÿøÏsÿù^ÿùx’ÿùá›ÿú4¦ÿúl×ÿúƒÿúŸ¶ÿú®Jÿúʹÿúü=ÿûBSÿû›˜ÿûõ ÿü;¾ÿüp"ÿü’¡ÿü¢Ùÿü­ÒÿüÂÿÿüó’ÿýQÍÿýß»ÿþ‚ÿÿKþä³åGa¶JãDWiQkQ!ßÝÏT41¹“7ÿÿ1ãÿþDBÿýp;ÿü½Kÿü&(ÿû pÿû·ÿú¿ÿùóÿùU”ÿøÆƒÿøQÿ÷þÿ÷Üùÿ÷ÿþÿø\¨ÿøÔÿùPÀÿù»ÿú @ÿúMÿús°ÿúgÿú;ÿù“ÙÿøÚ•ÿ÷üÿ÷ ÿö'´ÿõJÔÿôrˆÿó™–ÿò° ÿñ³½ÿðµAÿïÚ°ÿïKÿïJÿïJÿÿïÁýÿðsÿñs°ÿò×ZÿôªjÿöøËÿù«˜ÿü•¤ÿÿ•$‹ha@ <) êO ÿõ •Q Á· ˜þ Ež åê x‚ õƒ Yê ¢ À®ûÖS°2‡Dë¼áÿýîPÿûHrÿø8…ÿôäiÿñ{Ïÿî/õÿë5Èÿè¿Þÿæô3ÿåñÿåÌ ÿæeÿçÿ$ÿê-Zÿìëÿð%'ÿóýÿ÷‹¶ÿûOmÿþÿ´‚Ñ»?‹¬ Ù* •Î ¢¹ ëZ v d¯ šb+æB¢-µÿÿDˆÿüÎlÿúã¿ÿù‡ ÿø¹šÿø] ÿøF’ÿøOsÿøSáÿøB×ÿø )ÿ÷:ÿö­Zÿõ[Lÿó–7ÿñyÿï=­ÿíëÿêñ}ÿéfNÿè‰eÿèmÌÿé+«ÿê·FÿìøÿïÏ+ÿó¨ÿögáÿùÂÃÿüæìÿÿÊ*X-húõRêÏL! 'à ÈÞ­˜7Fwñ¦…7ñþA{€[¼öd2þiÓz²ÿÿbÛÿþ.ÿüî®ÿûÊOÿúá;ÿúYÿúL/ÿú°?ÿûqñÿüŒ‡ÿýñKÿÿ„ª3KØB¦h1OÕå>ßgRÒkÒL)Ð%^/ÿþàåÿýY‡ÿûÏÿúSžÿùÿ÷ó¸ÿ÷)èÿöÿõå`ÿõYõÿôì­ÿô™êÿôDÿóõ2ÿóÖîÿóôÿô^VÿõJÿöïÛÿùk=ÿü?Øé)§¼ æ)¸â<\(ÙÇ¥ºˆ” ¥, 0ĉ«ÏÿÿŒÿü‰ÿúhÁÿøöUÿøÑÿ÷Z ÿöÉ`ÿö nÿõçÿô DÿòÌÿñƒ¸ÿð[iÿï‰ÿï#Lÿï0ƒÿïòÿñ½ÿó­ÖÿöG]ÿùBÿü%±ÿÿrÈ·c›ùòÜ Šà (P ¡?éâ/ÿÿוÿüeNÿùlÿöÈÿóyñÿñ6ãÿïtPÿîwÿí+ëÿì‡4ÿìõÿëóøÿì•ÿì—çÿíiìÿîªCÿðiÛÿò•Aÿõ#?ÿø³ÿúò°ÿý½@‰6¨nÌÙh`¶ûÏÿÿÇšÿüã\ÿùtèÿõ¼`ÿñýÿîyÿëh¨ÿèðcÿç;ÿæ~ÿæÄÈÿçéuÿé¾òÿì(ýÿï#ÿòoÉÿõÜÝÿù9‘ÿüwÕÿÿx€"ê…«’º  Ê‘ 9 KC b Zù] ú=eK½ Yÿþ¹vÿü=2ÿùÕ«ÿ÷¨ÐÿõàÅÿô¬iÿô,Bÿô\µÿõ$œÿö_çÿ÷âÐÿù‹éÿû>‹ÿüÝRÿþFÃÿÿbz,£›Ø0Ù£†8”ÿÿ¬]ÿÿñÿþP‰ÿýª„ÿý7¾ÿý 0ÿý%‚ÿý…½ÿþ#ÿþÜpÿÿ‡Bìã†ô"Ämq!Ï\êD6ô´sM°O“Ð à"êLvHÊ6ÿÿükÿþ!˜ÿü4dÿú2uÿø68ÿöd©ÿô¼ ÿóB´ÿò+üÿñ—•ÿñ•*ÿò0ÿó[]ÿõãÿ÷;fÿù¤ëÿüzÿþ$C™ƒõ–^?,™õÃ"Æ(–"3³Z,jÄÚƒm¨,ÿ¨X“un5Òšî²iÿÿ•Êÿþ]ÐÿýÁÿûÍkÿú}ÿù.¶ÿ÷ävÿö–FÿõY®ÿôEcÿóKÿòdþÿñ®+ÿñ6aÿðñaÿðáéÿñ YÿñfÇÿñûÑÿòÒÿóç¹ÿõ@mÿöÑÿøxçÿú.TÿûòEÿý¸iÿÿŠ!{œ”±ØèD Ã\ %Á³0¤i»°« ÷I PKØE²ÿÿXÿú8fÿõRRÿðÉ=ÿìêžÿéÚäÿç­•ÿæl¦ÿæ>ÿæ{Sÿç‹ÿé)qÿëB ÿíÃüÿð jÿóÈÞÿ÷*ùÿú›KÿýÛÍ»žfÎõþ8½çµÒXL¡HíAP#èzÃÁßA%ˆÔþ­[òt=!X>2©D£ÿýÛÿøû·ÿôYæÿïrÿê›8ÿæD’ÿâáEÿàØÿà% ÿá$Aÿã¾ÿçØpÿí1Ðÿóg¨ÿúÌ›ïºû ~-Ýpü{ŒL)/ õ LëRà/Aÿþ èÿú$ºÿöÁÖÿô*Dÿò‚ËÿñØ”ÿò!ÿó¯ÿô›áÿö‚)ÿø{yÿúT3ÿûüçÿýOpÿþÿþPðÿýéÿüéQÿû_àÿùa2ÿ÷$½ÿôè¤ÿòë™ÿñ‚ÎÿðéÕÿñ<«ÿòœÿõÜÿøl|ÿüih¸¥òYœ WÈ ÜŸ ‘ ) ïÀÔ›{ŠÿýbõÿúØHÿùnÿ÷ð”ÿ÷¡8ÿ÷ÝÿøZ<ÿøôuÿùŽ“ÿùéaÿù×’ÿùb?ÿø–Áÿ÷ŠkÿökÿõnºÿôÉ—ÿô’ÅÿôÉúÿõw>ÿö˜—ÿøÿùfÿúõ^ÿüëÿý%ÿý®æÿþ®ÿþBÿþ|áÿþÿ‡ Äßÿüá %ž #Œuߑޒ æÃ àkßÿýðÿõJÿí©nÿç Gÿâ,dÿߟ”ÿßµqÿâ_æÿç8Õÿí–ÿô¹Úÿûæ9TITÆ qÊ uù {9Ù fÿÿÖ²ÿûØwÿø«ÿöÃ7ÿöeìÿ÷¢êÿúTIÿþÖX´™ß 0» ª ›L ü© ¨Æ½è ÿûÅ ÿõª©ÿïó.ÿë64ÿççÿæióÿæò5ÿégõÿíwµÿò©ÒÿøoÌÿþ+K5M~ Í@ F …èá1ÏÿþÝ=ÿú…ÿöÏÄÿôR?ÿóºÿôwXÿ÷^ÿúϹÿÿD²ÁqŽz Ú æ HÅÃ"ÿþÀÿùj¬ÿô‚ÿðž}ÿî/Fÿío"ÿîTMÿð›ÕÿóÓOÿ÷j¨ÿúÌÎÿýpÿÿƒtžPÿÿ?qÿý‹Çÿû¢°ÿú}ÿùBgÿù¹;ÿû~Åÿþno.=, Ï9 ~ä ªA ù€ i^:ýà5ÿúéÞÿôò>ÿï¥ÿë°›ÿé…ÿéEÿêÛåÿíû#ÿòKÿö›*ÿû ¨ÿþçò´­FºÖü¨Û[µ¹•Îÿÿ´ÿÿ;ÿÿE²ÿÿÅ=–!zd.…¾I@m$YÿþyŽÿüq§ÿú;Üÿøöÿõó‚ÿô4ÿòÛßÿñýÈÿñª÷ÿñÞ«ÿò†¹ÿóˆÿôÆ7ÿö:ÿ÷ï¤ÿùöŽÿü]»ÿÿ"k0™U{:„ Ÿ W h8 x% M_'r]ÜÿþD}ÿú=ðÿöÑ{ÿôcçÿó)ÿòû^ÿóùRÿõ¹üÿ÷ÞnÿúðÿûÀÿüÇÿüò,ÿü=ÿú¹€ÿøŸÿöéÿó²uÿñÓÄÿðçlÿñBÿòúÿõûpÿúÿþäSéù“Š dPÿÂtz L ÔŒ~.¦sÿû¿íÿ÷:ÊÿóL¹ÿð'ÅÿîÎÿì÷åÿìÛ›ÿí_2ÿî;ªÿï`]ÿðÄDÿòVŽÿôQÿöÿøu"ÿûIÿþ‰0+ ã¿ 4š‘Å•\ð› ~ñ uê>QÿþNÿøVEÿó%ŽÿïTÿí/ÿì–îÿí»¥ÿð?Óÿóœˆÿ÷1“ÿúsÿüóøÿþbËÿþ¾ŽÿþOµÿý{³ÿüŸuÿü œÿü’ÿüäÿþz$­R(Öd9à)>Qk" àËÿüóþÿøì)ÿõS2ÿòŸPÿñ1ºÿñ2}ÿò}íÿôÄèÿ÷œ!ÿú€÷ÿü÷Ñÿþ¨¥ÿÿq?ÿÿOÿÿþUOÿüÐàÿûA[ÿúÿù½¥ÿúLIÿûÂJÿþkßjÓk]:ÞÞ rüŠ­"ÿþ wÿúbäÿö’¤ÿó¶³ÿò3ÿñÒÿòÏ&ÿô²³ÿ÷(lÿùÞÕÿüeÿþB{ÿÿ‹ÿþèbÿýæEÿümÓÿúò6ÿùàtÿù±ÿù÷‡ÿûLÿýqi°XÊwú½ðg‰†äŽÿþiuÿúÂÊÿ÷¥-ÿõ‘NÿôØEÿõ”9ÿ÷Ž9ÿúOÅÿý@éÿÿÁŸ9î;ÿÿ²ÿüá*ÿùAIÿõ‰cÿòŽÚÿðõBÿñ’ÿó<ÿ÷Šÿü6¿VÚ¡ ½X ½ já ¶TÇÿÿÙÿø¸ÿó¸ÿïDÿí1,ÿíŽäÿï÷ÿóËKÿø5mÿümëÿÿË–ןsŸǰ*¾ÿþ"ÿüI ÿû#kÿúüPÿûÌÖÿýUÿÿ6Ùê®ê¼ßã±Êÿþ˜)ÿüuÿùhÑÿ÷Xªÿö@aÿö_!ÿ÷¸®ÿú´ÿüÁ7ÿÿDêþ?¸©ÿý™ËÿúD¥ÿö³ÿó¥ÖÿñßÓÿñç/ÿóÞµÿ÷…èÿüJ?k²3 ‚ º höÅs¤´ÿþ½­ÿùíÅÿö_ÿóˆáÿò¦Àÿó4nÿôÖ¿ÿ÷ÿù8ÿú™ÿûG?ÿûAÿú<Èÿù"ÿøK|ÿøKÿùbRÿûDÿþ“#§KV½ê¶õÎZúÌ.ÿûÛ~ÿ÷!¼ÿó|ÿñˆ€ÿñ˜Ïÿóœ$ÿ÷$Qÿû‡#ÿÿõNšÓÅèÇqï:†ÿý“ÿøÄAÿõ;°ÿó+ÿò÷ÿô£ÿ÷ÐKÿûÞb  ñÔ£¿©%P© ÿü£)ÿùlNÿöõÍÿõnÿÿôàâÿõ=ÿö:eÿ÷xÐÿø¨*ÿù‹ÿú\ÿú_ïÿú·4ÿûsÿüÉ6ÿþ¸“'ÜÝeE*M·4ÊqIj]Áÿü‰%ÿ÷uîÿòÜõÿïoÿí•Yÿír¸ÿïMÿñ÷ ÿõÙ!ÿú"°ÿþUÔõ¨¦Hjî/¹YÞéªnLþÉ!aÿþ-cÿûÿ)ÿù‚õÿöɦÿô ¯ÿñ«sÿð pÿïƒÿð8°ÿòG¼ÿõ®Ýÿú"Nÿÿ ­»AV ØÌ nÉ )¯E21ÿý…Pÿøù¬ÿõDãÿòÞÿñôÁÿò~òÿô-;ÿö°ÿùFŠÿûúÂÿþkoë¤ág—h{•šößxÿÿLÿýpFÿûkkÿùo0ÿ÷±ñÿö_oÿõ­–ÿõÉ–ÿöª~ÿø*Œÿú€ÿü@ÿýµáÿþìXÿÿ’²ÿÿª®ÿÿEPÿþ™ÿýüJÿý³Íÿýàµÿþ%ÿÿrx G¯ Qÿÿ§ ÿýr:ÿú£xÿ÷™DÿôÏ„ÿò½%ÿñµïÿñãÏÿóGyÿõ¸•ÿøç.ÿüjÇÿÿ×^ÁlÍ Æô¨ˆ –À"ÿý€}ÿúøîÿøÉvÿ÷$4ÿö(ÿõâäÿöRÿ÷_&ÿøÜ`ÿúš:ÿüzÿþS®ÿÿí-@Žø@L.Ìÿþ‡ÿü„†ÿúf/ÿø~ÿ÷+Nÿöºvÿ÷KÈÿøÉ¿ÿûÿýª­_ë§IØiþ˜×ÃÉÿÿ+1ÿü/ºÿùCÿöÏõÿõ0=ÿô›Äÿõ”ÿö†›ÿø]ÿúþÿýSÿÿYÜßÈPçå¯lÅ#ÿÿò,ÿþðKÿý³Ñÿü-mÿú_ ÿøiŽÿö†ùÿôöÄÿóç ÿóyYÿóÏ=ÿôônÿöÚBÿùY.ÿüCÿþÌee¨*:¶´C,0ÿþëtÿüU4ÿùÙ1ÿ÷òÊÿöøþÿ÷ vÿø$}ÿú,ÿüvÇÿþàôì“2`_<ZíÿÿQ-ÿüšúÿù©­ÿöý€ÿõ’ÿôXÙÿôã·ÿöŸ9ÿùJÿü‚€ÿÿÍL¨Ó¢©iÙ°ì+vÿü¥»ÿøçëÿõ„@ÿòþHÿñ·[ÿñî×ÿóŸÒÿö†·ÿúA×ÿþWŒF†á”« Ñ(ÙËšFöÿýfÿøïÔÿõpYÿó%ÿòÅÿò¾¾ÿôïÔÿøgÿü£b(ó“à7 ZC &ÕFˆìRÿÿ‡œÿú­õÿõò©ÿñÞìÿîè4ÿíg…ÿí” ÿïb4ÿò„ãÿö¡ ÿûSEX†® Ë“ ‘‹ û²'yU!ЧÿýèÛÿùò¸ÿö?èÿómÿðĺÿïlÁÿï‹ÿᄎÿñO9ÿó·yÿöÓÿúc<ÿþ"nÉÜe¨ Ií ³´½BrTFÿþË"ÿú(vÿõ£ÿñÓnÿïO*ÿîjµÿï1KÿñŒ5ÿõ4Vÿù«`ÿþaeÁÞ=°aæì˜ñÒÈŠÚ”ÿÿ£…ÿü—iÿú;ÿøL€ÿ÷o¨ÿ÷gËÿø ÿù'"ÿúnÐÿûŸ‡ÿü˜8ÿýfÿþLÿþ¿ÈÿÿNCÿÿÊÀ:‡¢+îÙ bã%O ÿÿ?üÿýÆÜÿûúNÿú_ÿøNèÿöó,ÿö5<ÿö@ìÿ÷!qÿøÃÜÿúÝÿýxÿþôa”³êe ºÿþ»Ñÿý=(ÿûË¥ÿúüÿùÚÿù–1ÿùÐÀÿúrMÿûXœÿücžÿýfÿþ …ÿþéÿþšŸÿþVÛÿý¥–ÿü‘?ÿû,ºÿù¨/ÿø;\ÿ÷bÿö.ÅÿõØ0ÿö)ÿ÷:îÿøüÿÿûGkÿýå›ó«q÷M/IOìs"ÿþÖÕÿûؼÿøãcÿöf•ÿôÓÿôy«ÿõnÿ÷…Çÿú`_ÿýƒFkÒªöíß(£*ýÿþÃöÿü6Pÿùèùÿø:5ÿ÷pÿ÷›7ÿø‘“ÿú˜ÿûçªÿý¬âÿÿ%•QˆÇm£ÿÿÚ£ÿþæçÿýÃBiris-edu-libmseed-4314359/test/data/Int32-oneseries-mixedlengths-mixedorder.mseed000066400000000000000000000376001422047135100276510ustar00rootroot00000000000000000001R TEST 00LHZXXÚ:2·@0è8é'ÿüuöÿüƒªÿü˜MÿüŸÑÿükÿü}ÿü~ ÿü‚/ÿüqÿü`Éÿüa¿ÿü`Ïÿügbÿü‡õÿü¾ÿü”000001R TEST 00LHZXXÚ:48·ð@0è8 é'ÿü{½ÿü‚¶ÿüv ÿü]KÿüNªÿü?ûÿüV†ÿü†ÿü‰tÿü‚Dÿü„›ÿünÿüQºÿüHBÿüZÿüsPÿün°ÿü^Mÿüo|ÿüŠ/ÿüs‡ÿüM¦ÿüMÿüU©ÿüW ÿüV§ÿüJ=ÿüGÿüWãÿü\ŸÿüWôÿü^ÉÿüyÝÿü±ÿüÊØÿü§¸ÿüŠCÿüv¹ÿüS|ÿü61ÿü(ÿüAtÿühºÿüvÿüˆÿü€5ÿüc¹ÿüsÿü„.ÿüy1ÿüwUÿü}©ÿü‘zÿü¤˜ÿü‰ºÿüvÿüpšÿüJhÿüEÿüQØÿü:Bÿü=.ÿüiÿüt»ÿü^"ÿüyÿüœrÿü…ÿüb´ÿüaÿü—!ÿüµFÿüêÿü´^ÿüljÿü­Cÿü‹Gÿüe}ÿünÚÿü`Øÿü ºÿüÿü“VÿüêíÿýgÿüòÙÿý <ÿý3,ÿýI4ÿýH¶ÿü¹yÿû¬AÿúÛcÿú–ÿúÑ ÿûÿü/@ÿü6ÿûæ’ÿûºŠÿûù²ÿü\¸ÿüÏDÿüþMÿüÛ1ÿüÍÿü•Eÿü9›ÿü)‰ÿü¡ÿûˆLÿûvÿû‰Õÿû oÿúâÿû ýÿûHKÿû„ÿûö‹ÿüyíÿüë¼ÿý“!ÿþDÿþ£ÿýøìÿýŸ"ÿý ÿü©+ÿü]qÿü+0ÿüâÿü¸@ÿü¤úÿü2€ÿûccÿûooÿü ¦ÿüœÿûÇ¡ÿûžÈÿûùÿü‰,ÿüôpÿýDÿüë/ÿüo2ÿý-ÿýùÔÿýÚîÿýæÿüTÿûx3ÿúJlÿú€¯ÿûžSÿûÐ)ÿü\ÿü ÿü͉ÿýt ÿþš–ÿÿU%ÿÿôÿýÿèÿüì?ÿüÿûJRÿúú½ÿûyOÿüÿýVrÿýÀkÿþ÷ÿý¥¶ÿý~ºÿý}ÿüàþÿüTËÿûùmÿûþÿý eÿüêÿüÍÿü¯0ÿü}ãÿüL;ÿü0ÿü@¶ÿü}ÁÿüÇòÿüý$ÿý‡ÿýDÿýŠÿýŽÿý Öÿý˜ÿý}ÿüÙÿürêÿü £ÿû®ÂÿûY›ÿû=ÿúëPÿúÞŸÿúØ’ÿúÎoÿú¶¹ÿú…¡ÿú=Dÿùî~ÿùɼÿùñ@ÿúKÖÿúÈ?ÿûm1ÿü(ËÿüÐÿý@Sÿý‚”ÿý½Ôÿýò‰ÿþ”ÿýáäÿýzsÿüäýÿüQsÿûéeÿûÚ”ÿü8bÿüÜoÿý†zÿý÷4ÿþÊÿýá1ÿý£~ÿýcÿÿý ÿü¡}ÿü6ÿû̪ÿûpîÿû:'ÿû9.ÿûeKÿûÄPÿüNKÿüÎ:ÿý.gÿýxnÿý¯ÿýΪÿýÄ¥ÿý‘ÆÿýKèÿýëÿüÀ?ÿü†ÇÿüPËÿü,ûÿü+ñÿü83ÿü#ÿûÚïÿû}öÿû;úÿû0ÿûa°ÿûÅMÿü:Íÿü¤Ïÿü÷èÿýJîÿý¿.ÿþGóÿþºGÿþó´ÿþçÒÿþ°ÙÿþuÿþHfÿþ.¼ÿþ4ÿþÌÿýîÃÿýÊ¢ÿý½ÿýg&ÿým_ÿý†äÿý‰ÿýNÿüòFÿüíÿüOÃÿümÿûÞÿû»{ÿû¨ÿû‘Ìÿûkqÿû;ÿûcÿúÈÿú‰¿ÿúKµÿú3£ÿúQaÿúˆ¶ÿúÈÿûuÿûb‚ÿû°±ÿûѳÿûÅ]ÿû¯ ÿûšÆÿû™bÿûÄÇÿü ¶ÿüfôÿüæÿý„¿ÿþ!0ÿþ‘§ÿþ£ŒÿþRkÿýцÿýHÿüÜYÿü´“ÿüÒnÿýëÿýuÿý˼ÿþ ^ÿþ!Zÿýüÿý›_ÿý”ÿüpvÿû¾ÿû ÿúQ¿ÿùžbÿù¸ÿø˜ÿøOäÿø@“ÿøbcÿø«cÿøñüÿù)eÿùhnÿùÊXÿúXzÿúêMÿûU·ÿûˆ,ÿû‚íÿûY`ÿû#ôÿûÿúò³ÿúçíÿúÙ³ÿú¾óÿú²ÿúÌÿúúâÿû;Oÿû‘IÿûòGÿü`ïÿüâÿý{4ÿþ Óÿþ¿oÿÿ\^ÿÿï^9¡Ù±þ’“MøÿÿØ‚ÿÿ$êÿþNÆÿýˆòÿüìÿümšÿûèÇÿûN@ÿú²àÿú72ÿúùÿú÷ÿúKÿú|ÿú£ƒÿúÓcÿû·ÿûg¿ÿû»!ÿüÿüjþÿüÄ6ÿýqÿüúTÿü³WÿüLóÿûà!ÿûzlÿû\ÿúÃÿúx7ÿúJžÿú?îÿú7µÿúßÿùÞ]ÿùÌÿùî”ÿú/6ÿú‰)ÿúõ¯ÿû\»ÿû»÷ÿü …ÿü1Bÿü3Sÿü—ÿûñÎÿûîùÿü ™ÿü2¯ÿü`«ÿü§®ÿýóÿý¶²ÿþXÈÿþâKÿÿ5ëÿÿCôÿÿ°ÿþÐÿÿþg`ÿýñ7ÿý„ÿý?xÿý.-ÿýGÿýv8ÿý¦kÿýìÿþVÖÿþÉâÿÿ'\ÿÿ^Fÿÿh*ÿÿC5ÿþë‘ÿþiâÿýéPÿý•/ÿýh¢ÿýNpÿý6Pÿý cÿü¾Ìÿü9Àÿûˆ~ÿúØŽÿú9dÿùª[ÿùCÏÿù*ÿùs¸ÿúñÿú“PÿûðÿûJ)ÿûjaÿûgÿû7ÿúÑÇÿúbIÿú1ïÿúZ(ÿúÓ ÿû×ÿüj„ÿýD¡ÿþ³ÿþ“vÿþùªÿÿYøÿÿ¿55EÀÇL´YÆ6S{rHÿÿkðÿþnÿý‡ÿüØTÿü:œÿû¬‚ÿû/XÿúÙ]ÿúËGÿúîRÿû bÿû”ÿûoÿúÏvÿú{ ÿúÿù§VÿùF²ÿøñ_ÿø—«ÿø1žÿ÷Ù˜ÿ÷¨õÿ÷ œÿ÷ÐmÿøLmÿù\ÿùÿÿúò†ÿûÄ8ÿü\Òÿü§[ÿü³÷ÿü¦ÒÿüŠÿüuÇÿüƒ‚ÿü£®ÿüÀ‡ÿüátÿý†ÿýs@ÿýãÿþiRÿÿÿÿûpUô¥+ú5>ÐHåÿ^üÿÿr¾ÿþSíÿý%ˆÿü"‰ÿûw|ÿûœÿû •ÿûSŽÿûíçÿüºÿÿýš¢ÿþ_þÿþÙpÿþù ÿþÊOÿþQiÿýš>ÿüÁòÿûê9ÿû/ðÿú¨çÿúmœÿú{Fÿú®NÿúíºÿûÁÿû'©ÿû GÿúêÿúÄBÿúŸ^ÿúŠÿú–HÿúÆÿû QÿûNQÿû†Úÿû§@ÿû±ÿû–^ÿû8sÿúŒöÿù¡ÿÿøœÕÿ÷°ÆÿöýõÿöŒ)ÿönGÿö¼ ÿ÷b¸ÿø@öÿùAOÿúM¡ÿûcÿüv~ÿýj>ÿþ2?ÿþÐKÿÿQ^ÿÿÁ,JfQ¢ûÞý#`o Ç×7d»N)áwY ¥’» –]Oþ Ù«›__Ý',dþ˜WÿÿÑÌÿÿ!€ÿþ–ÿþ.LÿýÉGÿý:oÿümVÿûhÿúJBÿùC§ÿø€Âÿø—ÿøéÿø-RÿøxÓÿøÊ5ÿù Sÿù3Eÿù3ÿù †ÿøÌÿøš|ÿøƒ,ÿø†Zÿø®%ÿøôZÿù;?ÿùp ÿù•–ÿù§ÿù£Hÿù“¾ÿùzKÿùXÔÿù4Zÿùrÿøó{ÿøÚlÿøÆ¢ÿø¿ÿøÏsÿù^ÿùx’ÿùá›ÿú4¦ÿúl×ÿúƒÿúŸ¶ÿú®Jÿúʹÿúü=ÿûBSÿû›˜ÿûõ ÿü;¾ÿüp"ÿü’¡ÿü¢Ùÿü­ÒÿüÂÿÿüó’ÿýQÍÿýß»ÿþ‚ÿÿKþä³åGa¶JãDWiQkQ!ßÝÏT41¹“7ÿÿ1ãÿþDBÿýp;ÿü½Kÿü&(ÿû pÿû·ÿú¿ÿùóÿùU”ÿøÆƒÿøQÿ÷þÿ÷Üùÿ÷ÿþÿø\¨ÿøÔÿùPÀÿù»ÿú @ÿúMÿús°ÿúgÿú;ÿù“ÙÿøÚ•ÿ÷üÿ÷ ÿö'´ÿõJÔÿôrˆÿó™–ÿò° ÿñ³½ÿðµAÿïÚ°ÿïKÿïJÿïJÿÿïÁýÿðsÿñs°ÿò×ZÿôªjÿöøËÿù«˜ÿü•¤ÿÿ•$‹ha@ <) êO ÿõ •Q Á· ˜þ Ež åê x‚ õƒ Yê ¢ À®ûÖS°2‡Dë¼áÿýîPÿûHrÿø8…ÿôäiÿñ{Ïÿî/õÿë5Èÿè¿Þÿæô3ÿåñÿåÌ ÿæeÿçÿ$ÿê-Zÿìëÿð%'ÿóýÿ÷‹¶ÿûOmÿþÿ´‚Ñ»?‹¬ Ù* •Î ¢¹ ëZ v d¯ šb+æB¢-µÿÿDˆÿüÎlÿúã¿ÿù‡ ÿø¹šÿø] ÿøF’ÿøOsÿøSáÿøB×ÿø )ÿ÷:ÿö­Zÿõ[Lÿó–7ÿñyÿï=­ÿíëÿêñ}ÿéfNÿè‰eÿèmÌÿé+«ÿê·FÿìøÿïÏ+ÿó¨ÿögáÿùÂÃÿüæìÿÿÊ*X-húõRêÏL! 'à ÈÞ­˜7Fwñ¦…7ñþA{€[¼öd2þiÓz²ÿÿbÛÿþ.ÿüî®ÿûÊOÿúá;ÿúYÿúL/ÿú°?ÿûqñÿüŒ‡ÿýñKÿÿ„ª3KØB¦h1OÕå>ßgRÒkÒL)Ð%^/ÿþàåÿýY‡ÿûÏÿúSžÿùÿ÷ó¸ÿ÷)èÿöÿõå`ÿõYõÿôì­ÿô™êÿôDÿóõ2ÿóÖîÿóôÿô^VÿõJÿöïÛÿùk=ÿü?Øé)§¼ æ)¸â<\(ÙÇ¥ºˆ” ¥, 0ĉ«ÏÿÿŒÿü‰ÿúhÁÿøöUÿøÑÿ÷Z ÿöÉ`ÿö nÿõçÿô DÿòÌÿñƒ¸ÿð[iÿï‰ÿï#Lÿï0ƒÿïòÿñ½ÿó­ÖÿöG]ÿùBÿü%±ÿÿrÈ·c›ùòÜ Šà (P ¡?éâ/ÿÿוÿüeNÿùlÿöÈÿóyñÿñ6ãÿïtPÿîwÿí+ëÿì‡4ÿìõÿëóøÿì•ÿì—çÿíiìÿîªCÿðiÛÿò•Aÿõ#?ÿø³ÿúò°ÿý½@‰6¨nÌÙh`¶ûÏÿÿÇšÿüã\ÿùtèÿõ¼`ÿñýÿîyÿëh¨ÿèðcÿç;ÿæ~ÿæÄÈÿçéuÿé¾òÿì(ýÿï#ÿòoÉÿõÜÝÿù9‘ÿüwÕÿÿx€"ê…«’º  Ê‘ 9 KC b Zù] ú=eK½ Yÿþ¹vÿü=2ÿùÕ«ÿ÷¨ÐÿõàÅÿô¬iÿô,Bÿô\µÿõ$œÿö_çÿ÷âÐÿù‹éÿû>‹ÿüÝRÿþFÃÿÿbz,£›Ø0Ù£†8”ÿÿ¬]ÿÿñÿþP‰ÿýª„ÿý7¾ÿý 0ÿý%‚ÿý…½ÿþ#ÿþÜpÿÿ‡Bìã†ô"Ämq!Ï\êD6ô´sM°O“Ð à"êLvHÊ6ÿÿükÿþ!˜ÿü4dÿú2uÿø68ÿöd©ÿô¼ ÿóB´ÿò+üÿñ—•ÿñ•*ÿò0ÿó[]ÿõãÿ÷;fÿù¤ëÿüzÿþ$C™ƒõ–^?,™õÃ"Æ(–"3³Z,jÄÚƒm¨,ÿ¨X“un5Òšî²iÿÿ•Êÿþ]ÐÿýÁÿûÍkÿú}ÿù.¶ÿ÷ävÿö–FÿõY®ÿôEcÿóKÿòdþÿñ®+ÿñ6aÿðñaÿðáéÿñ YÿñfÇÿñûÑÿòÒÿóç¹ÿõ@mÿöÑÿøxçÿú.TÿûòEÿý¸iÿÿŠ!{œ”±ØèD Ã\ %Á³0¤i»°« ÷I PKØE²ÿÿXÿú8fÿõRRÿðÉ=ÿìêžÿéÚäÿç­•ÿæl¦ÿæ>ÿæ{Sÿç‹ÿé)qÿëB ÿíÃüÿð jÿóÈÞÿ÷*ùÿú›KÿýÛÍ»žfÎõþ8½çµÒXL¡HíAP#èzÃÁßA%ˆÔþ­[òt=!X>2©D£ÿýÛÿøû·ÿôYæÿïrÿê›8ÿæD’ÿâáEÿàØÿà% ÿá$Aÿã¾ÿçØpÿí1Ðÿóg¨ÿúÌ›ïºû ~-Ýpü{ŒL)/ õ LëRà/Aÿþ èÿú$ºÿöÁÖÿô*Dÿò‚ËÿñØ”ÿò!ÿó¯ÿô›áÿö‚)ÿø{yÿúT3ÿûüçÿýOpÿþÿþPðÿýéÿüéQÿû_àÿùa2ÿ÷$½ÿôè¤ÿòë™ÿñ‚ÎÿðéÕÿñ<«ÿòœÿõÜÿøl|ÿüih¸¥òYœ WÈ ÜŸ ‘ ) ïÀÔ›{ŠÿýbõÿúØHÿùnÿ÷ð”ÿ÷¡8ÿ÷ÝÿøZ<ÿøôuÿùŽ“ÿùéaÿù×’ÿùb?ÿø–Áÿ÷ŠkÿökÿõnºÿôÉ—ÿô’ÅÿôÉúÿõw>ÿö˜—ÿøÿùfÿúõ^ÿüëÿý%ÿý®æÿþ®ÿþBÿþ|áÿþÿ‡ Äßÿüá %ž #Œuߑޒ æÃ àkßÿýðÿõJÿí©nÿç Gÿâ,dÿߟ”ÿßµqÿâ_æÿç8Õÿí–ÿô¹Úÿûæ9TITÆ qÊ uù {9Ù fÿÿÖ²ÿûØwÿø«ÿöÃ7ÿöeìÿ÷¢êÿúTIÿþÖX´™ß 0» ª ›L ü© ¨Æ½è ÿûÅ ÿõª©ÿïó.ÿë64ÿççÿæióÿæò5ÿégõÿíwµÿò©ÒÿøoÌÿþ+K5M~ Í@ F …èá1ÏÿþÝ=ÿú…ÿöÏÄÿôR?ÿóºÿôwXÿ÷^ÿúϹÿÿD²ÁqŽz Ú æ HÅÃ"ÿþÀÿùj¬ÿô‚ÿðž}ÿî/Fÿío"ÿîTMÿð›ÕÿóÓOÿ÷j¨ÿúÌÎÿýpÿÿƒtžPÿÿ?qÿý‹Çÿû¢°ÿú}ÿùBgÿù¹;ÿû~Åÿþno.=, Ï9 ~ä ªA ù€ i^:ýà5ÿúéÞÿôò>ÿï¥ÿë°›ÿé…ÿéEÿêÛåÿíû#ÿòKÿö›*ÿû ¨ÿþçò´­FºÖü¨Û[µ¹•Îÿÿ´ÿÿ;ÿÿE²ÿÿÅ=–!zd.…¾I@m$YÿþyŽÿüq§ÿú;Üÿøöÿõó‚ÿô4ÿòÛßÿñýÈÿñª÷ÿñÞ«ÿò†¹ÿóˆÿôÆ7ÿö:ÿ÷ï¤ÿùöŽÿü]»ÿÿ"k0™U{:„ Ÿ W h8 x% M_'r]ÜÿþD}ÿú=ðÿöÑ{ÿôcçÿó)ÿòû^ÿóùRÿõ¹üÿ÷ÞnÿúðÿûÀÿüÇÿüò,ÿü=ÿú¹€ÿøŸÿöéÿó²uÿñÓÄÿðçlÿñBÿòúÿõûpÿúÿþäSéù“Š dPÿÂtz L ÔŒ~.¦sÿû¿íÿ÷:ÊÿóL¹ÿð'ÅÿîÎÿì÷åÿìÛ›ÿí_2ÿî;ªÿï`]ÿðÄDÿòVŽÿôQÿöÿøu"ÿûIÿþ‰0+ ã¿ 4š‘Å•\ð› ~ñ uê>QÿþNÿøVEÿó%ŽÿïTÿí/ÿì–îÿí»¥ÿð?Óÿóœˆÿ÷1“ÿúsÿüóøÿþbËÿþ¾ŽÿþOµÿý{³ÿüŸuÿü œÿü’ÿüäÿþz$­R(Öd9à)>Qk" àËÿüóþÿøì)ÿõS2ÿòŸPÿñ1ºÿñ2}ÿò}íÿôÄèÿ÷œ!ÿú€÷ÿü÷Ñÿþ¨¥ÿÿq?ÿÿOÿÿþUOÿüÐàÿûA[ÿúÿù½¥ÿúLIÿûÂJÿþkßjÓk]:ÞÞ rüŠ­"ÿþ wÿúbäÿö’¤ÿó¶³ÿò3ÿñÒÿòÏ&ÿô²³ÿ÷(lÿùÞÕÿüeÿþB{ÿÿ‹ÿþèbÿýæEÿümÓÿúò6ÿùàtÿù±ÿù÷‡ÿûLÿýqi°XÊwú½ðg‰†äŽÿþiuÿúÂÊÿ÷¥-ÿõ‘NÿôØEÿõ”9ÿ÷Ž9ÿúOÅÿý@éÿÿÁŸ9î;ÿÿ²ÿüá*ÿùAIÿõ‰cÿòŽÚÿðõBÿñ’ÿó<ÿ÷Šÿü6¿VÚ¡ ½X ½ já ¶TÇÿÿÙÿø¸ÿó¸ÿïDÿí1,ÿíŽäÿï÷ÿóËKÿø5mÿümëÿÿË–ןsŸǰ*¾ÿþ"ÿüI ÿû#kÿúüPÿûÌÖÿýUÿÿ6Ùê®ê¼ßã±Êÿþ˜)ÿüuÿùhÑÿ÷Xªÿö@aÿö_!ÿ÷¸®ÿú´ÿüÁ7ÿÿDêþ?¸©ÿý™ËÿúD¥ÿö³ÿó¥ÖÿñßÓÿñç/ÿóÞµÿ÷…èÿüJ?k²3 ‚ º höÅs¤´ÿþ½­ÿùíÅÿö_ÿóˆáÿò¦Àÿó4nÿôÖ¿ÿ÷ÿù8ÿú™ÿûG?ÿûAÿú<Èÿù"ÿøK|ÿøKÿùbRÿûDÿþ“#§KV½ê¶õÎZúÌ.ÿûÛ~ÿ÷!¼ÿó|ÿñˆ€ÿñ˜Ïÿóœ$ÿ÷$Qÿû‡#ÿÿõNšÓÅèÇqï:†ÿý“ÿøÄAÿõ;°ÿó+ÿò÷ÿô£ÿ÷ÐKÿûÞb  ñÔ£¿©%P© ÿü£)ÿùlNÿöõÍÿõnÿÿôàâÿõ=ÿö:eÿ÷xÐÿø¨*ÿù‹ÿú\ÿú_ïÿú·4ÿûsÿüÉ6ÿþ¸“'ÜÝeE*M·4ÊqIj]Áÿü‰%ÿ÷uîÿòÜõÿïoÿí•Yÿír¸ÿïMÿñ÷ ÿõÙ!ÿú"°ÿþUÔõ¨¦Hjî/¹YÞéªnLþÉ!aÿþ-cÿûÿ)ÿù‚õÿöɦÿô ¯ÿñ«sÿð pÿïƒÿð8°ÿòG¼ÿõ®Ýÿú"Nÿÿ ­»AV ØÌ nÉ )¯E21ÿý…Pÿøù¬ÿõDãÿòÞÿñôÁÿò~òÿô-;ÿö°ÿùFŠÿûúÂÿþkoë¤ág—h{•šößxÿÿLÿýpFÿûkkÿùo0ÿ÷±ñÿö_oÿõ­–ÿõÉ–ÿöª~ÿø*Œÿú€ÿü@ÿýµáÿþìXÿÿ’²ÿÿª®ÿÿEPÿþ™ÿýüJÿý³Íÿýàµÿþ%ÿÿrx G¯ Qÿÿ§ ÿýr:ÿú£xÿ÷™DÿôÏ„ÿò½%ÿñµïÿñãÏÿóGyÿõ¸•ÿøç.ÿüjÇÿÿ×^ÁlÍ Æô¨ˆ –À"ÿý€}ÿúøîÿøÉvÿ÷$4ÿö(ÿõâäÿöRÿ÷_&ÿøÜ`ÿúš:ÿüzÿþS®ÿÿí-@Žø@L.Ìÿþ‡ÿü„†ÿúf/ÿø~ÿ÷+Nÿöºvÿ÷KÈÿøÉ¿ÿûÿýª­_ë§IØiþ˜×ÃÉÿÿ+1ÿü/ºÿùCÿöÏõÿõ0=ÿô›Äÿõ”ÿö†›ÿø]ÿúþÿýSÿÿYÜßÈPçå¯lÅ#ÿÿò,ÿþðKÿý³Ñÿü-mÿú_ ÿøiŽÿö†ùÿôöÄÿóç ÿóyYÿóÏ=ÿôônÿöÚBÿùY.ÿüCÿþÌee¨*:¶´C,0ÿþëtÿüU4ÿùÙ1ÿ÷òÊÿöøþÿ÷ vÿø$}ÿú,ÿüvÇÿþàôì“2`_<ZíÿÿQ-ÿüšúÿù©­ÿöý€ÿõ’ÿôXÙÿôã·ÿöŸ9ÿùJÿü‚€ÿÿÍL¨Ó¢©iÙ°ì+vÿü¥»ÿøçëÿõ„@ÿòþHÿñ·[ÿñî×ÿóŸÒÿö†·ÿúA×ÿþWŒF†á”« Ñ(ÙËšFöÿýfÿøïÔÿõpYÿó%ÿòÅÿò¾¾ÿôïÔÿøgÿü£b(ó“à7 ZC &ÕFˆìRÿÿ‡œÿú­õÿõò©ÿñÞìÿîè4ÿíg…ÿí” ÿïb4ÿò„ãÿö¡ ÿûSEX†® Ë“ ‘‹ û²'yU!ЧÿýèÛÿùò¸ÿö?èÿómÿðĺÿïlÁÿï‹ÿᄎÿñO9ÿó·yÿöÓÿúc<ÿþ"nÉÜe¨ Ií ³´½BrTFÿþË"ÿú(vÿõ£ÿñÓnÿïO*ÿîjµÿï1KÿñŒ5ÿõ4Vÿù«`ÿþaeÁÞ=°aæì˜ñÒÈŠÚ”ÿÿ£…ÿü—iÿú;ÿøL€ÿ÷o¨ÿ÷gËÿø ÿù'"ÿúnÐÿûŸ‡ÿü˜8ÿýfÿþLÿþ¿ÈÿÿNCÿÿÊÀ:‡¢+îÙ bã%O ÿÿ?üÿýÆÜÿûúNÿú_ÿøNèÿöó,ÿö5<ÿö@ìÿ÷!qÿøÃÜÿúÝÿýxÿþôa”³êe ºÿþ»Ñÿý=(ÿûË¥ÿúüÿùÚÿù–1ÿùÐÀÿúrMÿûXœÿücžÿýfÿþ …ÿþéÿþšŸÿþVÛÿý¥–ÿü‘?ÿû,ºÿù¨/ÿø;\ÿ÷bÿö.ÅÿõØ0ÿö)ÿ÷:îÿøüÿÿûGkÿýå›ó«q÷M/IOìs"ÿþÖÕÿûؼÿøãcÿöf•ÿôÓÿôy«ÿõnÿ÷…Çÿú`_ÿýƒFkÒªöíß(£*ýÿþÃöÿü6Pÿùèùÿø:5ÿ÷pÿ÷›7ÿø‘“ÿú˜ÿûçªÿý¬âÿÿ%•QˆÇm£ÿÿÚ£ÿþæçÿýÃB000001R TEST 00LHZXXÚ:3·p@0è8 é'ÿüMìÿüc$ÿür¨ÿü‚…ÿü†‰ÿüƒÿüŒ:ÿü€ÿübÛÿüNdÿü.gÿüXÿü# ÿü0ÿüIßÿüjßÿüˆÝÿü–Õÿü–3ÿüòÿüx¹ÿüX˜ÿüCçÿü>Ãÿü<ÏÿüF©ÿüZ»ÿü`›ÿülNÿüz‡ÿüv ÿüp@ÿük)ÿüqCÿü†*ÿüŒ³ÿüˆËÿü…!ÿüwlÿüpcÿüu7ÿütÿülfÿü^ÿüPQÿüLéÿüX;ÿübdÿücÿüiÿüs,ÿüyÿü{qÿüvÿü` ÿüGÁÿü*0ÿü ²ÿü„ÿü<¾ÿüaÿü…Ïÿü óÿü­Ñÿü£*ÿü‘/ÿüx9ÿü\fÿüR­ÿüF‚ÿü7?ÿü7‘ÿü=£ÿüG†ÿüb“ÿü}ÿü†õÿü‘§ÿüÿü€æÿüvžÿüeÜÿüU-ÿüRvÿüS3ÿüUôÿü\ÿüg±ÿüyÑÿüŽ‹ÿü—%ÿüˆžÿüu³ÿüe§ÿüXçÿü]vÿüg@ÿüi.ÿüb?ÿüOŒÿüLÒÿüapÿül©ÿüoGÿüqôÿür ÿüwÿüMÿüùÿüÿü„"ÿüzè000001R TEST 00LHZXXÚ: ·ð@0è8 é'ÿÿ‹zÿÿµOÿÿÑ(ÿÿxJÿþËAÿýÍÆÿü’Zÿû‘'ÿú@ÿùnJÿø&‰ÿ÷+¬ÿö–]ÿõÙçÿõ\pÿõá±ÿ÷!*ÿømÿù„¦ÿú|Hÿû=;ÿüÿýÓÿýß³ÿþ…9ÿþåÿþ¥ ÿýæ%ÿüÉäÿû„~ÿúMžÿù™^ÿùÃŽÿú@2ÿúßDÿû‘—ÿûØÿü$iÿüÉ¡ÿý~cÿþ\Iÿÿ[ÐâG®B)/ÿÿÌOÿÿ>ˆÿþ§lÿþ1ÄÿýÅÛÿý‚ÿü~ÿüs`ÿü6-ÿû¨ÿû@Ðÿû.+ÿûhÿû³“ÿû̧ÿûìlÿü&zÿûÃÐÿúüñÿúÝØÿûpšÿün$ÿýaŒÿýá"ÿþ-…ÿþ]Rÿþu­ÿþ”!ÿþÿþ2Cÿý”<ÿýOÿüË$ÿüŒaÿüPmÿü*6ÿü_Cÿü’:ÿü6yÿû‘fÿûÛÿú¼ïÿú)ïÿùyPÿøÑÂÿø^‡ÿøi°ÿù —ÿùî2ÿú~ðÿúæÿû€*ÿüêÿü„Èÿý¡ÿý0ÿývÕÿý$çÿüþ3ÿý#­ÿý…Ñÿýì®ÿþ0,ÿþWÿþu’ÿþaÿþ2¾ÿþDÿý±þÿýüÿü›3ÿüuAÿüO0ÿûüRÿû÷ÿü›ÿûõMÿûì ÿü*´ÿüÊfÿýdÂÿý`uÿýbÿý’ÿý ‰ÿüÞ’ÿü¿åÿüŒŽÿüŠÐÿü·Àÿüتÿý'ÿý‡•ÿýÈäÿþÿþ3‰ÿþ";ÿýã\ÿý¹çÿývUÿýˆÿü¾ÿü”šÿüBØÿûOÿú`ÿÿúbÿú}×ÿú$%ÿú&ÿú]Hÿú[ÿúš?ÿûWÐÿü];ÿýÿý[ÿýÈwÿýÙèÿýX¼ÿý29ÿý>„ÿýMÿý­žÿý’–ÿüÍVÿüEbÿüG¶ÿünÆÿü+Xÿûz ÿû ÿû5Šÿû}®ÿû]×ÿûJMÿûR\ÿû”5ÿü!xÿüLwÿüµÿüE^ÿüæWÿý† ÿýË<ÿýbÿüÂnÿûÞÿûC[ÿû®ÿû,(ÿûŽËÿû¤âÿûW ÿû*öÿû#GÿúÏ ÿú_ÎÿúD`ÿú„­ÿúÁGÿúâpÿûNÐÿü)ÿüo‘ÿüVtÿûô`ÿûƒ@ÿúî!ÿútÿúJ¼ÿúÊÿù®bÿùÈüÿúm¶ÿû66ÿûþÁÿüÍ·ÿýTÕÿý’ÿý©ÿýººÿþ@ÿþ)~ÿýÚzÿýõÿûø²ÿûaõÿû¶ÿú÷"ÿûR,ÿûÿ,ÿüïÖÿý¨ìÿýÍVÿý°%ÿýWŸÿü•ÿû ÑÿúòŽÿúÜfÿû)§ÿûÖZÿüôgÿýÿÿþú2ÿÿÔwÿÿû ÿÿ•†ÿþÒÚÿý·]ÿü™¾ÿû„vÿú¢Êÿú\Xÿú‚0ÿú½ôÿû`ÿû`Lÿûš¾ÿûÄ ÿü =ÿü†wÿý!YÿýXüÿýªÿüÐÿÿü®Vÿü†KÿüVÚÿüRÌÿü^ÿülÿü”lÿüÀ}ÿüÎÿýøÿý~ÿý¬ÝÿýÅpÿýôRÿýξÿýj‡ÿýÿüìßÿý/¬ÿý©=ÿýõ—ÿþ2ÿþ2Fÿþ.ìÿþ·ÿýä¿ÿý²óÿýKêÿüà†ÿüµòÿüµçÿüèþÿý#ÿý$Øÿý£ÿüýBÿýŽÿý-RÿýwgÿýÚYÿþ%*ÿþ•RÿÿÿþþÍÿþ´¹ÿþnŒÿþÙÿý”ˆÿüïÆÿüGÕÿûسÿûCêÿú”ŽÿúdÿùÜ<ÿú.cÿú›Íÿú Àÿú¤¸ÿúííÿû#Uÿû-åÿû4ÿûA~ÿû`ÿûBƒÿû'uÿûOÿû¹Êÿû•žÿûQrÿúÝDÿúYCÿùÙÂÿùhÿùJ=ÿùW—ÿù3²ÿù,Žÿù~tÿùê©ÿú='ÿú\oÿúK«ÿú&2ÿùýÿú4ñÿúü‹ÿû}¯ÿûwÿûvnÿû†ÕÿûÍ@ÿüs;ÿüüÿüûHÿü…õÿûíÇÿû¤¤ÿû~ÿúØÿùûšÿùyXÿù2Ýÿù ÐÿùEgÿùä5ÿú‹éÿûŒÿüèSÿýÏÿþiëÿþùQÿÿc´-õ&ç¬óäT&dmT`oÿÿ£ãÿþ¨ÿþƒÿýé`ÿýØ ÿýìÍÿþ{3ÿÿ Íÿÿúÿþúuÿÿ8]ÿÿ’ ÿÿ¾I–h¦fÿÿ#ÀÿýÚ3ÿü¢‡ÿüNöÿü“ìÿü–eÿüHÞÿû®ÐÿúÎÞÿúGKÿúH×ÿúS>ÿúCüÿú˜•ÿûqdÿü`‰ÿýƒˆÿþ¯QÿÿkýÿÿÁ ÿÿÁ ÿÿÁ†ÿÿ†nÿÿÑÿþ»–ÿþf:ÿýù®ÿýkÿüe!ÿûžBÿûõÿúp\ÿùØÍÿù˜ÿøgÿøQ]ÿø£Îÿù$3ÿù¼ ÿú>KÿúŽöÿúuxÿùóéÿùt}ÿù@îÿù=zÿùe‚ÿúÙÿûlèÿüòÝÿýíFÿþ$Ëÿýì»ÿýÿÿýØàÿýÚYÿýeÂÿü³_ÿüdÿüsÄÿüi_ÿü@Mÿü4ÿü\ÿüc÷ÿý#ÿýUoÿýN.ÿý;ÿü¤^ÿü]:ÿüS]ÿüQëÿü8Jÿûä0ÿûlVÿûÿú»uÿú »ÿúvÞÿúDƒÿú‚Âÿû{ÿûŒ¤ÿûÛSÿü= ÿüž¨ÿüبÿüð¢ÿüöÿüø+ÿý ÿüì™ÿü¯÷ÿüŸÿü«ÿü‰íÿüYpÿü> ÿü/ŒÿüN½ÿüwÒÿüD$ÿûºWÿû9"ÿúçMÿúºeÿú½ŸÿúÆúÿúìÿû\±ÿû¤pÿû±‹ÿû¨WÿûGáÿú» ÿú?dÿùðlÿùóÿú,ÿú˜þÿûE£ÿüçÿüÓ:ÿýÓÿþÐ ÿÿZèÿÿª5ÿÿå*ÿÿÀwÿÿIÿþÐõÿþ€&ÿþ4xÿýưÿý/cÿüb£ÿûv¨ÿú²ÿú2´ÿùÓbÿù¡ˆÿùÇ`ÿú#•ÿú²‚ÿû¥ÀÿüÄÔÿýÄ#ÿþÈ:ÿÿÏe„ÒÊÅÀÅg6ÿÿÕÿÿ?ˆÿþž‚ÿý̧ÿü´{ÿûƒ!ÿú„âÿùô®ÿùõÓÿú\fÿúÝöÿû‹„ÿücdÿüîoÿý ºÿüâÿüÈÿü|uÿü^±ÿüKÿû¿vÿûŠÿûˆ¦ÿûÌíÿûñ¢ÿû¨Tÿûnšÿû«™ÿûüwÿü<Äÿü€œÿü¡Ÿÿü²ÿüAÿü33ÿûÄ÷ÿû%ÿû€µÿû.îÿúÃ0ÿúm9ÿú&Tÿùùöÿúiÿúˆzÿû ÿûCÿûÉžÿü KÿüŒnÿý <ÿý¨`ÿþNøÿþÆÿþÃ<ÿþˆ¹ÿþ4 ÿýÀÁÿýcÐÿýQ‹ÿý”Rÿþ®ÿþ£hÿþì~ÿþé]ÿþØÿþÐÿþ­Ñÿþ|•ÿþcYÿþkßÿþoïÿþ/óÿý¯Pÿý4+ÿüÖ ÿü‡Êÿü|®ÿüÎÝÿýJ›ÿýÓÿþgGÿÿ¬ÿÿ„þÿÿ˜ÓÿÿYEÿþïWÿþL9ÿýsTÿüo×ÿûsmÿúÖÅÿú ÿú§3ÿú¸©ÿú©ÿú|šÿú5mÿùâ;ÿù”ÿù£ÿø[ªÿ÷·áÿ÷NDÿ÷?ÿ÷‰·ÿ÷ùPÿø¸ÿù&œÿùÅìÿú—ÿûP(ÿû±!ÿû¼°ÿû·âÿûéTÿü>‡ÿü‹šÿü»•ÿü°ÿü¨÷ÿüuÜÿü/dÿü ðÿüÿûácÿû¹ýÿû¶"ÿû®ÿûÅùÿûÀ$ÿû¿cÿûÈ%ÿûÚ—ÿüƒÿür·ÿý>Öÿþ‡ÿþ‘ÿþìçÿÿ¢ÿÿ+«ÿÿäÿþÇpÿþpÿþQÿý¦¬ÿýi!ÿýZaÿý(‡ÿüíÏÿüÓÿü²uÿüz¼ÿüPBÿü6®ÿûö4ÿûwGÿúýÿúÒ¸ÿúÙ-ÿú¨Wÿú<Ôÿùõhÿùòéÿú ÿú4/ÿú£½ÿû]£ÿü9ÿÿý ¿ÿýÇpÿþkÿþêõÿÿ9ºÿÿLÿÿ8šÿÿéÿþÉCÿþ\ÿþWbÿþ+ÿýËÿýpDÿýâÿüÐaÿü”GÿüŒÿü¼ÖÿüøTÿý©ÿý•ÿüß°ÿü}ÿü¸ÿû»Ìÿû•íÿû¾Yÿü4ßÿü±‘ÿüÞ²ÿüéŒÿüò­ÿüµTÿü?€ÿûÖ_ÿûzÿû(×ÿúý¯ÿû ŽÿûRRÿû©¾ÿûárÿüEÿü"¼ÿû÷ÿû¾ÿûžÂÿû|yÿûDøÿúöÿúȈÿúîÚÿû>pÿû¬ÿü:ÿü–ÿüÒÿü[§ÿü'>ÿüXÿüÅÿüÑÿýQhÿþ”ÿþbÿþeÿþBbÿýÿ.ÿý•Kÿý%uÿü›¢ÿûøñÿûyÆÿûdÿúóÄÿû&ñÿû¡ºÿü+õÿü¢ûÿüúÿý$\ÿý&èÿý/;ÿýKNÿýOˆÿý! ÿüÚ­ÿüœúÿüs™ÿüfÿülgÿü|=ÿü™+ÿüŠÍÿüûÿûqÿúö^ÿúÉoÿúâúÿûXÿûD»ÿû]ÿûujÿû},ÿûZØÿû6Êÿû*rÿûÛÿûùÿû0 ÿûNþÿû^úÿû?ƒÿû xÿú÷1ÿû …ÿû¸ÿúüÑÿû„ÿûG ÿû˜¬ÿû½Èÿû¹rÿû¦<ÿû“bÿûŸnÿûéÿÿüG"ÿü{#ÿü˜ ÿüºŸÿüÙÙÿüÿîÿý5 ÿýdÿýtÜÿýeçÿýhñÿý›ÿýÀYÿý‘áÿý*ÿü¦:ÿü†–ÿü˜^ÿü¼$ÿý±ÿýûÿþ)+ÿþˆõÿþ›%ÿþyDÿþ4Èÿýìùÿý̘ÿýËgÿýÖ®ÿýö+ÿþ!Xÿþ6_ÿþÇÿý¦æÿýÿü ‘ÿü9ÀÿûôâÿûÓ`ÿûÁEÿû½Mÿû±¼ÿûvÿû+•ÿúÿ\ÿúåÿÿúÒ=ÿúÆÿúÌ7ÿúê®ÿû>ÿû<½ÿû[¯ÿûwºÿû“Ëÿû¯IÿûÊíÿûîµÿü#ÿüY,ÿü~Áÿü´áÿý Óÿý‰®ÿýĹÿýõqÿþ ãÿþBšÿþC>ÿýøÕÿý|îÿüäÿüAÄÿûÚ:ÿû¸±ÿû¹‚ÿûÍ…ÿûâÖÿûúÿü6 ÿü£/ÿýŠÿý,kÿüæíÿürnÿûÿ•ÿû­LÿûŽyÿû©¥ÿüUÿü‡†ÿý¡ÿý”Óÿýì/ÿþiÿþ\ÿý˜%ÿüÿ=ÿüošÿüŒÿûËúÿûÚèÿüßÿüW:ÿü…Øÿü¢ìÿü¹ÆÿüͰÿü½ÿük¼ÿûõÖÿû†bÿû@ ÿûA½ÿûuÿûÇ–ÿüSÿý:ÿýÖKÿþE†ÿþb!ÿþIÕÿþXÿý¤‡ÿýG ÿüÿ;ÿüÑ|ÿüÇ.ÿüå„ÿýôÿý=EÿýB ÿý¥ÿüÍÿü^sÿûñiÿû¥«ÿûoÈÿûhOÿû¥eÿülÿüVGÿü’þ000001R TEST 00LHZXXÚ:2·0@0è8é'ÿü‚Wÿül—ÿü^ÿü_†ÿüoôÿüŠ ÿürÿü™Gÿü…ÿüŒ©ÿü£?ÿü—ˆÿüfPÿü=äÿü:´ÿü,_ÿü!Xÿü(Þÿü!Cÿü-†ÿüBÿüNsÿür­ÿüŽÿü‹ÿü’4ÿü£~ÿü²aÿüÄìÿüÉáÿü±[ÿüŠ ÿümÚÿüaÿüP‡ÿüLæÿülPÿüŠÿüŸ×ÿü aÿü‡.ÿü‹³ÿü ÿühÿüIéÿüDkÿüD;ÿüA÷000001R TEST 00LHZXXÚ:88·ð@0è8 é'ÿý©ÊÿþHÿþYrÿþ%ÿý€Dÿüxÿûßòÿû˜ÿû\ÿûbþÿûiÿû°8ÿüB|ÿüŠ ÿüˆ ÿüŒÿû…fÿûÙ¸ÿür²ÿüàÿýPÿüÛ4ÿüÕ&ÿüœõÿüK³ÿü¯¿ÿüí-ÿüfÿü}ÿü Žÿûü£ÿûÝeÿûÞmÿû»¯ÿû~Ðÿûoýÿû¶çÿûñýÿüÄÿü·‹ÿýlÆÿý?¸ÿý0/ÿý¤jÿýÙ†ÿý ØÿýFáÿüðaÿü„²ÿü´ÿûÞuÿûãÿüUÓÿüŨÿü“CÿüÿûÂÛÿûï‘ÿü=“ÿü[þÿüH‘ÿüs…ÿülÿü‰ÿû‚|ÿúÿÿûCfÿü²ÿü”óÿüù•ÿýZéÿýºðÿýÞÿý£ÎÿýJbÿüÍÿüŒÿûJzÿúïüÿû(XÿûŽjÿü-sÿüÙàÿý©ÿý$’ÿýlrÿý_>ÿüôUÿü•±ÿüEÎÿû˯ÿûÆkÿü®ÿüFÿü(kÿü˜ÿý¸ÿüÞûÿüª'ÿü¢cÿük ÿü?½ÿü–/ÿý*ÿý3|ÿüæÁÿüÄ'ÿü–ÿü:ÿü2ÿüTÂÿüj%ÿüg5ÿü›†ÿüÄ`ÿüµÿüyèÿü^ ÿüj™ÿü<5ÿüjÿüb\ÿüÚÿüà2ÿü²ÿü¬ƒÿüŠ£ÿüb5ÿüK¡ÿüÿûæÝÿûþ ÿüÿü Uÿüæÿürlÿý=žÿýÜ•ÿýÊÈÿýk·ÿýCÿü‘ÿûáSÿûÆYÿû¥»ÿûI”ÿûf÷ÿûÝÿüEÈÿü¢gÿüèÙÿüþsÿüÝÐÿü«jÿüeÏÿü42ÿü5öÿüõÿü¸ÿü_Øÿü“éÿü·‚ÿüæ-ÿüÇ'ÿüwÿüfÿûÖ"ÿûè ÿûýsÿûè½ÿûÑUÿû×’ÿûù:ÿü µÿü0ÄÿüK©ÿüTèÿü¶dÿýäÿüÃ.ÿüy¶ÿüqÕÿüg$ÿüeÿüpoÿü_±ÿü9Uÿü=#ÿü…¿ÿü„\ÿü'ÿû´¢ÿû»ÿûÌYÿü!,ÿü˜]ÿüÀOÿüÊdÿüÒ ÿüŽýÿüH;ÿüOòÿü=ÿü¯ÿûøsÿü*•ÿüˆ’ÿü™æÿüpcÿü–Ôÿü­ëÿüYÿü$¤ÿü>kÿü<}ÿü< ÿü©ÿý!¢ÿý&­ÿüõ^ÿüÄAÿü¥¤ÿü›QÿüëÿüÀÆÿýÿüèÊÿü õÿürÿüPjÿü8"ÿûß{ÿûÿûe+ÿûF¿ÿû^!ÿûÌ?ÿüVpÿüÛ™ÿý“ÿý(_ÿý4¡ÿüú$ÿüÕÿüìÿüÕcÿüf-ÿûûÄÿûÍgÿû °ÿû´ÿûÃAÿûôêÿü ¼ÿü.wÿül†ÿü¼ÿý ”ÿýLÙÿýgÿÿý=pÿüßmÿü£ÛÿüdBÿûú¯ÿû¦vÿûdüÿûlCÿû¿ÿü(ùÿü”ÿüÎþÿýBÿý'ÿý ¦ÿý Gÿýkÿüåmÿüèrÿü÷Ôÿü­|ÿüzÿü`bÿü@ŽÿüBÓÿü:¿ÿü>UÿüC¯ÿüMÚÿücÿü}Ðÿüpàÿü´FÿüàÿüÇÿü¢°ÿüjóÿü‘ÿû¶ ÿû8îÿû4ÿû¤\ÿûü!ÿü'ÿü:pÿüo6ÿüÉßÿýVÿý65ÿý-#ÿýÙÿüÚîÿüuÜÿüðÿûÍÜÿûËiÿü2 ÿü­ÄÿüìTÿṳ̈ÿü`ÿü+UÿüPcÿü%ÿû….ÿû’ÿûHëÿû±Íÿü±ÿüPGÿüFÿü’)ÿüžíÿü|MÿüF#ÿüoÿüªÿÿüƒÿüVŠÿüH…ÿüD5ÿü„ÿü´°ÿüšÈÿügWÿüEÿüÂÿûßlÿûÖÎÿüwÿü&çÿüêÿüÿü$ÿü#Wÿü›ÿüÜÿü)µÿüzåÿüà­ÿý-lÿý*HÿüîCÿüËêÿüÓ1ÿüÆÚÿü³õÿü¯Aÿü®±ÿü·¡ÿüÕ2ÿüôÿüÝžÿüçnÿý+{ÿýÿü×6ÿü»†ÿü­¢ÿüÆ+ÿüÑüÿü”xÿüOÖÿü-üÿü †ÿüDÿûè+ÿû¼nÿûÄ»ÿü™ÿüu¢ÿü‚ÿü9ÿü«!ÿü»Œÿü¨ÿü¬ÿÿü®¼ÿü~·ÿü|¶ÿü¯úÿü´ ÿüÁTÿüÇ3ÿüp”ÿü¡ÿû­Mÿû¾–ÿüNeÿüyÿü´ÿûÍ¡ÿûÞÿûî¿ÿûþÿü Uÿü/ãÿü5Œÿü#ØÿûÒ›ÿû‘`ÿûƒ„ÿûSÿûÿû[ˆÿûáÂÿüvÿûÍÿûÁÿû¼gÿû–ÿûyìÿûtìÿûw†ÿû©ïÿûøŽÿüV—ÿüáÚÿýp$ÿþ¯ÿþÜ’ÿÿUæÿÿ†”ÿÿlÂÿþòzÿþ2ÿýGMÿüZ»ÿûÙ‰ÿûÆâÿû°Ñÿû¨žÿûÜWÿü2.ÿüv”ÿüzœÿüXpÿüuÿüºÿü¢žÿüˆÄÿüŒPÿü@cÿü Cÿü4§ÿûé•ÿû@ÿû‹ÕÿûÊ3ÿü8"ÿü Úÿüó>ÿý©ÿüòyÿý¯ÿýi¹ÿýGƒÿý2óÿýÆÿü‘ÿü' ÿûáuÿûU˜ÿúÍSÿúò¯ÿûš{ÿüFÿüŽ(ÿý‘°ÿþœ)ÿÿg¥ÿÿÅTÿÿ¦ÓÿÿW@ÿÿM¦ÿÿx0iris-edu-libmseed-4314359/test/data/SRO-encoded.mseed000066400000000000000000000100001422047135100221520ustar00rootroot00000000000000000001M TEST LHEXX¶hˆÀ€0è  ' *   ¯Ú¯ª¯t¯S¯`¯ˆ¯»¯æ   - ? E 8  ¯ç¯Ð¯¿¯³¯£¯›¯¯x¯t¯‰¯±¯Ö¯ÿ  ¯ÿ¯ï¯à¯æ¯î¯û ¯ö¯Ö¯¡¯d¯9¯)¯-¯N¯’¯Ì¯ë¯ã¯Ó¯À¯À¯æ  7 1 ¯®¯K¯®ô¯#¯u¯Ë  < F G E S j …  „ T ¯È¯¯J¯0¯;¯Y¯v¯¯¬¯·¯®¯¥¯·¯ë , q ™ Œ S¯ÿ¯§¯o¯[¯l¯‡¯„¯k¯f¯y¯¥¯ñ D o _ #¯Ê¯|¯Y¯S¯`¯|¯¯¯|¯{¯˜¯µ¯Õ¯þ % %  ¯Þ¯±¯¯q¯m¯¯˜¯®¯Ã¯Ó¯×¯ä¯ý  5 H 6 ¯ð¯à¯Ö¯é   ¯ø¯·¯o¯<¯)¯+¯A¯^¯r¯¯Œ¯³¯î ( Q Q &¯à¯Ž¯F¯¯¯4¯^¯Ž¯©¯¿¯Ó¯ú 1 s ª Ì Û ¿ g¯ý¯¢¯l¯f¯‡¯±¯Ø¯ê¯å¯Ý¯Ý¯ñ   . D H 3 ¯ê¯Õ¯Ë¯Ð¯Ö¯Ý¯â¯æ¯á¯ä¯ï   0 @ ? - ¯Ø¯©¯¯|¯p¯|¯Œ¯•¯’¯—¯£¯¿¯ø 5 f m T !¯Û¯ ¯ƒ¯v¯s¯{¯}¯}¯r¯p¯„¯ª¯×   + 1 ¯ù¯À¯s¯,¯ ¯ ¯%¯d¯´¯ñ   ¯÷¯á¯ê¯õ¯×¯¯z¯n¯r¯™¯Û ! N K %¯ì¯¾¯¨¯¦¯¨¯³¯Ä¯Ø¯ï¯ð¯ó¯û  ( I j w f M 3  ' B R D ¯Ð¯‰¯g¯m¯˜¯Î¯ç¯Ý¯¶¯‡¯g¯b¯ˆ¯Å¯ö ¯ÿ¯ì¯à¯à¯è¯î¯ô¯â¯­¯q¯8¯®î¯¯1¯[¯‚¯¨¯Æ¯Ô¯¿¯œ¯y¯b¯a¯w¯”¯ª¯¹¯²¯‘¯f¯Q¯a¯p¯€¯”¯µ¯Õ¯ï  # > H 6  ¯Ï¯‡¯6®î®Ú¯¯J¯¯ð ( 4 , * 4 D ] b 7¯ç¯Ž¯A¯¯¯B¯u¯§¯Ç¯ã   ? … Ñ¡ ¡ ì † ¯~¯ ®Á®Ÿ®ª®Ü¯*¯ƒ¯Ë¯ÿ ' W s v t m K  ¯½¯r¯3¯®û¯¯3¯\¯ƒ¯œ¯§¯®¯¿¯×¯ç¯æ¯Ð¯§¯q¯;¯¯¯ ¯0¯O¯n¯ˆ¯¥¯È¯ô ! ? = ¯î¯²¯ƒ¯v¯¯ž¯¼¯Í¯Í¯Î¯Ò¯Ì¯Á¯¬¯Œ¯k¯I¯.¯(¯8¯Z¯s¯x¯¯¯¥¯·¯È¯è  9 P R @ ' ¯ð¯Ý¯Ê¯È¯Õ¯ð   D z Ÿ ¤ œ ‡ X ¯å¯Ù¯Ù¯é¯ÿ    ¯ü¯ø   + @ S J &¯ô¯¾¯¤¯®¯Õ  Q { … p C ¯ý¯ò¯Ý¯¼¯“¯Y¯%¯¯¯¯Z¯£¯å  - N ^ M '¯ö¯¼¯Œ¯r¯r¯¯ž¯²¯¸¯¶¯°¯¼¯Ø  0 K P B ¯Ð¯¯V¯0¯1¯O¯…¯¾  < i ‰ œ ” j ¯®¯D®î®¿®Ï¯¯~¯à < { ˆ o =  ¯ä¯Ä¯°¯™¯w¯P¯&¯ ¯ ¯3¯l¯¢¯Ò¯ÿ ) C ] m e 5¯ð¯¤¯a¯C¯O¯h¯ƒ¯’¯ˆ¯}¯ƒ¯œ¯¯¯­¯Ÿ¯“¯y¯_¯_¯y¯¡¯Â¯Ô¯Ò¯Â¯»¯°¯©¯§¯«¯±¯Á¯Á¯¸¯º¯Ì¯è   ' ¯ú¯Ø¯Î¯Û¯ê   1 > , ¯ú¯ç¯Ö¯Å¯´¯£¯š¯»¯ê ! W w e 3¯ô¯´¯‚¯l¯t¯„¯”¯­¯Ç¯á  9 ` p Y $¯ß¯™¯g¯c¯ˆ¯¶¯ä          ¯÷¯Ñ¯Ÿ¯l¯<¯)¯9¯e¯’¯¼¯Ô¯Ñ¯Ï¯Ù¯Ú¯Ö¯Ë¯´¯œ¯€¯u¯…¯¬¯à     ¯ñ¯Ù¯À¯¨¯—¯”¯“¯–¯®¯È¯ã¯ø   ¯õ¯í¯Ü¯Å¯®¯›¯¯Š¯„¯¯’¯­¯Ç¯ë   " ( + %   " , - !¯û¯¿¯Š¯k¯[¯K¯X¯€¯Ÿ¯´¯Å¯Ø¯è¯û  A Q 3¯ù¯§¯O¯®ð¯¯A¯…¯·¯Ñ¯Ñ¯Í¯Ø¯Þ¯ç¯ó¯ê¯Õ¯¾¯¬¯§¯¸¯à¯ÿ     ¯þ¯ë¯Â¯†¯G¯¯¯ ¯_¯²  . 3 ¯à¯¹¯Ÿ¯¯¯Ž¯¯‹¯Š¯ž¯Î  X | m :¯ó¯§¯g¯K¯Y¯‚¯®¯×  * I ` q l M ¯¹¯e¯'¯¯¯@¯l¯š¯Ò¯ø¯ÿ    + ¯é¯³¯‡¯c¯W¯g¯„¯£¯¹¯¿¯±¯ž¯¯‡¯—¯³¯Ë¯ë  ¯ý¯ð¯à¯Ç¯¬¯‘¯Š¯˜¯§¯´¯Æ¯Ô¯É¯¨¯€¯c¯W¯T¯]¯x¯¯Ä¯í   ) C N 7 ¯é¯¹¯¯>¯¯¯N¯¥  x Ì ê Â m ¯»¯†¯^¯C¯=¯4¯/¯F¯¯í E ‹ ² ¨ o ¯Ð¯’¯b¯>¯1¯3¯F¯g¯š¯Ú  J  œ ƒ I¯ÿ¯¯¯`¯&¯¯7¯Q¯_¯^¯f¯¯©¯Ý  M X C ¯ä¯º¯ž¯¯…¯s¯h¯k¯~¯ª¯Û  9 D 1 ¯æ¯¹¯‘¯v¯Z¯W¯s¯£¯Õ     ¯ù¯ñ¯ì¯ó¯þ¯ø¯Ö¯¯¯¯˜¯¡¯¸¯Î¯é¯û    ¯÷¯×¯°¯¯r¯d¯p¯‡¯Œ¯…¯y¯s¯ƒ¯´¯õ - ^ z p L % ¯ç¯Ï¯À¯§¯¯b¯]¯u¯ž¯Ð   4 C ; ¯å¯º¯¯o¯[¯X¯m¯Š¯³¯Ù¯û  1 / 1 &¯÷¯±¯|¯Z¯E¯I¯Y¯q¯…¯’¯–¯–¯›¯¡¯¼¯â   ! - - ¯à¯¯¯Š¯z¯ƒ¯¨¯Ç¯Ü¯ã¯ë¯ò¯ó   ¯ÿ¯×¯š¯^¯D¯\¯˜¯Ø   1 3 ¯÷¯ï¯ö¯ü¯ù¯ê¯È¯Ÿ¯v¯o¯Œ¯¶¯á  7 C 8 $  ¯ã¯¸¯¯i¯H¯8¯>¯P¯g¯”¯Ü " U | –  [ ¯É¯¯j¯X¯Z¯n¯“¯À¯â¯þ   ¯Ï¯œ¯p¯\¯R¯U¯T¯R¯\¯p¯’¯Ä¯ü - V i a U I 7 ¯î¯º¯Œ¯n¯h¯k¯|¯›¯È  G … ¹ Ø Ï Ž >¯ï¯¥¯s¯g¯v¯¯ ¯¡¯ª¯Á¯Ü  ; y ‘ w <¯þ¯½¯¯~¯–¯¶¯É¯Ç¯À¯È¯×¯ë    * , $  ¯ÿ  "  ¯ç¯Ï¯´¯Ž¯„¯‘¯ª¯È¯â¯ñ¯ï¯á¯Þ¯Õ¯Ç¯Ä¯Æ¯¹¯›¯†¯‚¯ˆ¯¯›¯¸¯Ð¯Ì¯½¯¼¯Â¯Ä¯½¯È¯è  ' .  ¯ì¯¦¯Q®þ®Ð®Ô®ó¯&¯g¯¦¯Ó¯ö # Q i h D ¯¬¯K¯¯ ¯'¯H¯o¯š¯¿¯Ö¯ë¯þ    &     ¯î¯Ç¯¯…¯t¯h¯o¯m¯^¯Z¯e¯‰¯Æ  : \ [ @ ' ¯ü¯ó¯í¯ã¯Ì¯¸¯œ¯‡¯ˆ¯‘¯¯¯Ò¯ø   ¯Ü¯¸¯©¯¶¯Þ  ¯ý¯Ç¯‡¯R¯6¯8¯c¯¡¯Õ¯ø      * 6 / ¯ô¯Ê¯¯_¯T¯k¯œ¯Ò¯õ¯ÿ¯ö¯Ù¯¥¯z¯y¯„¯ˆ¯Ž¯Ÿ¯ª¯¬¯°¯¾¯Ù¯ú     ¯ï¯Ã¯ ¯¯š¯¶¯Ü¯õ¯õ¯Ð¯¡¯¯}¯›¯Ñ  7 ; ¯â¯Ó¯Þ¯ô   ¯Ç¯~¯L¯@¯g¯¬¯ô ! - ' ¯Ð¯Ÿ¯t¯Z¯[¯m¯€¯‡¯‰¯“¯¯®¯Ê¯ÿ ? l g /¯Ý¯¯U¯8¯Y¯¢¯ø B g j H      ¯ô¯Á¯„¯H¯¯ ¯2¯‚¯Ë¯ö¯ÿ¯í¯È¯’¯g¯J¯;¯?¯:¯$¯¯ ¯¯1¯`¯¶  9 Z f O %¯ý¯Û¯º¯£¯‘¯‰¯¯š¯°¯Ê¯Ô¯Ç¯´¯«¯«¯µ¯Ñ¯ê¯ÿ      ¯î¯Å¯˜¯{¯€¯ž¯Ò  > O @ ¯ë¯Á¯²¯½¯Ä¯¶¯¤¯¯¯¯®¯Ð¯ö¯ú¯ã¯´¯|¯@¯¯¯?¯…¯Î  W x x b O K E  ¯á¯‘¯:®û®ì¯ ¯X¯¥¯Ý    ¯û¯÷¯è¯·¯‘¯‰¯¯¨¯æ , c { c < ¯ö¯Ó¯¿¯¦¯l¯'®þ¯¯+¯„   ˆ Æ ´ n ¯Ã¯†¯Z¯H¯E¯K¯I¯[¯¯×  F t — – ‡ i -¯ß¯ˆ¯=¯(¯H¯x¯©¯Ó¯è¯Þ¯Ã¯ž¯„¯{¯Œ¯Ÿ¯¬¯±¯¨¯•¯m¯<¯¯ ¯¯8¯t¯³¯é  G P H 9 )   ¯÷¯ç¯æ¯ö  : _ p V ¯¬¯X¯2¯K¯~¯½¯ý * , ¯ý¯ý  8 J R ;  ¯Ó¯­¯¯€¯’¯²¯Ì¯ß¯î¯ì¯Ú¯Ã¯¸¯·¯¿¯È¯Å¯µ¯˜¯h¯E¯:¯?¯W¯r¯‚¯€¯o¯b¯o¯–¯Ï   8 F 5 ¯ç¯Ê¯°¯¯¯¯p¯^¯^¯j¯…¯´¯å  3 M Q <  ¯ï¯Û¯¼¯’¯e¯C¯B¯g¯Ÿ¯Ý  , ¯÷¯Ö¯Á¯¼¯Ã¯Ã¯´¯°¯¹¯Æ¯Ò¯ß¯î¯ì¯â¯Þ¯Ð¯·¯¦¯›¯Œ¯†¯˜¯±¯Ì¯Û¯à¯ç¯ì¯ê¯å¯ï¯ÿ ¯ü¯ò¯Ü¯ª¯t¯[¯M¯O¯v¯Â  ; A &¯ñ¯Å¯ª¯±¯Û  5 3 ¯î¯Ù¯Ý¯ï¯û¯û¯Ü¯˜¯R¯&¯¯4¯d¯š¯Ï  , C S c h U (¯ç¯¡¯e¯8¯¯)¯W¯ˆ¯«¯¸¯Å¯Ü¯ú  / = = '¯þ¯Û¯Ü¯ø  / ; 2 ¯è¯¹¯”¯‰¯ž¯¸¯Ä¯Ê¯È¯¶¯­¯´¯Õ  9 f n A¯û¯¨¯X¯¯¯¯(¯E¯f¯}¯¯¯‹¯¡¯³¯Ô   ! ¯ü¯á¯Í¯Ç¯É¯Ó¯á¯æ¯Üiris-edu-libmseed-4314359/test/data/Steim1-AllDifferences-BE.mseed000066400000000000000000000100001422047135100244020ustar00rootroot00000000000000000001D TEST BHZXXÆQ;"oÿÿ€0dþ–ý(ý¡\Çÿ_üþÞbwýAû´2¸’*ªªªüLý» È€þ!üú`è€ûtþ ÝýÚýQ~rÿ'ýßÿƒÿáÿÿWÿ„ÿ#ÿ´ÆÞa*jªª|ܬo…WÒ—âÿrþhþŸÖÿÛþ¿ÿp6@ÿ©ÚúYÿþá,Mÿtÿž*ª©©.ÿ¸þÔþ¾ÿØpÿ‡þÒÿ¼¦>ÿ´§Ü‘>^e9åÿ°ÿ¯ÿ”ÿRÿWÿŸÊ¡ˆ *ªjf\+oɤë½~½>©›ÒŒþçþìÿ_ÿCÿÿA¨üD€b¿Áÿ·ÿG*•j–ÿÿþÜþÔþìþðÿÿ6ƒÑñûþþJI;AKSWT.FÎèn_ÂÁHX}8è|e 8*UUª‰Y-±»!â7GãÁë˘ÅçÒÕáÛÍ´—™Åý#1÷ų›ÐäÃÿáÿÿ4ÿÿ‚ÿ[ÿ˜©•••›ÿýn¡Hz"[E§Pu ÿSÿ’þÕ‡“º«ÚªŒàÿ;ÿtèÛ¢¨ç âÁèþ¥Ujì%,bU2¿œ˜šrs^):OT\G:\^ô*ç)5ïù&50$8@ÿýÿ÷ÿˆÿ>ÿQÿb*UjšÿEÿ4ÿTÿkÿ{ÿ ÄåW5][3%õôØØÒ‹šÖÅÿ“ÿWÿCÿjÿeÿQÿ}ÿ»Úý*%J¨‘U)U©ªÁ–Uñþ<;Í£ö ×äïýGŒgkŸk&JdR7‡Â†y“j*œTVÿóÿyÿ§ÿèÿ|ÿ>§Ø‘ˆiris-edu-libmseed-4314359/test/data/Steim1-AllDifferences-LE.mseed000066400000000000000000000100001422047135100244140ustar00rootroot00000000000000000001D TEST BHZXXÆQ;"oÿÿ€0d<t A è ªªªÅ < óþ@ý’ÙOñý@þBÂÒ2üþ5&þýÒýî½MÿŽþ#:ÿªªª*ÖÿþíþÓªÿ1þ/ÿ3sÿŽþÿ£ÿ?ÿ¾þðþoÿ”ÿ/ÿÿ°ÿþÿ„Vt|›šªª*X'óqÛù¹ûrÇÿÿÖníÿªþ¦ÿã¨ÿ ìœYBöeGeÿ€ÿ¦j©*ïÿdÿ)ÿÿ;ÿ•þÌþWÿÿ þüþÄÿå™­÷·Óý´ÿJÿ‡ÿ_‡‚ÿ#ÿIäHÕˆoeÀÿªªª*=ÃæÿÿÚÿÌ ÿfÿñÿœÿcÿ¡ÿŠÿ‘ÿ [ÏùdIœªŒ~ÿÿEªªª*9D¡ý‚þUÞÿóý¸ÿBÊþiÿÅXÌÿ^¼lˆ1Ñÿ›ÿ¡ ]?ÿ5ÿc“ÿªªª*¤ÿj îþŸÿ]·Óþtÿ·Ê>ÿþ–(ý¡ý\Ç_ÿüÞþbwAý´û2¸’ªªª*Lü»ý È€!þúü`è€tû þÝÚýQý~r'ÿßýƒÿáÿÿWÿ„ÿ#ÿ´ÿÆÞaªªj*|ܬo…WÒ—ârÿhþŸþÖÛÿ¿þpÿ6@©ÿÚúYþÿá,Mtÿžÿ©©ª*.¸ÿÔþ¾þØÿp‡ÿÒþ¼ÿ¦>´ÿ§Ü‘>^e9å°ÿ¯ÿ”ÿRÿWÿŸÿÊ¡ˆ fjª*\+oɤë½~½>©›ÒŒçþìþ_ÿCÿÿAÿ¨üD€b¿Á·ÿGÿ–j•*ÿÿÜþÔþìþðþÿ6ÿƒÑñûþþJI;AKSWT.FÎèn_ÂÁHX}8è|e 8ªUU*‰Y-±»!â7GãÁë˘ÅçÒÕáÛÍ´—™Åý#1÷ų›ÐäÃáÿÿ4ÿÿ‚ÿ[ÿ˜ÿ••©•›ýÿn¡Hz"[E§Pu Sÿ’ÿþÕ‡“º«ÚªŒà;ÿtÿèÛ¢¨ç âÁèþjU¥ì%,bU2¿œ˜šrs^):OT\G:\^ô*ç)5ïù&50$8@ýÿ÷ÿˆÿ>ÿQÿbÿšjU*Eÿ4ÿTÿkÿ{ÿ ÿÄåW5][3%õôØØÒ‹šÖÅ“ÿWÿCÿjÿeÿQÿ}ÿ»ÿÚý*%J¨‘Uª©U)Á–Uñþ<;Í£ö ×äïýGŒgkŸk&JdR7‡Â†y“jœ*TVóÿyÿ§ÿèÿ|ÿ>ÿ§Ø‘ˆiris-edu-libmseed-4314359/test/data/Steim2-AllDifferences-BE.mseed000066400000000000000000000100001422047135100244030ustar00rootroot00000000000000000001R TEST LHZXXà> $· @0è8  é&ÿÿÿÿÿÕäÿÿÙò€ò‚áƒâ$ƒþ Ž!áòì"ïc‹/ñOÔ€Óƒßà„@ð^ä?ÿÿÿŽуþ€^心òA?>òð‚ÿ2Ò‚àò… 2ðOõ-"üDŒâ {´“…¾?â?ÿÿÿƒîUÝ…!Ü„;#€àAà€/ò„<1á‚Kö ^äŽ2Â] "úƒïƒ 3à„ !ò?ÿÿÿâ/2€>Aá!òƒ0.ð!Žƒý_%ŠÚ5ÂM€Ñ$õ,Ô„À_Ò?ÿÿÿ…þ@Ò ÒO3ß0Œ6ÐNƒí‚!Ž1å+>ôþ…Άïƒ$߃ý …9„€@Ã?ÿÿÿ…¿`°ƒ/€óï1€à>0àñ./ó‚/>?ÿÿÿŽ"áƒ!‚.ñ‚@óN‹2±Š1+ŒÏn‹b ŒSÝòð€"îSŒò‚Á>?ÿÿÿ€1/_³\ŽRÐ??þ>ï Ѓ>²„CÑ„î!à‚þ!‚OŽâ€ñò>ŽÅU?ÿÿÿ‹æþ1/óŽôÞBà/€ ô/„%Ý„üÿƒ.#þ‚=!Ô‚‚ E ‹#ÿÄ\ÃtªªªÚ6Û Í7°?:ü3¹ô¡Ã[ëÓ¼íÒ•@¿ñ6ŒÁe62âK8ïÕ˜œÁ§ðëÐK¾öÿà*ªªªÊE0ÀÅ.Õ¿‰ÿ€¾åíÀ% Ïæ›ŸþÁJßó°¤ônM÷žýÑ^˜ûË”Œ¾á€€ùþ|*ªªª¾åY‚d}§¿lƒo¾æûMCÿ¼É~sƒ¾¿ˆƒ¶yx¸„˽\zG¾øèºkû ‚ÿ‚³*ªªª‰‡ù€µý¸µ í’µýi?„Ç€vŒ(lƒëʽIf5²íÙ ¸kúø‹ƒ¢ ƒ½¹k¿²¯Ñ>¶Ð†*ªªª‡Í¬‘`w ¾ë`Å­$}f¼ý‰#••S‚º¬ˆ^Y½ù‡{’& Ù&ñj²Rf~¿#Œsˆþ-¾Róí*ªªª½4F‚,½Ã}Šº8û±o ¿ûgµZ{„%ü‚ Š„ØõH@í<@N þÀ@·–‚錯‘*ªªª½îú¶3c‡ô ̃5ûCºSyý¿ïwp¾xŽƒ×û®¼rõ®¿ú þ€Zâ…q €\d¾þ8*ªªª€*óc€”ŠA€`¿î©€Çò½ÕŠ ‚wê_ó(ºÉ€<†ƒŒ¼b} ¹Ã{aŠyž¿ }ɺ“ÿÇ*ªªªƒty½ó|¶¿Éøô{¥0¾}|‚½ÖÞ€³Þ|"¿Ê‹U€y¼Èw`ƒ3‹ž/}à*ªªª½VЧ~®¼jø¤ƒ4‹9€Nøˆ¾Y…O„@¨»Šö½4*…¹ à*Rý¿Îüv½{Š‚^€BÛûù*ªªª½‚ÿþ‚…ó¾ç÷‚½Nˆ„þ†¾aw…‚€‹Ì¿…û}ºÈù­‚Ó ‚ÿž¿•}l¾ÆÿF¿J…Õ‚Ï{R*ªªª¾û`¾…†¥€€åšzßç^¼Âq¿uxÑ‚NÅ¿`¾ø~±š{ê¾`!‚Œq½~ù_¾÷‚^*ªªªƒûɾxb¾pÕÉß=ǃ†…Ø¿,ùI¼¾ÿ8Ðt€<ÿ4¾AS{ÿp¯‚ú¿“/¾[õ˽܀9*ªªª‚$ ’‚þå¿âú¼Å¸€àÌ‚ ÿ³€¼Eú €3„тނƒ¿B}€3¿º{¼³€¯„%A*ªªª¾¡ý¬èãËZ½ä‚l„/K¾ä{%½r üç¾ôí‚샋¾ü9…¤¿ÜyÁ¾•Âï0L¹¸*ªªª½Ò{¾€{…õƒ ~ȼÿúÖ¿Ì€N|‘¿ 3ƒi‚뽪{Ö&sʾÝþÜÆ[¾b/¿ÅƒO‰p*ªªªÈ:»˜€3~ó¾õ|Á€'ƒ7­0DÊf¹³Vè½fýQËC3 ½õɃ¬‚Á¾d{F¿C†!‚ÿþ›½aüK*ªªª€Z£¾´üô€…ƒ}Ñã¿Õ‚3€’}½y{¢€Fh€š‚ß®l¾Õÿ}ý€f‚¾¦û@¾û*ªªª~‚a-°ý2[ì¾åýu¿lŽÿï¾eþ!€¥‚.l¿0ý§¿‰©7‚³€üb½ |õ€„+*ªªª×'¡ñlª;òæÔ°¿|ú¾5àopØ¥ ¹,ÿ™¾w|/¾~*€RÚ ŒÐ(¿ßýE¿?‚¡*ªªª€1{Ó¾iå‚'ƒc¿ý€ðƒÔ€§ýý¹}ìLŽ¿Š}S¿ ¡‚nÅlëú€D"¾½üῇ|*ªªª/K¿œØ!Àî*ƒ!€€î¾ë|f€<ãÚ`ô¹?€¯¾O{¿¿¨ƒO>€…¿‰|¦¾ôЧUÌ*ªªª€öC¿æ|ð¾üÜ€‚#€#i{ƒE¿×|²í3|€_Q¾Ö~!¿€‡¦hL¿‘þA¾Ê~*ªªªïœuœùŒ¾œü€€ÜRU-¿î|ñ½ðþßzƒ¿­ý×€s‚½¿×ý¿ƒ±ÿ½èý¾Ð1²Ú*ªªª€ vXaóŸ+‘ê(+IÐbŸ‚¿²1nÃ]ûU¿Eü¾¨¬‚1«ãÍMÕ€ûÿ6¾P~Î×=b*ªªª¿´ý©ìI¶ÌoXÖBþ¾Ž}"¿m|[uÐ$¬¾µ6Ô&à?¾ö}!¿Ý‚ò{€gáZp}ÈîO~*ªªªÄA›­öhŽÝs¦ôãj„ÄÚ±#Âe,$¾÷~fÄ4ðÎýŒ»Æ½¿°ûÚ¾Ž‚ëÌ.[÷ùúf€*ªªªø…I'î ÛÏHÍÂ{šÍıº©¾¯ÿE”ÝžbpéÜL1€žâ¾à~4€f‚Œ"€@è=èû½SW*ªªªûÐ7€K2€8¾ÒýOõÕ©÷ÃúW“×4Z·à 5΀TÂ+=Ïvzì©ã¬Á.ŒFÖ§ðÜç7rªš©/8uÎá»:ç® KÚ!³ìî`_ÊŸÃkÃr€+þ޳|Õ< bÒÏáü˜vÄÑÛ³Ç1êmËøÙHˆ*ªªªñ0U¾ §í¸ÿ÷º€ìƒét«¾\|'¿ €‘ +ÐqÈÙ€3þ…¾`ý=€ Š[»€#þ“*ªªª¾Ïþ €‚f"€4ò=Òó¾õ~¼€™Ü ìëúÈêߥÓT$¾ý{MêÿqW ŒÆ:<¾õ*ZªªÌÕT—ÇcŒ#ðl£ëIÁÌ&*Ò)̱SPò¯ØÎÍÿšÔîöÌÏ‹žÆ ëïltÈp«ÕÄ‚Ì?÷í¤3*©ªªË¿e€º¢¿âýÿâLÏðß»¼ë²Œý`ȲÊï/zÁ!‡¬ìíTÕØ2·fñ~ØsÌAS]é ìi*ªªªÔ$´ú,ë³ÇW)ë -iμbƒÃGù“û:›üo V÷0Ñ2Ý¥¯Þå‡Ñã“Aè OÖ¡ÿ¼úŸëä*–ª©õ«ódÆT-%ÊÎBñôï„4>K@=1œí™ÎÀS÷ÎsO9å-,‹É€ÄpÊ2ÌóíÈ/—¤–½)bªjªñ‡Ì+Á/ÀZËñÏïú·&ñ¯Í×D;Òò>P:™Ÿ¾ËnÀ¤uŒÊ¼–Vì.èuÏdœÀÿŒ jðòN*Z¥¦ÐŸÿüjòõáPÄxåí®ârË!‡ñÌ÷ÁÆ£tÆÃžsS’i^'üøºó\ä$ÒDžÞû¥õmÛÙ*¥ªªÄ2¸ØÉ`w¹÷? þÔ-QÆÝ‡?ÇñüH|öý´/Êñ û`cÄóDÀØ4¬ñª:Âû"|êÊÁi¦šø÷â—õ<;ËÂÈ7ıÑÍùîÐ3Èh&(:'Ìó GZÉea ;·¼Ìø ŸaÂÓ$¹^=<Ùòëó²Ì´p2%¥V¦ô®//ÃÈAo0 þ ·Jÿ乿ÙéÉóI<Ø«ì2ÛëH.ž^Ì`§Uô/4[Ƀè»&Y®íÜ`v*™ªªØ”°÷Ý“MõŸ@iÉq€) ú ýÝËiýwIÒþr`ÞÁü^ãút…ÈQ«çõŽ0gË@SaôŸOʲ¤1&ª¦ªùýs‹ fRÂ1+åòü# È¤Õ3ÆÝªôô/, Á±DœÈ딜ÙâÃÿyÆŒ*†÷é2ÌPo™ô £€%jªªÁÒ\²y*ëÓÖÇ¿ÞÙ£°G΃ðxü]sNö~oÜÂ!´¸ËÑWËù¯µ÷ ëôÇ"0vȲdñJó¬ê&¦¦ªÈðwà²Ã£ú@p«Ëáôú®t«_:Á18…½û(÷°LhhUR+ýžƒöþPÌÅ,çûÛ¾÷àØ¡)Z]ZÍã$4ø-‹ð39ó½tr ßýúõĢ$ËûXO颼ú ïã ]FʆÕ:(þ)GÜôMœYÑs/Æ%ª¦ªòm´B ÜHMì“ü!ÄáÆ‚âöŒhÃÀ¤cÉo×ö½O‰Þ&UOÀ°ṀÏïkK^À!¸Ðó %ªjiò«Ûmù:JdrCê“÷^³ýä†ÄîãGø0Ü«tí ¤û>ð ÉSL]úM¨úêÃþÈô`ü xÑ-\<•ZjðÆíLÇÀÛ ô ø(Éáü ÊßéÕä!IÅ ï^rº®ý<°ù°lȠǼšáEdÂÏ;‰÷^Ì,È"h*¥Z¥Å`g“ñŒCŸÆƒÔþÈo‡[ó=×ëLiT6â²™Æ/tNíŸÿìºÆ>oòŸœ«ÎRT¥‚“ºëEdUU¦`&Ó¨Ãö þú.Ö¾î>g3Ó¦Ë%õÇØ*lWþ·Äòõåö$:(øþàžú@hÉÃÑ­­¯­ýü½)¦ª¥Ìñ;ªöÞ›ß϶æMÉ‚4>þ~‹w‚Ì+mÈQÜ?ý S)øp¤•ÊR@jÀrìóÀ°ñͰ?kT!éóô–•VÝã&î½ÁÂr¸¶À]"ª4QAKeJã÷-K ÂR ~$äóõ·¨ÑXxK×—ýVa2ú™™ØÅ¼¦%Z•ZÂn:‚ WaX-Ù”©JS+ð¾žû ]Èa¸ú]§ KGíæëý(J3àŽÜ2jyIé÷ý‹À@Airis-edu-libmseed-4314359/test/data/Steim2-AllDifferences-LE.mseed000066400000000000000000000100001422047135100244150ustar00rootroot00000000000000000001R TEST LHZXXà> $· @0è8 é&ÿÿÿäÕÿÿòÙÿÿò€á‚$⃠þƒá!Ž"ìòcï/‹ÔOñÓ€à߃@„ä^ðÿÿÿ?ÑŽƒþ¿å^€Aòƒ?ðò>Ò2ÿ‚òà‚ð2 …-õODü" ⌓´{â?¾…ÿÿÿ?ÝUîƒÜ!…#;„àAà€ò/€<„á1 öK‚ä^]Â2Ž" úïƒà3 ƒò! „ÿÿÿ?2/â>€!áAò.0ƒð!Ž%_ýƒ5ÚŠMÂ$Ñ€,õÔÒ_À„ÿÿÿ?Ò@þ…OÒ 0ß3NÐ6Œíƒ!‚+å1Žþô>Î…ï†ß$ƒ ýƒ9…„Ã@€ÿÿÿ?°`¿…</ƒ0ÐQ^dŒ@Ž!á#Šáâ1Ãa ƒ>á„1ïó€>à€à0.ñó/>/‚ÿÿÿ?á"Ž!ƒñ.‚Nó@‚±2‹1Š+nÏŒ b‹ÝSŒðò"€SîòŒ>Á‚ÿÿÿ?/1€\³_?ÐRŽþ?ï>Ð ²>ƒÑC„à!î„!þ‚O‚âŽñ€>òUÅŽÿÿÿ?1þæ‹ó/BÞôŽ/à/ô €Ý%„ÿü„þ#.ƒÔ!=‚‚ ‚ Eÿ#‹Ã\ÄtªªªÚ6Û Í7°?:¹3ü[áô¼Óë@•Òí6ñ¿Œ26eÁ8K✘Õïð§ÁKÐëàÿö¾ªªª*Ê0EÕ.ÅÀ€ÿ‰¿íå¾ %ÀŸ›æÏßJÁþ¤°óMnôýž÷˜^ÑŒ”Ëû€á¾|þù€ªªª*Yå¾§}d‚oƒl¿Mûæ¾ÿCs~ɼ¾ƒƒˆ¿xy¶Ë„¸Gz\½èø¾ ûkºÿ‚³‚ªªª*ù‡‰¸ýµ€’í µ?iýµv€Ç„l(ŒÊëƒ5fI½ Ùí²øúk¸¢ƒ‹ƒ ¿k¹½>ѯ²†жªªª*‘¬Í‡ w`Å`ë¾f}$­#‰ý¼S••º‚Y^ˆ¬{‡ù½Ù &’jñ&~fR²sŒ#¿-þˆíóR¾ªªª*F4½,‚Š}ý±û8º ogû¿„{Zµü%Š ‚HõØ„<í@ N@@Àþé‚–·‘¯Œªªª*úî½c3¶Ì ô‡Cû5ƒySºýpwᅫx¾®û׃®õr¼þ ú¿âZ€ q…d\€8þ¾ªªª*có*€AŠ”€`€©î¿òÇ€ ŠÕ½êw‚(ó_<€ÉºŒƒ† }b¼a{ùžyŠÉ} ¿Çÿ“ºªªª*ytƒ¶|ó½ôøÉ¿î{„€0¥‚|}¾ÞÖ½³€"|ÞU‹Ê¿y€`wȼž‹3ƒà}/ªªª*ŠV½®~§¤øj¼9‹4ƒˆøN€O…Y¾¨@„öŠ»*4½ ¹…ýR*àvüοŠ{½B€^‚ùûÛªªª*þÿ‚½ó…‚‚÷羈N½†þ„…wa¾Ì‹€‚}û…¿­ùȺ Ó‚žÿ‚l}•¿FÿƾՅJ¿R{Ï‚ªªª*`û¾¥†…¾å€€ßzš^çq¼Ñxu¿ÅN‚`¿±~ø¾ê{š!`¾qŒ‚_ù~½^‚÷¾ªªª*Éûƒbx¾Õp¾Ç=ßÉØ…†ƒIù,¿8ÿ¾¼tÐ4ÿ<€SA¾pÿ{ú‚¯/“¿Ëõ[¾9€Ü½ªªª*’ $‚åþ‚ú⿸żÌà€³ÿ ‚€ úE¼Ñ„3€ƒ‚Þ‚}B¿3€{º¿¯€³¼A%„ªªª*¬ý¡¾ZËãèl‚ä½K/„%{ä¾r½çü íô¾‹ƒì‚ü¾¤…9ÁyÜ¿•¾L0︹ªªª*¾{Ò½õ…{€È~ ƒÖúÿ¼Ì¿‘|N€3 ¿ë‚iƒ{ª½Ês&ÖÜþݾ[Æ/b¾OƒÅ¿p‰ªªª*˜»:Èó~3€Á|õ¾7ƒ'€D0­Â³¹fÊèVQýf½ 3CËÉõ½Á‚¬ƒF{d¾!†C¿›þÿ‚Küa½ªªª*£Z€ôü´¾}ƒ…€ãÑ3‚Õ¿}’€¢{y½hF€‚š€l®ß}ÿÕ¾ý‚f€@û¦¾û¾ªªª*a‚~°-ì[2ýuýå¾l¿ïÿŽ!þe¾‚¥€l.§ý0¿©‰¿³‚7bü€õ| ½+„€ªªª*¡'×;ªlñ°Ôæòú|¿à5¾po¹ ¥Ø™ÿ,/|w¾*~¾ÚR€Œ (ÐEýß¿¡‚?¿ªªª*Ó{1€åi¾cƒ'‚ý¿Ôƒð€Ãý§€ì}¹½ŽLS}Š¿ ¿n‚¡úëlÅ"D€áü½¾|‡¿ªªª*K/Øœ¿À!!ƒ*îf|ë¾ã<€¹ô`Ú¯€?¿{O¾Oƒ¨¿…€>¦|‰¿ô¾ÌU§Ðªªª*Cö€ð|æ¿Üü¾#‚€i#€Eƒ{²|׿|3íQ_€!~Ö¾‡€¿¦LhAþ‘¿~ʾªªª*œuœïŒùüœ¾€€-URÜñ|î¿ßþð½ƒz×ý­¿½‚s€ý׿ƒ¿ÿ±¾ýè½Ú²1Ъªª*v €aX‘+ŸóI+(ꂟbв¿n1Uû]ÃüE¿¬¨¾«1‚ÕMÍã6ÿû€~P¾b=×Ϊªª*©ý´¿¶IìXoÌþBÖ"}޾|m¿u[¬$Ð6µ¾?à&Ô!}ö¾ò‚Ý¿g€{}pZá~OîȪªª*­›AÄŽhöô¦sÝÄ„jã#±Ú$,eÂf~÷¾Îð4ÄÆ»Œý½Úû°¿¾ë‚Ž÷[.Ì€fúùªªª*'I…øÛ îÍHÏÍš{©º±Äÿ¯¾”EpbžÝ1LÜé➀4~ྌ‚f€@€"è=èWS½ûªªª*7ÐûK€8€2OýÒ¾÷©Õõ“Wú÷Z4×5 àT€Î=+ÂzvϬã©ìFŒ.ÁÜð§Ör7穚ª/8u:»áÎK ®ç³!Ú_`îìkßÊ+€rÃ|³ŽþÕ< bÏÒv˜üáÑÄ1Ç³ÛøËmêÙHˆªªª*¾U0ñ§ ÿ¸íº÷éƒì€«t'|\¾‘€ ¿+ ÙÈqÐ…þ3€=ý`¾Š €»[“þ#€ªªª* þϾf‚€4€"óÒ=ò¼~õ¾Ü™€ Èúëì¥ßê¾$TÓM{ýWqÿêŒ <:Æõ¾ªªZ*—TÕÌ#ŒcÇë£lðIÁÌ&*Ò)PS±ÌÎØ¯òÔšÿÍöîž‹ÏÌë ÆtlïÕ«pÈ?Ì‚Ä3¤í÷ªª©*‡‚ï˺€e¿¢ÿýâ¿Lâ»ßðϼ벌²È`ýz/ïʬ‡!ÁÕTíìf·2ØsØ~ñ]SAÌiì 骪ª*´$Ô³ë,ú)WÇi- ëƒb¼Î“ùGÛ:ûV oü2Ñ0÷Þ¯¥Ý‡åA“ãÑO è¼ÿ¡ÖäëŸú©ª–*dó«õ%-TÆñBÎÊ4„ïô>K@=1œ™í÷SÀÎ9Os΋,-åpÄ€ÉÌ2Êíó¤—/È–½)bªjªñ‡Ì+ZÀ/ÁïÏñË&·úͯñÒ;D×:P>ò™Ÿn˾Œu¤ÀV–¼Êuè.ìÀœdÏj ŒÿNòð¦¥Z*ÿŸÐòjüÄPáõxåí®âr‡!ËÁ÷ÌñÆt£ÆSsžÃ’i^'üøº$ä\óDÒžÞû¥ÙÛmõªª¥*ظ2Ĺw`É ?÷Q-Ôþ?‡ÝÆÇñüH|/´ýö ñÊÄc`ûÀDó¬4ØÂ:ªñê|"ûÁÊš¦iø÷â—;<õ7ÈÂËıÑÍ3Ðîù&hÈ(:'ÌZG ó aeÉ;·¼ÌaŸ ø¹$ÓÂ^=<Ù²óëò2p´Ì¦V¥%/®ô/ÃÈAo0 J· þ¹äÿ¿ÙéÉóI<Ø«ì2ÛëH.ž^U§`Ì[4/ôèƒÉ»&Y®v`Üíªª™*°”ØM“Ý÷i@Ÿõ)€qÉ ú iËÝýýwIÒÞ`rþã^üÁ…túç«QÈg0ŽõaS@ËOŸô1¤²Êª¦ª&‹sýù fRå+1 #üò3Õ¤ÈôªÝÆ ,/ôœD±Á”ëÈœÙâÃyÿ†*ŒÆ2é÷™oPÌ€£ ôªªj%²\ÒÁy*ëÓÖÇ¿ÞÙ£°GxðƒÎNs]üÜo~ö¸´!ÂËWÑ˵¯ùôë ÷v0"Çd²ÈJñꬳꦦ&ÃwðÈ ²Ã£«p@úôáËt®ú«_:…81Á(û½ÂhL°÷hUR+ƒžýPþöç,Å̾Ûû¡Øà÷Z]Z)4$ãÍ‹-øð39ó½tr ßýµÃú$¢ÄËûXO颼úãï ]FʆÕ:(þ)GÜYœMôÆ/sѪ¦ª%´mòB ÜHMì“áÄ!üâ‚ÆhŒöc¤ÀÃ×oɉO½öÞ&UOM°ÀχÌ^Kkï¸!À óÐijª%mÛ«òù:JdrCê“ý³^÷†¤ÃGãîÄ«Ü0øtí ¤ ð>û]LSɨMúúêÃþ`ôÈx üÑ-\Æ«œŸòTRÎ¥‚“ºëEd¦UU`&Ó¨Ãö þú.Ö¾î>g3Ó¦Ë%õÇØ*lWþ·Äòõåö$:(øþàžh@úÑÃÉ­­¯­½üý¥ª¦)ª;ñÌß›Þö϶æM>4‚Éw‹~þ‚Ì+m?ÜQÈ)S ý•¤pøj@RÊìrÀñ°Àók?°ÍT!éóôV•–Ýã&î½Á¶¸rÂ"]Àª4QAKeJã K-÷~ RÂ$äóõ·¨ÑXxK×—ýVa2ú™™Ø¦¼ÅZ•Z%:n‚ WaX-Ù”©JS+ð¾ž] û¸aȧ]ú KGíæëý(J3àŽÜ2jyIéÀ‹ý÷A@iris-edu-libmseed-4314359/test/data/corrupt-blockettes-wrongnext.mseed000066400000000000000000000010001422047135100257740ustar00rootroot00000000000000000001D TEST BHZXXÔì60Ëœøùš@0è8  éUÿÿÿÿÿÿÿÿÿgñ€ ÿH1‘L”˜È‡dWgPs¤¢DDÿP„ä-3ýŒßØßŒ«íÍŽÞÝÙ‹òÿŽB?ÿÿÿãPDD4ðƒï1ŒÍÍÌŽÚº¿Ý¿ýŽÝ"D6LT¦‡vEV…CB€îíï̹¹¸s¼k?ÿÿÿsŠçz‰¼šÎíH2œÉRc èT”ÊV“‚ECƒ ðàáù«ŠË©ÈsÌë—ˆÍÜïŽþ/ÐŽ?ÿÿÿ€Î3Žîñ€ 3 !!°!€í!ðŽïÿðþ%ƒï1ñƒD4bJB b„eó„ýà?€€Þ½ìŠ‰Û»Š¬Ü¬¿þúiris-edu-libmseed-4314359/test/data/detection.record.mseed000066400000000000000000000010001422047135100233430ustar00rootroot00000000000000656063D TEST 00BHZXXÔÒ 0è8 ÉB >ÌÌÌAÔÒ:Z_SPWWSS iris-edu-libmseed-4314359/test/data/invalid-blockette-offset.mseed000066400000000000000000000440331422047135100250110ustar00rootroot00000000000000000001M TEST 00LHZXXÚ:2·p @0è8  éd'Fªªªÿüuöÿübd€ ´ŠQ‡„·Ím¤€Èƒ·wo¬€{ƒI “Šäöß¶Ýj@¸¾rˆ7‰´ûÕµé‡*ªªª‹KtI§dW”¾hq«º|‡†¼2ŒCŠ|‹ô’Z¾Œˆ¥ã‰E„õ³½X®±èó7·»|_µ±ŠëŠ*ªªª³f„…€¬[°ìú‚¿è}¼…ú•8‡ÂÝ‚|„™tV±%뉰ìñƒÙŒè¡Žÿ ø¿¯y¿´cßß*ªª µ§úÜ¿ ÚŠ à…ÙŽ9½Áú6½t†Šs†‰¾ |V¹%ø÷‚j~ß¼(r'¸â|˜…© )000000M TEST 00LHZXXÚ:34·¹ @0è8  éd)Fªªªÿücÿüë¼€\…ä……é.zµg¡±7ã‚…é#:’a¤N’ Þº¬î³…d-»#óÕ¸^€Rƒ ã*ªªª†šs„÷в­{pIºÜo>·¨ýI€^‚Áƒ —‰º„Mqy¶Šïô¹ „åíM¾£ž…œ‚ž*ªªªV€‚ŠŠ/†Vº vÆ€j†ù¹ªgA¸¯ñQ‹E¯Š²xÐ+걎öˆ‰˜Ñ½°oˆ—š³´¬Z*ªªª¿­©€±ÿ›¹Ë|ʈn¼½ª†ÕŠ74ŒãÜà±Eìv®aüµ¸ê™n“£ Z‰x±Â^ˆ‹õ¿T*ªªª‰è“²‘lK½JÙνP д5ì•ó §´³šì~²h’®Ø~f›ž%´Rt‰•庯Z6„®ñþÿªâ*ªªª@ ã@y¹@W—ŠrrŒ1§ð‹‚ÿpÃþòÈÿ/"ÿº¢@;@½ù@ <@Mÿ°*ªªª©ü?(@c@rŒ—„Üä¸êH@ÿ¤V·÷\ÿ‚«· “Hÿ“š Ñ*ì§;µ@r‹@ƒb@qÏ000000M COL³ 00LHZXXÚ:69·@0è8  éd'Fªªªÿý“!ÿúºã@§e@‚#„¯ÚIÿ¦6ÿhë¡ÿ´FÿÍ¿@T²œ/lºÿ†ÿ0ã@ *ªªª@7@ öÿ®ÿ×'@Z¹@«@kD@OŸÿ§ ÿ„@¬û@ݧÿáÿ5øÿC©*ªªªÿ#¤þÒ9@6C@¤˜ë73@…Ä@@i@¦ƒ@&Š@ºÿ±ÏþøôþìWÿBÿAÑ*ªªªÿ°k@~’@´@Éo@iù@BŒÿ¢¿¬‚ÃÿPÿsÍÿ¤¢ÿBâÿœ©>·Ø@Ìz*ªªª@Š@šÞ@ýB@›-ÿ†ñþí@ÿ³2@‰ÿšÿœ¼ÿvÞÿËã@V”@2³@Ru*ªªª@¤“@¯@ ŸÿM Éü˜ÿ«&úD†¦d¯ãÿþñ@U¿@¢\@lh@?@@H•¸kJ*ªªªÿÆœÿ¾4ÿÝÿ¾–ÿq‡ÿ¥Æ@ ¤@E@wT@¦p@ƒÍÀççÿbMþÊñþò]000000M TEST 00LHZXXÚ:8È·„ @0è8  éd'FªªªÿúPvÿü²ÿ•“€ã$ @eê@öš@Ç@\@u„@žIˆ¯Ë“ÿ[?þ÷ÙÿgÕÿ¸*ªªª¢ë@@G"@’D@Gÿþf˜]Ž ÿå9ÿ¶Œÿ¨ ÿ£Aÿ“[¡:ñ@§EH*ªªª²ß^è¤#Õ†ÿælÿ¿†ÿÿ…ÓªÏuÿÏ*ÿ”}ÿ¸”¾À–7@+@oŽ@¹æ@GRÿ¦ *ªªªÿ©€ÿ”Qÿ˜ à„™@rÅ@oÕÿÍ›ÿmϠ䬶@N5ì“•zyÿ•üÿÏ\ýÆFý2çüÂü¹ü¯ý \ý[)ý¼òþ=mþ«'ÿ tÿ[Iÿ’Á*ªªª­ª@yR@Ò@@W@¿˜@+f@þ@át@íý@ÊU@ƒ„@ö@óÿ|˜*ªªª@DR@ÌL@…A@d¢@aT@`‘EÀÿ¦”ÿ‚­ÿD‰ÿ8îÿ¥‚@8\@f@Ÿ *ªªª@¬m”ä é@GàÿòÌÿ•ÿ¡\ÿ°ÿ…á½^=CL"%@p2@h¯!Ë,¼H¨ÿò²*ªªª@Vr@“ß@ nÿ³E®³Qøÿ£é¯<бýš(¨Ú¸ZDÔ² ¨ÎU5@Pò@w²ƒQÞ000000M TEST 00LHZXXÚ:;·]+@—ÿ[?ýŽVûöùúÈgúLú¨úÏIü.ŠýÉÿy¿@$·@„.@\µ*ªªª@• @Aî@€w@nÓ@[Ãÿ‘'ÿ+þÿ#Âÿj'@ö@Óý@••@3.@{„@;c*ªªª@{ð@^Vÿìýеü¾«ü3ûø+üg ýLþ’j@Ã@ðððððððððððððð𪪪@vÚ@°Ô@ÈšÿÞÀÿPþ{‘þp{þÛ$ÿ¡&@ޤ@v@F!@Öÿ@ô&@—Í000000M TEST 00LHZXXÚ:-.·g @0è8  éd&Fªªª:ÿý™Ë@ι@¤ÈÿA”ýÜü°˜ûóUûÂmü/Àý$þ`€ÿ»N@ü¥@ã*ªªª@u¹@¶i@†I@Ýè8  éd$Fªªªÿõâäÿñ·[ÿºÆ@o3@ @}:@½Ú@ßÚ@Ùš@™@%@|¸ÿ±Tþî€þX4*ªªªýý†ýá©þéþ­6ÿ(@‘R@}÷/7H@©¦@µ>@G^@n@T&ÿ.Ùþ*ò*ªªªýghý‰ýHýŒóþ`Hÿk‡@}Ð@m@Â@a@@T@¾@…+@éI@M—*ªªªÿÏÈÿ†fÿYÿ- þþþÆþyœþ1œïÿ­"½˜²ÙvÓ@>”@Ÿ²@š\ÿû³ÿ³í€˜u÷©„áS¦TþB–x ê*ªªª@Nu@`v@AO°j·YA!ÿÖ‹ÿ¼nÿ™3ÿ®‘ÿÖÿ®>ÿ (ÿÿ€Ž¼ÿ¦N*ªªª€õ·8¾ê¿"@½‘@k@´€ü@mu@qÿ~Ô¬¾ŒK@ƒ@`—ÿäøÿ:Àÿx 000000M TEST 00LHZXXÚ:·x @0è8  éd'FªªªÿüG¶ÿý©=*'ÿ¼’}Ð@m@Â@a@@T@¾@…+@éI@M—*ªªªÿÏÈÿ†fÿYÿ- þþþÆþyœþ1œþ …þkþoËþðHÿ’M@Uä@%1*ªÃÿä’*ªªª@@MžM!)@l`@±Y@ohÿæãÿìÿŽàÿjáÿ…ïÿÖ¬ÿ¾ÿ¥˜@š@¤º*ªªª@È€@È‹@Îö@‡ž¡–ë@·@I†@%>ÿ°üÿ*{þó½ÿiCÿ¯Áÿål@[ *ªªª@­@ðª@¹’5bÏÿ§zÿ=xÿ ºÿQ½ÿéØ@MA@¬³@ @ ¶@û@ÚE*ªªª@&•ÿšzÿ=Tþäƒþâaþê¸ÿTÿ¹Ž’ì;Ä@Jl@Wì9)M@F2@|:@šâ*ªªª›ÑÀ®ÿ·U®#########################################################################«×õ¨Gûò…à‡”,,†Ëºä@u—g“—qZlÿ›Éÿ¨ŽÿÙÊ@BÍ@y‘000000M TEST 00LHZXXÚ: ·{ @0è8  éd'Fªªªÿýõ—ÿüNö@LZ“Í•¾Sa˪N4ÿ˜÷ÿ”œª¶õ™‹º€äaË»O”L@Ä@J@bò*ªªª@JÑ@p(@nÀÿú»ÿµìÿ¹Óÿ¡Mÿ„¯ÿ[>ÿXÿÞÿk7ÿP¤ÿ€Ö))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))@R~¤o<­CÖß@7à@Çš@$¼è~ï@g@Fk@¥û@ˆÔ*ªªªÿÿ9ÿŠ­ÿgÒÿ¶ÝÿÙuÿZtÿ# ÿ}¾ÿ¹…«y»—@žÎ@§´@+@\?@æ¼*ªªª@šÜ@f@jc@ÊA@øò@† @7a@B@F­ÿçOÿ*³þïôÿ4ÜÿÅÿPÛ*ªªªªîî«@Â@Žf@’šƒ–å{@=è@Y®@,>@PM@Zÿ«ÀÿZþ¶sþÈTÿ¬o000000M TEST 00LHZXXÚ: · @0è8  éd'Fªªªÿü“ìÿÿI@DAyÿ²yÿeòÿ ÿxm€Æ gÿð¾@T™@ØÏ@ï%@"A+É*ªªª@¼¬@U €KæÿÄèÿzcÿºÅÿª¤ÿ“tÿqRþú!ÿ9!ÿ€³ÿQgÿhqÿEË*ªªªÿHõÿéÐ@Rq@€e@˜m@«@P«ÿæ‚ÿ~qÿ€”¦8üŒ@(@­W@Z@…õ*ªªª@úi›ÂÇð«‚!@yÿ‹iÿMÿ°¿‡Óu›«w]çÿò(@S›@ž,@SL¼_ ÿ”#*ªªªÿ¸Ü»þŽÿæ_ÿ«æÿˆ&ÿ•Çÿ¹X²£V#¦Ò¾?@—¹@r)@N¯@a¹@aœú*ªªª‚±'…ð衯o#…õÞè§Áä°¸¶1”ŠÌRÿv3ÿ~Ëÿ®+©Œ:„­¥ @p®@G¿†öÌ*ªªªÿŸŠÿs?ÿ„Dÿ±Y8õ@lë@¬¥@ÂD@ËS@ÿÍÿÿÿ@ŠÝ@OMzÛMÿˆŠ000000M TEST 00LHZXXÚ:ý·w @0è8  éd&FªªªÿþÐõÿú©ÿ‡ôÿ¯1ÿ´Rÿ’8ÿh°ÿ3@ÿÿ;`ÿ€¬ÿ ®§%Ø@\5@Ží*ªªª@ó>@@ÿO@@+@µm@Eóÿöÿ-----------------------------------------------------------------ÿ»8¯Vâ<ÿ°šÿ°+¥L~˜@DG*ªªª@$µÿ¶²£#<ÿ@PÞ@@M@CØhÿë:ÿ•òÿ‘Ĭcÿ®9ÿ”Bÿª ÿ¹*ªªª©Ñ#s@k@‚@t¶@J[@C­@#@ªª¨ŒÞ\ÿç¸ÿ§Yÿ¡ ²a”@b@n@“Î@ˆ$@¦˜@w$¾E}ÿ«TÿŒ´ÿ£*ªªªÿí»@BÇ@„\@Šº@I¾oî½»ú]çbfÄ„CÿÀÿ]ÿ„Ûÿ¡Þÿ±Áÿôä*ªªª@R/@{¾@ˆx@”4@ e@}R‰êÀrÿ–ÿ\âÿ'þüƒÿ–ÿcX¤å†£ˆ»pØ00000dM TEST 00LHZXXÚ:·ˆ @0è8  édúúªªªÿú|šÿüÅÿÓÿ¸Óÿ¬Îÿ±âÿ†ÿFÿ\7ÿ–cÿñI@J*@o™@–h@–ä*ªªª@ŸP@Ñ.@¹@`ù…Çû2@1r@U3@M—ý‡³#Ìåÿ¹ˆ®Fy ­éØš¾ŒŒ¥ú+*ªªª¿ŸˆÂ‰9(ì@o4@Ì@ɱ@ˆú@[f˜]Ž ÿå9ÿ¶Œÿ¨ ÿ£Aÿ“[¡:ñ@§EH*ªªª²ß^è¤#Õ†ÿælÿ¿†ÿÿ…ÓªÏuÿÏ*ÿ”}ÿ¸”¾À–7@+@oŽ@¹æ@Ü\*ªªª@ÑÀ@»±@£­@Ø@Nʼnqëý¨'ÀZ£ŒÇÿÀÉÿ²Õÿ¥Dÿ¬žÿ³¡óx8˜+»~*ªªªŒ*ôìÿÚÿ¯ÍÿŽ;ÿž­¨l@v†@|²–ŠÚ„§ÿŠ,ÿ–ßÿ£¸ÿ®Àªl ß*ªª@HÄ@Wl›Ú-Ó‰»ÔR£Á`2®ÛÈÿ±$©6&R@O–@m¤@ü@\½_ÊÕ¥ËÚ@m000000M TEST 00LHZXXÚ:·— @0è8  éd&FªªªÿüÑÿOæí@{ @×@³,@]‚¼ÜÓÿ¼Ìÿ–ÿ*ÿv-ÿ]Oÿ€Õÿ¤žª°3-*ªªª@zÉ@Š;@w@W•%Œ„)œ‚Rÿ¹ ¡&ÖŸ¹{؇ëîÿñ¢ÿŒ.ÿZÿ…F*ªªª©ˆ™‹œ/)cŒ)˜\ƒá]¬­ùs¨º4ÿ‰ ó‡þ`‰¥ú빊* 3´ „³@E‡@Q¡’Ž{ª¶em&*ªªª@ @J‘@]#š}ÿŸ:“ µ—Õ¸…ƒ ™¥GÿшÿƒIÿ‘°.È@#Æ@L*ªªª@ˆJ@˜0@_ʉ^ÿ»„ÿ¸1¯ÏþÏ…£Ÿ}•–•ÿÙhÿ—ÿx8ÿsÿ™/ÿ»"*ªªª¯?må¾to•Q‹¡»ñ@m%@l[@áÿº‚000000M TEST 00LHZXXÚ:·ˆ @0è8  éd&FªªªÿürnÿýΪÿ‹ÿ'ÿ­·°–›,@X°@…1@@}2@W\•ióÿ—Éÿgÿp]*ªªªÿ“ò¤7îž{¿[—O‹mêÿïßÿ®-ÿŠÿŒÿ¹«€Ø3Ð@R @‹r@Å2@¾*ªªª@o;ŽMç´ÿ»ƒÿŸ/ÿ¢†ÿ¸.© õ²+1p“(„ÅÿØ›ÿ²^ÿ‘pÿ’öÿ´B¥ø‡*ªªª@=@]@SÛž[´˜ð­HŒ_ag¤Ñbû±N³§,cÖˆR½ @J1š™c^÷F»HŠázå*ªªªÿ¾œÿ™Ñÿ˜¹ÿ£ÿªÙÿ¹¢¬ óO¼ùõÝ´%Nèÿ·£ÿ±:­Ÿ'„@Z–@|i@¤ò*ªªª@»š@§´@oÔ@BA 4µ‰…ÜPÿ˜ÿjŠÿlvÿ—òÿñ/@]Î@¤ @ª @pº*ªªª‹ËRg¡&Àÿ§ÿ–zÿ”žÿ–ÿ¤D¤œÿ@,@_@‰û@ï@`-@J›V000000M TEST 00LHZXXÚFy ­éØš¾ŒŒ¥ú+*ªªª¿ŸˆÂ‰9(ì@o4@Ì@ɱ@ˆú@[f˜]Ž ÿå9ÿ¶Œÿ¨ ÿ£A:·‰ @0è8  d&bªªªÿýÄ¥ÿýˆòºýÍ!ÿº"ÿ¶ÿ¾T£DJ®~ö†!jêÿ·Òÿ£ÿ¾º 1¢@c@u€*ªªª@j@S@S@t@@ˆÅ@rTœ¶ô¤ƒÄ5©¬fVµ¼h˜µûÛß¡Ùiƒ™…Åÿ¤/*ªªªÿ«§ÿ±Öÿ¾ª§ÓÝg¶Pé°¬ÒУñD³ ÔÁö³÷¾›ª¿Y@Gf@S @N/sªµ!ë&*ªªª¿N+e@Gï@Z>@@ž»@œq@pw@åÿ®ßÿÿv™ÿ”:¬Û@I}@Y*ªªª@V·@@¢Š~Z¨ÿŸ]ÿw5ÿ]âÿM’ÿJúÿH½ÿL£ÿeVÿŒàÿ¿L¸W¡Ð@I*ªªª@F™›´¿ @aê@Ž"@‘Ó@kj™:úÁ«9Ê”®Æñ2ºqƲ s'.Ä@@m@Uú@`þ*ªªª@n¨@’@˜³@½Ÿ@žœ@œï@’¥@o6@C ˆà•ÿ»eÿŠŠÿLhÿ)Üÿ:,000000M TEST 00LHZXXÚ:"·z @0è8  éd&Fªªªÿüìÿû¬‚ÿc,ÿ|ÿ{-ÿeyÿd ÿ„R¦c”þ™K1“y¯à@ET@O@Sb@Vï*ªªª@Xî@Y8žøãÿ¹ÿ™œÿ“.ÿšKÿ ðÿ@@¢*ªªª@Yó@l†@g @_<@MŽ“Þ‚±"\7¾• “ -ü@G@sE@›¿@¢@‰ƒ@S *ªªª‡Ù¼ÿ³Oÿ–aÿ‰×ÿ’Êÿ»w·Z˜Ö—š°3@E©@jÂ@s @]z›u äÿÛ ÿ¨\*ªªªÿ~Qÿnÿ«ß©¹åγðVÿ²iÿzôÿN¾ÿPÿ`Öÿp÷ÿ™tÿæE@I¤@Ž9*ªªª@‘_@o @G9|§ÿÐÿš·ÿ‚§Ó(9@xø@¼·@Ú­@Ú@Â@ŒÃ@f4†ªªª@`N@e=@v@‹‚@‹Ö@gTþî€þX4*ªªªýý†ýá©þéþ­6ÿ(@‘R@}÷/7H@©¦@µ>@G^@n@T&ÿ.Ùþ*ò*ªªªýghý‰ýHýŒóþ`Hÿk‡@}Ð@m@Â@a@@T@¾@…+@éI@M—*ªªªÿÏÈÿ†fÿYÿ- þþþÆþyœþ1œþ …þkþoËþðHÿ’M@Uä@%1*ªªª@åÔ@~ì@Å@®"@J@‘Å@’Œÿy†þwíý¿DýiÀýƒýþ™ÿ4@x*ªùÖ@Æäÿp#þ+<ý&ŠüzEüB0üœUýzþ¹000000M TEST 00LHZXXÚ:4'·g @0è8  éd&Fªªªÿñî×ÿÿÊÀ@7|@°û@æå@» @µ@îuM@à@ Ê@Œ&ÿý¢Áü{\ûÒp*ªªªûÖnü€…ý¡Ìÿ  @ ù@1@w?@Eÿ#(ÿø#@¥6@!@G®@0·@ø±@ÍÏ@·E@¢|@Ž{@|}000000M TEST 00LHZXXÚ:6·h @0è8  éd&Fªªª:‡ÿþ| @oÇ@g¤@L®ŽD×Ãÿpåþðòþ†àþ3rþþ?‰þ¤DÿB@ °*ªªª@à…@¢k@±@)ë@ìŒ@m@±ÿײÿ Uþ±þWþŽ}þÒWÿ< ÿ¼+*ªªª@:@¡@æO@ @t@ºs@ad@¶ÿ¼<ÿ¼@ÝÿEÿÍþù¨ÿ ÿ!wÿHÍÿbHÿqæ000000M TEST 00LHZXXÚ:$·y @0è8  éd$Fªªªÿû/X¥’ÿ‚Öÿª¸õ#  2·íÈÿ«ªÿ˜äÿ“RÿŸ\ÿª­ÿ¦Lÿ™óÿ§ú*ªªª§®÷§@/Ñ@|@Âï@ð3@ò÷@Ѳ@˜š@J‰†NrÛ±Þë8†Ý ,Žl í@9@Xº*ªªª@oÙ@†9@žK@–^@ju@@„@O7@U @D›@ ÿ¶)ÿ_îÿÂþá/þÑ›*ªªªþýÿTóÿ¥ ÿîù@Gù@šY@Í@ߣ@Å\@yrÍÑDÿ‡ÿHÕÿ'´ÿ(G*ªªªÿE·ÿx÷¢Zª™„?l™‡è²Ï\È­Ûµ^ .@0U@B´@EœD f„ëeHÿ¢ÿTƒ*ªªªÿ þúÖÿñÿM/ÿŽ4ÿâ@MÙ@¦˜@Þ>@Y@ R@g@v@óÀ@È*ªªª@ž @úí+ûO ü5Šý„ºÿ µ@™Ü@¥@Dø*ªªª@‡@3‚@ñ@D¦@3b@ô`ÿ¸Ëþ¢ýÚŠýrmýc%· @0è8  éd&Fªªª» ÿïÚ°Š»ÛTÿ¹¡ÿ»§3Rÿ³Äÿ}ÈÿNïÿ8èÿ3Yÿ9uÿO´ÿtÿ˜=*ªªªÿšûÿq(ÿ2çþúÃþâ)þùeÿ=ÿ—Õµ©)i@K@Qb@C’ùÚ«³Á’§2h°*ªªª—'Ë@F5@Fåš°¤öˆ¶|F¸;f¯DÛ†® c ³xì6¼uæ@?ë@i4@i @S œ ¬*ªªª‰Ž”Ž7±„@FYE@Yu@F±š2"ˆ ùŠ–°“@^;@î@¯Ç@¼|@¹æ@®*ªªª@“|@né@P™žº$ú€áåðÿÐÛÿ»ðÿ±…ÿ¤Ýÿ…bÿU¤ÿ"¬ÿ_ÿ+ùÿM*ªªªÿhÝÿzHÿ{GÿrÿeXÿb}ÿpïÿŠÿ¬ñ¯z£@\ª@wÙ@|?@jH@Q8*ªªª@@ß“HóQÿ´:ÿxžÿF¼ÿ!‰ÿîÿ¨ÿ# ÿ'´ÿ'ÿ ÿÿ„ÿ%o000000M TEST 00LHZXXÚ:,·l @0è8  éd&FªªªÿïK Èÿpb¨/µ@vþ@±@°@cª@Ó@Na@²Í@ê @ÿ€@öD@ÕØ*ªªª@žÊ@<(r*¯rŠ·ßWçª!ˆM@TÞ@\ p~·ôk¶H„â€ÞÏû@®&€¦@•\–3WGÿ¬ ÿ Lÿ’˜ÿ}ÿdgÿH'ÿþîäþÒÛ*ªªªþÑÚþÞ×þê½þæ§þ¸öþX-ýÙBýZ"üðü«äü—fü´&ýÓýŠþ4U*ªªªþüìÿÚì@µZ@}¿@.6@½À@: @ž–@Çù@÷@°G@ƒ@8n@Ðm@M~*ªªª@¼¤@ ë@H¡ÿ”þå9þ5³ý‘„ý¼üëýÓý‰äþSþ£Lÿ2ÿ£p*ªªª´Äá‚7nöÿÊRÿƒÿ þ­òþ:ëýâáýÄ•ýÃ>ýð’þtÑÿ#ÿäg@½ß*ªªª@‹›@AI@Öœ@5}@c9@Zâ@$)@ã>@Ž@Í@ŒX@˜@ºG@QÀƒ[æ000000M TEST 00LHZXXÚ:! ·i @0è8  éN&FªªªÞ­éÐåÿ¹Šÿ®@ÿ«/ÿ“‘ÿlÇÿO}ÿ>àÿ;©ÿ:`ÿ<šÿ6Õÿß*ªªªþè)þË8þÀ›þÛ¡ÿìÿwÌÿó(@d@Á²@–@dÄ@“_@®¡@¤Î@j*ªªª@%‹@ç¤@•i–íÌNÿskÿþàGþÒþ±üþŽ þ‚¶þx¢þvþ„þ¬}*ªªªþóÿ60ÿW(ÿdPÿt•ÿ@M—*ªªªÿÏÈ’¸ÿ­=ÿª1ÿ±°Þ@çüÂü¹ü¯ý \ý[)ý¼òþ=mþ«'ÿ tÿ[Iÿ’Á*ªªª­ª@yR@Ò@@W@¿˜@+f@þ@át@íý@ÊU@ƒ„Jö@8$@jœÿ‡N*ªªªþ›ýËËýÂü‘ŒüGxü@¡ü|üï ý‡»þJ¼ÿBç@FÂ@$­@Õ}@j *ªªª@ó&@S¦@m@\´@>D@«@ªj@bÁ@ @Å@ÿœ@¶v@nî@Äÿµ*ªªªÿZ—ÿþœüþC`þXýÔœý™ýƒ¼ý˜yýÓ%þ7õþˤÿÙ@0s@Çç*ªªª@;K@‚é@©@²¢@žÇ@iq@·@É‹@w–šJ’ÿÉÄÿ•ÿsÉÿZ”ÿI˜*ªªªÿYûÿ:©9R@`;@V@¹]@´@±@ªÏ@š@›@¢@©_@³­@®>000000M TEST 00LHZXXÚ:%·l @0è8  éd$FªªªêÿóÈÞ@²Ž@ÂL@°~@~™žcÿyÿ/þÈ=þ‹üþSîþ25þ%-þÌ*ªªªýþþÃþ.qþW`þ†«þéHÿk™ÿý•@šÚ@+Y@³†@,ƒ@i…@[@#É*ªªª@ÝV@‚\@i@¨Î@ZÉ”–ƒÿÏúÿœùÿ€?ÿyÿ—–¥ís“@$¿@W|@Xë*ªªªŽmÀdÿeÿ{þãaþÈþ¹Ãhþëµÿÿ*ªªªÿI-ÿˆ6ÿ»¸D)p@[n@• @ÖL@œ@X´@²@§È@µm@Ãñ@Æ$@Ѹ*ªªª@ñ{@@D7@k@X@be@êò@ñ@9ÿFðþFžýYü‡úûÚHûeË*ªªªû ûìûvëü!aüðFýÒ±þ¿ÿ£˜¸k@=@á@›@ð@Ün@(t000000M TEST 00LHZXXÚ:&3·h @0è8  éd&Fªªªÿ÷*ùÿùŽ“@b@pR@@‚@ßÑ@XÈ@º@/C@¿¯@GÎÿÌ£ÿyÇÿU)ÿKù*ªªªÿbâÿ˜W­£›€@EÖ@c½@uÙ@]E@K^ÿ­ÿÚþkMý›$üÁ8ûõÜû^/*ªªªû(û)*û©Züœ³ýâSÿb@þ¡@™Û@T@Y`@5Ø@Ÿ$@•#@ @Hƒ*ªªª@)•@×Ê@l@ þÐýÂüæßüWÝüõûÜaûÞ§üÒüýhnþX‡*ªªªÿUÉ@=@úŽ@‹2@æH@ùP@غ@¨´@R‰@Ì@5oÿ˜-ÿ4þvþR*ªªªýËýÃçþõþ—5ÿg@RÖ@_å@tL@[ @üì@O=@9´@«C@º,@„×*ªªª@2òþõ˜ýê—ý(Aü¼šü¦ïüçkýuSþ*&þî&ÿ°¤@;È@}<@š9@š000000M TEST 00LHZXXÚ:(#·i @0è8  éd&FªªªÿùéaÃ"@ZÎÿî1ÿŠ­ÿ4‚þóªþàšÿµÿZݤ—75@­D@!Y@n@†É*ªªª@gø@$@é:@«Á@`È™+ºÜ@‚¦@†@¶Ò@V @áâ@(½@ýî@RS@¯*ªªªÿ‡ýÎ1ûù¨ú:tøîøA.ø_PùaÙû!ýs0@Ý@ªu@Øï@]X@#Ì*ªªª@K_@n@}@@/ÿ@ý]Ôü9YûÄLüÅüÒ þ ÿ¢µ@<þ@±_*ªªª@½@FÞ@A+@–Ü@lï@ý¢ÿa]ý¬ü"úâú%ùåŸúH…ûCü°Ð*ªªªþ‚ï@ˆB@uÀ@À@2@Åú@»³@¶@I@Â@ø¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸þô¼ýcßûHîû«n*ªªªû§ÉüJ¾ý‚{ÿ-{@÷ž@@È[@tù@|¿@Í @„`@ö ÿ?.ý}ûþ 000000M TEST 00LHZXXÚ:*·g @0è8  éd&FªªªÿþÀÿüò,úüúúªûXüyýÉÿ?Ü@å+@Gˆ@7z@—Y@b&@â@ò•*ªªª@ñ™ÿÛÿþîÔþLVþéþdÍÿ:ê@vÔ@ÅŠ@ïª@¿Î@ýÝ@£@¯«@+]*ªªªÿO?ýoÞûÑŸú¥8ú ©ú`ú³Rü ýÔiÿÀ@–Ç@>@(@„ß@q~*ªªª@ÛJ@Ì»@’ @BÿÑ‘ÿ2ÎþÚ^þàÿGÿ‡@ ™@‹@Ðä@äC@³·*ªªª@W£ÿÂÿ@0è8  éd&Fªªª» ÿïÚ°Š»ÛTÿ¹¡ÿ»§3Rÿ³Äÿ}=ª@sÐ@µ@ê@g-@İ@.@$â@å @U@}¸@ZáÿíýÕ:*ªªªüÚü6jûæ¡ûùsü“‹ý’lþ²Bÿå5@ýô@Àª@$r@$‚@½*@ý@+000000M TEST %0LHZXXÚ:,·g ÿø@0è8  éd&Fªªªÿü=k]ÿJØþ||ý×ý„JýŒþ!Oÿ¨@Z•@¸@Y@‘@ÐR@¦ªªª@©‘@ÐÆ@›r@ý×ý„JýŒþ!Oÿ¨@Z•@¸@Y@‘@ÐR@¦*ªªª@©‘@ÐÆ@›r@²ÿg ýÑüˆ{û©¢û(EûzûzÝüïüÛ ýÞ þò*ªªªÿã¶@ƒ—@Üx@$³@cç@’J@¿Ã@ÿ?@_’@Óí@@!@JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ¡é@åw@Ó/@PÛ*ªªª@]+@—ÿ[?ýŽVûöùúÈgúLú¨úÏIü.ŠýÉÿy¿@$·@„.@\µ*ªªª@• @Aî@€w@nÓ@[Ãÿ‘'ÿ+þÿ#Âÿj'@ö@Óý@••@3.@{„@;c*ªªª@{ð@^Vÿìýеü¾«ü3ûø+üg ýLþ’j@Ã@ðððððððððððððð𪪪@vÚ@°Ô@ÈšÿÞÀÿPþ{‘þp{þÛ$ÿ¡&@ޤ@v@F!@Öÿ@ô&@—Í000000M TEST 00LHZXXÚ:-.·g @0è8  éd&Fªªª:ÿý™Ë@ι@¤ÈÿA”ýÜü°˜ûóUûÂmü/Àý$þ`€ÿ»N@ü¥@ã*ªªª@u¹@¶i@†I@Ýè8  éd$Fªªªÿõâäÿñ·[ÿºÆ@o3@ @}:@½Ú@ßÚ@Ùš@™@%@|¸ÿ±Tþî€þX4*ªªªýý†ýá©þéþ­6ÿ(@‘R@}÷/7H@©¦@µ>@G^@n@T&ÿ.Ùþ*ò*ªªªýghý‰ýHýŒóþ`Hÿk‡@}Ð@m@Â@a@@T@¾@…+@éI@M—*ªªªÿÏÈÿ†fÿYÿ- þþþÆþyœþ1œþ …þkþoËþðHÿ’M@Uä@%1*ªªª@åÔ@~ì@Å@®"@J@‘Å@’Œÿy†þwíý¿DýiÀýƒýþ™ÿ4@x*ªùÖ@Æäÿp#þ+<ý&ŠüzEüB0üœUýzþ¹000000M TEST 00LHZXXÚ:4'·g @0è8  éd&Fªªªÿñî×ÿÿÊÀ@7|@°û@æå@» @µ@îu@@à@ Ê@Œ&ÿý¢Áü{\ûÒp*ªªªûÖnü€…ý¡Ìÿ  @ ù@1@w?@Eÿ#(ÿø#@¥6@!@G®@0·@ø±@ÍÏ@·E@¢|@Ž{@|}000000M TEST 00LHZXXÚ:6·h @0è8  éd&Fªªª:‡ÿþ| @oÇ@g¤@L®ŽD×Ãÿpåþðòþ†àþ3rþþ?‰þ¤DÿB@ °*ªªª@à…@¢k@±@)ë@ìŒ@m@±ÿײÿ Uþ±þWþŽ}þÒWÿ< ÿ¼+*ªªª@:@¡@æO@ @t@ºs@ad@¶ÿ¼<ÿN»þë©þ›{þ{uþ“-þÌ*ªªªÿ'cÿ©k@Pî@Ð@Â@Jl@ž0@œX@)~@KÜ@7üÿ £þ#6ýc³ýç*ªªªý §ýƒ2þl}ÿ¦™@ôÔ@H@Ú˜@"ç@èŒ@?$@Bé@Iÿ{þ"Zý˜ù*ªªªýrZý²©þQ@ V@Ý@±@{;˜XÔvÿt™*ªªªÿžþ¹ßþsþS4þp˜þÐmÿcÒ@@ÜÉ@ž©@1q@v©@d@ñ)@),*ªªª@,Åÿ!Šþ0ûý~?ý(ÒýDýÇþžÍÿ§d@©"@{„@ó@UÉ@>ˆ@Ü7*ªªª@L—@©@ ÿŠ ÿ98ÿÆþöþì\þïéþó­ÿ ÿ$ÎÿZ“ÿ¬í@ ã*ªªª@/lºÿ†ÿ0ãeÔGsG@QÛ@ÿÔ@}ÀÿÓŽÿ+yþºˆþ‡ÊþŠÓþÄIÿ-L*ªªªÿÇÕ@zë@ É@Vý@S‡@ì@ä@Ñÿv~ÿ-þÀpþ¹™þèºÿ;¦ÿ²&*ªªª@8Ô@²q@Ê@;»@@(@„ß@q~*ªªª@ÛJ@Ì»@’ @BÿÑ‘ÿ2ÎþÚ^þàÿGÿ‡@ ™@‹@Ðä@äC@³·*ªªª@W£ÿÂÿ@0è8  éd&Fªªª» ÿïÚ°Š»ÛTÿ¹¡ÿ»§3Rÿ³Äÿ}=ª@sÐ@µ@ê@İ@.@$â@å @U@}¸@ZáÿíýÕ:*ªªªüÚü6jûæ¡ûùsü“‹ý’lþ²Bÿå5@ýô@Àª@$r@$‚@½*@ï*ÿ—ÚÿNÛÿ)þ÷iþçç000001M TEST 00LHZXXÚ:;!· @0è8  éd&FªªªÿúäÿüÐo@„ë@Þ_@Ž@5ì?í&iris-edu-libmseed-4314359/test/data/no-blockette1000-steim1.mseed000066400000000000000000000200001422047135100242000ustar00rootroot00000000000000000000D TEST BHEXXË  P00UUUQQ;:1,"  &&-'.'ÿ÷ëíïòóçêîãÓɾ¹º­¬­ª)UUUÿ£ÿ£ÿ¥ÿn£ž™¢Ÿ¨¶ÂÁÏÜèíûöýþýøõ÷ *EFMUVIIl:9=/4.,*1)"% ÷ûñèãÔÈÈÁ»ºÂÁÌÑÚݶßâãáäáâãäæçUUUïóøÿíêçêëíõô!##I(9:@=;.1" UUU   ÷ôõóòñîóòßÛÔÖÊɾÃÀÇĸ‹Àºº¿¾¿ÉÇÅÇ͏»·¸¼ÁËÝäôþ ©UU #(,20<=Lcikry|ƒ«sgZPMF;95*)+  ý  øóòïìàã×UUUÕàÛÎÔÌÐËÅýºÇÈÈÅœ¿¼Á¶¶¹±»ÉÌ×ÞÔÔãàèõï÷÷þ üýýüþÿ'/.8*ªUUMdq€}†´†~{‹ƒ|~voaRF8# ùèãÙÑÈÁ°°«¯°°«¨«£¬©¢•*¥VªÿŽÿxÿHÿgÿ`ÿXÿcÿiÿmÿ~„‘ž ­°¬¶ÆÐÛåêþ 6N\r~ƒ…– ª™ *UUª›“ºŠ…zxmchjknh^bige\JOB>45&"üìäÙÉÆ²©œÿ’ÿ†ÿÿqÿgÿZÿTÿP*¥UUÿIÿHÿIÿ+ÿaÿcÿgÿnÿnÿ{…‰¡¢§¸ÐÑèö $ !('.2226;=A@AdC@78/$ ##""%'* ).1(*!$!ûîÒ³£œ„ÿÿzÿ…ÿx%UVUÿÿW‰‡› ¥­¶ÃÐÑÒÜãíö  %''-(/*"(%)29CQTX`œlqj_YSH;?41( UUUüøëÜÌÿº®©£±³¶¾ÃǦÔÎÎÉÒÅÑÕÑÜØáíöò $)/2-)'%$I""UUU).38424-%.#ÿøêÜØÈÁ¿¸³¸¶·žÕáêõ K þÿöøü UUU øïäÝØÞÒÜÙ³íÿ= ú÷äà­ÖÖÓÎÅÓÐÖàãæöø    ý !!&UUU,08uT\ky…‹€ƒrZ©Uo_[>4#ôîÞÌɱ¥œ“’‹ˆÿ…ÿyÿtÿtÿsÿEÿnÿwÿ|ÿ„‘•¤³½ËÓÝñý "*349;3UUU8EJIMIKPJDD<['   %(+.,((÷üÿúÿõõþû÷ùðïïíßÝUUUÙÈËÆÁÊÑ×Õà­ØÒÐËȾ¶º»»ÀÂÄÍÎÐßçïý $+6:JNQ[\^]`USOG@2((UUUÿÿøþ üüüüøþùý   ÿýðàÜÚËÆÅÄÂÇÁ»Ç›ÉÌÐÑßâèéæãíãâéêáéUZUÛÞÝàãããäçóîü (--(&%" )/3FR„kowz}sriYVRD7<( V•U úñíÝÛÑÑÉÄÄſʸ½¨Ÿ›”‹ÿ‹ÿŠÿhÿ“Ž“’““™‘™ ©µÏÐß÷ÿ  057CD¥UU@=DD?88;.4;j?GGCA2'  UUUÿ üòöîÜ×ÒÌÏÇÄÅÌÍϲÜçóëìïêêèëéíåîô "!"øóõñüûUUU7üÌö÷ìîéèë÷òîòðòú!!P$('$".$')"#.&,&þûîìèÛÕÖUUUÖÒרÝßáãçáÜÙßâéÎõûú÷óîàÝÖÏÓÔÑ×èñ÷  þ÷üúÿ÷öøýþþUUUþõüþüúö $"0,.e9787573)#"#$(5-(&"þíí×ÑÇüȻº½³³¯³†·UUU¹ÅÏåô ÿ   B   úúüïçåãâ»àâãÜUUUÝÚÚÛåÚßâãäéëòý ./0+,)aFSUV`nnjkeabXUMFEJL‚\UU¥YSP[Uc\TOG?=:+)$íêÞÖÍÀ¼½¹ÀÉÊÄÊËÈÈÀ­±¦ÿ¨ÿ¥ÿtÿ¤¨¼ÁÏÒÓÛÝUUUÞèõù $',1..5,%&þòèïæèãñú  E÷õøUUU  úþóøýùöüõôèå²åâãæééôüÿ !&N*&""!%23/- UUUúÿû úøèäÙÑÏÐÄ¿ÏÒÚæëåéêíÄîÙÓʾÆÁº´®¨³»ÅÔåèéöû/09UUU885<@@E@:( (Y3GPZ`ZTQEF@<8970&ÿæßÑʿ¾·µ²¬¡œ“ ©«‹¿UUUÁÊÌÏÍÎÄÅÆ½ÊÐÚåðóø %.0::665)1338@c75$"ôíæßÏÔÍÍ»¶³®UUU»´ÃÔèõ1=A;D9<>5;>jGYYegiZRF8<014+(#ÿúäÝŽĴº½Â½Á¸»±®ž¢¥000000D TEST BHEXXË  Á`0UUUÿÿÿ’Fÿxÿ²·¼ÂÇÄÑÙÝØáÜ×âÝëéãêð÷"&$'*+2%+  *')1+/.5_85UUU:?3/' üÿÿÿ øóèîðñøýøòöðôúùúôñöúÿøùöô÷òíóôêðUUUððëåϠųª¥—–ŸŸ®ÁÔè)(340+, $$"&%"02288.]6@EHABD=97:6:2+*UUUòñæÚÛÑÌÑÏÎÐÐÏÌ·´¸µ¾šËÐÞâêíðöü üïêâÛÜÚ򯧯áâß×UUUåßàãÞãàÞÚàßëöõý *=IMT[YcMLJEk?>>ION_hbke_`XSLE,(þêåÔ½® ’*¥UUÿ~ÿxÿlÿiÿlÿqÿrÿ|ÿWÿ„¢­¾ÒÞäæçêðîîìîêåÚàêô!(364<48=8-1317-*UUU($D-*1/'# ðôôñðöìïðçèøùõþüüôëêéìïäá´èçíöý8 UUU÷ü÷÷öùôöÒü1 $)$% òñóèäëéðûþ  ôéëèèìã®âäïüúÿUUUDÿþóüúÿÿ  þÿøùø÷òíðæÀãáÞá×Ù×ÑÈÖÔÝæÜÞÜßßðó UUU/54747DB;C>e>9340ýõüùòïïðïø÷ÿú  #'&!)&# öUUUõñéíÞÕÎÐÆÍ×ÌÝâààáÓÍ›¶°¶±²¶°µÃÊË×áâìõú !&0:.'$08767UUU.+)J         "%! þîûõîíç×UUUâàØØË¼°¥¢§¦‚®½ÃÌÎÒÖÓÉ¿ÌÍÖâáÜàäíôîìöóòÿ $4IPNINDH@5;9UUU;]544;2254/37441!úûòõó÷ëóóóõöóòïçååæãåÞÚÞØÔáÜáêîêíèçáå­UUUãàãåíãäåÝÞÙרèëôûÿþþ ýúü      &'(!UUUL,2+,(#% !  ÷óì×ÔÍļÅÃËÓÉ¢Î×âô÷    6ýÏù÷UUUþ> þøôíìòã»æÝÜåâæõü H"   óõUUZéåéåáãññôæçåÜÖϾ¿¿¹ÄÇÌÄľ¾µ³µ·ÄÕÛåññÿ '5BJVcicloq}‰)UUU²ƒpofUEF4/3-$ üüúðéåäÜØÐ¸¾¿½Á¿ÀÂÉÉÛÝàÙàÓØÚÓÍŸÂÆÌÊUUUÇÁ¾¿ÎÐÏßâéõÿüóþù÷ýû÷ÿþúíêàãåãéôîü %%##".'%%!$)03A)UUVOSŠbcfe[TN>?70))/+-*3-)"& þ÷íáãßÏú¬ª¡™›¥ššÿ™ÿ˜&•UUÿ˜ÿt”‘‘Œÿƒÿ‚ÿ€ÿ~’𬶾ÀÃÑèü &2728?8EEC81-/3*-77;B:9631;417UUU^947/4)%-.+*( #' % ÷öùúüûöñíÞá×ÜíêíóüûýÿõñöêèÔ½UUUªŠÿfÿ‰‹‘ ¤§´¼Ïáãáîéääæçòôý#3,0**',/0<=FWSZXQLLD;c7*7-UU•137584-2647@ALME@C2+!ùôãíߨÒü·®œ¦ ¤§¦Ÿª©©ÿÿ©©¥¢–“Ž‹““¢¨UUU­ÁÛò"(.-9B;:EIQ^afed_WUWzJEL?58.& ûôçæëãâãÜåêáäæâáàÞáUUiïíéóñøüöÍþúôõîïö÷ý T+1.'!'"" ÷ûóóíîà×Íÿ¹ÿµÿ­ÿs¡¢¨­U•U´¶¶½»¾ÈÌÔàèòþ "-04GU^ijbqržsyutiaYMK=4 üùöíãáØÛÜ×ÓÓǼUUU¿º¸ÃÁ¹¼½ÁÊ“¶ÀÊÎÑÏËÕÐÔËÏÒ××ÒÏßèôúþ*'17:AJNHME>85%Bÿñ¿ëùUUUùþýÿ ÿ 9  øóøñ  þú÷ôöôøÿ¥UUúóøêâÚÛÓÿÍÿ¼ÿ±ÿy¤¡Ÿ¤ª°¶±»Á¼ÁÀ½ÅÓàêú'23B;BHDHKLERMOUNxNUUUUJUPNONB:0&ø÷éäãÜÑÓÆÅÐËÑÊÊ»ËÅ–ſÉÊÒç÷û  $$'B UUU ôù÷ìöñéðíã¾ßÚÐÊ¿ÊÍÏÕÞÚßååìúÿýÿ &3CAFMUL~FIMVMVGA2UUU. ûõýîòîØØÎȸÁµ®¼¼½”º¶¼¸¸ÅÉÁËÑÕâðîûøýõ÷ïïëðïíóó# ,:@UUYEED<@8078;qGHLFDBE7;332:1;7:30(ö÷ïëäÛ×ÑÆ´¶²¨§™œÿ“ÿp  ¯±UUi±¹ÆÀÄÉÂÐÔÕÓÙ×âèíï &*%#!"$$#+35DNT‹_[TREUUU;-%&.( &-(,*$ýóíâçäÜÞÞÕÕÕÎÉÀ³´¯±©µ´¸»±´¯ª£¥¡—•“Zª••“𢣩µÀÌâçô ,6CUcou‘“’ŒŠŽº‡…xpk`]YTA6,UUUîâÝÉŹ´¯¸­·º¿¹ËÎÕáðú ýôñòäçáÛØÙÒ¬äÞçàâßêðïõóçïçðù÷ UUU öùñîõðìëðì÷ÿü !$$ "% I ûÿùóý  ùúíã¸âÜÔUUUÓÓäëðö (+$$O!,-,-0+.&û÷êíôñ ûòëæÙÑÎÇÉÈÄÇ¥ÕUUUÙÝáÞåÝÓÖÏËÕÜÛâéíôþ !  $( ?  UUU"*/$"$   ÷øïáÞÓÑÔÖÆËÈÒ«×Ôäíóööùû  úüûùöùþ  UUUüñóðôùûúþÿþ(],'&õæÝÓÎ¥ÏÊÑÖ×ÚáÞòù#UUU)!%- þûúýûúû $! ýýöêëåÙÒÖÔÕÒÔЫÒUUUÉÑÉÂÂÈÅÑÎØâçíý &('4.:==*3\/:315,&&$þùìàßÒÊ´¶UUU°‚¢£§°ÃÊÚäðö "&57:@C67Q! ýùþùùÿÿ iUU   þïåÐÅÿ½ÿ¹ÿ¥ÿw¤£¬¹±½Ã¿ÆÍÐÏÖÏßíñûý &)43=969-&&'(*UUU!"$,*$#L ##&!-1.-, ûïëìçæÞÙÙäâìøíúÿõôçáÛÎɽƒ«ºUUU¼ÇÖâêöý ý !&(% ÿóæßÚÓÌÎÇÅ×ÜÙàêû &,*-1;<=UUU??i79%'  þúðúúóüðíðòàäÑÊÌŸÇ×àæû'&'U%*#    üõçìUUUÞÕØØßçå²ÝÒÓÖÕÑÕÙÎÙÛãâåæñôÿ .34>8?IJDj63) óííðîïõí÷üòïñâUUUÞ·ÕÌÊÆÏ×Ûìòüúþùýÿý   ")]?ALPMJGDA<1/& óáØÀ¸¹³§®UUU¥­¸¼‘¿ÄÏÎÕßêòîóúûûïéëãëííôüýþùí÷òíôòòýøþýþÿø•UU$&.2AT\fšumwgj`ZMN;/!ýúôïèäãÙØÔÒÔÞÛâæßããáÛÛÎÍÞËÎÍÖÓUUUÙÆ’ÁÆÃÇÃÁÉÆÄÇÄÂÆËÕØæêëéáèãÞÞߨÕÝÚåìó!29?5542**,UZª+.Z,7B@FTVYUTQULGLGCDDAJ=730* ûçÒµ ÿ–ÿ„ÿ„ÿ|ÿsÿqÿwÿsÿzÿ€ÿƒÿ‚%UUZÿYÿ‹Ž¡Ÿ¤¤­»·»ÁÁÍÜíîýÿ  &!%+/7<>GAIX_inUUU_\QIA4)$"#  ý õñõïíêßÜÚÍÈÏÈÊÖÌÊÆÏÉÉœ¿ÁÉÃÔÔÕÕÜÛèòî÷UUUÿ-,+1*''"&J òïæÜ­ÛÊÎÓÍÜßÜÚÞÔçðúþ ùþúû  #UUU+12,-*(.*Q31&++!  ýøøþþú÷öøõîøðë÷ùø  ú÷êçéãÚÙܪÔÈÈËUUUÍÌÒÔØÞàêòýû')29353(,S" øûôëæäÛâµàØÔÎËÉÔÔèíþUUU úúþþ   þ '.-i6<52+-  þýÿÿÿüøùíïßÑÎÍÅÒiris-edu-libmseed-4314359/test/data/text-encoded.mseed000066400000000000000000000100001422047135100224730ustar00rootroot00000000000000000030D TEST LOGXXÔ  / ¤š80è Quanterra Packet Baler Model 14 Restart. Version 1.45 Control Port 3512 Opened Baler ready on Serial at 115200 baud Retry of command type 5A Retry of command type 5A Retry of command type 5A Retry of command type 5A Retry of command type 5A Power Cycled Baler Acknowledged Commands Accepted by Q330 Access timeout: 11265 sec Control Port 1490 Opened Data Port 1491 Opened Registered with Q330 Combination Record Received Window=4 Min. Timeout=10 Max. Timeout=30 Link Reset, starting window sequence: 9705 GPS Receiver ID Received Msg From 1xx.xx.xx.xxx:Baler readback. 368 recs. seq end: 9698 Baler clock set to 2004-06-08 10:47:31 Starting to Read DP Tokens Msg From 1xx.xx.xx.xxx:Baler14-1.45 registered. clock set: 2004-06-08 10:47:31 DP Tokens loaded, size=1274 bytes Webserver advertising 1xx.xx.xx.xxx:80 filters & delay BHZ:1@40,Linear below 100sps=0.405462 filters & delay BHN:2@40,Linear below 100sps=0.405462 filters & delay BHE:3@40,Linear below 100sps=0.405462 filters & delay LHZ:1@1,Linear below 100sps=14.930462 filters & delay LHN:2@1,Linear below 100sps=14.930462 filters & delay LHE:3@1,Linear below 100sps=14.930462 filters & delay VHZ:LHZ@0.1000=214.430462 filters & delay VHN:LHN@0.1000=214.430462 filters & delay VHE:LHE@0.1000=214.430462 filters & delay UHZ:VHZ@0.0100=2209.430462 filters & delay UHN:VHN@0.0100=2209.430462 filters & delay UHE:VHE@0.0100=2209.430462 [2004-06-08 00:57:51.000000] continuity found: 9698 139971471.000000 Q=58 [2004-06-08 00:57:51.000000] restoring continuity Sending DT_OPEN Station: TA-V04C Q330 Serial Number: 0100000000000000 AMB Serial Number: 0100000000000000 Seismo 1 Serial Number: 0000000000000000 Seismo 2 Serial Number: 0000000000000000 QAPCHP 1 Serial Number: 0000000 QAPCHP 2 Serial Number: 0 KMI Property Tag Number: 000 System Software Version: 1.53 Slave Processor Version: 1.10 Calibrator Type: QCAL330 Calibrator Version: 1.6 Clock Type: Motorola M12 PLD Version: 4.6 GPS Engine Identification SFTW P/N # 61-G10002A SOFTWARE VER # 1 SOFTWARE REV # 8 SOFTWARE DATE MAY 15 2002 MODEL # P273000000 HWDR P/N # 2 SERIAL # P05ISY MANUFACTUR DATE 3D17 Total Hours: 4188.05 Power On Hours: 1737.89 Time of Last Boot: 2004-06-07 22:15:01 Total Number of Boots: 34 Time of Last Re-Sync: 2004-06-07 22:28:15 Total Number of Re-Syncs: 39 Status Inputs: 00000000 AC OK: Off, Input 1,2: Off,Off, Analog Fault: Off Clock Quality: 44% Clock quality mapping: L=100 T=90 H=80 N=0 zone=0 Clock Phase: 1 usec. max allowed=50000 Boom positions: Ch1: -11 Ch2: 0 Ch3: -2 Ch4: 20 Ch5: 20 Ch6: 20 Analog Status Analog Positive Supply: 5.47V Input Voltage: 12.00V System Temperature: 23C Main Current: 39ma Antenna Current: 0ma GPS Status Time: Date: Fix Type: OFF Height: Latitude: Longitude: Off Time: 169min Sat. Used: 0 In View: 0 Checksum Errors: 0 Last GPS timemark: 2004-06-08 07:58:07 PLL Status State: Hold Intitial VCO: 1955.836792 Time Error: 0.000003 RMS VCO: 0.0000000 Best VCO: 1955.84 Seconds Since Track or Lock: 10169.4 Vco Control: 1957 timing mode: internal GPS internal GPS power management mode: Until PLL lock tempco normal power off-time: 180m max on-time: 120m resync at: 0 PLL update: 10s PLL lock criterion: 5us Pfrac: 150.00 VCO slope: -0.0175000 VCO intercept: 7.1100001 Km delta: 600.0000000 Logical Port 4 Status Data Packets Sent: 9715 Flood Packets Sent: 0 Packets Re-Sent: 18 Sequence Errors: 0 Packet Buffer Used: 4194044 Physical Port: Serial 2 Baler Model: 14 Software Version: 1.45 MAC Address: F2:3F:09:9E:AF:C2 Disk Size: 20000669696 Percent of 1177 data files in use: 2.2 DMU2 Software Version=4, Serial Number=0100000000000000 Supply Voltage=11.9 Temperature=20C Disk Model: IC250000000000-0 Revision: C0000000 [2004-06-08 00:57:51.000000] SEQUENCE GAP 16134 FROM 9698 TO 25832 [2004-06-08 05:26:45.000003] time label discontinuity: LCQ 16133.000003 iris-edu-libmseed-4314359/test/data/unapplied-timecorrection.mseed000066400000000000000000000100001422047135100251150ustar00rootroot00000000000000000001R TEST 00BHZXXÓ• ²\øüÍ'€0è@  dB ÿÿÿ ã /…qÿõ|aÿV‰.J][b‚3ý«€a«ŒV;ŒCcß>‹«Tzd$ø|b~z‚#òL?ÿÿÿ{ð­"€¾eï@S[Tç yàý CÀ¥D‚0ܱƒ²wF4 BBòûŒ¼ÆT@ð|c±”:žbÜ{Ðî¸?ÿÿÿNœÝŽÕ9oîoÝu~ü%w¯E„LñŒ‰Àƒ3EPÿÃñO²LOðPüFƒñØßFƒ;Bë{?ÿÿÿq\c„s´ ŸB‹ø{»ë½q°VC¤?Dt_€BFPˆÉX€ä‡D_1F3à†Z€ß?ÿÿÿ†QtsK÷pcÑûƒñ -iútŠ‘±Ez¡8crXkÑFBrºîßèi²ŸxŽö]¡‡ùMD0 ]?ÿÿÿƒw Fe¢‚¦`D="L?{éIß C‹Ïg7„ð&u„Ù7SL1EP0Œdƒ7CýŠ‚¼Œþ!ì¬?ÿÿÿ‹°Ÿ.ŒŸÐ ‹³ÍŒ`àŽ» Ëc’ŒBOçë†ÎVû~Sl-ƒ°‚Á ¿€Ë>|•óBIêì ‚ìu«?ÿÿÿ€VëÝò(½rU ¡†!O¾~U—ßHôæ “†BÎFPA?w¿œo;áŽãèÏHWdKÜcúnóü?ÿÿÿ‰½¡\eqB£áŽã Í/PBœD†3.à†m H#'áGò¬Á‚CÝ!F,èK]Ê Êƒï0ÂKÌ×?ÿÿÿ}›ŒšÃl¬GûóÞŽ™¿@ƒÿ7Í´H?ØFC¾¬ØrF@BÑ„í‹ðgàEߥ=Šä ‹TQá?ÿÿÿH yލ%,z-ùC΀P{ß!ÉñŒd®†Ûƒ*Ï'Ž‘ø €ð*΄m?ˆW؃,á?ÿÿÿCÌälEô$€‚¸#sà Xx¢ûßN c¾Ž!ÝßF!w¤P^ø‰C¾F}à—ÖF±xC‚â>Bo¢ ƒ>ß?ÿÿÿL pˆ±Ã[tjÂV;ã{wòûšhyl¼@?gê†í£~Šåÿ>ràCß Aˆ™3¿~â?ÿÿÿVàd.W¼ £ƒ¨Ó+H±p…ûÂûŠªâÉ€a! æaoÅ ýxs€ªƒÒNÀ‚,±Vƒ""ÿÍ€òì$?ÿÿÿƒûò2¼3FŽ™ÿÏŒžCÀEÝ\)C«ð¼m­kxyÝô(V> ~sMŒmÎü œÍêB-_É„Úáy ”Œo·HA$@ À‚ “@?ÿÿÿ}ñ P“-cŒÁ% ‚áø†ïOñEÎ\ˆ­Êš€È½ŠÜB¢ÊŽo~뼋à.΂Ô+P04~qh‹?ÿÿÿH0xʆÁqÞF„>RÞ"D +EÎu,Gíä‡PÎô‚wÉ­~/Þ5u\ˆe€Í!{ŸŒœn"€!?ÿÿÿŽ!Œ½4O‰æÂûߺwìÔ&Œ©±þAËo¼‚ù¬â$þ5‚ß,Å„¸÷_ŠÐ35ÑR…þ2…>"?ÿÿÿ~F,º@Ós{Hã|GR1(Á$ßq€îc@ptÞ{Â'YޱÜÜAÜlkEq¤^7o0,èNøVèÒwm|¼?ÿÿÿa•5BÚÿPSF…u-—W½k¥Œ™éw°E„àQNŒïD“ø%Eÿ”ˆ¾°eA¬ñB±ÁyİY?ÿÿÿrešRñd †BT(@Oë VŠ@Ak)ÞÀT-bPò€†?ÿÿÿ„ÚæcL2 æT`‰  ‡z»×€DÏQŒ­4OËÒ±^‰D W²,ºŠÓ+ï‹à3À­ßžvp~?ÿÿÿoÁv¶‰ð6‹Ä!/y¿„h¡±žt$§;GáœÈ$†€Â@„qûÏ‚M‹½þÐH«}_Û?ÿÿÿsß(øoa0»vts^B>ß~OÑd‰œ"Î@Œñ„C#…ÙBƒq°4AÀBqâöa‡Þÿ#ƒ6Oƒûàï?ÿÿÿN€ÿÂ…uÛEÊe+ƒ .ŠÃŒïŒ”^óH/òà»˜Š€Bºà…(ýyjhŠÌðFRk!Uì¥?ÿÿÿAÎN@ EDRÆR’xGîð!‚a4ƒ%ÑKŽàû7€þÃSª&>‰ ÿ¾L߈MÚðŽÍÚ2ob—?ÿÿÿp"µŠf9ÕFMÛÁIÀ‡DP@hgR.?Du— ƒò7†'r¡XPû¼@#3‚ê ‰êÝ»ï€ ® ?ÿÿÿqÞÎÞƒ ˜ÞsÀw> `‹ÝÔ} % n'ÓJó‹„ð/ŽÊ5€ÀU-ŒFK„Ra˜àDƒ“´QFP?ÿÿÿŽ&cð΃‰×Pí„@1@kAZžÛl ÞïÍMêì=Ž}ºv2î¹ÀÊ Œ:َܪÀ„«3/‚YÄ"?ÿÿÿŽªæ_÷"„îÿ A†4s‚¿F6Uûô§žœ‚T_bÁTnhmO:l!oÐlA{˜¾v5 »?ÿÿÿBëR@k'Qü…fƒàATƒ "B6aÍÐq_øeì½m¡|\‰¬oߊàVò¼’_y°€oÐsž?ÿÿÿz|ßk£´NÃòà…ë½J ðå{N¬»s¥E„Ê0‹ársÄ'߃e7 †âíBB &u $u¥K?ÿÿÿI¡ cƒTuô›¾…L¾ƒÍ$.Š @±ƒáº¸]‹ì‚;»à@^Úø‰½á=Žû¼Ùrò»Eû×}ôn¬?ÿÿÿŒýÖ>yð6l¬”tSŠûB¥€$D!̇ÁUCH0{ÆR”Ÿ6DD`÷žRßx„‚ÁczEÿŠß?ÿÿÿƒÉŒE€íVuÒƒ™n.ï¢GnŠñ™sq«v„tîŠîÜï/²`rëŠShqyÁ™g‚+ÖB>‘?ÿÿÿŒý÷Bqƒ$þ‹rÀDJLoôHMÌ…m…âVP‚ ÀN=ãÇT`ïUüôc}¿˜fBˆZD„r\HLßã?ÿÿÿOýˆâˆ¤p‰ƒbì¯N ôk‡ÈÀɉÈ„ â-vŸõvdþÜ„eÍŽÿÜðE‹åo@=šŠ+²A?ÿÿÿŽýþ±„VT… uJ"µ?t°šB¤î¥Z,ëæPO½kp˜>oMƒÙ‰ë¼Ýã $/u‘$‹÷MÑ?ÿÿÿ„/àAƒÿsÊDÕ‡]H„Ì‚¼gFÔ4è~$§¸@‚o`x3júŠ˜½ð€-ÐEü/­+ÐùkÏŒ>ñ¸?ÿÿÿE]¬sò‡V[ÏïZJyËCÒ(¾x7+Yx$¾Fâ^âVŽÛAG¸m%<ÁKë'ކm ˜Ùoô¬^?ÿÿÿ~òøŽôeùƒ_ÛìNÕ…O6ý‰ùãDl‰P^ëèV-àéŒ/á‚CŠáNdg­"@BjÚD|Û€?ÿÿÿ…ï-Þm°~e†«S?ÿÿÿv”÷FkãG­&‚AÀé|akRßÉ„íÛ~c#õBR#û~4wDP`ˆ€îWø€bÝ~€K…RË?ÿÿÿó‡)QÿhFKý‡ÛkR¤Xcµ ›t ßàAÚ‰¤Ñ£[€ñÝ€ÓwH‹WqàAÐHGÐŒèÔŽU?ÿÿÿ|d {~ƒ–«0#@-ã”p"6Š®gƒ¾Cp&Ütƒ÷w{À)Br“Þ?ÿÿÿJlÈA•%F­;3Þ;P®dh¯füB2“=R¤~Br‘hw_”Ç{òû¥TN||bjŸP firis-edu-libmseed-4314359/test/lmtestpack.c000066400000000000000000000234311422047135100205070ustar00rootroot00000000000000/*************************************************************************** * lmtestpack.c * * A program for libmseed packing tests. * * Written by Chad Trabant, IRIS Data Management Center * * modified 2016.275 ***************************************************************************/ #include #include #include #include #include #include #define VERSION "[libmseed " LIBMSEED_VERSION " example]" #define PACKAGE "lmtestpack" static flag verbose = 0; static int reclen = -1; static int encoding = -1; static int byteorder = -1; static char *outfile = NULL; static int parameter_proc (int argcount, char **argvec); static void print_stderr (char *message); static void usage (void); /* A simple, expanding sinusoid of 500 samples. * For all samples, no successive difference is greater than 30 bits (signed). * - Good for INT32, STEIM1, STEIM2, etc. * Between index 0-400, no sample value is greater than 16 bits (signed). * - Good for INT16. */ static int32_t sindata[500] = {0, 2, 4, 5, 7, 9, 10, 11, 11, 11, 11, 10, 8, 6, 4, 1, 0, -3, -6, -8, -11, -13, -14, -15, -16, -15, -14, -13, -11, -8, -5, -1, 2, 6, 9, 13, 16, 18, 20, 21, 22, 21, 19, 17, 14, 10, 5, 0, -4, -9, -14, -19, -23, -26, -29, -30, -30, -29, -26, -22, -18, -12, -5, 1, 8, 15, 22, 28, 33, 38, 40, 41, 41, 39, 35, 29, 22, 14, 5, -4, -14, -24, -33, -41, -48, -53, -56, -57, -56, -52, -46, -38, -27, -16, -3, 10, 23, 37, 49, 60, 68, 75, 78, 78, 75, 69, 60, 48, 33, 17, 0, -19, -38, -56, -72, -86, -97, -104, -108, -107, -102, -92, -78, -60, -39, -16, 8, 34, 59, 83, 105, 123, 137, 146, 149, 146, 137, 122, 101, 75, 45, 12, -22, -57, -92, -124, -152, -175, -192, -202, -204, -198, -183, -160, -129, -92, -50, -3, 44, 93, 139, 182, 219, 249, 269, 280, 279, 267, 243, 208, 164, 110, 50, -13, -80, -146, -209, -266, -314, -352, -376, -386, -380, -359, -322, -270, -205, -128, -44, 45, 137, 227, 311, 386, 449, 495, 523, 530, 516, 480, 423, 346, 252, 144, 25, -99, -225, -347, -460, -558, -637, -694, -724, -726, -698, -640, -553, -440, -305, -151, 15, 187, 359, 524, 673, 801, 902, 969, 999, 990, 939, 848, 718, 554, 359, 142, -89, -327, -561, -782, -980, -1145, -1271, -1349, -1375, -1346, -1260, -1118, -925, -686, -409, -104, 218, 544, 862, 1157, 1417, 1629, 1784, 1871, 1885, 1822, 1681, 1466, 1181, 836, 443, 15, -430, -877, -1306, -1700, -2039, -2309, -2495, -2586, -2575, -2457, -2233, -1909, -1492, -997, -441, 156, 771, 1381, 1958, 2479, 2920, 3259, 3478, 3562, 3504, 3300, 2951, 2467, 1861, 1154, 371, -460, -1306, -2134, -2908, -3595, -4162, -4582, -4830, -4890, -4752, -4413, -3878, -3162, -2286, -1281, -181, 971, 2131, 3252, 4285, 5184, 5908, 6418, 6686, 6690, 6419, 5874, 5064, 4013, 2753, 1329, -208, -1801, -3385, -4896, -6268, -7438, -8351, -8959, -9223, -9120, -8637, -7779, -6566, -5034, -3231, -1221, 921, 3114, 5270, 7298, 9110, 10622, 11760, 12462, 12680, 12386, 11571, 10247, 8447, 6225, 3657, 832, -2143, -5153, -8076, -10787, -13167, -15103, -16499, -17274, -17372, -16759, -15432, -13417, -10766, -7564, -3920, 36, 4153, 8270, 12217, 15825, 18930, 21386, 23065, 23864, 23716, 22587, 20483, 17450, 13576, 8983, 3832, -1687, -7367, -12977, -18286, -23061, -27086, -30164, -32129, -32855, -32260, -30315, -27044, -22526, -16897, -10341, -3089, 4587, 12392, 20010, 27120, 33408, 38583, 42385, 44602, 45078, 43720, 40510, 35502, 28830, 20697, 11378, 1207, -9432, -20123, -30427, -39906, -48136, -54727, -59340, -61705, -61632, -59023, -53880, -46311, -36527, -24838, -11646, 2567, 17262, 31853, 45737, 58314, 69012, 77316, 82784, 85076, 83966, 79360, 71301, 59981, 45728, 29009, 10408, -9387, -29613, -49456, -68085, -84684, -98487, -108811, -115090, -116897, -113975, -106249, -93837, -77057, -56418, -32610, -6480, 20993, 48737, 75622, 100508, 122289, 139942, 152573, 159453, 160065, 154123, 141602, 122746, 98068, 68342, 34581, -1992, -39992, -77915, -114200, -147287, -175686, -198036, -213168, -220164, -218401, -207588, -187799, -159476}; static char *textdata = "I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. " "I watched C-beams glitter in the dark near the Tannhäuser Gate. All those moments will be lost " "in time, like tears...in...rain. Time to die."; /* Binary I/O for Windows platforms */ #ifdef LMP_WIN unsigned int _CRT_fmode = _O_BINARY; #endif int main (int argc, char **argv) { MSRecord *msr = NULL; float *fdata = NULL; double *ddata = NULL; int idx; int rv; /* Redirect libmseed logging facility to stderr for consistency */ ms_loginit (print_stderr, NULL, print_stderr, NULL); /* Process given parameters (command line and parameter file) */ if (parameter_proc (argc, argv) < 0) return -1; if (!(msr = msr_init (msr))) { fprintf (stderr, "Could not allocate MSRecord, out of memory?\n"); return 1; } /* Set up record parameters */ strcpy (msr->network, "XX"); strcpy (msr->station, "TEST"); strcpy (msr->channel, "LHZ"); msr->dataquality = 'R'; msr->starttime = ms_timestr2hptime ("2012-01-01T00:00:00"); msr->samprate = 1.0; msr->encoding = encoding; msr->byteorder = byteorder; if (encoding == DE_ASCII) { msr->numsamples = strlen (textdata); msr->datasamples = textdata; msr->sampletype = 'a'; } else if (encoding == DE_FLOAT32) { msr->numsamples = 500; if (!(fdata = (float *)malloc (msr->numsamples * sizeof (float)))) { fprintf (stderr, "Could not allocate buffer, out of memory?\n"); return 1; } for (idx = 0; idx < msr->numsamples; idx++) { fdata[idx] = (float)sindata[idx]; } msr->datasamples = fdata; msr->sampletype = 'f'; } else if (encoding == DE_FLOAT64) { msr->numsamples = 500; if (!(ddata = (double *)malloc (msr->numsamples * sizeof (double)))) { fprintf (stderr, "Could not allocate buffer, out of memory?\n"); return 1; } for (idx = 0; idx < msr->numsamples; idx++) { ddata[idx] = (double)sindata[idx]; } msr->datasamples = ddata; msr->sampletype = 'd'; } else if (encoding == DE_INT16) { msr->numsamples = 400; /* The first 400 samples can be represented in 16-bits */ msr->datasamples = sindata; msr->sampletype = 'i'; } else { msr->numsamples = 500; msr->datasamples = sindata; msr->sampletype = 'i'; } msr->samplecnt = msr->numsamples; rv = msr_writemseed (msr, outfile, 1, reclen, encoding, byteorder, verbose); if (rv < 0) ms_log (2, "Error (%d) writing miniSEED to %s\n", rv, outfile); /* Make sure everything is cleaned up */ if (msr->datasamples == sindata || msr->datasamples == textdata) msr->datasamples = NULL; msr_free (&msr); return 0; } /* End of main() */ /*************************************************************************** * parameter_proc: * * Process the command line parameters. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int parameter_proc (int argcount, char **argvec) { int optind; /* Process all command line arguments */ for (optind = 1; optind < argcount; optind++) { if (strcmp (argvec[optind], "-V") == 0) { ms_log (1, "%s version: %s\n", PACKAGE, VERSION); exit (0); } else if (strcmp (argvec[optind], "-h") == 0) { usage (); exit (0); } else if (strncmp (argvec[optind], "-v", 2) == 0) { verbose += strspn (&argvec[optind][1], "v"); } else if (strcmp (argvec[optind], "-r") == 0) { reclen = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-e") == 0) { encoding = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-b") == 0) { byteorder = strtol (argvec[++optind], NULL, 10); } else if (strcmp (argvec[optind], "-o") == 0) { outfile = argvec[++optind]; } else { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } } /* Make sure an outfile was specified */ if (!outfile) { ms_log (2, "No output file was specified\n\n"); ms_log (1, "Try %s -h for usage\n", PACKAGE); exit (1); } /* Report the program version */ if (verbose) ms_log (1, "%s version: %s\n", PACKAGE, VERSION); return 0; } /* End of parameter_proc() */ /*************************************************************************** * print_stderr(): * Print messsage to stderr. ***************************************************************************/ static void print_stderr (char *message) { fprintf (stderr, "%s", message); } /* End of print_stderr() */ /*************************************************************************** * usage: * Print the usage message and exit. ***************************************************************************/ static void usage (void) { fprintf (stderr, "%s version: %s\n\n", PACKAGE, VERSION); fprintf (stderr, "Usage: %s [options] -o outfile\n\n", PACKAGE); fprintf (stderr, " ## Options ##\n" " -V Report program version\n" " -h Show this usage message\n" " -v Be more verbose, multiple flags can be used\n" " -r bytes Specify record length in bytes\n" " -e encoding Specify encoding format\n" " -b byteorder Specify byte order for packing, MSBF: 1, LSBF: 0\n" "\n" " -o outfile Specify the output file, required\n" "\n" "This program packs static, test data into miniSEED\n" "\n"); } /* End of usage() */ iris-edu-libmseed-4314359/test/lmtestparse.c000066400000000000000000000175011422047135100207040ustar00rootroot00000000000000/*************************************************************************** * lmtestparse.c * * A program for libmseed parsing tests. * * Written by Chad Trabant, IRIS Data Management Center * * modified 2016.275 ***************************************************************************/ #include #include #include #include #include #include #define PACKAGE "lmtestparse" #define VERSION "[libmseed " LIBMSEED_VERSION " " PACKAGE " ]" static flag verbose = 0; static flag ppackets = 0; static flag basicsum = 0; static flag tracegap = 0; static int printraw = 0; static int printdata = 0; static int reclen = -1; static char *inputfile = 0; static double timetol = -1.0; /* Time tolerance for continuous traces */ static double sampratetol = -1.0; /* Sample rate tolerance for continuous traces */ static int parameter_proc (int argcount, char **argvec); static void print_stderr (char *message); static void usage (void); /* Binary I/O for Windows platforms */ #ifdef LMP_WIN unsigned int _CRT_fmode = _O_BINARY; #endif int main (int argc, char **argv) { MSTraceList *mstl = 0; MSRecord *msr = 0; int64_t totalrecs = 0; int64_t totalsamps = 0; int retcode; /* Redirect libmseed logging facility to stderr for consistency */ ms_loginit (print_stderr, NULL, print_stderr, NULL); /* Process given parameters (command line and parameter file) */ if (parameter_proc (argc, argv) < 0) return -1; if (tracegap) mstl = mstl_init (NULL); /* Loop over the input file */ while ((retcode = ms_readmsr (&msr, inputfile, reclen, NULL, NULL, 1, printdata, verbose)) == MS_NOERROR) { totalrecs++; totalsamps += msr->samplecnt; if (tracegap) { mstl_addmsr (mstl, msr, 0, 1, timetol, sampratetol); } else { if ( printraw ) ms_parse_raw (msr->record, msr->reclen, ppackets, -1); else msr_print (msr, ppackets); if (printdata && msr->numsamples > 0) { int line, col, cnt, samplesize; int lines = (msr->numsamples / 6) + 1; void *sptr; if ((samplesize = ms_samplesize (msr->sampletype)) == 0) { ms_log (2, "Unrecognized sample type: '%c'\n", msr->sampletype); } if (msr->sampletype == 'a') { char *ascii = (char *)msr->datasamples; int length = msr->numsamples; ms_log (0, "ASCII Data:\n"); /* Print maximum log message segments */ while (length > (MAX_LOG_MSG_LENGTH - 1)) { ms_log (0, "%.*s", (MAX_LOG_MSG_LENGTH - 1), ascii); ascii += MAX_LOG_MSG_LENGTH - 1; length -= MAX_LOG_MSG_LENGTH - 1; } /* Print any remaining ASCII and add a newline */ if (length > 0) { ms_log (0, "%.*s\n", length, ascii); } else { ms_log (0, "\n"); } } else for (cnt = 0, line = 0; line < lines; line++) { for (col = 0; col < 6; col++) { if (cnt < msr->numsamples) { sptr = (char *)msr->datasamples + (cnt * samplesize); if (msr->sampletype == 'i') ms_log (0, "%10d ", *(int32_t *)sptr); else if (msr->sampletype == 'f') ms_log (0, "%10.8g ", *(float *)sptr); else if (msr->sampletype == 'd') ms_log (0, "%10.10g ", *(double *)sptr); cnt++; } } ms_log (0, "\n"); /* If only printing the first 6 samples break out here */ if (printdata == 1) break; } } } } if (retcode != MS_ENDOFFILE) ms_log (2, "Cannot read %s: %s\n", inputfile, ms_errorstr (retcode)); if (tracegap) mstl_printtracelist (mstl, 0, 1, 1); /* Make sure everything is cleaned up */ ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, 0); if (mstl) mstl_free (&mstl, 0); if (basicsum) ms_log (1, "Records: %" PRId64 ", Samples: %" PRId64 "\n", totalrecs, totalsamps); return 0; } /* End of main() */ /*************************************************************************** * parameter_proc(): * Process the command line parameters. * * Returns 0 on success, and -1 on failure ***************************************************************************/ static int parameter_proc (int argcount, char **argvec) { int optind; /* Process all command line arguments */ for (optind = 1; optind < argcount; optind++) { if (strcmp (argvec[optind], "-V") == 0) { ms_log (1, "%s version: %s\n", PACKAGE, VERSION); exit (0); } else if (strcmp (argvec[optind], "-h") == 0) { usage (); exit (0); } else if (strncmp (argvec[optind], "-v", 2) == 0) { verbose += strspn (&argvec[optind][1], "v"); } else if (strncmp (argvec[optind], "-p", 2) == 0) { ppackets += strspn (&argvec[optind][1], "p"); } else if (strncmp (argvec[optind], "-z", 2) == 0) { printraw = 1; } else if (strncmp (argvec[optind], "-d", 2) == 0) { printdata = 1; } else if (strncmp (argvec[optind], "-D", 2) == 0) { printdata = 2; } else if (strncmp (argvec[optind], "-tg", 3) == 0) { tracegap = 1; } else if (strcmp (argvec[optind], "-s") == 0) { basicsum = 1; } else if (strcmp (argvec[optind], "-r") == 0) { reclen = atoi (argvec[++optind]); } else if (strncmp (argvec[optind], "-", 1) == 0 && strlen (argvec[optind]) > 1) { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } else if (inputfile == 0) { inputfile = argvec[optind]; } else { ms_log (2, "Unknown option: %s\n", argvec[optind]); exit (1); } } /* Make sure an inputfile was specified */ if (!inputfile) { ms_log (2, "No input file was specified\n\n"); ms_log (1, "%s version %s\n\n", PACKAGE, VERSION); ms_log (1, "Try %s -h for usage\n", PACKAGE); exit (1); } /* Report the program version */ if (verbose) ms_log (1, "%s version: %s\n", PACKAGE, VERSION); return 0; } /* End of parameter_proc() */ /*************************************************************************** * print_stderr(): * Print messsage to stderr. ***************************************************************************/ static void print_stderr (char *message) { fprintf (stderr, "%s", message); } /* End of print_stderr() */ /*************************************************************************** * usage(): * Print the usage message and exit. ***************************************************************************/ static void usage (void) { fprintf (stderr, "%s version: %s\n\n", PACKAGE, VERSION); fprintf (stderr, "Usage: %s [options] file\n\n", PACKAGE); fprintf (stderr, " ## Options ##\n" " -V Report program version\n" " -h Show this usage message\n" " -v Be more verbose, multiple flags can be used\n" " -p Print details of header, multiple flags can be used\n" " -z Print raw details of header\n" " -d Print first 6 sample values\n" " -D Print all sample values\n" " -tg Print trace listing with gap information\n" " -s Print a basic summary after processing a file\n" " -r bytes Specify record length in bytes, required if no Blockette 1000\n" "\n" " file File of Mini-SEED records\n" "\n"); } /* End of usage() */ iris-edu-libmseed-4314359/test/pack-Float32-encoded.test000077500000000000000000000001151422047135100226170ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 4 -o - iris-edu-libmseed-4314359/test/pack-Float32-encoded.test.ref000066400000000000000000000100001422047135100233610ustar00rootroot00000000000000000001R TEST LHZXXÜô80è @@€@ @àAA A0A0A0A0A A@À@€?€À@ÀÀÁÁ0ÁPÁ`ÁpÁ€ÁpÁ`ÁPÁ0ÁÀ ¿€@@ÀAAPA€AA A¨A°A¨A˜AˆA`A @ À€ÁÁ`Á˜Á¸ÁÐÁèÁðÁðÁèÁÐÁ°ÁÁ@À ?€AApA°AàBBB B$B$BB AèA°A`@ À€Á`ÁÀÂÂ$Â@ÂTÂ`ÂdÂ`ÂPÂ8ÂÁØÁ€À@A A¸BBDBpBˆB–BœBœB–BŠBpB@BAˆÁ˜ÂÂ`¬ÂÂÂÐÂØÂÖÂ̸œÂpÂÁ€ABBlB¦BÒBöC CCCC BôBÊB–B4A@Á°ÂdÂ¸ÂøÃÃ/Ã@ÃJÃLÃFÃ7à øÂHÀ@B0BºC C6C[CyC†€CŒC‹€C…€CsCPC$BÜBHÁP ÃÃQÃ…ÃðüÃÁþó€Ã¡Ã‡ÃMÃÂ0B4C CcC›€CÁCà€C÷€DÀD€DCðCÓ€C­C|CAÈÂÆÃaí€ÃæÄ €Ä@Ä-€Ä5Ä5€Ä.€Ä Ä @ÃÜØ€ÃApC;C³€DD(@DH@Da€Dr@DyÀDw€DjÀDTD3€D €C³€C²ã€Ä @ÄC€ÄuÄ ÄžàĨ Ä«àĨ@ĀċÀÄg@Ä+€ÃÌ€ÂÐCZDDW€D D± DË DßDéàDë DãÀDÒ D·@D“ DQCÝ€ApÃ×Ä[@Ä£@ÄÔ€ÄþàÅPÅðÅ! Å ðÅÅ Äî Äº€Äy@ÃÜ€CD@ÀD¬ DôÀEðE6€EK°EY`E^ E[EN@E8pE0Dè D@C¹€ÃæÄ£@Å`Å5ÀÅ`°Å‚Å0Å–ðŘÐÅ”€Å‰èÅr`ÅE ÅàÄ  Ã5DrÀE0EK@E…èE¢E¸ EÈEÐðEÑEȘE·Ež@EzÐE,D¦ ÃPÄá ÅSÅ™ÅÃàÅèpÆ|Æ üÆÆ€ÆôÅóÅÍ0ÅPÅIðĘ Df@EB E¤°EäFXF%øF7ÀFB¸FF FAˆF4ÌF FüEˆEdDPÅðÅ¡Åü`Æ(ŒÆM¼ÆküÆ€æÆ†ôƇ¸Æ‚îÆq ÆQ¤Æ(8Åì`ÅuBEÈF8F>äFwDF“äF§F´2FºpF¹HF°vF FˆTFT F \Eo€ÄÒàÅæ8ÆJÄÆŽÜÆ´*ÆÓœÆë¨ÆûÇWÆüÆìÖÆÓHƯüÆ„Æ!”ÅAEXFA FœTFÓàG€G·G%‘G.:G0G*ÈG>G ®Fá<F¡²F1ÈD–àÆ`Æ6Æí¶ÇâÇ<ÇUÇÇgÌÇq ÇpÀÇfÇRxÇ4çǯÆÂ Æ5øE pF†ÜFøÚG2©GcÊG†ÊG—G¡°G¦*G£ÿG›G‹B€GjMG2 Fâ¢F" Æ¬ÆçZÇA0Ç„ú€Ç¥fÇÀ[€ÇÔ…€ÇàÉÇäP€ÇÞ›€ÇÏ„€Ç·F€Ç–€€Ç\bÆþÄÅÊ€F¤G>aG“³GÄNGîØ€H©€Hÿ@H·@HP@H‚ÀH H€Gï½G¿ŠG…{GÄùÇ8ǘ-€Çß ÈÕÀÈ+‘€ÈAeÈP,ÈWÈUH@ÈJ¹È7eÀȽiris-edu-libmseed-4314359/test/pack-Float64-encoded.test000077500000000000000000000001151422047135100226240ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 5 -o - iris-edu-libmseed-4314359/test/pack-Float64-encoded.test.ref000066400000000000000000000100001422047135100233660ustar00rootroot00000000000000000001R TEST LHZXXÜô80è @@@@@"@$@&@&@&@&@$@ @@?ðÀÀÀ À&À*À,À.À0À.À,À*À&À À¿ð@@@"@*@0@2@4@5@6@5@3@1@,@$@ÀÀ"À,À3À7À:À=À>À>À=À:À6À2À(À?ð@ @.@6@<@@€@C@D@D€@D€@C€@A€@=@6@,@ÀÀ,À8À@€ÀD€ÀHÀJ€ÀLÀL€ÀLÀJÀGÀCÀ;À0À@$@7@B€@H€@N@Q@RÀ@S€@S€@RÀ@Q@@N@H@@€@1À3ÀCÀLÀRÀU€ÀX@ÀZÀ[ÀZÀÀY€ÀWÀS€ÀNÀC€À0@ @A@M€@TÀ@Z@@^À@a @b@@b @b@@a @^€@Y@@RÀ@F€@(À6ÀL€ÀWÀ_ÀcÀeàÀhÀi@Ài€ÀhÀÀfàÀdÀ` ÀWÀIÀ@F@W@@a`@fÀ@k`@o @pÐ@q€@qp@p°@n`@j@d€@[€@IÀ*ÀTÀb@Àj Àp Às ÀvÀw€Àx ÀwÀÀvpÀt ÀpàÀi À`ÀF@F€@a @l`@sp@x @|@~ð@€X@€@€ @~@zp@u @o€@b@9ÀXÀÀl Àu°À|ÀÀpÀƒèÀ…°À† À†°À…ÐÀ„ÀHÀ{€ÀsÀbà@.@g`@vp@€`@…@‰@Œ0@ŽH@8@Žð@X@Š€@†p@P@vp@aÀÀV@ÀtpÀˆÀˆpÀŽ À‘äÀ“ÜÀ•À•|À•À“°À‘xÀŒèÀ…pÀyÀZ@k@@@Šð@’@–$@™t@›à@<@t@œx@šD@–è@’t@Š @{°@.ÀzàÀ‹hÀ”hÀšÀŸÜÀ¢ À£~À¤4À¤À£2À¡rÀÔÀ—PÀ(À{@c€@ˆ@•”@ž˜@£^@¦Ð@©v@«,@«Ô@«`@©È@§@£F@@’@w0À|ÀÀ”hÀ ¬À¦¸À¬À°BÀ±æÀ²ÞÀ³À²À±=À®LÀ¨´À¡ÜÀ”Àf @ŽX@ ¦@©h@°½@´@@·@¹@º@º"@¹@¶ò@³È@¯Z@¥‚@”ÄÀjÀœ$ÀªrÀ³ À¸|À½ÀÀO€ÀÁ€À€ÀÁÐÀÀÞ€À¾cÀ¹¦À³ªÀ©>À“@ŒÈ@¨T@´–@¼‚@ÁË@Ä¿@Æø@ÈW@ÈÄ@È1@Æ™€@Ä€@À€@¸Q@¬’@ŠÀ ¾À´!À¿ŒÀÅ€ÀÉ·€ÀÍ€ÀÐÀÀÐÞ€ÀÐ÷ÀÐ]ÀÀÎ$ÀÊ4€ÀÅÀ½ŒÀ® @B@°9@À'@ÇÜ€@Îè€@Ò|€@Ôâ€@Ö†@@×N@×)@ÖÀ@ÔÀ@Ñ €@Ê„@Á‹€@­ðÀš\À¼ÇÀÉX€ÀÑÛ€ÀÖ…@ÀÚs€ÀÝuÀß`@Àà àÀßÀÝšÀÀÚiÀÕÿ€ÀЀ@ÀÄ2€À¨"@±ë@È4@ÓŠ€@Ú|@àP@âÖà@ä² @åÇ@@æÀ@åY@ãÇÀ@áUÀ@Ü'€@Ô6@@Æ9@’ÜÀÂlÀÓ¦ÀÀݶÀÀã|@ÀçÀê¸àÀìù€Àî! ÀîÀìÑàÀêOÀæœàÀáÕàÀØA€ÀÆ¿@¤@ÐÛ€@ß@@æU @ìy@@ðÙ@@òà@@ô6@ôÅ@@ôà@ó`@ñhP@íI @æT@ÜT@@ÄTÀÂU€ÀÜë@Àè&ÀðŸPÀô¬ÀÀø pÀú°Àü ÀüŠÀûÓpÀùðÀöèÐÀòÐÀëŒ@Àߨ€À¹P@Ô€@@çÌ @òv`@ø‰À@ýÛA0AŸèAvèAŠAÐXAI@ý÷ @÷ñ@@ð¯`@àâ ÀŸ Àã‡Àó°Àûá€Áú¸Ár0Á, Á €Á à Á ©Á W Áì¸Áw iris-edu-libmseed-4314359/test/pack-Int16-encoded.test000077500000000000000000000001151422047135100223060ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 1 -o - iris-edu-libmseed-4314359/test/pack-Int16-encoded.test.ref000066400000000000000000000100001422047135100230500ustar00rootroot00000000000000000001R TEST LHZXXÜ80è  ÿýÿúÿøÿõÿóÿòÿñÿðÿñÿòÿóÿõÿøÿûÿÿ  ÿüÿ÷ÿòÿíÿéÿæÿãÿâÿâÿãÿæÿêÿîÿôÿû!&())'#ÿüÿòÿèÿßÿ×ÿÐÿËÿÈÿÇÿÈÿÌÿÒÿÚÿåÿðÿý %1<DKNNKE<0!ÿíÿÚÿÈÿ¸ÿªÿŸÿ˜ÿ”ÿ•ÿšÿ¤ÿ²ÿÄÿÙÿð";Si{‰’•’‰zeK- ÿêÿÇÿ¤ÿ„ÿhÿQÿ@ÿ6ÿ4ÿ:ÿIÿ`ÿÿ¤ÿÎÿý,]‹¶Ûù  óФn2ÿóÿ°ÿnÿ/þöþÆþ þˆþ~þ„þ™þ¾þòÿ3ÿ€ÿÔ-‰ã7‚Áï à§Züÿÿþ¥þ4ýÒýƒýJý,ý*ýFý€ý×þHþÏÿi»g ¡!†ÉçÞ«PÎ*gŽÿ§þ¹ýÏüòü,û‡û ú»ú¡ú¾ûû¢ücýRþgÿ˜Ú ^…‰]øO]‘ºD»þRü“úæù\ø öûöAõæõñög÷Gø‹ú,üþGœe¦ ¯ h » – ê ° ä ‡ £E‚sþ4úæ÷ªô¤ñõï¾îí"ìæípîÃðÚó¦÷úÿÿKËS ´½@"òÈ­ Á1ÿ0ø÷òÇìàç„âòßaÝÛùÜ`ÞCáæZìVóaû;™ *–‚#–)~-ð0®1ˆ0b-3( ÿQI@÷¡ëßàtÕÝ̑ſ¼†¼$¾‰Ã¸Ë—Õòâtð°$9 N/¹=ÑIòSŠZ]8\¤X;PD*5#øùiã9ÍO¸’¥ë–2Š,iris-edu-libmseed-4314359/test/pack-Int32-encoded.test000077500000000000000000000001151422047135100223040ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 3 -o - iris-edu-libmseed-4314359/test/pack-Int32-encoded.test.ref000066400000000000000000000100001422047135100230460ustar00rootroot00000000000000000001R TEST LHZXXÜô80è  ÿÿÿýÿÿÿúÿÿÿøÿÿÿõÿÿÿóÿÿÿòÿÿÿñÿÿÿðÿÿÿñÿÿÿòÿÿÿóÿÿÿõÿÿÿøÿÿÿûÿÿÿÿ  ÿÿÿüÿÿÿ÷ÿÿÿòÿÿÿíÿÿÿéÿÿÿæÿÿÿãÿÿÿâÿÿÿâÿÿÿãÿÿÿæÿÿÿêÿÿÿîÿÿÿôÿÿÿû!&())'#ÿÿÿüÿÿÿòÿÿÿèÿÿÿßÿÿÿ×ÿÿÿÐÿÿÿËÿÿÿÈÿÿÿÇÿÿÿÈÿÿÿÌÿÿÿÒÿÿÿÚÿÿÿåÿÿÿðÿÿÿý %1<DKNNKE<0!ÿÿÿíÿÿÿÚÿÿÿÈÿÿÿ¸ÿÿÿªÿÿÿŸÿÿÿ˜ÿÿÿ”ÿÿÿ•ÿÿÿšÿÿÿ¤ÿÿÿ²ÿÿÿÄÿÿÿÙÿÿÿð";Si{‰’•’‰zeK- ÿÿÿêÿÿÿÇÿÿÿ¤ÿÿÿ„ÿÿÿhÿÿÿQÿÿÿ@ÿÿÿ6ÿÿÿ4ÿÿÿ:ÿÿÿIÿÿÿ`ÿÿÿÿÿÿ¤ÿÿÿÎÿÿÿý,]‹¶Ûù  óФn2ÿÿÿóÿÿÿ°ÿÿÿnÿÿÿ/ÿÿþöÿÿþÆÿÿþ ÿÿþˆÿÿþ~ÿÿþ„ÿÿþ™ÿÿþ¾ÿÿþòÿÿÿ3ÿÿÿ€ÿÿÿÔ-‰ã7‚Áï à§Züÿÿÿÿÿÿÿÿþ¥ÿÿþ4ÿÿýÒÿÿýƒÿÿýJÿÿý,ÿÿý*ÿÿýFÿÿý€ÿÿý×ÿÿþHÿÿþÏÿÿÿi»g ¡!†ÉçÞ«PÎ*gŽÿÿÿ§ÿÿþ¹ÿÿýÏÿÿüòÿÿü,ÿÿû‡ÿÿû ÿÿú»ÿÿú¡ÿÿú¾ÿÿûÿÿû¢ÿÿücÿÿýRÿÿþgÿÿÿ˜Ú ^…‰]øO]‘ºD»ÿÿþRÿÿü“ÿÿúæÿÿù\ÿÿø ÿÿöûÿÿöAÿÿõæÿÿõñÿÿögÿÿ÷Gÿÿø‹ÿÿú,ÿÿüÿÿþGœe¦ ¯ h » – ê ° ä ‡ £E‚sÿÿþ4ÿÿúæÿÿ÷ªÿÿô¤ÿÿñõÿÿï¾ÿÿîÿÿí"ÿÿìæÿÿípÿÿîÃÿÿðÚÿÿó¦ÿÿ÷ÿÿúÿÿÿÿKËS ´½@"òÈ­ Á1ÿÿÿ0ÿÿø÷ÿÿòÇÿÿìàÿÿç„ÿÿâòÿÿßaÿÿÝÿÿÛùÿÿÜ`ÿÿÞCÿÿáÿÿæZÿÿìVÿÿóaÿÿû;™ *–‚#–)~-ð0®1ˆ0b-3( ÿQI@ÿÿ÷¡ÿÿëßÿÿàtÿÿÕÝÿÿÌ‘ÿÿÅÿÿ¿ÿÿ¼†ÿÿ¼$ÿÿ¾‰ÿÿøÿÿË—ÿÿÕòÿÿâtÿÿð°$9 N/¹=ÑIòSŠZ]8\¤X;PD*5#øÿÿùiÿÿã9ÿÿÍOÿÿ¸’ÿÿ¥ëÿÿ–2ÿÿŠ,ÿÿ‚ÿÿ©ÿÿüÿÿ‰•ÿÿ–\ÿÿ¨ÿÿ½ÿÿÿ×›ÿÿóïë0hN*ið‚€–·¥‘®:°ªÈž>Š®pžPÙ,r·ÿÿÛ(ÿÿ±eÿÿ‰%ÿÿdÿÿCøÿÿ*9ÿÿ4ÿÿ÷ÿÿ@ÿÿqÿÿ-ˆÿÿKÿÿqQÿÿžúÿÿÒ‚ Cn|m²©ãÊ ”.C`LTGþ6…êM² qQ(¨ÿÿÛUÿÿŒSÿÿ>Ðÿþö ÿþµ4ÿþIÿþVõÿþ>nÿþ7_ÿþBÉÿþ`÷ÿþ‘sÿþÒÿÿÿ#žÿÿ€žÿÿæ°R¾a'fˆœݱ"¦SýnÝqAZ )"ßz ö‡ÿÿø8ÿÿcÈÿþÏ¥ÿþAèÿýÀ©ÿýQºÿüúlÿü¿Pÿü£üÿüªßÿüÕÿý"iÿý‘ iris-edu-libmseed-4314359/test/pack-Steim1-encoded.test000077500000000000000000000001161422047135100225500ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 10 -o - iris-edu-libmseed-4314359/test/pack-Steim1-encoded.test.ref000066400000000000000000000100001422047135100233110ustar00rootroot00000000000000000001R TEST LHZXXÜô@0è  UUUÿý‘ ÿþþþýÿýýþýþÿÿÿÿþþýüûûüûûûUUUüýýÿþüúùø÷÷öö÷øùûýÿ  ýú÷ôñðïíUUUíîðòõùü  ý÷ñëæâßÞÝÝàäéïöþ%*//1.+% ÿôèÝÔÊUUªÄÁ½¾ÁÇÐÚèö%4AMTY\ZTK?.òÜdz¢”‰„‚†ž±Çâþ:Wq‡š¦¬¬¥&ªšª•€eC÷ÿÍÿ¥ÿ~ÿ\ÿ=ÿ'ÿÿÿÿ#ÿ:ÿ[‚²æVŽÁï1BF>'Ô*ªªª›WÿÁÿsÿ)þãþ§þwþTþCþAþSþvþ­þòÿFÿ¥ vàD¡ï,UgbA *ªªª¹SÛTÿÆÿ4þ£þý¢ý=üñüÁü²üÄüúýQýÉþ\ÿÿÄŠSÌlíL€ˆa*ªªª ƒÔþ þñýßüÖûåûúpùÿùÇùÐúú¤ûnüoý þøgãZ½ü Ú^‘*ªªªlìèr¾ÚþÚüÑúÔøø÷Rõøô÷ôaô>ô•õiö´øpúŒüùÿže/ß [ ‚<t*ªªªk ! ˜ÿlû—÷Èô'ðÞîëáêqéÐêëCíYðGóúøSý*S™ Ǧýœ*ªªªTü}ÂÆ7Ú©Üú²óvìpåðà;Û™ØEÖqÖ=×ÀÚùßÚæAíûöÃI 1‘&8*ªªª-©3ˆ7…9g8ÿ6<1!)Ê p\ôûªîà…ÓÈÈS¾±·W²­°þ²}·;¿)Ê׬çyøñ j.0|*ª¯ÿAŒPŸ]fkQl`ia6UDõ1WàdèÊ϶XŸš‹âÿÿ|ÿÿq#ÿÿkÿÿkÝÿÿrCÿÿ~Á*€‘¨²Äää¬ã*=MMn£iris-edu-libmseed-4314359/test/pack-Steim2-encoded.test000077500000000000000000000001161422047135100225510ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 11 -o - iris-edu-libmseed-4314359/test/pack-Steim2-encoded.test.ref000066400000000000000000000100001422047135100233120ustar00rootroot00000000000000000001R TEST LHZXXÜô@0è  ÿÿÿÿý‘ €"!îŽßÝíŽÿñ‚3CC„2!Ží˼‹»Í߀Dg†wvU‚ì©q{Ú׈›ß?ÿõÕL…­­Zæ-Fêô1Âûm.Ã-y<RŽUvadŽ ÝñëæâßÞÝÝà$¦ý¾%*//1.+%5UUZP¿ôèÝÔÊÄÁ½¾ÁÇÐÚèö%4AMTY\ZTK?.òÜdz¢”‰„‚†ž±Çâþ:Åqćɢ˜¬)ªªªÊ”•È”C÷Í¥÷ís=ò|gñl:õ¾ ²þ`tVÈãïÑTÅBÔdù'ÐCP›Åp;Á÷<¦ãêyÞT*ªªªä9Sçj¶òôn” ÇcD€ÐïU3‚b ‚ Û•LÛÅO4¿Qþ¾Ñ}=¾xüÁ¾Y|ľ}}Q*ªªª¾äþ\ðŠ€©‚flö„L‚@ˆ‚0„ Á‚Ôßä0¿xýß¾k{彊zp¼ÿùǼèz½R{n*ªªª¾7ý ïã­½‚þ ƒí^„Hˆlƒö‚ôr_Ú¿m|ѽjxø»©uøº{ôaºt•º´ö´*ªªª¼8zŒ¾|ÿž2…/ƒïŠ[†A<‡ºˆ k‡ !„Ìÿl½Ë÷ȺðÞ·ëáµ8éе kC*ªªª¶¬ðG¹ýxS¾•SƒÌŒÇˆÓýŒÎTŽþ}ŽáÆŒH7‡m©€îz²¹»lp²ø`;­ÌØE«8Ö=*ªªª«àZù¯ífA¶ýöÀ$Š1Š ‘“-©™Ä7…œ³¸ÿ›1!”å pŠ®ô½Õn°BÓÈÿÈSÿ¾±*ªªªÿ·Wÿ²­ÿ°þÿ²}ÿ·;ÿ¿)¥ ׬³¼øñ…µ.@0|@AŒ@PŸ@]@f@kQ*ªªª@l`@i@a6@U@Dõ˜«šà2hÊÿÏÿ¶XÿŸšÿ‹âÿ|ÿq#ÿkÿkÝ*ª€ÿrCÿ~Áÿ‘ÿ¨²¢rd¬ƒqª=@MM@n£iris-edu-libmseed-4314359/test/pack-text-encoded.test000077500000000000000000000001151422047135100223710ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestpack -e 0 -o - iris-edu-libmseed-4314359/test/pack-text-encoded.test.ref000066400000000000000000000100001422047135100231330ustar00rootroot00000000000000000001R TEST LHZXXÜë80è I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhäuser Gate. All those moments will be lost in time, like tears...in...rain. Time to die.iris-edu-libmseed-4314359/test/read-CDSN-encoded.test000077500000000000000000000001371422047135100221350ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/CDSN-encoded.mseed -D iris-edu-libmseed-4314359/test/read-CDSN-encoded.test.ref000066400000000000000000000600361422047135100227110ustar00rootroot00000000000000XX_TEST__BHE, 000000, Q, 4096, 2016 samples, 20 Hz, 1986,360,01:11:45.430000 -96 -87 -100 -128 -123 -83 -52 -54 -77 -108 -130 -120 -92 -93 -106 -108 -96 -57 -18 -1 -3 -11 -29 -20 33 80 81 62 38 28 58 101 105 86 63 48 75 150 200 186 143 109 102 120 146 154 153 151 165 190 188 166 149 133 123 135 165 169 157 144 127 123 135 138 128 107 78 45 38 58 75 70 34 -9 -41 -59 -48 -31 -26 -46 -56 -52 -54 -45 -43 -72 -95 -90 -85 -88 -60 -46 -75 -104 -112 -100 -60 0 10 -43 -84 -59 -6 3 -10 -17 -21 -32 -19 23 74 89 48 -9 -23 10 68 95 93 94 117 144 155 142 104 71 68 90 115 148 161 130 101 117 163 187 158 95 38 42 69 97 106 119 114 106 110 142 177 168 120 70 50 58 92 101 97 72 55 57 61 70 77 77 56 38 34 44 47 60 62 36 -10 -28 -17 -24 -50 -62 -54 -36 -20 -18 -44 -70 -72 -41 -1 10 -13 -19 -18 -32 -34 -8 16 19 19 25 28 40 56 58 61 62 68 80 90 97 105 111 114 109 103 97 88 98 123 119 82 52 51 70 97 110 93 74 63 63 51 48 37 8 -15 -9 1 -11 -38 -49 -35 -20 -22 -61 -106 -132 -134 -112 -73 -70 -110 -155 -184 -187 -167 -150 -153 -156 -167 -188 -188 -176 -185 -199 -200 -194 -207 -187 -161 -153 -147 -144 -155 -144 -115 -98 -110 -95 -71 -63 -60 -60 -43 -1 31 26 9 12 18 37 89 131 133 95 65 88 153 214 225 213 210 220 249 269 261 232 198 177 179 221 277 303 274 229 204 213 220 215 198 173 144 117 98 92 92 83 48 21 6 15 49 65 25 -36 -81 -115 -96 -39 -6 -28 -62 -92 -113 -91 -83 -115 -141 -152 -164 -170 -139 -107 -94 -56 -20 13 53 87 61 -5 -60 -79 -71 -43 -48 -90 -105 -58 -21 -19 -34 -24 -30 -64 -108 -109 -39 60 139 189 204 166 108 54 18 -29 -43 2 57 80 68 28 -14 -4 64 124 157 171 162 145 118 96 85 84 69 27 -15 -52 -69 -68 -61 -71 -126 -190 -224 -210 -142 -55 -28 -81 -136 -145 -88 19 166 275 307 278 255 268 276 240 200 229 291 327 311 290 325 403 449 406 294 195 122 112 157 238 262 214 173 209 255 228 152 101 82 101 145 196 225 211 142 88 112 150 137 100 64 16 -34 -37 -15 -7 -48 -127 -192 -153 -38 20 -43 -145 -192 -176 -159 -181 -223 -238 -226 -213 -206 -199 -195 -190 -196 -182 -162 -165 -232 -327 -379 -340 -227 -139 -156 -231 -273 -259 -192 -124 -75 -65 -97 -116 -81 -41 -43 -50 7 91 113 63 -9 -52 -63 -26 28 55 64 95 138 180 212 233 251 251 224 175 173 232 269 252 239 255 285 308 302 279 257 246 249 242 214 161 121 131 163 184 188 178 153 120 78 4 -71 -99 -98 -77 -39 -43 -107 -159 -178 -177 -176 -209 -276 -342 -348 -277 -175 -101 -104 -155 -197 -201 -163 -112 -86 -117 -158 -188 -209 -220 -197 -163 -140 -108 -85 -92 -96 -72 -62 -60 -43 -17 -9 25 53 52 53 53 70 118 154 111 42 13 16 46 100 131 99 33 1 24 42 45 39 38 27 22 55 116 162 169 147 141 145 140 132 130 145 167 197 239 264 261 249 231 201 169 174 206 221 234 246 235 192 159 141 132 125 105 87 83 61 17 -35 -63 -57 -22 21 29 -12 -52 -66 -51 -22 17 59 60 19 -40 -73 -76 -53 -31 -39 -68 -121 -179 -209 -170 -91 -42 -40 -70 -84 -59 -19 7 4 -14 -7 35 74 71 17 -26 -28 14 73 106 74 31 16 42 93 132 132 109 102 123 163 191 191 158 95 43 41 78 121 118 79 29 -10 -34 -4 25 52 22 -10 -29 -23 -1 43 56 36 28 27 51 86 76 27 17 43 67 95 114 79 45 23 24 59 125 149 113 98 113 95 81 85 84 85 91 95 104 146 179 166 156 141 102 64 60 66 76 84 73 49 62 72 71 72 85 74 55 47 22 -35 -84 -106 -102 -48 46 101 65 4 -31 -14 28 38 -5 -64 -83 -70 -25 52 110 111 53 -6 -29 -17 -12 -63 -144 -200 -212 -196 -168 -155 -152 -138 -115 -98 -85 -97 -136 -171 -177 -156 -138 -136 -161 -168 -132 -74 -54 -71 -89 -96 -96 -82 -57 -40 -35 -54 -72 -51 -14 3 6 -6 -15 1 34 30 -3 -23 -25 -1 49 90 87 39 -3 -32 -21 25 53 45 30 20 15 29 32 17 -12 -38 -49 -17 15 19 8 17 37 52 57 33 12 27 74 105 110 83 37 4 25 72 129 119 63 4 -22 -13 12 23 12 20 69 105 98 73 61 83 148 210 247 250 229 215 225 251 261 234 188 172 174 187 210 211 166 122 120 128 136 146 131 97 98 118 112 100 90 57 20 20 23 18 18 -11 -47 -42 -35 -63 -65 -31 -14 -27 -46 -74 -112 -128 -144 -165 -153 -115 -102 -103 -96 -84 -91 -99 -107 -120 -135 -133 -122 -101 -71 -58 -88 -105 -95 -94 -113 -117 -118 -131 -143 -165 -173 -128 -80 -71 -79 -82 -85 -71 -27 -6 -10 -31 -52 -46 12 55 48 32 37 42 68 119 141 134 127 119 143 199 265 284 254 214 185 203 262 308 321 320 330 341 344 348 341 336 330 321 300 284 289 282 275 286 289 279 277 258 246 256 281 265 234 206 188 191 201 179 133 76 43 42 60 58 27 -5 -18 -27 -32 -27 -38 -65 -96 -106 -108 -109 -124 -167 -211 -223 -189 -160 -171 -206 -249 -274 -272 -251 -242 -240 -241 -251 -259 -240 -220 -222 -241 -248 -243 -218 -176 -143 -134 -144 -170 -170 -143 -107 -74 -62 -55 -54 -49 -30 -7 -3 7 31 44 58 96 115 87 73 96 115 142 169 174 160 172 177 187 216 229 192 147 118 103 134 182 203 177 148 146 167 197 188 133 80 52 65 81 79 57 51 52 48 44 41 18 -19 -43 -46 -17 5 6 -18 -42 -76 -91 -65 -18 -4 -14 -33 -45 -40 -23 -25 -19 -25 -43 -63 -69 -63 -54 -46 -44 -39 -23 -18 -32 -48 -53 -72 -88 -69 -25 21 50 34 -9 -34 -11 15 16 1 -37 -52 -19 9 -4 -25 -44 -74 -83 -68 -55 -50 -70 -105 -123 -90 -54 -63 -89 -105 -101 -76 -32 0 -20 -65 -96 -80 -43 -19 -12 -30 -42 -23 4 33 47 35 -7 -15 19 46 79 102 93 69 85 122 136 145 132 97 110 134 151 168 210 215 210 216 194 163 180 212 219 218 212 184 168 188 201 197 173 124 84 91 118 129 108 65 33 43 90 118 94 26 -18 -17 21 52 43 -4 -54 -49 11 58 64 19 -62 -95 -56 14 61 62 3 -37 -2 57 91 82 36 -1 18 87 136 133 92 34 6 24 67 96 94 61 18 26 68 98 93 55 4 -40 -19 29 47 19 -39 -81 -65 -28 -6 -23 -67 -112 -125 -81 -22 -4 -38 -88 -105 -66 -15 12 0 -61 -108 -100 -46 -21 -20 -37 -72 -86 -68 -28 13 29 0 -48 -56 -30 1 37 42 9 -19 -16 31 79 106 71 13 6 40 83 104 102 86 83 96 125 158 164 158 164 168 177 196 212 204 185 172 189 218 237 221 186 184 204 214 230 228 216 211 223 228 214 187 157 141 153 189 195 169 130 92 77 100 108 79 34 7 6 18 22 0 -30 -70 -84 -78 -66 -70 -84 -103 -133 -144 -151 -169 -185 -182 -178 -189 -203 -224 -251 -258 -240 -238 -255 -263 -264 -259 -234 -217 -239 -262 -256 -234 -208 -181 -187 -203 -197 -175 -163 -141 -127 -130 -123 -79 -71 -70 -49 -33 -35 -11 36 75 83 64 34 43 102 153 162 144 114 98 113 177 201 169 110 94 125 187 234 216 151 98 95 136 196 210 174 99 77 105 130 136 113 62 35 68 114 123 84 33 -7 10 51 60 27 -12 -29 -9 27 56 39 -5 -26 -19 13 50 42 -16 -73 -76 -38 5 12 -25 -67 -82 -77 -61 -58 -70 -90 -97 -93 -85 -80 -70 -57 -55 -71 -81 -65 -47 -37 -32 -34 -58 -86 -77 -27 43 91 79 26 -1 28 77 113 117 96 72 84 120 150 150 142 125 116 161 216 205 160 137 146 180 213 218 174 132 125 158 209 229 185 123 86 100 149 189 168 114 89 95 124 171 154 88 44 57 66 87 100 80 44 40 40 40 47 45 8 -2 25 48 50 41 7 -20 1 26 31 28 22 4 -6 12 34 42 43 39 14 17 34 54 65 65 41 24 26 34 42 64 76 63 49 51 54 59 53 36 31 31 23 31 44 42 31 10 -5 -3 15 8 -12 -40 -63 -57 -47 -52 -63 -84 -108 -99 -62 -60 -72 -79 -103 -102 -47 -10 -32 -73 -98 -104 -78 -49 -40 -54 -52 -59 -71 -52 -36 -45 -44 -24 -25 -19 2 6 -6 17 33 33 33 37 37 36 49 57 47 34 20 26 48 79 91 73 43 32 34 74 102 88 57 41 63 92 109 102 61 23 33 58 83 117 105 51 23 46 87 130 118 62 11 21 73 114 123 87 26 19 56 87 101 83 29 -8 28 92 118 80 -11 -83 -62 36 98 89 16 -85 -139 -92 -4 34 0 -83 -153 -156 -88 -23 -19 -76 -140 -152 -120 -67 -44 -81 -137 -156 -130 -74 -30 -27 -55 -70 -62 -48 -9 20 21 3 -4 -7 2 39 59 59 74 84 79 87 103 96 96 128 135 121 119 102 88 92 106 108 110 111 79 75 100 113 101 81 46 23 33 52 70 85 66 19 -7 28 64 67 25 -29 -63 -42 11 34 9 -33 -60 -55 -24 6 -12 -58 -89 -77 -35 -5 -17 -77 -145 -157 -96 -27 1 -23 -75 -119 -108 -72 -43 -50 -49 -57 -70 -50 -8 6 -2 -22 -42 -38 1 43 69 71 51 38 68 102 121 139 144 115 128 175 208 229 243 236 218 226 245 251 275 283 273 270 283 280 265 270 282 293 309 315 274 233 226 237 254 264 237 179 141 139 158 182 169 121 64 40 49 66 53 4 -51 -83 -78 -76 -73 -101 -145 -178 -187 -193 -204 -222 -234 -235 -227 -224 -231 -246 -251 -258 -256 -253 -250 -250 -248 -243 -228 -203 -205 -205 -196 -185 iris-edu-libmseed-4314359/test/read-DWWSSN-encoded.test000077500000000000000000000001411422047135100224260ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/DWWSSN-encoded.mseed -D iris-edu-libmseed-4314359/test/read-DWWSSN-encoded.test.ref000066400000000000000000000600351422047135100232060ustar00rootroot00000000000000XX_TEST__LHE, 000000, M, 4096, 2016 samples, 1 Hz, 1980,360,00:00:00.320000 6 5 1 -9 -18 -19 -7 10 27 34 34 35 40 45 49 44 35 31 31 36 42 46 50 54 56 56 52 50 47 44 36 24 11 3 2 7 10 10 7 6 10 17 21 19 12 -1 -11 -17 -14 -10 -7 -9 -14 -14 -10 -3 3 3 -5 -15 -22 -23 -20 -14 -12 -12 -14 -19 -23 -25 -22 -16 -16 -19 -22 -23 -23 -21 -19 -19 -21 -22 -21 -17 -12 -4 4 11 18 19 16 12 9 10 12 14 17 20 25 35 41 47 44 34 21 11 5 4 5 8 11 15 17 17 18 21 24 27 27 24 20 15 15 16 20 19 11 -1 -10 -11 -4 7 18 19 11 -2 -15 -18 -15 -11 -16 -32 -48 -54 -47 -35 -24 -25 -33 -41 -43 -43 -46 -54 -65 -68 -63 -51 -46 -47 -52 -50 -41 -34 -32 -39 -46 -45 -38 -29 -22 -18 -16 -18 -24 -35 -49 -67 -91 -123 -161 -203 -245 -277 -304 -329 -357 -386 -406 -414 -403 -379 -345 -307 -264 -213 -151 -83 -14 49 105 154 198 235 264 291 319 345 365 377 383 387 388 386 383 375 363 347 327 305 284 263 243 223 204 187 176 168 164 158 149 132 112 94 78 64 51 42 35 32 28 18 4 -11 -18 -22 -25 -32 -42 -50 -56 -56 -55 -58 -63 -71 -75 -74 -66 -58 -58 -67 -79 -84 -81 -76 -77 -86 -95 -97 -90 -77 -67 -64 -66 -67 -63 -54 -47 -45 -51 -61 -67 -68 -68 -68 -70 -69 -60 -48 -40 -36 -39 -45 -51 -56 -54 -44 -28 -15 -10 -12 -17 -21 -19 -15 -12 -16 -20 -20 -11 5 21 31 29 22 15 8 3 -6 -17 -26 -27 -18 -5 3 5 -1 -10 -14 -16 -16 -18 -20 -21 -21 -17 -13 -16 -18 -19 -14 -4 1 -3 -9 -13 -8 1 5 -4 -18 -28 -27 -18 -6 0 -3 -10 -17 -18 -16 -13 -12 -13 -15 -17 -18 -16 -8 5 17 21 19 14 12 17 19 17 9 -2 -8 -7 0 9 16 19 21 20 20 18 14 9 0 -9 -16 -20 -21 -14 -5 2 3 0 -6 -10 -13 -12 -10 -7 -8 -13 -15 -14 -7 2 6 6 3 2 4 6 5 0 -6 -6 0 9 18 25 28 28 23 17 12 7 1 -8 -15 -15 -7 2 5 7 7 8 8 3 -8 -19 -27 -25 -19 -13 -12 -13 -13 -11 -5 -1 -4 -13 -21 -29 -32 -32 -31 -26 -17 -2 11 20 23 24 29 36 45 47 45 43 44 49 57 64 67 62 52 39 27 17 13 12 15 15 12 11 13 19 27 29 25 14 4 -3 -3 0 4 6 9 15 21 26 27 26 25 25 27 27 23 18 16 19 27 34 39 41 44 50 55 52 46 38 35 38 45 52 52 50 44 43 48 52 52 43 31 21 16 18 21 15 4 -9 -16 -15 -10 -5 -6 -12 -16 -17 -15 -12 -13 -18 -26 -31 -33 -35 -34 -31 -24 -16 -10 -12 -14 -15 -14 -9 -7 -5 -6 -9 -11 -13 -15 -14 -12 -5 1 7 12 18 20 17 11 4 -4 -14 -21 -21 -13 -2 9 16 17 15 14 13 12 8 0 -9 -16 -19 -21 -21 -21 -20 -14 -8 -6 -13 -22 -27 -24 -18 -17 -25 -37 -42 -38 -28 -19 -18 -20 -21 -16 -9 -2 -2 -7 -18 -26 -27 -23 -18 -16 -14 -10 -6 -5 -10 -13 -11 -6 -1 -5 -15 -23 -22 -12 0 3 1 -3 -2 5 14 15 10 -3 -11 -16 -18 -26 -37 -48 -56 -56 -57 -57 -58 -58 -56 -52 -51 -55 -59 -55 -45 -36 -29 -29 -32 -33 -27 -20 -14 -11 -11 -11 -10 -8 -7 -10 -13 -10 -4 3 6 4 -2 -6 -7 -6 -4 -7 -15 -23 -29 -26 -20 -17 -23 -34 -40 -39 -31 -20 -12 -12 -18 -24 -25 -21 -14 -13 -19 -29 -36 -35 -28 -17 -7 -2 -1 -1 -1 1 2 3 3 2 2 1 3 4 3 4 7 12 21 29 31 30 24 19 18 20 20 17 11 9 8 11 13 10 6 2 -1 -2 -5 -6 -5 4 14 20 19 11 3 -1 1 4 6 2 -6 -10 -3 9 23 32 32 22 10 3 -1 -2 0 3 7 13 20 25 29 29 26 17 12 12 14 15 15 8 5 7 13 18 19 18 20 23 27 27 22 12 5 0 0 0 1 1 2 6 10 15 16 13 5 -10 -27 -42 -55 -69 -84 -98 -112 -124 -132 -140 -146 -152 -161 -173 -187 -195 -199 -198 -197 -193 -179 -156 -131 -102 -80 -59 -29 10 50 84 106 120 133 152 173 196 217 234 247 253 254 253 251 247 239 230 219 206 193 177 160 145 133 127 121 114 100 78 54 34 21 13 8 2 -3 -7 -7 -6 -6 -11 -23 -36 -45 -47 -41 -31 -21 -12 -1 10 20 25 26 28 33 40 48 54 57 60 66 72 71 61 48 40 41 48 50 41 25 13 10 14 18 17 10 3 -2 -4 -5 -6 -9 -8 -2 4 9 9 6 3 1 3 4 6 4 4 8 15 21 24 24 17 8 -3 -15 -24 -28 -23 -20 -21 -23 -20 -13 -7 -7 -15 -26 -30 -32 -33 -40 -53 -64 -70 -68 -62 -57 -55 -58 -65 -72 -77 -78 -77 -75 -73 -71 -67 -56 -41 -27 -18 -17 -20 -17 -6 7 17 21 21 25 32 37 33 23 13 9 10 13 12 12 15 24 31 33 25 14 6 3 1 -1 -7 -15 -25 -35 -42 -45 -44 -38 -29 -18 -7 -1 3 1 -6 -15 -23 -28 -33 -33 -32 -25 -14 -5 4 7 2 -7 -17 -25 -27 -25 -22 -21 -16 -9 -2 2 0 -3 -6 -5 1 10 22 35 43 43 38 31 24 18 12 8 7 7 14 20 24 25 29 29 29 29 25 24 20 15 7 0 -6 -8 -7 -2 5 15 29 37 41 39 32 27 19 12 5 -1 -2 1 7 11 12 12 9 7 8 7 8 6 4 2 -2 -3 -1 0 -1 -4 -10 -11 -6 0 5 2 -6 -14 -20 -20 -16 -12 -8 -8 -6 -1 3 3 -4 -16 -25 -32 -35 -36 -38 -36 -28 -18 -9 -9 -14 -18 -20 -19 -17 -12 -4 4 6 1 -5 -6 -1 6 7 7 5 7 9 12 12 10 4 0 -1 2 7 11 15 15 14 9 0 -11 -19 -24 -24 -20 -17 -15 -13 -11 -9 -8 -10 -15 -18 -18 -8 1 8 6 -2 -10 -12 -9 -4 2 8 13 16 16 14 10 8 8 10 14 17 22 24 25 26 26 21 11 -2 -19 -30 -33 -34 -33 -34 -36 -35 -31 -25 -18 -13 -7 -3 -4 -7 -10 -6 3 8 9 8 8 7 7 5 3 4 8 11 7 0 -6 -4 1 4 2 -4 -7 -6 -4 -4 -4 -3 -1 4 10 16 18 15 9 7 8 12 16 15 12 11 16 22 24 19 12 6 2 -1 -6 -10 -9 -5 3 6 6 2 -6 -12 -18 -20 -20 -20 -19 -18 -12 1 17 31 38 36 27 13 3 -1 2 8 11 10 8 11 19 24 19 9 -2 -7 1 13 27 36 42 46 48 48 44 35 22 10 1 -1 1 4 5 5 7 11 18 22 20 15 12 14 16 18 18 19 21 28 33 36 31 21 12 6 4 0 -5 -13 -18 -16 -7 4 9 6 -1 -4 0 7 4 -7 -22 -29 -26 -17 -11 -10 -12 -12 -9 -7 -7 -10 -17 -23 -25 -23 -14 -6 -1 2 4 6 10 13 15 18 19 19 15 9 6 7 11 17 18 20 24 31 35 32 23 16 12 13 17 20 23 23 24 24 25 23 16 7 2 5 10 13 11 6 4 4 3 -2 -7 -14 -18 -19 -18 -18 -19 -16 -17 -16 -18 -21 -24 -25 -21 -17 -14 -17 -22 -27 -28 -22 -13 -6 -5 -9 -14 -12 -6 0 7 12 14 15 11 1 -14 -30 -38 -43 -40 -40 -39 -37 -32 -21 -10 -1 2 -2 -6 -11 -10 -6 0 3 2 1 0 2 2 -7 -26 -46 -59 -60 -52 -39 -31 -25 -19 -9 2 8 8 3 -4 -6 -6 -7 -11 -19 -25 -29 -32 -36 -42 -47 -51 -55 -55 -50 -45 -39 -35 -31 -25 -18 -13 -11 -9 -4 1 3 0 -6 -7 -4 1 1 -6 -17 -21 -20 -15 -12 -15 -22 -27 -24 -20 -13 -5 2 7 11 13 17 23 31 37 32 18 7 -4 -9 -14 -19 -28 -35 -38 -37 -30 -20 -13 -12 -13 -18 -19 -17 -14 -10 -8 -8 -11 -17 -24 -28 -29 -30 -33 -36 -34 -23 -6 8 11 6 0 -1 3 1 -8 -16 -19 -10 5 16 18 10 -4 -21 -34 -45 -52 -56 -53 -46 -35 -25 -15 -6 2 7 7 -3 -17 -31 -39 -42 -40 -37 -28 -14 4 18 25 26 21 17 13 11 9 6 3 5 15 29 39 37 25 10 2 0 1 1 -3 -5 -3 3 10 18 19 13 4 -2 -3 1 4 1 -3 -5 1 11 19 19 12 5 4 10 16 16 10 5 5 8 8 4 -2 -3 3 11 14 11 3 -2 0 5 9 11 13 18 20 19 15 8 -1 -6 -8 -9 -11 -13 -13 -9 4 15 25 27 21 13 8 3 0 -3 -6 -10 -15 -20 -21 -14 1 15 22 15 -1 -14 -19 -12 -1 7 8 5 4 3 3 0 -8 -19 -27 -26 -16 1 11 11 0 -11 -16 -15 -14 -19 -27 -33 -34 -31 -29 -30 -32 -33 -32 -28 -23 -23 -26 -32 -34 -32 -26 -23 -25 -33 -38 -37 -31 -24 -21 -22 -19 -11 1 7 5 0 -3 -4 -6 -12 -16 -16 -11 -7 -10 -14 -15 -11 0 7 8 4 1 1 6 10 17 20 20 16 5 -7 -14 -9 1 9 9 1 -9 -11 -5 2 4 2 0 6 15 25 30 28 25 24 23 25 25 22 14 3 -8 -13 -11 -5 -3 -7 -16 -25 -28 -22 -9 -1 -3 -11 -20 -22 -16 -6 4 10 14 14 11 11 14 22 35 43 44 38 33 31 31 29 21 5 -14 -31 -39 -34 -20 -5 8 16 24 37 56 74 86 88 84 80 82 85 83 72 52 27 7 -7 -21 -35 -54 -68 -77 -79 -73 -63 -51 -39 -28 -15 -2 13 34 59 83 100 110 107 99 90 81 72 58 36 8 -13 -26 -32 -33 -34 -37 -35 -29 -17 -2 11 24 36 50 63 76 80 75 67 59 53 52 54 57 61 63 63 66 71 77 76 iris-edu-libmseed-4314359/test/read-Float32-encoded.test000077500000000000000000000001421422047135100226140ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Float32-encoded.mseed -D iris-edu-libmseed-4314359/test/read-Float32-encoded.test.ref000066400000000000000000000300671422047135100233750ustar00rootroot00000000000000XX_TEST__VHE, 000001, D, 4096, 1008 samples, 0.1 Hz, 1986,360,02:12:05.864800 -1.0625 -1.078125 -1.078125 -1.078125 -1.078125 -1.078125 -1.0859375 -1.0859375 -1.0859375 -1.0859375 -1.09375 -1.09375 -1.09375 -1.09375 -1.0859375 -1.0859375 -1.0703125 -1.0625 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.078125 -1.09375 -1.109375 -1.1171875 -1.125 -1.125 -1.125 -1.1171875 -1.09375 -1.0859375 -1.0859375 -1.078125 -1.0859375 -1.09375 -1.109375 -1.125 -1.1328125 -1.140625 -1.15625 -1.1640625 -1.1875 -1.2109375 -1.234375 -1.2578125 -1.2734375 -1.2890625 -1.296875 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.296875 -1.2890625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.21875 -1.203125 -1.1875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.109375 -1.1015625 -1.0703125 -1.0546875 -1.03125 -1.0234375 -1.015625 -1.015625 -1.0078125 -1.0078125 -1 -0.9921875 -0.9765625 -0.96875 -0.96875 -0.9609375 -0.9609375 -0.953125 -0.9453125 -0.9453125 -0.9609375 -0.96875 -0.984375 -0.9921875 -0.9921875 -0.9921875 -0.9765625 -0.9609375 -0.9375 -0.90625 -0.8828125 -0.8671875 -0.8671875 -0.859375 -0.859375 -0.859375 -0.8671875 -0.875 -0.8984375 -0.90625 -0.9296875 -0.9375 -0.9453125 -0.953125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.9140625 -0.9296875 -0.9296875 -0.9375 -0.9453125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.8984375 -0.890625 -0.8671875 -0.859375 -0.84375 -0.828125 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.875 -0.875 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9296875 -0.9375 -0.953125 -0.9609375 -0.9765625 -1 -1.015625 -1.03125 -1.046875 -1.0546875 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.1171875 -1.1171875 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1015625 -1.1015625 -1.0859375 -1.078125 -1.0703125 -1.0703125 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.125 -1.140625 -1.1640625 -1.1640625 -1.1796875 -1.171875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.125 -1.1328125 -1.15625 -1.171875 -1.1875 -1.1953125 -1.203125 -1.1953125 -1.1875 -1.15625 -1.1484375 -1.140625 -1.140625 -1.1328125 -1.1484375 -1.1484375 -1.1484375 -1.140625 -1.125 -1.125 -1.140625 -1.1484375 -1.1640625 -1.1875 -1.1953125 -1.1796875 -1.171875 -1.1640625 -1.15625 -1.15625 -1.1796875 -1.1953125 -1.2265625 -1.25 -1.2578125 -1.25 -1.2421875 -1.234375 -1.21875 -1.2109375 -1.2109375 -1.2265625 -1.234375 -1.2421875 -1.2421875 -1.25 -1.25 -1.2421875 -1.25 -1.2578125 -1.2578125 -1.265625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.2265625 -1.2265625 -1.2265625 -1.2421875 -1.25 -1.25 -1.2578125 -1.25 -1.25 -1.2421875 -1.25 -1.2421875 -1.2421875 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.2109375 -1.2109375 -1.21875 -1.2265625 -1.2265625 -1.21875 -1.203125 -1.1875 -1.1796875 -1.1796875 -1.171875 -1.171875 -1.171875 -1.1796875 -1.1875 -1.203125 -1.21875 -1.21875 -1.21875 -1.2265625 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.1953125 -1.1875 -1.171875 -1.1640625 -1.140625 -1.125 -1.109375 -1.0859375 -1.0703125 -1.0625 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.0859375 -1.1015625 -1.109375 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.1015625 -1.09375 -1.0859375 -1.078125 -1.078125 -1.078125 -1.09375 -1.09375 -1.109375 -1.125 -1.140625 -1.1640625 -1.1796875 -1.1875 -1.1875 -1.1875 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.265625 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3125 -1.328125 -1.328125 -1.328125 -1.3203125 -1.3046875 -1.3046875 -1.296875 -1.296875 -1.2890625 -1.28125 -1.2734375 -1.25 -1.2265625 -1.1875 -1.1640625 -1.1328125 -1.125 -1.125 -1.125 -1.1171875 -1.1015625 -1.078125 -1.0546875 -1.0390625 -1.0234375 -1.0234375 -1.015625 -1.0078125 -1.015625 -1.015625 -1.0234375 -1.015625 -1.0078125 -1 -1 -0.9765625 -0.9609375 -0.9375 -0.921875 -0.90625 -0.890625 -0.8828125 -0.875 -0.859375 -0.8515625 -0.8515625 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.8671875 -0.875 -0.875 -0.859375 -0.84375 -0.8359375 -0.8359375 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.859375 -0.8515625 -0.84375 -0.84375 -0.8515625 -0.859375 -0.8828125 -0.890625 -0.8984375 -0.90625 -0.90625 -0.90625 -0.90625 -0.8984375 -0.8984375 -0.890625 -0.8984375 -0.890625 -0.90625 -0.9140625 -0.921875 -0.9296875 -0.9296875 -0.921875 -0.90625 -0.8984375 -0.8671875 -0.84375 -0.8359375 -0.859375 -0.8828125 -0.921875 -0.9609375 -0.984375 -1 -1.015625 -1.0234375 -1.0234375 -1.0234375 -1.03125 -1.046875 -1.0546875 -1.0546875 -1.046875 -1.03125 -1.015625 -1 -0.984375 -0.9765625 -0.9609375 -0.9375 -0.9140625 -0.8828125 -0.875 -0.875 -0.8984375 -0.921875 -0.9609375 -0.9921875 -1.0234375 -1.0390625 -1.03125 -1.0078125 -0.9765625 -0.9609375 -0.9453125 -0.9375 -0.9296875 -0.9296875 -0.9375 -0.9375 -0.9375 -0.9453125 -0.9609375 -0.984375 -0.9921875 -1 -1 -1 -1 -0.9921875 -0.9921875 -0.9921875 -1 -1.015625 -1.015625 -1.0078125 -1.015625 -1.03125 -1.0546875 -1.078125 -1.078125 -1.0625 -1.03125 -1 -0.9609375 -0.9453125 -0.9296875 -0.9296875 -0.921875 -0.9296875 -0.9453125 -0.96875 -0.9921875 -1.015625 -1.03125 -1.0390625 -1.03125 -1.03125 -1.03125 -1.0234375 -1.0234375 -1.0234375 -1.03125 -1.03125 -1.0390625 -1.0390625 -1.03125 -1.0390625 -1.03125 -1.0234375 -1.0234375 -1.0234375 -1.046875 -1.0625 -1.09375 -1.1328125 -1.171875 -1.1953125 -1.203125 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.25 -1.2578125 -1.25 -1.2265625 -1.1875 -1.15625 -1.1328125 -1.1015625 -1.0859375 -1.0703125 -1.0625 -1.0703125 -1.0859375 -1.1015625 -1.109375 -1.1015625 -1.0859375 -1.078125 -1.0859375 -1.0703125 -1.078125 -1.0703125 -1.0546875 -1.046875 -1.0390625 -1.0234375 -1.0078125 -1 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.984375 -0.96875 -0.9453125 -0.9296875 -0.9140625 -0.8984375 -0.8828125 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9296875 -0.9296875 -0.9296875 -0.9296875 -0.9140625 -0.8984375 -0.8828125 -0.8828125 -0.875 -0.859375 -0.84375 -0.828125 -0.828125 -0.8359375 -0.8515625 -0.8671875 -0.875 -0.8984375 -0.8984375 -0.8984375 -0.890625 -0.875 -0.8671875 -0.8671875 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8828125 -0.890625 -0.8984375 -0.8984375 -0.890625 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8828125 -0.8984375 -0.9140625 -0.9296875 -0.9453125 -0.96875 -0.984375 -1 -1.0078125 -1.0078125 -1 -0.9921875 -0.984375 -0.984375 -0.9921875 -1.0078125 -1.03125 -1.0390625 -1.0390625 -1.03125 -1.0078125 -0.9765625 -0.9609375 -0.9609375 -0.953125 -0.9609375 -0.984375 -0.984375 -0.9921875 -1.015625 -1.0546875 -1.0703125 -1.1015625 -1.1171875 -1.109375 -1.0859375 -1.0703125 -1.0703125 -1.0703125 -1.0859375 -1.09375 -1.09375 -1.1015625 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.1171875 -1.1171875 -1.1171875 -1.125 -1.1328125 -1.1328125 -1.125 -1.125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.09375 -1.0859375 -1.0703125 -1.0546875 -1.0390625 -1.0390625 -1.03125 -1.03125 -1.03125 -1.0546875 -1.0625 -1.0859375 -1.109375 -1.1171875 -1.125 -1.1171875 -1.109375 -1.1015625 -1.1015625 -1.1015625 -1.1171875 -1.1328125 -1.1484375 -1.1640625 -1.1796875 -1.171875 -1.171875 -1.171875 -1.1484375 -1.1328125 -1.109375 -1.09375 -1.09375 -1.0859375 -1.0859375 -1.1015625 -1.1171875 -1.125 -1.1328125 -1.125 -1.1171875 -1.1015625 -1.0859375 -1.078125 -1.0546875 -1.046875 -1.0234375 -1.0078125 -0.9765625 -0.9609375 -0.953125 -0.953125 -0.9609375 -0.9765625 -1.0078125 -1.0390625 -1.0703125 -1.09375 -1.125 -1.1640625 -1.1796875 -1.203125 -1.2265625 -1.2421875 -1.2578125 -1.265625 -1.2734375 -1.28125 -1.28125 -1.265625 -1.2421875 -1.21875 -1.2109375 -1.203125 -1.1953125 -1.203125 -1.21875 -1.2421875 -1.265625 -1.2890625 -1.296875 -1.2890625 -1.2734375 -1.2421875 -1.234375 -1.2109375 -1.1953125 -1.1953125 -1.203125 -1.1953125 -1.1953125 -1.203125 -1.2109375 -1.21875 -1.21875 -1.21875 -1.203125 -1.1796875 -1.140625 -1.1015625 -1.0625 -1.0390625 -1.03125 -1.0390625 -1.046875 -1.0625 -1.078125 -1.0859375 -1.09375 -1.0859375 -1.078125 -1.0625 -1.0546875 -1.0390625 -1.03125 -1.0234375 -1.0234375 -1.0390625 -1.0625 -1.0859375 -1.1015625 -1.125 -1.1484375 -1.1796875 -1.1796875 -1.1796875 -1.1875 -1.2265625 -1.2734375 -1.3046875 -1.3359375 -1.3515625 -1.34375 -1.3203125 -1.296875 -1.2734375 -1.2578125 -1.2578125 -1.2578125 -1.265625 -1.2734375 -1.2734375 -1.265625 -1.234375 -1.1953125 -1.15625 -1.1171875 -1.1015625 -1.09375 -1.09375 -1.1015625 -1.109375 -1.109375 -1.09375 -1.078125 -1.0703125 -1.0625 -1.0703125 -1.0859375 -1.078125 -1.0703125 -1.0625 -1.046875 -1.0390625 -1.03125 -1.0390625 -1.046875 -1.046875 -1.046875 -1.0234375 -1.0078125 -0.984375 -0.953125 -0.9296875 -0.90625 -0.890625 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9140625 -0.90625 -0.8984375 -0.875 -0.84375 -0.8125 -0.78125 -0.7578125 -0.75 -0.75 -0.7578125 -0.7734375 -0.796875 -0.828125 -0.859375 -0.8828125 -0.9140625 -0.9140625 -0.921875 -0.9296875 -0.9296875 -0.9453125 -0.953125 -0.9765625 -0.984375 -1 -1 -1 -0.9921875 -0.984375 -0.96875 -0.9609375 -0.9609375 -0.953125 -0.9609375 -0.9609375 -0.9609375 -0.953125 -0.953125 -0.9609375 -0.9609375 -0.984375 -0.984375 -1.015625 -1.0390625 -1.0625 -1.09375 -1.140625 -1.1796875 -1.1875 -1.1953125 -1.1875 -1.171875 -1.15625 -1.140625 -1.1328125 -1.1328125 -1.1328125 -1.1328125 -1.125 -1.1171875 -1.1015625 -1.09375 -1.0859375 -1.0703125 -1.0703125 -1.078125 -1.0859375 -1.109375 -1.1171875 -1.1328125 -1.1484375 -1.1484375 -1.140625 -1.140625 -1.140625 -1.140625 -1.15625 -1.1875 -1.2109375 -1.2265625 -1.2421875 -1.2421875 -1.21875 -1.1953125 -1.171875 -1.1640625 -1.1484375 -1.1484375 -1.1484375 -1.1640625 -1.171875 -1.171875 -1.1640625 -1.15625 -1.1328125 -1.1171875 -1.1015625 -1.09375 -1.09375 -1.0859375 -1.0703125 -1.0546875 -1.03125 -1.015625 -1.015625 -1.015625 -1.046875 -1.0859375 -1.1328125 -1.1640625 -1.1875 -1.203125 -1.2109375 -1.203125 -1.1953125 -1.1796875 -1.1640625 -1.1484375 -1.1328125 -1.125 -1.1015625 -1.0859375 -1.0703125 iris-edu-libmseed-4314359/test/read-Float64-encoded.test000077500000000000000000000001421422047135100226210ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Float64-encoded.mseed -D iris-edu-libmseed-4314359/test/read-Float64-encoded.test.ref000066400000000000000000000141021422047135100233720ustar00rootroot00000000000000XX_TEST__VHE, 000001, D, 4096, 504 samples, 0.1 Hz, 1986,360,02:12:05.864800 -1.0625 -1.078125 -1.078125 -1.078125 -1.078125 -1.078125 -1.0859375 -1.0859375 -1.0859375 -1.0859375 -1.09375 -1.09375 -1.09375 -1.09375 -1.0859375 -1.0859375 -1.0703125 -1.0625 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.078125 -1.09375 -1.109375 -1.1171875 -1.125 -1.125 -1.125 -1.1171875 -1.09375 -1.0859375 -1.0859375 -1.078125 -1.0859375 -1.09375 -1.109375 -1.125 -1.1328125 -1.140625 -1.15625 -1.1640625 -1.1875 -1.2109375 -1.234375 -1.2578125 -1.2734375 -1.2890625 -1.296875 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.296875 -1.2890625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.21875 -1.203125 -1.1875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.109375 -1.1015625 -1.0703125 -1.0546875 -1.03125 -1.0234375 -1.015625 -1.015625 -1.0078125 -1.0078125 -1 -0.9921875 -0.9765625 -0.96875 -0.96875 -0.9609375 -0.9609375 -0.953125 -0.9453125 -0.9453125 -0.9609375 -0.96875 -0.984375 -0.9921875 -0.9921875 -0.9921875 -0.9765625 -0.9609375 -0.9375 -0.90625 -0.8828125 -0.8671875 -0.8671875 -0.859375 -0.859375 -0.859375 -0.8671875 -0.875 -0.8984375 -0.90625 -0.9296875 -0.9375 -0.9453125 -0.953125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.9140625 -0.9296875 -0.9296875 -0.9375 -0.9453125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.8984375 -0.890625 -0.8671875 -0.859375 -0.84375 -0.828125 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.875 -0.875 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9296875 -0.9375 -0.953125 -0.9609375 -0.9765625 -1 -1.015625 -1.03125 -1.046875 -1.0546875 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.1171875 -1.1171875 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1015625 -1.1015625 -1.0859375 -1.078125 -1.0703125 -1.0703125 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.125 -1.140625 -1.1640625 -1.1640625 -1.1796875 -1.171875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.125 -1.1328125 -1.15625 -1.171875 -1.1875 -1.1953125 -1.203125 -1.1953125 -1.1875 -1.15625 -1.1484375 -1.140625 -1.140625 -1.1328125 -1.1484375 -1.1484375 -1.1484375 -1.140625 -1.125 -1.125 -1.140625 -1.1484375 -1.1640625 -1.1875 -1.1953125 -1.1796875 -1.171875 -1.1640625 -1.15625 -1.15625 -1.1796875 -1.1953125 -1.2265625 -1.25 -1.2578125 -1.25 -1.2421875 -1.234375 -1.21875 -1.2109375 -1.2109375 -1.2265625 -1.234375 -1.2421875 -1.2421875 -1.25 -1.25 -1.2421875 -1.25 -1.2578125 -1.2578125 -1.265625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.2265625 -1.2265625 -1.2265625 -1.2421875 -1.25 -1.25 -1.2578125 -1.25 -1.25 -1.2421875 -1.25 -1.2421875 -1.2421875 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.2109375 -1.2109375 -1.21875 -1.2265625 -1.2265625 -1.21875 -1.203125 -1.1875 -1.1796875 -1.1796875 -1.171875 -1.171875 -1.171875 -1.1796875 -1.1875 -1.203125 -1.21875 -1.21875 -1.21875 -1.2265625 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.1953125 -1.1875 -1.171875 -1.1640625 -1.140625 -1.125 -1.109375 -1.0859375 -1.0703125 -1.0625 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.0859375 -1.1015625 -1.109375 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.1015625 -1.09375 -1.0859375 -1.078125 -1.078125 -1.078125 -1.09375 -1.09375 -1.109375 -1.125 -1.140625 -1.1640625 -1.1796875 -1.1875 -1.1875 -1.1875 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.265625 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3125 -1.328125 -1.328125 -1.328125 -1.3203125 -1.3046875 -1.3046875 -1.296875 -1.296875 -1.2890625 -1.28125 -1.2734375 -1.25 -1.2265625 -1.1875 -1.1640625 -1.1328125 -1.125 -1.125 -1.125 -1.1171875 -1.1015625 -1.078125 -1.0546875 -1.0390625 -1.0234375 -1.0234375 -1.015625 -1.0078125 -1.015625 -1.015625 -1.0234375 -1.015625 -1.0078125 -1 -1 -0.9765625 -0.9609375 -0.9375 -0.921875 -0.90625 -0.890625 -0.8828125 -0.875 -0.859375 -0.8515625 -0.8515625 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.8671875 -0.875 -0.875 -0.859375 -0.84375 -0.8359375 -0.8359375 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.859375 -0.8515625 -0.84375 -0.84375 -0.8515625 -0.859375 -0.8828125 -0.890625 -0.8984375 -0.90625 -0.90625 -0.90625 -0.90625 -0.8984375 -0.8984375 -0.890625 -0.8984375 -0.890625 -0.90625 -0.9140625 -0.921875 -0.9296875 -0.9296875 -0.921875 -0.90625 -0.8984375 -0.8671875 -0.84375 -0.8359375 -0.859375 -0.8828125 -0.921875 -0.9609375 -0.984375 -1 -1.015625 -1.0234375 -1.0234375 -1.0234375 -1.03125 -1.046875 -1.0546875 -1.0546875 -1.046875 -1.03125 -1.015625 -1 -0.984375 -0.9765625 -0.9609375 -0.9375 -0.9140625 -0.8828125 -0.875 -0.875 -0.8984375 -0.921875 -0.9609375 -0.9921875 -1.0234375 -1.0390625 -1.03125 -1.0078125 -0.9765625 -0.9609375 -0.9453125 -0.9375 -0.9296875 -0.9296875 -0.9375 -0.9375 -0.9375 -0.9453125 -0.9609375 -0.984375 -0.9921875 -1 -1 -1 -1 -0.9921875 -0.9921875 -0.9921875 -1 -1.015625 -1.015625 -1.0078125 -1.015625 -1.03125 -1.0546875 iris-edu-libmseed-4314359/test/read-GEOSCOPE163-encoded.test000077500000000000000000000001561422047135100230450ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/GEOSCOPE-16bit-3exp-encoded.mseed -D iris-edu-libmseed-4314359/test/read-GEOSCOPE163-encoded.test.ref000066400000000000000000000600371422047135100236210ustar00rootroot00000000000000XX_TEST__VHE, 000000, D, 4096, 2016 samples, 0.1 Hz, 1986,360,02:12:05.864800 -1.0625 -1.078125 -1.078125 -1.078125 -1.078125 -1.078125 -1.0859375 -1.0859375 -1.0859375 -1.0859375 -1.09375 -1.09375 -1.09375 -1.09375 -1.0859375 -1.0859375 -1.0703125 -1.0625 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.078125 -1.09375 -1.109375 -1.1171875 -1.125 -1.125 -1.125 -1.1171875 -1.09375 -1.0859375 -1.0859375 -1.078125 -1.0859375 -1.09375 -1.109375 -1.125 -1.1328125 -1.140625 -1.15625 -1.1640625 -1.1875 -1.2109375 -1.234375 -1.2578125 -1.2734375 -1.2890625 -1.296875 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.3046875 -1.296875 -1.2890625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.21875 -1.203125 -1.1875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.109375 -1.1015625 -1.0703125 -1.0546875 -1.03125 -1.0234375 -1.015625 -1.015625 -1.0078125 -1.0078125 -1 -0.9921875 -0.9765625 -0.96875 -0.96875 -0.9609375 -0.9609375 -0.953125 -0.9453125 -0.9453125 -0.9609375 -0.96875 -0.984375 -0.9921875 -0.9921875 -0.9921875 -0.9765625 -0.9609375 -0.9375 -0.90625 -0.8828125 -0.8671875 -0.8671875 -0.859375 -0.859375 -0.859375 -0.8671875 -0.875 -0.8984375 -0.90625 -0.9296875 -0.9375 -0.9453125 -0.953125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.9140625 -0.9296875 -0.9296875 -0.9375 -0.9453125 -0.9453125 -0.9375 -0.9375 -0.9296875 -0.9140625 -0.8984375 -0.890625 -0.8671875 -0.859375 -0.84375 -0.828125 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.875 -0.875 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9296875 -0.9375 -0.953125 -0.9609375 -0.9765625 -1 -1.015625 -1.03125 -1.046875 -1.0546875 -1.0625 -1.0546875 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.1171875 -1.1171875 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1015625 -1.1015625 -1.0859375 -1.078125 -1.0703125 -1.0703125 -1.0546875 -1.0625 -1.0859375 -1.1015625 -1.125 -1.140625 -1.1640625 -1.1640625 -1.1796875 -1.171875 -1.171875 -1.15625 -1.1484375 -1.1328125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.125 -1.1328125 -1.15625 -1.171875 -1.1875 -1.1953125 -1.203125 -1.1953125 -1.1875 -1.15625 -1.1484375 -1.140625 -1.140625 -1.1328125 -1.1484375 -1.1484375 -1.1484375 -1.140625 -1.125 -1.125 -1.140625 -1.1484375 -1.1640625 -1.1875 -1.1953125 -1.1796875 -1.171875 -1.1640625 -1.15625 -1.15625 -1.1796875 -1.1953125 -1.2265625 -1.25 -1.2578125 -1.25 -1.2421875 -1.234375 -1.21875 -1.2109375 -1.2109375 -1.2265625 -1.234375 -1.2421875 -1.2421875 -1.25 -1.25 -1.2421875 -1.25 -1.2578125 -1.2578125 -1.265625 -1.2734375 -1.2578125 -1.25 -1.234375 -1.2265625 -1.2265625 -1.2265625 -1.2421875 -1.25 -1.25 -1.2578125 -1.25 -1.25 -1.2421875 -1.25 -1.2421875 -1.2421875 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.2109375 -1.2109375 -1.21875 -1.2265625 -1.2265625 -1.21875 -1.203125 -1.1875 -1.1796875 -1.1796875 -1.171875 -1.171875 -1.171875 -1.1796875 -1.1875 -1.203125 -1.21875 -1.21875 -1.21875 -1.2265625 -1.2265625 -1.2265625 -1.2109375 -1.203125 -1.1953125 -1.1875 -1.171875 -1.1640625 -1.140625 -1.125 -1.109375 -1.0859375 -1.0703125 -1.0625 -1.0546875 -1.0546875 -1.0625 -1.0859375 -1.0859375 -1.1015625 -1.109375 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.1015625 -1.09375 -1.0859375 -1.078125 -1.078125 -1.078125 -1.09375 -1.09375 -1.109375 -1.125 -1.140625 -1.1640625 -1.1796875 -1.1875 -1.1875 -1.1875 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.265625 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3125 -1.328125 -1.328125 -1.328125 -1.3203125 -1.3046875 -1.3046875 -1.296875 -1.296875 -1.2890625 -1.28125 -1.2734375 -1.25 -1.2265625 -1.1875 -1.1640625 -1.1328125 -1.125 -1.125 -1.125 -1.1171875 -1.1015625 -1.078125 -1.0546875 -1.0390625 -1.0234375 -1.0234375 -1.015625 -1.0078125 -1.015625 -1.015625 -1.0234375 -1.015625 -1.0078125 -1 -1 -0.9765625 -0.9609375 -0.9375 -0.921875 -0.90625 -0.890625 -0.8828125 -0.875 -0.859375 -0.8515625 -0.8515625 -0.8515625 -0.859375 -0.8671875 -0.8671875 -0.8671875 -0.875 -0.875 -0.859375 -0.84375 -0.8359375 -0.8359375 -0.828125 -0.8359375 -0.8515625 -0.859375 -0.8671875 -0.859375 -0.8515625 -0.84375 -0.84375 -0.8515625 -0.859375 -0.8828125 -0.890625 -0.8984375 -0.90625 -0.90625 -0.90625 -0.90625 -0.8984375 -0.8984375 -0.890625 -0.8984375 -0.890625 -0.90625 -0.9140625 -0.921875 -0.9296875 -0.9296875 -0.921875 -0.90625 -0.8984375 -0.8671875 -0.84375 -0.8359375 -0.859375 -0.8828125 -0.921875 -0.9609375 -0.984375 -1 -1.015625 -1.0234375 -1.0234375 -1.0234375 -1.03125 -1.046875 -1.0546875 -1.0546875 -1.046875 -1.03125 -1.015625 -1 -0.984375 -0.9765625 -0.9609375 -0.9375 -0.9140625 -0.8828125 -0.875 -0.875 -0.8984375 -0.921875 -0.9609375 -0.9921875 -1.0234375 -1.0390625 -1.03125 -1.0078125 -0.9765625 -0.9609375 -0.9453125 -0.9375 -0.9296875 -0.9296875 -0.9375 -0.9375 -0.9375 -0.9453125 -0.9609375 -0.984375 -0.9921875 -1 -1 -1 -1 -0.9921875 -0.9921875 -0.9921875 -1 -1.015625 -1.015625 -1.0078125 -1.015625 -1.03125 -1.0546875 -1.078125 -1.078125 -1.0625 -1.03125 -1 -0.9609375 -0.9453125 -0.9296875 -0.9296875 -0.921875 -0.9296875 -0.9453125 -0.96875 -0.9921875 -1.015625 -1.03125 -1.0390625 -1.03125 -1.03125 -1.03125 -1.0234375 -1.0234375 -1.0234375 -1.03125 -1.03125 -1.0390625 -1.0390625 -1.03125 -1.0390625 -1.03125 -1.0234375 -1.0234375 -1.0234375 -1.046875 -1.0625 -1.09375 -1.1328125 -1.171875 -1.1953125 -1.203125 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.25 -1.2578125 -1.25 -1.2265625 -1.1875 -1.15625 -1.1328125 -1.1015625 -1.0859375 -1.0703125 -1.0625 -1.0703125 -1.0859375 -1.1015625 -1.109375 -1.1015625 -1.0859375 -1.078125 -1.0859375 -1.0703125 -1.078125 -1.0703125 -1.0546875 -1.046875 -1.0390625 -1.0234375 -1.0078125 -1 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -0.984375 -0.96875 -0.9453125 -0.9296875 -0.9140625 -0.8984375 -0.8828125 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9296875 -0.9296875 -0.9296875 -0.9296875 -0.9140625 -0.8984375 -0.8828125 -0.8828125 -0.875 -0.859375 -0.84375 -0.828125 -0.828125 -0.8359375 -0.8515625 -0.8671875 -0.875 -0.8984375 -0.8984375 -0.8984375 -0.890625 -0.875 -0.8671875 -0.8671875 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8828125 -0.890625 -0.8984375 -0.8984375 -0.890625 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.8828125 -0.8984375 -0.9140625 -0.9296875 -0.9453125 -0.96875 -0.984375 -1 -1.0078125 -1.0078125 -1 -0.9921875 -0.984375 -0.984375 -0.9921875 -1.0078125 -1.03125 -1.0390625 -1.0390625 -1.03125 -1.0078125 -0.9765625 -0.9609375 -0.9609375 -0.953125 -0.9609375 -0.984375 -0.984375 -0.9921875 -1.015625 -1.0546875 -1.0703125 -1.1015625 -1.1171875 -1.109375 -1.0859375 -1.0703125 -1.0703125 -1.0703125 -1.0859375 -1.09375 -1.09375 -1.1015625 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.1171875 -1.1171875 -1.1171875 -1.125 -1.1328125 -1.1328125 -1.125 -1.125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.09375 -1.0859375 -1.0703125 -1.0546875 -1.0390625 -1.0390625 -1.03125 -1.03125 -1.03125 -1.0546875 -1.0625 -1.0859375 -1.109375 -1.1171875 -1.125 -1.1171875 -1.109375 -1.1015625 -1.1015625 -1.1015625 -1.1171875 -1.1328125 -1.1484375 -1.1640625 -1.1796875 -1.171875 -1.171875 -1.171875 -1.1484375 -1.1328125 -1.109375 -1.09375 -1.09375 -1.0859375 -1.0859375 -1.1015625 -1.1171875 -1.125 -1.1328125 -1.125 -1.1171875 -1.1015625 -1.0859375 -1.078125 -1.0546875 -1.046875 -1.0234375 -1.0078125 -0.9765625 -0.9609375 -0.953125 -0.953125 -0.9609375 -0.9765625 -1.0078125 -1.0390625 -1.0703125 -1.09375 -1.125 -1.1640625 -1.1796875 -1.203125 -1.2265625 -1.2421875 -1.2578125 -1.265625 -1.2734375 -1.28125 -1.28125 -1.265625 -1.2421875 -1.21875 -1.2109375 -1.203125 -1.1953125 -1.203125 -1.21875 -1.2421875 -1.265625 -1.2890625 -1.296875 -1.2890625 -1.2734375 -1.2421875 -1.234375 -1.2109375 -1.1953125 -1.1953125 -1.203125 -1.1953125 -1.1953125 -1.203125 -1.2109375 -1.21875 -1.21875 -1.21875 -1.203125 -1.1796875 -1.140625 -1.1015625 -1.0625 -1.0390625 -1.03125 -1.0390625 -1.046875 -1.0625 -1.078125 -1.0859375 -1.09375 -1.0859375 -1.078125 -1.0625 -1.0546875 -1.0390625 -1.03125 -1.0234375 -1.0234375 -1.0390625 -1.0625 -1.0859375 -1.1015625 -1.125 -1.1484375 -1.1796875 -1.1796875 -1.1796875 -1.1875 -1.2265625 -1.2734375 -1.3046875 -1.3359375 -1.3515625 -1.34375 -1.3203125 -1.296875 -1.2734375 -1.2578125 -1.2578125 -1.2578125 -1.265625 -1.2734375 -1.2734375 -1.265625 -1.234375 -1.1953125 -1.15625 -1.1171875 -1.1015625 -1.09375 -1.09375 -1.1015625 -1.109375 -1.109375 -1.09375 -1.078125 -1.0703125 -1.0625 -1.0703125 -1.0859375 -1.078125 -1.0703125 -1.0625 -1.046875 -1.0390625 -1.03125 -1.0390625 -1.046875 -1.046875 -1.046875 -1.0234375 -1.0078125 -0.984375 -0.953125 -0.9296875 -0.90625 -0.890625 -0.875 -0.8671875 -0.8671875 -0.8671875 -0.8671875 -0.875 -0.890625 -0.8984375 -0.9140625 -0.9140625 -0.90625 -0.8984375 -0.875 -0.84375 -0.8125 -0.78125 -0.7578125 -0.75 -0.75 -0.7578125 -0.7734375 -0.796875 -0.828125 -0.859375 -0.8828125 -0.9140625 -0.9140625 -0.921875 -0.9296875 -0.9296875 -0.9453125 -0.953125 -0.9765625 -0.984375 -1 -1 -1 -0.9921875 -0.984375 -0.96875 -0.9609375 -0.9609375 -0.953125 -0.9609375 -0.9609375 -0.9609375 -0.953125 -0.953125 -0.9609375 -0.9609375 -0.984375 -0.984375 -1.015625 -1.0390625 -1.0625 -1.09375 -1.140625 -1.1796875 -1.1875 -1.1953125 -1.1875 -1.171875 -1.15625 -1.140625 -1.1328125 -1.1328125 -1.1328125 -1.1328125 -1.125 -1.1171875 -1.1015625 -1.09375 -1.0859375 -1.0703125 -1.0703125 -1.078125 -1.0859375 -1.109375 -1.1171875 -1.1328125 -1.1484375 -1.1484375 -1.140625 -1.140625 -1.140625 -1.140625 -1.15625 -1.1875 -1.2109375 -1.2265625 -1.2421875 -1.2421875 -1.21875 -1.1953125 -1.171875 -1.1640625 -1.1484375 -1.1484375 -1.1484375 -1.1640625 -1.171875 -1.171875 -1.1640625 -1.15625 -1.1328125 -1.1171875 -1.1015625 -1.09375 -1.09375 -1.0859375 -1.0703125 -1.0546875 -1.03125 -1.015625 -1.015625 -1.015625 -1.046875 -1.0859375 -1.1328125 -1.1640625 -1.1875 -1.203125 -1.2109375 -1.203125 -1.1953125 -1.1796875 -1.1640625 -1.1484375 -1.1328125 -1.125 -1.1015625 -1.0859375 -1.0703125 -1.0625 -1.0546875 -1.0390625 -1.03125 -1.0234375 -1.03125 -1.0390625 -1.0546875 -1.0703125 -1.0859375 -1.0859375 -1.0703125 -1.046875 -1.03125 -1 -0.984375 -0.9765625 -0.96875 -0.96875 -0.9765625 -0.9765625 -0.9765625 -0.9609375 -0.9453125 -0.9375 -0.9375 -0.9140625 -0.890625 -0.8671875 -0.84375 -0.84375 -0.84375 -0.859375 -0.8671875 -0.890625 -0.921875 -0.9453125 -0.9765625 -0.984375 -0.984375 -0.9609375 -0.9375 -0.8984375 -0.859375 -0.8203125 -0.7890625 -0.7578125 -0.7421875 -0.7265625 -0.7265625 -0.734375 -0.7421875 -0.765625 -0.78125 -0.8046875 -0.828125 -0.84375 -0.859375 -0.890625 -0.9140625 -0.9453125 -0.9765625 -1.0234375 -1.0546875 -1.0859375 -1.1015625 -1.1015625 -1.1015625 -1.0859375 -1.0703125 -1.0546875 -1.046875 -1.0390625 -1.0234375 -1.0234375 -1.015625 -1.0234375 -1.015625 -1.0234375 -1.0390625 -1.0625 -1.0859375 -1.1015625 -1.1171875 -1.1171875 -1.125 -1.1171875 -1.1015625 -1.078125 -1.0546875 -1.015625 -0.9921875 -0.9609375 -0.9375 -0.90625 -0.90625 -0.9140625 -0.9296875 -0.9453125 -0.96875 -0.984375 -1 -1 -0.9921875 -0.9765625 -0.953125 -0.9296875 -0.90625 -0.890625 -0.8828125 -0.875 -0.8671875 -0.8671875 -0.859375 -0.859375 -0.859375 -0.8671875 -0.875 -0.8984375 -0.90625 -0.9296875 -0.9375 -0.9609375 -0.9921875 -1.015625 -1.0390625 -1.0546875 -1.046875 -1.0234375 -1 -0.9609375 -0.9140625 -0.875 -0.8359375 -0.8046875 -0.7890625 -0.765625 -0.765625 -0.7734375 -0.78125 -0.7890625 -0.8046875 -0.828125 -0.84375 -0.859375 -0.8671875 -0.8828125 -0.8984375 -0.921875 -0.9296875 -0.9609375 -0.96875 -0.984375 -0.9921875 -1 -1 -1.0078125 -1.0078125 -1.03125 -1.0390625 -1.0625 -1.0859375 -1.1015625 -1.1171875 -1.125 -1.1328125 -1.125 -1.125 -1.1328125 -1.1328125 -1.1328125 -1.1328125 -1.125 -1.1328125 -1.125 -1.125 -1.1171875 -1.109375 -1.109375 -1.109375 -1.1015625 -1.1015625 -1.09375 -1.0859375 -1.0703125 -1.0625 -1.0703125 -1.0703125 -1.0625 -1.0703125 -1.078125 -1.0703125 -1.0625 -1.0546875 -1.03125 -1.0078125 -1 -0.984375 -0.984375 -0.984375 -0.9921875 -1.015625 -1.03125 -1.0625 -1.0859375 -1.09375 -1.1171875 -1.125 -1.125 -1.125 -1.125 -1.109375 -1.1015625 -1.0859375 -1.0546875 -1.0390625 -1.0234375 -1.0078125 -1.0078125 -1.0078125 -1.0078125 -1.0234375 -1.0390625 -1.0546875 -1.078125 -1.1015625 -1.1171875 -1.125 -1.125 -1.1171875 -1.1171875 -1.1015625 -1.0859375 -1.0703125 -1.0625 -1.0546875 -1.046875 -1.0546875 -1.0546875 -1.078125 -1.09375 -1.109375 -1.1171875 -1.140625 -1.15625 -1.171875 -1.1796875 -1.1875 -1.1953125 -1.1953125 -1.1953125 -1.1875 -1.1796875 -1.1640625 -1.140625 -1.109375 -1.0859375 -1.0625 -1.03125 -1.015625 -0.9921875 -0.96875 -0.953125 -0.9296875 -0.90625 -0.8828125 -0.8671875 -0.84375 -0.828125 -0.8046875 -0.796875 -0.7890625 -0.7734375 -0.7578125 -0.75 -0.734375 -0.71875 -0.71875 -0.71875 -0.71875 -0.7265625 -0.7421875 -0.7421875 -0.75 -0.7578125 -0.7734375 -0.78125 -0.8046875 -0.8203125 -0.8359375 -0.8515625 -0.8671875 -0.8828125 -0.8984375 -0.890625 -0.90625 -0.90625 -0.9140625 -0.921875 -0.9375 -0.9453125 -0.9609375 -0.96875 -0.9765625 -0.984375 -0.9921875 -0.9921875 -1.0078125 -1.015625 -1.0234375 -1.0390625 -1.0546875 -1.078125 -1.09375 -1.109375 -1.1171875 -1.1328125 -1.1328125 -1.1328125 -1.125 -1.125 -1.109375 -1.09375 -1.0859375 -1.0625 -1.046875 -1.03125 -1.0078125 -1 -0.9921875 -0.9921875 -0.984375 -0.9765625 -0.9765625 -0.9765625 -0.984375 -0.9765625 -0.9921875 -1 -1.015625 -1.03125 -1.046875 -1.0546875 -1.0703125 -1.078125 -1.0859375 -1.09375 -1.1015625 -1.109375 -1.1171875 -1.125 -1.1328125 -1.1328125 -1.1328125 -1.140625 -1.140625 -1.1484375 -1.15625 -1.1640625 -1.171875 -1.1953125 -1.2109375 -1.2265625 -1.2421875 -1.2578125 -1.2734375 -1.2890625 -1.296875 -1.3046875 -1.3125 -1.3046875 -1.3125 -1.3046875 -1.296875 -1.28125 -1.265625 -1.25 -1.2265625 -1.2109375 -1.1953125 -1.1796875 -1.1640625 -1.1484375 -1.1171875 -1.1015625 -1.0859375 -1.0546875 -1.03125 -1.015625 -0.9921875 -0.984375 -0.9765625 -0.9765625 -0.9765625 -0.96875 -0.96875 -0.96875 -0.96875 -0.9609375 -0.953125 -0.9453125 -0.9296875 -0.921875 -0.9140625 -0.90625 -0.90625 -0.8984375 -0.8984375 -0.8984375 -0.8984375 -0.890625 -0.8828125 -0.875 -0.8671875 -0.859375 -0.84375 -0.8203125 -0.8125 -0.796875 -0.796875 -0.7890625 -0.7890625 -0.7890625 -0.8046875 -0.8125 -0.8203125 -0.8203125 -0.8359375 -0.84375 -0.8515625 -0.8515625 -0.875 -0.8828125 -0.890625 -0.890625 -0.90625 -0.90625 -0.9140625 -0.9140625 -0.90625 -0.8984375 -0.8984375 -0.875 -0.875 -0.859375 -0.84375 -0.8359375 -0.8203125 -0.8125 -0.7890625 -0.765625 -0.7421875 -0.71875 -0.703125 -0.6953125 -0.6953125 -0.703125 -0.7265625 -0.7421875 -0.765625 -0.7890625 -0.8125 -0.84375 -0.859375 -0.875 -0.890625 -0.90625 -0.921875 -0.9296875 -0.9296875 -0.9296875 -0.9296875 -0.9296875 -0.9296875 -0.921875 -0.9140625 -0.90625 -0.90625 -0.890625 -0.8828125 -0.875 -0.859375 -0.8515625 -0.8359375 -0.828125 -0.828125 -0.828125 -0.8359375 -0.84375 -0.859375 -0.8671875 -0.890625 -0.9140625 -0.9375 -0.9609375 -0.9921875 -1.015625 -1.046875 -1.0703125 -1.0859375 -1.109375 -1.125 -1.140625 -1.15625 -1.1640625 -1.171875 -1.171875 -1.1796875 -1.1875 -1.1875 -1.1953125 -1.1875 -1.1875 -1.1875 -1.1796875 -1.171875 -1.1640625 -1.15625 -1.1484375 -1.1328125 -1.1328125 -1.125 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.1171875 -1.109375 -1.109375 -1.09375 -1.0859375 -1.0625 -1.046875 -1.03125 -1.0234375 -1.015625 -1.015625 -1.0078125 -1.015625 -1.0078125 -1.015625 -1.0078125 -1.0078125 -1.0078125 -1.015625 -1.015625 -1.0234375 -1.0390625 -1.0546875 -1.0703125 -1.09375 -1.1171875 -1.1484375 -1.15625 -1.1796875 -1.1953125 -1.2109375 -1.2265625 -1.234375 -1.2421875 -1.2421875 -1.234375 -1.2265625 -1.2109375 -1.203125 -1.1953125 -1.1796875 -1.171875 -1.171875 -1.1640625 -1.171875 -1.171875 -1.1796875 -1.1796875 -1.1953125 -1.203125 -1.203125 -1.203125 -1.1953125 -1.1875 -1.1796875 -1.15625 -1.140625 -1.1171875 -1.09375 -1.078125 -1.0546875 -1.03125 -1.0078125 -1 -0.9921875 -0.984375 -0.9765625 -0.9765625 -0.96875 -0.96875 -0.96875 -0.96875 -0.9765625 -0.9921875 -1.0078125 -1.0234375 -1.046875 -1.0625 -1.0859375 -1.09375 -1.109375 -1.1171875 -1.125 -1.1171875 -1.1171875 -1.09375 -1.0859375 -1.0703125 -1.046875 -1.0234375 -1 -0.9921875 -0.9765625 -0.9609375 -0.9609375 -0.953125 -0.9453125 -0.9453125 -0.9375 -0.9375 -0.9453125 -0.9453125 -0.9453125 -0.9453125 -0.9375 -0.9375 -0.9375 -0.9296875 -0.921875 -0.9140625 -0.90625 -0.8984375 -0.8984375 -0.890625 -0.8828125 -0.890625 -0.8984375 -0.8984375 -0.90625 -0.9140625 -0.921875 -0.921875 -0.921875 -0.9296875 -0.9296875 -0.9296875 -0.9375 -0.9375 -0.9375 -0.9375 -0.9453125 -0.953125 -0.953125 -0.9453125 -0.9453125 -0.953125 -0.953125 -0.953125 -0.9609375 -0.9609375 -0.9609375 -0.96875 -0.9765625 -0.984375 -0.9921875 -1.0078125 -1.0234375 -1.0390625 -1.0546875 -1.078125 -1.09375 -1.1015625 -1.1171875 -1.1328125 -1.140625 -1.140625 -1.140625 -1.140625 -1.1328125 -1.1171875 -1.1171875 -1.09375 -1.078125 -1.0625 -1.0546875 -1.0390625 -1.0234375 -1.0078125 -0.9921875 -0.984375 -0.96875 -0.9609375 -0.953125 -0.9453125 -0.953125 -0.953125 -0.9609375 -0.96875 -0.9765625 -0.9765625 -0.984375 -0.9921875 -0.9921875 -0.9921875 -0.9921875 -1 -1.0078125 -1.015625 -1.0234375 -1.0234375 -1.03125 -1.0390625 -1.0546875 -1.078125 -1.09375 -1.1171875 -1.1484375 -1.171875 -1.1953125 -1.2109375 -1.2265625 -1.25 -1.2578125 -1.2734375 -1.2734375 -1.28125 -1.28125 -1.2890625 -1.296875 -1.3046875 -1.3046875 -1.3125 -1.328125 -1.3359375 -1.34375 -1.3515625 -1.3671875 -1.3671875 -1.3828125 -1.3828125 -1.3828125 -1.3828125 -1.3828125 -1.390625 -1.3984375 -1.40625 -1.4140625 -1.421875 -1.421875 -1.4296875 -1.4296875 -1.421875 -1.4140625 -1.3984375 -1.390625 -1.375 -1.359375 -1.3515625 -1.34375 -1.3203125 -1.3203125 -1.328125 -1.328125 -1.3203125 -1.3203125 -1.3203125 -1.3046875 -1.3125 -1.3203125 -1.3203125 -1.328125 -1.3359375 -1.34375 -1.34375 -1.3515625 -1.3515625 -1.34375 -1.34375 -1.3359375 -1.3203125 -1.3125 -1.296875 -1.28125 -1.2578125 -1.2421875 -1.21875 -1.203125 -1.1875 -1.1796875 -1.171875 -1.1640625 -1.15625 -1.1484375 -1.1484375 -1.1484375 -1.15625 -1.15625 -1.15625 -1.15625 -1.171875 -1.171875 -1.1796875 -1.1875 -1.1875 -1.1875 -1.1875 -1.1875 -1.1796875 -1.1796875 -1.1796875 -1.1796875 -1.1796875 -1.1875 -1.1953125 -1.203125 -1.21875 -1.2265625 -1.234375 -1.234375 -1.2421875 -1.25 -1.2578125 -1.25 -1.2421875 -1.234375 -1.2265625 -1.2109375 -1.1875 -1.1640625 -1.1484375 -1.1171875 -1.1015625 -1.0859375 -1.0703125 -1.046875 -1.03125 -1.0234375 -1.015625 -1 -0.9921875 -0.9921875 -0.9765625 -0.96875 -0.9609375 -0.9453125 -0.9375 -0.9296875 -0.90625 -0.8984375 -0.8828125 -0.875 -0.859375 -0.84375 -0.8359375 -0.8359375 -0.8125 -0.7890625 -0.7734375 -0.75 -0.734375 -0.7265625 -0.71875 -0.7109375 -0.7109375 -0.7109375 -0.71875 -0.7265625 -0.7265625 -0.7265625 -0.734375 -0.7421875 -0.75 -0.7578125 -0.7734375 -0.78125 -0.7890625 -0.7890625 -0.796875 -0.8046875 -0.796875 -0.7890625 -0.78125 -0.78125 -0.765625 -0.7578125 -0.75 -0.75 -0.75 -0.734375 -0.7421875 -0.7421875 -0.7421875 -0.75 -0.7578125 -0.7578125 -0.7578125 -0.765625 -0.765625 -0.7734375 -0.7734375 -0.7890625 -0.8046875 -0.8125 -0.8125 -0.8125 -0.8203125 -0.828125 -0.828125 -0.8359375 -0.8359375 -0.84375 -0.8515625 -0.859375 -0.875 -0.8828125 -0.890625 -0.8984375 -0.9140625 -0.921875 -0.9296875 -0.9375 -0.9375 -0.953125 -0.9609375 -0.96875 -0.9765625 -0.984375 -0.9765625 -0.9765625 -0.9765625 -0.9765625 -0.9609375 -0.953125 -0.9375 -0.9296875 -0.9140625 -0.90625 -0.8984375 -0.8984375 -0.8984375 -0.90625 -0.9140625 -0.9296875 -0.9453125 -0.96875 -0.9921875 -1.015625 -1.0390625 -1.078125 -1.1015625 -1.140625 -1.171875 -1.1953125 -1.2265625 -1.2578125 -1.2734375 -1.296875 -1.3203125 -1.328125 -1.34375 -1.3515625 -1.3515625 -1.359375 -1.3671875 -1.3671875 -1.375 -1.375 -1.375 -1.3671875 -1.359375 -1.3515625 -1.3359375 -1.3203125 -1.3046875 -1.2890625 -1.2734375 -1.25 -1.234375 -1.21875 -1.2109375 -1.1953125 -1.1796875 -1.1640625 -1.1484375 -1.140625 -1.1328125 -1.125 -1.125 -1.125 -1.1328125 -1.140625 -1.140625 -1.15625 -1.15625 -1.15625 -1.1640625 -1.1640625 -1.1640625 -1.1640625 -1.1640625 -1.1640625 iris-edu-libmseed-4314359/test/read-Int16-encoded.test000077500000000000000000000001401422047135100223010ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int16-encoded.mseed -D iris-edu-libmseed-4314359/test/read-Int16-encoded.test.ref000066400000000000000000000600351422047135100230620ustar00rootroot00000000000000XX_TEST__LHE, 000001, M, 4096, 2016 samples, 1 Hz, 1980,360,00:00:00.320000 6 5 1 -9 -18 -19 -7 10 27 34 34 35 40 45 49 44 35 31 31 36 42 46 50 54 56 56 52 50 47 44 36 24 11 3 2 7 10 10 7 6 10 17 21 19 12 -1 -11 -17 -14 -10 -7 -9 -14 -14 -10 -3 3 3 -5 -15 -22 -23 -20 -14 -12 -12 -14 -19 -23 -25 -22 -16 -16 -19 -22 -23 -23 -21 -19 -19 -21 -22 -21 -17 -12 -4 4 11 18 19 16 12 9 10 12 14 17 20 25 35 41 47 44 34 21 11 5 4 5 8 11 15 17 17 18 21 24 27 27 24 20 15 15 16 20 19 11 -1 -10 -11 -4 7 18 19 11 -2 -15 -18 -15 -11 -16 -32 -48 -54 -47 -35 -24 -25 -33 -41 -43 -43 -46 -54 -65 -68 -63 -51 -46 -47 -52 -50 -41 -34 -32 -39 -46 -45 -38 -29 -22 -18 -16 -18 -24 -35 -49 -67 -91 -123 -161 -203 -245 -277 -304 -329 -357 -386 -406 -414 -403 -379 -345 -307 -264 -213 -151 -83 -14 49 105 154 198 235 264 291 319 345 365 377 383 387 388 386 383 375 363 347 327 305 284 263 243 223 204 187 176 168 164 158 149 132 112 94 78 64 51 42 35 32 28 18 4 -11 -18 -22 -25 -32 -42 -50 -56 -56 -55 -58 -63 -71 -75 -74 -66 -58 -58 -67 -79 -84 -81 -76 -77 -86 -95 -97 -90 -77 -67 -64 -66 -67 -63 -54 -47 -45 -51 -61 -67 -68 -68 -68 -70 -69 -60 -48 -40 -36 -39 -45 -51 -56 -54 -44 -28 -15 -10 -12 -17 -21 -19 -15 -12 -16 -20 -20 -11 5 21 31 29 22 15 8 3 -6 -17 -26 -27 -18 -5 3 5 -1 -10 -14 -16 -16 -18 -20 -21 -21 -17 -13 -16 -18 -19 -14 -4 1 -3 -9 -13 -8 1 5 -4 -18 -28 -27 -18 -6 0 -3 -10 -17 -18 -16 -13 -12 -13 -15 -17 -18 -16 -8 5 17 21 19 14 12 17 19 17 9 -2 -8 -7 0 9 16 19 21 20 20 18 14 9 0 -9 -16 -20 -21 -14 -5 2 3 0 -6 -10 -13 -12 -10 -7 -8 -13 -15 -14 -7 2 6 6 3 2 4 6 5 0 -6 -6 0 9 18 25 28 28 23 17 12 7 1 -8 -15 -15 -7 2 5 7 7 8 8 3 -8 -19 -27 -25 -19 -13 -12 -13 -13 -11 -5 -1 -4 -13 -21 -29 -32 -32 -31 -26 -17 -2 11 20 23 24 29 36 45 47 45 43 44 49 57 64 67 62 52 39 27 17 13 12 15 15 12 11 13 19 27 29 25 14 4 -3 -3 0 4 6 9 15 21 26 27 26 25 25 27 27 23 18 16 19 27 34 39 41 44 50 55 52 46 38 35 38 45 52 52 50 44 43 48 52 52 43 31 21 16 18 21 15 4 -9 -16 -15 -10 -5 -6 -12 -16 -17 -15 -12 -13 -18 -26 -31 -33 -35 -34 -31 -24 -16 -10 -12 -14 -15 -14 -9 -7 -5 -6 -9 -11 -13 -15 -14 -12 -5 1 7 12 18 20 17 11 4 -4 -14 -21 -21 -13 -2 9 16 17 15 14 13 12 8 0 -9 -16 -19 -21 -21 -21 -20 -14 -8 -6 -13 -22 -27 -24 -18 -17 -25 -37 -42 -38 -28 -19 -18 -20 -21 -16 -9 -2 -2 -7 -18 -26 -27 -23 -18 -16 -14 -10 -6 -5 -10 -13 -11 -6 -1 -5 -15 -23 -22 -12 0 3 1 -3 -2 5 14 15 10 -3 -11 -16 -18 -26 -37 -48 -56 -56 -57 -57 -58 -58 -56 -52 -51 -55 -59 -55 -45 -36 -29 -29 -32 -33 -27 -20 -14 -11 -11 -11 -10 -8 -7 -10 -13 -10 -4 3 6 4 -2 -6 -7 -6 -4 -7 -15 -23 -29 -26 -20 -17 -23 -34 -40 -39 -31 -20 -12 -12 -18 -24 -25 -21 -14 -13 -19 -29 -36 -35 -28 -17 -7 -2 -1 -1 -1 1 2 3 3 2 2 1 3 4 3 4 7 12 21 29 31 30 24 19 18 20 20 17 11 9 8 11 13 10 6 2 -1 -2 -5 -6 -5 4 14 20 19 11 3 -1 1 4 6 2 -6 -10 -3 9 23 32 32 22 10 3 -1 -2 0 3 7 13 20 25 29 29 26 17 12 12 14 15 15 8 5 7 13 18 19 18 20 23 27 27 22 12 5 0 0 0 1 1 2 6 10 15 16 13 5 -10 -27 -42 -55 -69 -84 -98 -112 -124 -132 -140 -146 -152 -161 -173 -187 -195 -199 -198 -197 -193 -179 -156 -131 -102 -80 -59 -29 10 50 84 106 120 133 152 173 196 217 234 247 253 254 253 251 247 239 230 219 206 193 177 160 145 133 127 121 114 100 78 54 34 21 13 8 2 -3 -7 -7 -6 -6 -11 -23 -36 -45 -47 -41 -31 -21 -12 -1 10 20 25 26 28 33 40 48 54 57 60 66 72 71 61 48 40 41 48 50 41 25 13 10 14 18 17 10 3 -2 -4 -5 -6 -9 -8 -2 4 9 9 6 3 1 3 4 6 4 4 8 15 21 24 24 17 8 -3 -15 -24 -28 -23 -20 -21 -23 -20 -13 -7 -7 -15 -26 -30 -32 -33 -40 -53 -64 -70 -68 -62 -57 -55 -58 -65 -72 -77 -78 -77 -75 -73 -71 -67 -56 -41 -27 -18 -17 -20 -17 -6 7 17 21 21 25 32 37 33 23 13 9 10 13 12 12 15 24 31 33 25 14 6 3 1 -1 -7 -15 -25 -35 -42 -45 -44 -38 -29 -18 -7 -1 3 1 -6 -15 -23 -28 -33 -33 -32 -25 -14 -5 4 7 2 -7 -17 -25 -27 -25 -22 -21 -16 -9 -2 2 0 -3 -6 -5 1 10 22 35 43 43 38 31 24 18 12 8 7 7 14 20 24 25 29 29 29 29 25 24 20 15 7 0 -6 -8 -7 -2 5 15 29 37 41 39 32 27 19 12 5 -1 -2 1 7 11 12 12 9 7 8 7 8 6 4 2 -2 -3 -1 0 -1 -4 -10 -11 -6 0 5 2 -6 -14 -20 -20 -16 -12 -8 -8 -6 -1 3 3 -4 -16 -25 -32 -35 -36 -38 -36 -28 -18 -9 -9 -14 -18 -20 -19 -17 -12 -4 4 6 1 -5 -6 -1 6 7 7 5 7 9 12 12 10 4 0 -1 2 7 11 15 15 14 9 0 -11 -19 -24 -24 -20 -17 -15 -13 -11 -9 -8 -10 -15 -18 -18 -8 1 8 6 -2 -10 -12 -9 -4 2 8 13 16 16 14 10 8 8 10 14 17 22 24 25 26 26 21 11 -2 -19 -30 -33 -34 -33 -34 -36 -35 -31 -25 -18 -13 -7 -3 -4 -7 -10 -6 3 8 9 8 8 7 7 5 3 4 8 11 7 0 -6 -4 1 4 2 -4 -7 -6 -4 -4 -4 -3 -1 4 10 16 18 15 9 7 8 12 16 15 12 11 16 22 24 19 12 6 2 -1 -6 -10 -9 -5 3 6 6 2 -6 -12 -18 -20 -20 -20 -19 -18 -12 1 17 31 38 36 27 13 3 -1 2 8 11 10 8 11 19 24 19 9 -2 -7 1 13 27 36 42 46 48 48 44 35 22 10 1 -1 1 4 5 5 7 11 18 22 20 15 12 14 16 18 18 19 21 28 33 36 31 21 12 6 4 0 -5 -13 -18 -16 -7 4 9 6 -1 -4 0 7 4 -7 -22 -29 -26 -17 -11 -10 -12 -12 -9 -7 -7 -10 -17 -23 -25 -23 -14 -6 -1 2 4 6 10 13 15 18 19 19 15 9 6 7 11 17 18 20 24 31 35 32 23 16 12 13 17 20 23 23 24 24 25 23 16 7 2 5 10 13 11 6 4 4 3 -2 -7 -14 -18 -19 -18 -18 -19 -16 -17 -16 -18 -21 -24 -25 -21 -17 -14 -17 -22 -27 -28 -22 -13 -6 -5 -9 -14 -12 -6 0 7 12 14 15 11 1 -14 -30 -38 -43 -40 -40 -39 -37 -32 -21 -10 -1 2 -2 -6 -11 -10 -6 0 3 2 1 0 2 2 -7 -26 -46 -59 -60 -52 -39 -31 -25 -19 -9 2 8 8 3 -4 -6 -6 -7 -11 -19 -25 -29 -32 -36 -42 -47 -51 -55 -55 -50 -45 -39 -35 -31 -25 -18 -13 -11 -9 -4 1 3 0 -6 -7 -4 1 1 -6 -17 -21 -20 -15 -12 -15 -22 -27 -24 -20 -13 -5 2 7 11 13 17 23 31 37 32 18 7 -4 -9 -14 -19 -28 -35 -38 -37 -30 -20 -13 -12 -13 -18 -19 -17 -14 -10 -8 -8 -11 -17 -24 -28 -29 -30 -33 -36 -34 -23 -6 8 11 6 0 -1 3 1 -8 -16 -19 -10 5 16 18 10 -4 -21 -34 -45 -52 -56 -53 -46 -35 -25 -15 -6 2 7 7 -3 -17 -31 -39 -42 -40 -37 -28 -14 4 18 25 26 21 17 13 11 9 6 3 5 15 29 39 37 25 10 2 0 1 1 -3 -5 -3 3 10 18 19 13 4 -2 -3 1 4 1 -3 -5 1 11 19 19 12 5 4 10 16 16 10 5 5 8 8 4 -2 -3 3 11 14 11 3 -2 0 5 9 11 13 18 20 19 15 8 -1 -6 -8 -9 -11 -13 -13 -9 4 15 25 27 21 13 8 3 0 -3 -6 -10 -15 -20 -21 -14 1 15 22 15 -1 -14 -19 -12 -1 7 8 5 4 3 3 0 -8 -19 -27 -26 -16 1 11 11 0 -11 -16 -15 -14 -19 -27 -33 -34 -31 -29 -30 -32 -33 -32 -28 -23 -23 -26 -32 -34 -32 -26 -23 -25 -33 -38 -37 -31 -24 -21 -22 -19 -11 1 7 5 0 -3 -4 -6 -12 -16 -16 -11 -7 -10 -14 -15 -11 0 7 8 4 1 1 6 10 17 20 20 16 5 -7 -14 -9 1 9 9 1 -9 -11 -5 2 4 2 0 6 15 25 30 28 25 24 23 25 25 22 14 3 -8 -13 -11 -5 -3 -7 -16 -25 -28 -22 -9 -1 -3 -11 -20 -22 -16 -6 4 10 14 14 11 11 14 22 35 43 44 38 33 31 31 29 21 5 -14 -31 -39 -34 -20 -5 8 16 24 37 56 74 86 88 84 80 82 85 83 72 52 27 7 -7 -21 -35 -54 -68 -77 -79 -73 -63 -51 -39 -28 -15 -2 13 34 59 83 100 110 107 99 90 81 72 58 36 8 -13 -26 -32 -33 -34 -37 -35 -29 -17 -2 11 24 36 50 63 76 80 75 67 59 53 52 54 57 61 63 63 66 71 77 76 iris-edu-libmseed-4314359/test/read-Int32-1024byte-encoded.test000077500000000000000000000001411422047135100235500ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-1024byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-1024byte-encoded.test.ref000066400000000000000000000056661422047135100243410ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 1024, 240 samples, 1 Hz, 2010,058,06:52:56.069539 -230467 -228682 -231926 -238261 -242006 -245765 -239994 -227824 -226956 -228796 -228197 -233827 -241222 -243646 -238977 -232624 -233808 -238003 -233604 -226769 -232569 -242266 -242432 -240215 -239860 -239961 -243139 -243961 -239645 -238433 -239628 -237879 -230947 -216815 -210216 -219208 -226749 -231751 -240772 -248271 -251898 -245388 -235334 -231916 -227298 -229323 -236615 -232681 -228306 -231119 -231595 -229975 -224902 -220008 -226886 -231931 -233318 -243096 -244472 -241192 -247230 -246482 -235244 -232261 -238046 -231154 -222094 -228092 -236876 -237286 -223455 -215738 -221718 -215970 -211063 -217789 -226489 -236163 -233766 -237352 -259142 -255587 -224426 -202003 -196505 -199975 -193732 -183508 -177868 -177994 -214663 -283583 -337053 -354811 -339701 -291068 -250048 -248179 -268654 -279926 -263758 -238408 -209084 -197043 -206031 -209659 -223931 -247397 -251511 -260703 -292788 -297331 -292395 -319377 -335343 -324355 -309173 -293888 -264565 -230931 -201796 -158943 -125628 -123229 -132884 -155870 -194547 -218837 -238223 -251088 -229406 -214976 -219910 -249216 -302237 -299153 -258906 -255588 -276575 -287032 -263807 -227028 -199568 -179185 -201937 -233678 -189395 -132652 -140562 -192282 -240497 -296909 -374164 -360273 -287149 -274391 -260260 -226016 -209527 -166900 -91498 -43739 -63756 -131096 -201665 -259967 -308654 -329027 -296625 -226045 -174478 -147349 -130313 -154186 -164166 -159619 -204546 -240437 -263827 -312241 -341525 -353176 -338880 -286534 -251189 -211543 -146709 -106984 -137975 -208311 -227973 -227836 -253819 -279231 -314337 -327678 -305514 -292535 -271426 -229295 -192256 -189025 -214292 -230273 -231145 -252867 -300861 -313972 -301713 -301984 -280033 -238469 -210717 -194525 -176091 -164971 -170273 -184965 -201809 -210752 -227498 -263971 -287069 -283833 -266161 -235613 -193005 -159264 -150687 -156856 -197227 -276346 -345373 -372618 -372164 -362788 -336698 -273568 -206809 -183226 iris-edu-libmseed-4314359/test/read-Int32-128byte-encoded.test000077500000000000000000000001401422047135100234730ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-128byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-128byte-encoded.test.ref000066400000000000000000000004161422047135100242510ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 128, 16 samples, 1 Hz, 2010,058,06:50:00.069539 -231946 -228438 -223155 -221231 -225429 -230129 -229728 -228817 -233187 -237367 -237121 -237361 -235678 -227339 -221762 -224099 iris-edu-libmseed-4314359/test/read-Int32-2048byte-encoded.test000077500000000000000000000001411422047135100235570ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-2048byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-2048byte-encoded.test.ref000066400000000000000000000137401422047135100243400ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 2048, 496 samples, 1 Hz, 2010,058,06:56:56.069539 -153142 -112621 -108174 -121595 -163772 -231395 -270350 -288753 -304109 -302338 -300778 -282568 -245124 -226804 -227315 -260468 -293530 -271944 -232782 -204782 -194992 -206028 -207578 -221963 -242765 -217153 -201427 -236012 -260995 -258674 -263005 -271003 -270739 -279633 -295216 -299011 -280857 -265731 -260924 -215157 -168762 -180296 -184273 -154518 -140922 -155432 -178463 -200607 -228174 -254796 -270731 -269554 -240173 -211544 -224445 -261870 -277797 -266351 -246381 -238594 -243567 -232571 -234355 -261495 -294276 -327916 -310426 -258126 -224013 -198251 -173335 -148752 -139762 -154674 -177566 -209649 -257652 -308614 -331780 -317352 -291222 -250509 -206368 -195671 -187246 -168846 -172226 -199595 -223823 -244274 -275537 -276885 -261202 -260538 -251797 -223075 -196424 -205061 -218585 -220573 -234741 -245827 -223697 -185842 -183428 -203071 -211929 -223713 -247288 -255950 -240446 -234971 -235723 -222330 -211872 -215788 -230936 -238070 -234855 -246731 -257686 -236964 -206322 -204750 -216560 -217981 -226653 -237003 -242783 -257508 -268579 -262645 -254204 -259499 -260122 -232852 -180834 -140139 -144696 -169033 -190141 -228975 -269997 -276903 -285253 -308844 -301321 -271087 -244280 -220569 -202535 -197005 -205360 -218262 -236081 -248782 -248330 -256011 -257864 -237608 -224279 -215166 -203219 -211161 -231676 -255386 -272862 -268279 -262797 -268099 -274091 -272494 -263878 -259147 -249660 -242775 -240408 -215452 -195356 -212178 -230986 -233003 -235740 -236263 -233361 -237647 -247467 -246493 -227905 -228260 -261081 -281438 -279807 -275367 -253652 -223139 -212913 -210332 -208374 -225539 -243653 -241678 -246387 -260689 -264077 -251243 -227182 -222746 -233373 -223532 -217621 -239334 -252764 -246165 -246659 -246775 -218864 -187998 -186707 -199330 -211903 -219740 -222383 -225045 -212794 -194552 -202550 -220939 -232946 -241558 -247774 -270469 -294629 -301781 -309569 -303583 -275393 -240016 -205927 -191853 -186273 -183135 -198108 -207586 -201709 -207517 -235987 -263228 -275097 -286544 -290636 -277695 -264982 -258884 -250249 -234362 -214014 -193644 -176935 -169985 -180880 -204947 -220197 -236478 -263505 -285066 -301828 -299965 -278655 -251655 -224113 -209154 -195774 -186595 -193882 -194233 -191637 -203411 -202638 -198700 -217732 -230889 -237470 -245618 -245037 -247105 -246187 -244817 -242214 -229021 -229936 -233248 -215994 -204777 -211173 -220496 -234765 -254575 -281075 -313106 -314341 -285604 -263135 -252154 -247184 -233674 -210465 -191402 -182731 -185053 -191015 -206098 -231972 -256272 -274980 -275607 -249333 -217660 -201644 -209756 -237549 -251051 -241565 -252667 -293586 -319854 -309013 -282163 -259919 -241593 -229562 -224727 -221459 -230323 -244189 -233705 -218369 -228600 -239990 -243579 -244683 -229500 -215888 -222520 -235689 -244473 -256318 -270484 -272690 -261001 -252185 -255254 -255331 -252787 -253097 -256101 -260132 -251467 -230683 -204627 -184980 -185784 -201149 -209942 -208079 -211238 -216075 -217279 -217423 -215135 -207566 -199652 -205410 -202898 -185477 -190434 -207050 -214138 -217694 -211413 -208388 -224136 -241706 -250372 -253818 -257980 -268245 -279442 -277317 -255591 -232030 -225150 -225479 -218335 -214132 -219107 -217857 -217412 -229705 -230218 -217094 -215904 -212652 -211149 -233324 -260703 -283315 -278890 -242075 -231039 -257612 -275039 -270845 -266561 -262649 -253867 -249885 -248436 -252968 -273765 -290464 -294012 -306412 -320115 -304248 -269886 -262026 -275199 -278267 -279449 -289280 -296468 -297748 -297082 -284177 -264050 -239977 -204326 -167900 -123985 -74606 -43546 -31084 -37694 -68998 -118271 -178355 -238917 -271991 -276766 -282415 -284514 -271273 -249298 -231788 -230756 -239504 -232175 -214385 -220514 -227132 -226224 -245661 -253885 -248665 -267883 -290752 -291883 -275917 -247774 -220966 -199874 -191575 -200071 -189521 -169543 -178301 -183565 -189754 -224881 -252000 -269963 -305768 -340653 -331089 -288133 -261050 -225752 -159312 -91095 -39003 -15020 -22829 -43200 -45658 -34768 iris-edu-libmseed-4314359/test/read-Int32-256byte-encoded.test000077500000000000000000000001401422047135100234750ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-256byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-256byte-encoded.test.ref000066400000000000000000000012241422047135100242510ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 256, 48 samples, 1 Hz, 2010,058,06:50:16.069539 -228777 -234345 -238060 -237690 -233484 -226807 -221838 -222905 -228070 -226135 -220353 -223352 -235952 -246300 -247116 -250785 -253608 -251682 -253629 -250490 -245121 -242061 -232787 -225785 -226529 -224716 -220290 -216479 -211732 -210463 -216741 -226807 -234022 -237295 -241529 -242458 -234416 -226815 -221225 -221087 -227538 -226381 -226037 -235504 -243223 -244629 -244677 -245257 iris-edu-libmseed-4314359/test/read-Int32-4096byte-encoded.test000077500000000000000000000001411422047135100235640ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-4096byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-4096byte-encoded.test.ref000066400000000000000000000300671422047135100243460ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 4096, 1008 samples, 1 Hz, 2010,058,07:05:12.069539 -29830 -19121 -11992 -34742 -79039 -143930 -224678 -290521 -352960 -430518 -514423 -578644 -616867 -665113 -697232 -663119 -581334 -496365 -424794 -361400 -312005 -257536 -190765 -139341 -96967 -72440 -88821 -137691 -210460 -293762 -373346 -419490 -408690 -376782 -336060 -290409 -272384 -252823 -210527 -164253 -107447 -42032 5346 18350 17040 10543 -13233 -49528 -88212 -118332 -145957 -189054 -225154 -232608 -248275 -284664 -311088 -315861 -301056 -281709 -275289 -267156 -252294 -277552 -328463 -336424 -298854 -233948 -171636 -138974 -119419 -107182 -100947 -93151 -94190 -118205 -158660 -190385 -210140 -226207 -241555 -251338 -237757 -224710 -248199 -290458 -320805 -344849 -382481 -427696 -470590 -500089 -497232 -456297 -397774 -360720 -334322 -294870 -259862 -228152 -188511 -160464 -166187 -187161 -197069 -187475 -162351 -136018 -118740 -108774 -100974 -106225 -118082 -126652 -151042 -190724 -222413 -232127 -241872 -263086 -264307 -258149 -264883 -267232 -251212 -210330 -170814 -171915 -191390 -191086 -193655 -205166 -213019 -226162 -226608 -215104 -206678 -186593 -161899 -145180 -130273 -117879 -122309 -138404 -149017 -166315 -192632 -213479 -224102 -245032 -307456 -368385 -368101 -361001 -383963 -383472 -369336 -369891 -353729 -305200 -238277 -191994 -173310 -145289 -140824 -173892 -183751 -180604 -176889 -152162 -159082 -209578 -244382 -243786 -233786 -251048 -296416 -327520 -313974 -295506 -303657 -308659 -306596 -289739 -253576 -242569 -254795 -244386 -203177 -162292 -144580 -160414 -212370 -270824 -310437 -327250 -316376 -291125 -285470 -305396 -316682 -318649 -340213 -368690 -375712 -359251 -343737 -335248 -307504 -262103 -233583 -240012 -265120 -294080 -332255 -363504 -374084 -390966 -414110 -407300 -365130 -313802 -262463 -209481 -174891 -159208 -153341 -148806 -129984 -120450 -140678 -195339 -264014 -302603 -323146 -329950 -306644 -262356 -200746 -153364 -144042 -151515 -174177 -223977 -286511 -331122 -336794 -317017 -272806 -199577 -131299 -67022 -11145 -1268 -27258 -77094 -149667 -222786 -293770 -351542 -369576 -359888 -344588 -325536 -303028 -288066 -277493 -259523 -227721 -188071 -173828 -190038 -208641 -217514 -227765 -239910 -240948 -237939 -234476 -224148 -212867 -209388 -194312 -164337 -152355 -146064 -134062 -143682 -169337 -191723 -201505 -184404 -153283 -133737 -123598 -118202 -119060 -126793 -138049 -150797 -177174 -204666 -215566 -215577 -202498 -187632 -187176 -194909 -197310 -192114 -185006 -166041 -140711 -121558 -92846 -64494 -65843 -84807 -102772 -127015 -158584 -200762 -243755 -272205 -310294 -355186 -387740 -402372 -381341 -353331 -352064 -351048 -332307 -318635 -315931 -314353 -310914 -303082 -310653 -317579 -294577 -280118 -289378 -306830 -336572 -370365 -403006 -432107 -439747 -436329 -445518 -447346 -426380 -398679 -377561 -369553 -373845 -383438 -393967 -379663 -328565 -295505 -297089 -297362 -293163 -275136 -232645 -197617 -197816 -227851 -266809 -285532 -295399 -337779 -394342 -427688 -445731 -456240 -440985 -400331 -357399 -291820 -202669 -143601 -103957 -67247 -40012 11765 75495 109811 123988 140900 158993 152672 98067 28423 -23581 -81240 -126077 -136864 -141301 -135987 -99533 -62003 -60166 -66955 -51107 -28149 -16823 3734 26790 5222 -56384 -140749 -220537 -241930 -224276 -223643 -243490 -282928 -340258 -374965 -374569 -371906 -375812 -354155 -298652 -237431 -162936 -86191 -37891 -16118 -15968 -15994 -31122 -65327 -83050 -104902 -132690 -169216 -236255 -287166 -319755 -364452 -403251 -450920 -497779 -503459 -482354 -449485 -410464 -377269 -356618 -363144 -396311 -428931 -442130 -443014 -432766 -388391 -299800 -199971 -135866 -121653 -136005 -146497 -141088 -140711 -170558 -216225 -236514 -232508 -235169 -245683 -254412 -257956 -236553 -196061 -174737 -176594 -192453 -220066 -238278 -240803 -241173 -247734 -269264 -299946 -327139 -345227 -352069 -362786 -375677 -359742 -320901 -291676 -271533 -246516 -221528 -206680 -200542 -199164 -198613 -195572 -201575 -217097 -221414 -218363 -226835 -239248 -246240 -249972 -241987 -231470 -244700 -279977 -313054 -334003 -345499 -344673 -342278 -332797 -303951 -285584 -282229 -284585 -309279 -345312 -376988 -397204 -396514 -381933 -354050 -309853 -260121 -208070 -142585 -77813 -42264 -21963 -6870 -16265 -46847 -77579 -98266 -117640 -145744 -184477 -236893 -297304 -347640 -380236 -404638 -417400 -407712 -384107 -347518 -285248 -211756 -146397 -79814 -12443 34002 51909 49349 26422 -10879 -49272 -90494 -144217 -215941 -294111 -359198 -396114 -395821 -369562 -336394 -291964 -236700 -201105 -194118 -204144 -221752 -230283 -237903 -258229 -278666 -292338 -292698 -275219 -265822 -284588 -299366 -283751 -263049 -246588 -229220 -220769 -216569 -221887 -249037 -277257 -287451 -294731 -315666 -343248 -365255 -383404 -394762 -385687 -358278 -324979 -295101 -276066 -258741 -226194 -188356 -153504 -110856 -80356 -81092 -96071 -117747 -147263 -171056 -175733 -158638 -124754 -89240 -70530 -71331 -75750 -77810 -86575 -99179 -105639 -103457 -102417 -118797 -151728 -183253 -207351 -227382 -230226 -209187 -177509 -142573 -104633 -63572 -31490 -26413 -42683 -69801 -111559 -167084 -233513 -298131 -338235 -352112 -350413 -345943 -349823 -361318 -379539 -400837 -420835 -453213 -500822 -542751 -569788 -573555 -554569 -526000 -487496 -448868 -408084 -354534 -307160 -282335 -279376 -280606 -267948 -246137 -226406 -214123 -212304 -218889 -231972 -250012 -259088 -260720 -269981 -280067 -281054 -277842 -276999 -278492 -278685 -276443 -271721 -261245 -232777 -180522 -128889 -93823 -70425 -57950 -54357 -61212 -80016 -102384 -126127 -153940 -169695 -173471 -186233 -201265 -207987 -216459 -230724 -241598 -248146 -264652 -297145 -328422 -339272 -337619 -350121 -377644 -395928 -396567 -390880 -379857 -351299 -303709 -247297 -193601 -145552 -103651 -70923 -50758 -45923 -51046 -63255 -79549 -94116 -108702 -124885 -144640 -167868 -189214 -208799 -224185 -226177 -213802 -198572 -192343 -195179 -204880 -225411 -254536 -279604 -289299 -278951 -248609 -216687 -205134 -202356 -200019 -215724 -245888 -272801 -296425 -317225 -328273 -325234 -306606 -284226 -269966 -258235 -253252 -264434 -278896 -287038 -295815 -310024 -330212 -341880 -332070 -311696 -283628 -247280 -223725 -225070 -238681 -252098 -261800 -257339 -225839 -175768 -129900 -105962 -105073 -114078 -131282 -158389 -187019 -222302 -263951 -296506 -319900 -330812 -317711 -286278 -250891 -220421 -198126 -187300 -186648 -184517 -177330 -176248 -188000 -206163 -221958 -232551 -235889 -234393 -230339 -222933 -226611 -256261 -298728 -330146 -341649 -335110 -320680 -310085 -303858 -297622 -295636 -304424 -313654 -316814 -319781 -320007 -315381 -307458 -303366 -311421 -324744 -329935 -324731 -322376 -328495 -327292 -309493 -288596 -279096 -280206 -285124 -289950 -286866 -267777 -243934 -230621 -223072 -214369 -206375 -196626 -183031 -171001 -166692 -170521 -169743 -156910 -147367 -159263 -191190 -219590 -227690 -223138 -213980 -194383 -159493 -120533 -96011 -91355 -100028 -117560 -135943 -144232 -144537 -141650 -133589 -122536 -117153 -127033 -153882 -188642 -221039 -247360 -264990 -273568 -278203 -279219 -282180 -297456 -316523 -327844 -334337 -339395 -342510 -340937 -333138 -322242 -312131 -304209 -297030 -289845 -282807 -275731 -266571 -253167 -239316 -229695 -215839 -188205 -161362 -146247 -133775 -122653 -114022 -113858 -132907 -164626 -203753 -245308 -271814 -280399 -280190 -275067 -269610 -263655 -248310 -220369 -192630 -185237 -203027 -232850 -262251 -283316 -291207 -284251 -261547 -227450 -190559 -158509 -136145 -125335 -130980 -157659 -196803 -233574 -261236 -275462 -271640 -256033 -239814 -227880 -220436 -214586 -209488 -213617 -234564 -264746 -293278 -311283 -310851 -297587 -276586 -240888 -190406 -141749 -113274 -105951 -112171 -129704 -154489 -178419 -196805 -208516 -211154 -203388 -190732 -180923 -179702 -189787 -209661 -237965 -265879 -285269 -299064 -300977 -285339 -261524 -240057 -224514 iris-edu-libmseed-4314359/test/read-Int32-512byte-encoded.test000077500000000000000000000001401422047135100234700ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-512byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-512byte-encoded.test.ref000066400000000000000000000026371422047135100242550ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 512, 112 samples, 1 Hz, 2010,058,06:51:04.069539 -242196 -236764 -232792 -228731 -227703 -228600 -226246 -229232 -236837 -242076 -250265 -255144 -253173 -249842 -243233 -234785 -227107 -223531 -223693 -225294 -231239 -239464 -244761 -246077 -246577 -244055 -238917 -237413 -234418 -230777 -231926 -233408 -234711 -233149 -227798 -226125 -227125 -228063 -231572 -233373 -232137 -232426 -234394 -237939 -241583 -242455 -239557 -236956 -236771 -235263 -232660 -231147 -230543 -231936 -237536 -243775 -251344 -258638 -255612 -246594 -237183 -227889 -220941 -217647 -220374 -224977 -231367 -238490 -240979 -244094 -248001 -247919 -246365 -243834 -236909 -230138 -227595 -224857 -225123 -229146 -231778 -236068 -240339 -241034 -240845 -240140 -238566 -235599 -230959 -225653 -223451 -227170 -232013 -236121 -239385 -238218 -235712 -235218 -236993 -241780 -242478 -237200 -234327 -233657 -232972 -232951 -231650 -229043 -225799 -225264 -228318 -230680 iris-edu-libmseed-4314359/test/read-Int32-8192byte-encoded.test000077500000000000000000000001411422047135100235650ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-8192byte.mseed -D iris-edu-libmseed-4314359/test/read-Int32-8192byte-encoded.test.ref000066400000000000000000000603411422047135100243450ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, R, 8192, 2032 samples, 1 Hz, 2010,058,07:22:00.069539 -211177 -198408 -186816 -180482 -188315 -202233 -209662 -217296 -229917 -242629 -249839 -245578 -229951 -210958 -197340 -191353 -190652 -192886 -195442 -194090 -188520 -189827 -206567 -232726 -259165 -282942 -304741 -322755 -332976 -336225 -337774 -340369 -346439 -359007 -377532 -397698 -407108 -396992 -373802 -341953 -299727 -251701 -208769 -180141 -163180 -148012 -134519 -129644 -138780 -165261 -203523 -241293 -267931 -271724 -247710 -205713 -162182 -133324 -127286 -138959 -154754 -171009 -193789 -220803 -248293 -275286 -298770 -312793 -313042 -301749 -277424 -242101 -209350 -184729 -165778 -151782 -143702 -146267 -159290 -177176 -196117 -212929 -227641 -241461 -250629 -250895 -247757 -253155 -271633 -295434 -312326 -315378 -302672 -277171 -247091 -219953 -198680 -177426 -147666 -112653 -83385 -68684 -71726 -85799 -101106 -112538 -119108 -124364 -130356 -135485 -144734 -160323 -170202 -168609 -162076 -161533 -176617 -200122 -221715 -241725 -258451 -270828 -279685 -284644 -290356 -300175 -312447 -326813 -341994 -357953 -373835 -379997 -372383 -358218 -342001 -323723 -302462 -282447 -273997 -277155 -282720 -288058 -288414 -277305 -258890 -235788 -203260 -162625 -122576 -93785 -89204 -109973 -142970 -178145 -205735 -215917 -208274 -189461 -166651 -144452 -127906 -122534 -132094 -156833 -191852 -233354 -279032 -325374 -372289 -418206 -457800 -487272 -503836 -507757 -499101 -480413 -462340 -448155 -432018 -406952 -370566 -333235 -305737 -292820 -294163 -304800 -318476 -327295 -331085 -333843 -337485 -344333 -347622 -340962 -328990 -312497 -290487 -265657 -237329 -204159 -165068 -122669 -82065 -41890 -4349 24121 41433 45566 37523 19960 -10110 -56086 -110906 -161550 -201698 -234086 -268089 -307648 -347424 -379086 -392199 -386825 -373875 -361328 -351357 -339101 -321353 -301121 -279775 -257520 -234754 -211914 -196239 -198060 -216233 -242445 -270303 -296340 -320676 -343275 -362441 -374114 -376850 -378955 -388641 -401827 -406385 -397676 -381130 -358103 -330321 -303941 -279561 -259707 -249534 -249005 -256617 -265778 -266503 -258919 -249169 -237397 -219218 -189709 -149838 -108344 -73141 -51733 -48140 -57936 -77569 -104608 -134857 -162815 -180360 -184787 -178429 -166344 -154005 -136172 -108842 -79390 -55460 -41402 -38870 -48331 -70767 -103966 -136880 -158417 -169822 -176528 -182704 -193437 -213300 -247360 -292738 -337778 -378524 -415141 -441393 -447980 -429128 -392719 -355504 -326928 -308695 -300447 -301304 -313584 -339513 -368055 -380433 -370136 -339168 -290857 -234876 -179039 -129357 -93322 -67158 -42504 -16587 13637 49351 85149 111705 116278 86907 29256 -37904 -102896 -159865 -206764 -247140 -283518 -315560 -337571 -341177 -332206 -324510 -321644 -325777 -340106 -361696 -388092 -415914 -440654 -462497 -485461 -511586 -534120 -546571 -548708 -536467 -504723 -454820 -393329 -331130 -277448 -238382 -219301 -216073 -219438 -226673 -231993 -228478 -220242 -212857 -204428 -189818 -167104 -138471 -104110 -63587 -25093 2160 22004 42283 64053 81616 84197 65294 24316 -36162 -109587 -187000 -253303 -297092 -320356 -324715 -306290 -266777 -214273 -157022 -106498 -75408 -67317 -79281 -110231 -157122 -212494 -267719 -315408 -349977 -365156 -361658 -348594 -332358 -319551 -317527 -324281 -333297 -342974 -352418 -357862 -354744 -342371 -325295 -307631 -293158 -284864 -282346 -289186 -313229 -357130 -417281 -484139 -544570 -590347 -619479 -627129 -607200 -564552 -507658 -442033 -373343 -302328 -231810 -169410 -118209 -77749 -44706 -16084 7498 26193 41723 57085 74592 93984 116695 145252 178974 216617 254327 284938 304530 310025 300637 282622 264985 252287 240539 221023 187687 142358 91390 38999 -11828 -56960 -92657 -119220 -145081 -181649 -234154 -301031 -374206 -441433 -491326 -517993 -523287 -512686 -493357 -472523 -455341 -445627 -445665 -456058 -472040 -484740 -490708 -489894 -479707 -461734 -443585 -429920 -420458 -415998 -416952 -420930 -427445 -436012 -445350 -454542 -461957 -468372 -473438 -475251 -471181 -454818 -427886 -400997 -379738 -365353 -356989 -352330 -348598 -341319 -328643 -310701 -287848 -264947 -246850 -233438 -224607 -220455 -217646 -212225 -199790 -175667 -139333 -94334 -46082 1508 46053 83809 112202 132835 148567 158033 158484 151812 139743 122319 102228 78897 47507 3895 -52765 -113598 -167877 -213685 -252376 -286608 -320585 -356929 -396521 -436844 -473469 -503533 -524796 -533255 -524290 -500568 -469887 -438080 -410872 -390080 -373473 -363600 -366847 -386245 -420903 -468331 -525282 -586228 -645196 -701740 -757112 -812650 -872288 -937027 -1002175 -1058128 -1094894 -1107126 -1094913 -1064451 -1019136 -953424 -862374 -742806 -591669 -414824 -223836 -27356 166760 352576 524298 670761 780879 851957 890193 901559 891134 869790 845290 817282 783747 743914 696849 638999 569083 491990 414640 340615 269636 197611 113889 5390 -135600 -309134 -509819 -727959 -951345 -1167371 -1362488 -1523746 -1641421 -1707745 -1717237 -1670811 -1573084 -1430182 -1250534 -1039065 -801859 -554058 -307347 -65612 164561 375615 560044 710954 824782 893625 912218 884598 812207 694882 535526 344738 142773 -47992 -209300 -334913 -424181 -476774 -500470 -506222 -503949 -502815 -507177 -520919 -552902 -610982 -697524 -813513 -952040 -1098323 -1244949 -1379971 -1481138 -1537691 -1544756 -1496149 -1394874 -1247089 -1061077 -850776 -628767 -408893 -203028 -13782 153645 289018 390482 464106 511820 532748 534467 527816 515757 497719 476791 455078 427319 389630 344443 295003 244740 194148 144126 92627 31410 -40229 -119277 -201042 -275889 -335557 -370425 -373713 -348097 -298511 -226169 -134837 -31574 78667 186393 279206 354353 413653 451902 463641 450407 414418 355282 281625 204329 118821 24111 -73499 -173689 -274531 -371810 -458725 -527432 -579096 -622320 -662176 -697867 -725843 -747030 -768997 -789198 -796946 -789501 -762282 -701811 -593957 -431299 -225217 7128 256297 501692 726758 928184 1088994 1195100 1246504 1235399 1156538 1018004 828716 602308 362923 137167 -57972 -227044 -366399 -461227 -523311 -566772 -603808 -652690 -712985 -783292 -865137 -949320 -1025175 -1079039 -1105076 -1101693 -1052033 -949827 -807466 -637091 -451774 -252495 -36152 178019 367609 520924 625376 665680 631103 531433 385583 202006 -10347 -236210 -453524 -647480 -820751 -968989 -1084336 -1171593 -1233941 -1276108 -1304075 -1313800 -1302891 -1271833 -1218068 -1136061 -1021477 -879295 -711873 -523085 -331088 -148219 16521 145064 224972 252264 221366 129999 -14438 -203940 -428824 -672672 -918271 -1148664 -1349464 -1511325 -1623265 -1671674 -1653560 -1578635 -1458446 -1300227 -1106909 -888887 -664355 -444015 -231467 -34688 140010 296363 430778 529535 594971 641681 670079 674627 655458 613113 548105 457221 343397 215997 73817 -83594 -246478 -404053 -546608 -663355 -742295 -775102 -762699 -711524 -630809 -531760 -422935 -311669 -205486 -112957 -40326 11269 41883 55344 55746 41862 14484 -21411 -63759 -110455 -152956 -182338 -194000 -187006 -162371 -122093 -74640 -28537 16916 60643 100084 139778 181266 224625 270622 315228 360938 410678 455860 488269 503887 496592 462048 401935 322124 226888 117302 -917 -122472 -248732 -380299 -510408 -629591 -738295 -834892 -906244 -944235 -944854 -905212 -828579 -717085 -574618 -416533 -262022 -121789 409 99317 169566 212780 236021 246562 247336 235042 209691 176986 142442 115712 102362 99181 108588 130984 153747 161134 144850 105198 45673 -27190 -107056 -190527 -275093 -361087 -446794 -531338 -616890 -697938 -768669 -832641 -891650 -938453 -969119 -986783 -990743 -980135 -956729 -918575 -863715 -792647 -704403 -601825 -493337 -381356 -265659 -149399 -30175 97180 234673 383208 541700 705372 861633 987315 1061028 1075643 1028267 915273 741451 514117 242317 -59304 -378778 -699822 -997059 -1250658 -1451292 -1593963 -1676122 -1699778 -1672365 -1602672 -1496719 -1359348 -1195012 -1007510 -800546 -578823 -353461 -140339 48030 201830 315125 392760 441831 460213 447064 412703 368968 322881 282659 256122 246721 253761 271639 297172 327341 351218 357437 336216 278066 174463 17571 -195109 -459849 -763418 -1084914 -1402056 -1686382 -1908411 -2047080 -2087520 -2022335 -1851876 -1582992 -1232432 -825432 -391476 39919 441083 787326 1060115 1246429 1339644 1342348 1264681 1117743 914702 675051 414432 143169 -127512 -383814 -605738 -775612 -884021 -927596 -911839 -847697 -746527 -622039 -492679 -371661 -262937 -176272 -124031 -110352 -136931 -202415 -303136 -433870 -580419 -726876 -857191 -949554 -988715 -967509 -877424 -716580 -496516 -235160 47269 324185 564636 743368 842911 855953 787753 651200 464897 251035 31626 -171275 -337848 -458130 -528236 -548552 -533248 -501188 -461707 -422253 -399007 -403566 -433601 -485695 -554389 -627963 -692550 -734825 -748859 -734726 -690370 -616297 -522595 -422554 -330402 -255509 -195803 -151834 -127058 -114171 -99103 -65657 3597 115935 269055 457953 664990 861068 1013215 1085838 1054866 911043 647275 269023 -194320 -701922 -1201810 -1635513 -1954716 -2121836 -2116239 -1941530 -1623851 -1206770 -738854 -268743 152649 480454 684490 751097 686905 514317 266854 -10574 -272265 -480489 -605385 -629268 -548118 -371639 -126506 153780 432607 667835 826794 891724 851113 698566 441832 106500 -277238 -677207 -1051858 -1362380 -1579260 -1676813 -1641931 -1480715 -1214539 -874030 -495668 -119937 215861 478590 642368 692294 623874 452833 209359 -74435 -359162 -602172 -765377 -819270 -755880 -587938 -340039 -47950 246129 495226 660186 723174 673812 509209 246562 -81892 -431444 -753148 -1008003 -1167546 -1216734 -1158067 -1008683 -797873 -562520 -340786 -159632 -31995 29854 20637 -49295 -160825 -286032 -391299 -441753 -411333 -295227 -102801 142909 404506 642873 818916 895553 850304 682334 408317 57397 -333346 -724418 -1071728 -1331045 -1473276 -1489634 -1385499 -1180893 -911797 -615638 -324440 -71694 111789 214714 251644 239757 187227 112057 38350 -19435 -50407 -47694 -15043 38433 96868 142875 165310 149824 93463 9305 -99954 -233049 -377892 -523274 -658558 -773114 -861217 -918072 -939273 -926037 -883015 -817011 -735689 -640505 -528476 -395634 -238149 -56725 143513 349563 539268 692127 789847 813112 751653 609631 403314 155100 -113539 -377360 -601733 -760857 -846295 -853154 -788142 -673284 -532882 -392464 -278502 -211177 -200148 -246524 -345728 -487265 -650007 -806283 -928828 -989332 -966143 -853481 -656528 -388095 -72621 256505 562058 812112 982978 1053556 1014401 871441 644236 359982 42611 -278547 -574774 -832327 -1038395 -1178162 -1247259 -1254501 -1220814 -1164374 -1089443 -998332 -895346 -780719 -649840 -494302 -308977 -95952 142105 397456 648127 865434 1020357 1086812 1044635 884465 620010 278097 -110947 -502203 -842354 -1092584 -1237713 -1272082 -1197147 -1032237 -811896 -577133 -363647 -199688 -105781 -82290 -110667 -164941 -221323 -259684 -257902 -203633 -99804 44370 207062 353337 450601 474751 414059 270880 57547 -199682 -463831 -699598 -876720 -970310 -970115 -885267 -736024 -549855 -360201 -198703 -87899 -36545 -45057 -109233 -208672 -310949 -385921 -410203 -373687 -277942 -128917 57194 250768 420701 539158 581342 532594 392330 175394 -89993 -367900 -617820 -805197 -911565 -929151 -864474 -740685 -579476 -401707 -236258 -114053 -58485 -71582 -137659 -234029 -331210 -401292 -425551 -395385 -308224 -167575 5264 176216 313975 391869 389223 297350 124046 -104075 -343350 -547539 -683698 -731067 -682951 -553415 -372795 -179991 -15969 80366 80664 -19941 -204502 -442039 -685725 -880934 -985790 -974958 -836580 -582262 -248163 114518 449185 703832 834945 813793 636500 327879 -64039 -477167 -844360 -1107900 -1232596 -1208604 -1050864 -799925 -510611 -234005 -13418 120735 160671 116656 10942 -122241 -243444 -318613 -328624 -275242 -174721 -51495 60078 125628 122851 45514 -92119 -262027 -431919 -567126 -638879 -631007 -542546 -391756 -212681 -48128 60158 81848 5289 -157237 -375643 -609536 -809514 -925741 -923857 -794955 -555544 -243137 93106 399411 623111 723642 682230 509299 238772 -82515 -397883 -654241 -816927 -874816 -838546 -731457 -588269 -451784 -354032 -309441 -321215 -377656 -451038 -504964 -505064 -433582 -291516 -93405 132263 346966 507370 571125 511578 329466 52270 -271490 -581188 -820203 -948096 -943921 -811996 -580527 -293085 -2738 236243 378344 397511 291311 80518 -192877 -474047 -705616 -840939 -854269 -744699 -536501 -270847 3682 237578 389588 435135 370981 217257 8215 -220375 -431026 -592435 -692481 -728862 -705249 -640411 -558896 -481238 -423025 -388260 -368657 -346316 -298212 -210634 -83821 75740 253327 419141 535117 571188 510577 346474 89537 -227035 -559634 -860939 -1085673 -1206951 -1215816 -1114035 -919795 -665311 -384336 -109100 128424 304661 411754 454191 440665 384745 305774 216318 117025 5729 -119453 -262359 -425227 -603738 -783185 -939149 -1045136 -1080561 -1034064 -899140 -676131 -384434 -62035 244545 491350 645324 683721 600495 410930 143773 -162480 -460372 -703261 -860648 -920383 -885006 -774853 -618576 -440694 -263486 -103666 28559 125860 188699 223000 235368 228245 196762 138742 57208 -46064 -167866 -300181 -430288 -544271 -630929 -676458 -669290 -611714 -513396 -388736 -260544 -150047 -70568 -27982 -21842 -47792 -91883 -132022 -150579 -139083 -98011 -36330 30731 83716 101807 68433 -22775 -167366 -351368 -550588 -733308 -869083 -936465 -924721 -833671 -673643 -465106 -234809 -10402 180588 314635 378612 370696 296971 169664 8730 -163715 -329490 -472714 -580556 -645090 -662812 -634345 -565466 -467872 -353734 -230892 -109650 -4819 70208 102136 81996 11980 -96512 -228218 -367057 -492008 -578738 -607626 -570424 -472641 -327417 -152915 24555 173897 267736 289278 235735 115657 -54479 -249926 -441598 -602123 -708547 -746556 -714348 -620901 -484003 -328035 -175330 -42532 57095 116816 136679 124335 93205 50467 -3540 -69557 -150575 -250515 -368887 -497266 -620807 -723260 -792820 -820903 -798915 -723858 -599486 -435922 -254397 -78747 71269 174122 211638 177219 76848 -70796 -240332 -403151 -527670 -591618 -587146 -514947 -388052 -231737 -73484 60563 143968 155452 88813 -44755 -222470 -415315 -590464 -714862 -763687 -728137 -614599 -439787 -228736 -12980 174291 303785 354701 317872 197868 11126 -219717 -464917 -687040 -852408 -936101 -921897 -811054 -620873 -376361 -108660 148993 362209 496811 532689 469209 314266 83702 -190106 -462892 -692135 -847323 -909883 -868674 -725036 -497901 -220318 67112 324499 516151 612931 599765 476808 257106 -30820 -348683 -658775 -925972 -1120204 -1218683 -1207283 -1088972 -883485 -613984 -306363 5143 284806 503324 641939 692619 654258 534393 349473 118951 -136997 -396616 -639000 -845459 -998214 -1086271 -1107829 -1065286 -962759 -804999 -601339 -367812 -122258 117212 331621 501780 608749 635828 572738 422484 198726 -79070 -382858 -679024 -928914 -1093846 -1152331 -1101493 -947147 -707498 -414880 -106139 180702 409008 549350 584856 520658 379018 187028 -23675 -223383 -389573 -504704 -561240 -563253 -520959 -448734 -364848 -286841 -223176 -170489 -123572 -81976 -45501 -13632 14983 41515 61145 68450 58149 20234 -49156 -145700 -263602 -389281 -504088 -593108 -641732 -638740 -581263 -474148 -336499 -194696 -68604 24980 70323 60005 2746 -82991 -180952 -275547 -352772 -402938 -420303 -405312 -363955 -304996 -236642 -170478 -122747 -97815 -91489 -108837 -154218 -224961 -316230 -415697 -509092 -587934 -643387 -665552 -644834 -574738 -459521 -309397 -137829 33267 174961 259917 274249 217068 95010 -76075 -272196 -466077 -629099 -732398 -755285 -692609 -555577 -368545 -163002 27602 174838 257503 264232 198819 76541 -80906 -248240 -399111 -509387 -561127 -550089 -487021 -386920 -268374 -152350 -55915 8017 35015 28067 -9565 -71961 -146622 iris-edu-libmseed-4314359/test/read-SRO-encoded.test000077500000000000000000000001361422047135100220500ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/SRO-encoded.mseed -D iris-edu-libmseed-4314359/test/read-SRO-encoded.test.ref000066400000000000000000000572271422047135100226350ustar00rootroot00000000000000XX_TEST__LHE, 000001, M, 4096, 1984 samples, 1 Hz, 1974,360,00:00:00.500000 39 42 32 1 -38 -86 -140 -173 -160 -120 -69 -26 13 45 63 69 56 27 1 -25 -48 -65 -77 -93 -101 -115 -136 -140 -119 -79 -42 -1 27 21 -1 -17 -32 -26 -18 -5 2 -10 -42 -95 -156 -199 -215 -211 -178 -110 -52 -21 -29 -45 -64 -64 -26 26 55 49 3 -82 -181 -255 -268 -221 -139 -53 19 60 70 71 69 83 106 133 144 132 84 17 -56 -129 -182 -208 -197 -167 -138 -112 -84 -73 -82 -91 -73 -21 44 113 153 140 83 -1 -89 -145 -165 -148 -121 -124 -149 -154 -135 -91 -15 68 111 95 35 -54 -132 -167 -173 -160 -132 -115 -115 -132 -133 -104 -75 -43 -2 37 37 12 -34 -79 -113 -143 -147 -129 -104 -82 -61 -45 -41 -28 -3 26 53 72 54 15 -16 -32 -42 -23 9 19 -8 -73 -145 -196 -215 -213 -191 -162 -142 -129 -116 -77 -18 40 81 81 38 -32 -114 -186 -225 -227 -204 -162 -114 -87 -65 -45 -6 49 115 170 204 219 191 103 -3 -94 -148 -154 -121 -79 -40 -22 -27 -35 -35 -15 12 46 68 72 51 17 -22 -43 -53 -48 -42 -35 -30 -26 -31 -28 -17 7 26 48 64 63 45 8 -40 -87 -112 -132 -144 -132 -116 -107 -110 -105 -93 -65 -8 53 102 109 84 33 -37 -96 -125 -138 -141 -133 -131 -131 -142 -144 -124 -86 -41 10 43 49 30 -7 -64 -141 -212 -245 -244 -219 -156 -76 -15 16 23 15 -9 -31 -22 -11 -41 -99 -134 -146 -142 -103 -37 33 78 75 37 -20 -66 -88 -90 -88 -77 -60 -40 -17 -16 -13 -5 15 40 73 106 119 102 77 51 31 39 66 82 68 24 -48 -119 -153 -147 -104 -50 -25 -35 -74 -121 -153 -158 -120 -59 -10 6 -1 -20 -32 -32 -24 -18 -12 -30 -83 -143 -200 -253 -274 -256 -207 -165 -126 -88 -58 -44 -65 -100 -135 -158 -159 -137 -108 -86 -71 -78 -111 -154 -175 -159 -144 -128 -108 -75 -43 -17 6 35 62 72 54 11 -49 -121 -202 -274 -294 -254 -182 -99 -16 40 52 44 42 52 68 93 98 55 -25 -114 -191 -235 -232 -190 -139 -89 -57 -29 13 63 133 209 268 279 236 134 3 -130 -244 -319 -353 -342 -292 -214 -125 -53 -1 39 87 115 118 116 109 75 10 -67 -142 -205 -256 -261 -240 -205 -164 -125 -100 -89 -82 -65 -41 -25 -26 -48 -89 -143 -197 -238 -254 -243 -208 -177 -146 -120 -91 -56 -12 33 63 61 31 -18 -78 -125 -138 -127 -98 -68 -51 -51 -50 -46 -52 -63 -84 -116 -149 -183 -210 -216 -200 -166 -141 -136 -129 -113 -91 -73 -56 -24 17 57 80 82 64 39 8 -16 -35 -54 -56 -43 -16 2 25 68 122 159 164 156 135 88 23 -27 -39 -39 -23 -1 18 21 13 -4 -8 13 43 64 83 74 38 -12 -66 -92 -82 -43 15 81 123 133 112 67 23 -3 -14 -35 -68 -109 -167 -219 -242 -252 -228 -166 -93 -27 15 45 78 94 77 39 -10 -68 -116 -142 -142 -127 -98 -78 -72 -74 -80 -68 -40 8 48 75 80 66 20 -48 -113 -170 -208 -207 -177 -123 -66 3 60 105 137 156 148 106 27 -82 -188 -274 -321 -305 -230 -130 -32 60 123 136 111 61 13 -28 -60 -80 -103 -137 -176 -218 -245 -245 -205 -148 -94 -46 -1 41 67 93 109 101 53 -16 -92 -159 -189 -177 -152 -125 -110 -120 -131 -125 -100 -81 -83 -97 -109 -135 -161 -161 -135 -95 -62 -44 -46 -62 -69 -80 -87 -89 -85 -79 -63 -63 -72 -70 -52 -24 1 25 39 31 -6 -40 -50 -37 -22 13 49 62 44 18 -6 -25 -42 -59 -76 -93 -102 -69 -22 33 87 119 101 51 -12 -76 -126 -148 -140 -124 -108 -83 -57 -31 3 57 96 112 89 36 -33 -103 -153 -157 -120 -74 -28 11 22 13 7 9 21 19 -9 -47 -97 -148 -196 -215 -199 -155 -110 -68 -44 -47 -49 -39 -38 -42 -53 -76 -100 -128 -139 -123 -84 -32 8 22 9 0 -15 -39 -64 -88 -105 -108 -109 -106 -82 -56 -29 -8 7 8 3 -11 -19 -36 -59 -82 -101 -115 -118 -124 -127 -110 -83 -57 -21 10 34 40 43 37 32 34 44 45 33 -5 -65 -118 -149 -165 -181 -168 -128 -97 -76 -59 -40 -24 -5 28 65 81 51 -7 -89 -177 -249 -272 -253 -191 -123 -73 -47 -47 -51 -40 -34 -25 -13 -22 -43 -66 -84 -89 -72 -32 -1 22 25 21 15 8 -2 -21 -62 -122 -185 -232 -250 -224 -161 -78 1 46 51 16 -32 -71 -97 -113 -115 -114 -115 -117 -118 -98 -50 20 88 124 109 58 -13 -89 -153 -181 -167 -126 -82 -41 1 42 73 96 113 108 77 18 -71 -155 -217 -251 -238 -192 -148 -102 -46 -8 -1 10 29 43 26 -23 -77 -121 -157 -169 -153 -124 -93 -71 -65 -79 -98 -115 -121 -105 -77 -53 -21 0 3 -3 -16 -32 -57 -84 -111 -118 -104 -89 -76 -58 -44 -55 -88 -128 -157 -169 -172 -163 -136 -99 -60 -19 12 41 67 78 55 18 -23 -71 -129 -194 -231 -228 -178 -91 15 120 204 234 194 109 14 -69 -122 -162 -189 -195 -204 -209 -186 -115 -19 69 139 178 168 111 27 -48 -110 -158 -194 -207 -205 -186 -153 -102 -38 19 74 129 156 131 73 -1 -81 -160 -218 -228 -201 -175 -161 -162 -154 -127 -87 -35 29 77 88 67 26 -28 -70 -98 -113 -123 -141 -152 -149 -130 -86 -37 15 57 68 49 16 -26 -71 -111 -138 -166 -169 -141 -93 -43 5 30 31 12 -7 -15 -20 -13 -2 -8 -42 -81 -99 -104 -95 -72 -50 -23 -5 10 17 4 -9 -41 -80 -115 -142 -156 -144 -121 -116 -123 -135 -141 -125 -76 -11 45 94 122 112 76 37 3 -25 -49 -64 -89 -127 -158 -163 -139 -98 -48 9 52 67 59 25 -27 -70 -112 -145 -165 -168 -147 -118 -77 -39 -5 31 49 47 49 38 -9 -79 -132 -166 -187 -183 -167 -143 -123 -110 -106 -106 -101 -95 -68 -30 12 33 45 45 17 -32 -81 -118 -134 -125 -88 -57 -36 -29 -21 -14 -13 0 27 29 -1 -41 -102 -162 -188 -164 -104 -40 11 49 51 22 -9 -17 -10 -4 -7 -22 -56 -97 -138 -145 -116 -74 -31 17 55 67 56 36 9 -29 -72 -113 -151 -184 -200 -194 -176 -153 -108 -36 34 85 124 150 141 91 14 -55 -113 -150 -168 -166 -146 -109 -64 -30 -2 20 28 0 -49 -100 -144 -164 -174 -171 -172 -174 -164 -144 -110 -60 -4 45 86 105 97 85 73 55 27 -18 -70 -116 -146 -152 -149 -132 -101 -56 7 71 133 185 216 207 142 62 -17 -91 -141 -153 -138 -115 -96 -95 -86 -63 -36 2 59 121 145 119 60 -2 -67 -112 -130 -106 -74 -55 -57 -64 -56 -41 -21 9 29 42 44 36 21 3 -1 23 34 31 3 -25 -49 -76 -114 -124 -111 -86 -56 -30 -15 -17 -31 -34 -43 -57 -60 -58 -71 -101 -122 -126 -120 -112 -101 -72 -48 -52 -67 -68 -62 -60 -67 -56 -24 16 39 46 32 -20 -90 -175 -258 -304 -300 -269 -218 -153 -90 -45 -10 35 81 105 104 68 3 -84 -181 -241 -245 -217 -184 -145 -102 -65 -42 -21 -2 18 24 31 38 32 21 11 -18 -57 -99 -123 -140 -152 -145 -147 -162 -166 -155 -119 -58 7 58 92 91 64 39 15 -4 -13 -19 -29 -52 -72 -100 -121 -120 -111 -81 -46 -8 16 21 1 -36 -72 -87 -74 -34 3 20 -3 -57 -121 -174 -202 -200 -157 -95 -43 -8 12 28 30 30 42 54 47 24 -12 -54 -113 -161 -172 -149 -100 -46 -11 -1 -10 -39 -91 -134 -135 -124 -120 -114 -97 -86 -84 -80 -66 -39 -6 13 25 31 20 -17 -61 -96 -113 -102 -74 -36 -11 -11 -48 -95 -129 -131 -101 -47 15 55 59 19 -30 -45 -34 -12 15 24 3 -57 -130 -180 -192 -153 -84 -12 33 45 39 1 -48 -97 -140 -166 -165 -147 -128 -121 -119 -109 -99 -82 -54 -1 63 108 103 47 -35 -112 -171 -200 -167 -94 -8 66 103 106 72 28 1 2 7 9 -12 -63 -124 -184 -232 -245 -206 -126 -53 -10 -1 -19 -56 -110 -153 -182 -197 -193 -198 -220 -240 -244 -232 -207 -160 -74 3 57 90 102 79 37 -3 -37 -70 -93 -111 -119 -113 -102 -80 -54 -44 -57 -76 -85 -85 -75 -47 -22 -1 24 32 25 14 5 -18 -59 -104 -133 -128 -98 -46 15 62 79 64 28 -21 -63 -78 -67 -60 -74 -92 -112 -127 -113 -82 -48 -10 -6 -29 -76 -132 -192 -234 -237 -193 -123 -50 22 87 120 120 98 79 75 69 32 -31 -111 -198 -261 -276 -244 -168 -91 -35 4 19 9 -5 -9 -24 -73 -111 -119 -112 -88 -26 44 99 123 99 60 19 -10 -45 -65 -90 -148 -217 -258 -256 -213 -124 10 136 198 180 110 25 -61 -122 -166 -184 -187 -181 -183 -165 -113 -41 25 70 116 151 150 135 105 45 -33 -120 -195 -216 -184 -136 -87 -45 -24 -34 -61 -98 -124 -133 -116 -97 -84 -79 -88 -107 -147 -196 -233 -247 -238 -200 -140 -77 -23 30 71 80 72 57 41 30 21 8 -9 -25 -26 -10 20 58 95 112 86 15 -84 -168 -206 -181 -130 -67 -3 42 44 18 -3 -3 27 56 74 82 59 10 -45 -83 -115 -128 -110 -78 -52 -33 -18 -20 -38 -61 -72 -73 -65 -56 -59 -75 -104 -152 -187 -198 -193 -169 -142 -126 -128 -145 -158 -145 -106 -49 11 56 70 53 19 -25 -54 -80 -99 -115 -127 -144 -162 -162 -150 -123 -76 -27 16 51 77 81 60 27 4 -17 -37 -68 -110 -155 -189 -190 -153 -97 -35 17 44 29 -9 -42 -63 -68 -61 -61 -76 -80 -71 -58 -46 -33 -18 -20 -30 -34 -48 -73 -90 -101 -116 -122 -104 -79 -52 -37 -32 -25 -20 -22 -27 -17 -1 1 -4 -14 -36 -86 -140 -165 -179 -177 -138 -62 15 59 65 38 -15 -59 -86 -79 -37 21 53 51 23 -18 -39 -35 -17 -5 -5 -36 -104 -174 -218 -228 -204 -156 -102 -49 2 44 67 83 99 104 85 40 -25 -95 -155 -200 -226 -215 -169 -120 -85 -72 -59 -36 -6 23 47 61 61 39 -2 -37 -36 -8 28 47 59 50 16 -24 -71 -108 -119 -98 -72 -60 -54 -56 -74 -83 -76 -43 6 57 102 110 65 -5 -88 -168 -230 -254 -242 -216 -187 -154 -131 -129 -129 -117 -95 -77 -44 2 28 33 23 -4 -31 -51 -57 -55 -45 -31 -26 -36 iris-edu-libmseed-4314359/test/read-Steim1-bigendian.test000077500000000000000000000001531422047135100230650ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Steim1-AllDifferences-BE.mseed -D iris-edu-libmseed-4314359/test/read-Steim1-bigendian.test.ref000066400000000000000000000167611422047135100236510ustar00rootroot00000000000000XX_TEST__BHZ, 000001, D, 4096, 623 samples, 20.00022125 Hz, 1990,337,23:59:28.872500 2757 3299 3030 2326 2472 3201 3280 2753 2305 2371 3077 3287 2313 1828 2649 3199 2685 2127 2365 2810 2631 2261 2296 2325 2127 2134 2092 1599 1324 1535 1449 986 777 828 687 317 63 -30 -223 -545 -817 -962 -1070 -1279 -1509 -1589 -1566 -1563 -1565 -1433 -1091 -719 -457 -181 199 610 954 1249 1520 1763 2132 2607 2856 2856 3041 3548 3918 3861 3732 3946 4312 4293 3951 3861 4088 4217 4129 4140 4376 4532 4547 4636 4702 4692 4793 4864 4709 4581 4564 4408 4193 4081 3884 3521 3213 3044 2819 2467 2207 2147 2120 2017 1934 1936 1927 1854 1809 1806 1730 1548 1427 1522 1657 1531 1310 1383 1611 1683 1640 1520 1421 1532 1633 1569 1630 1825 1799 1562 1524 1728 1744 1499 1345 1330 1230 1073 978 860 749 878 1146 1237 1262 1469 1718 1818 1891 2047 2217 2357 2375 2245 2133 2202 2515 2583 1976 1594 1935 1901 1376 1304 1370 1060 909 1106 1194 1142 1236 1424 1532 1668 1973 2236 2189 2088 2249 2517 2610 2417 2214 2313 2442 2333 2241 2347 2360 2086 1989 2338 2521 2220 2080 2519 2977 2783 2286 2436 3208 3471 2743 2136 2740 3707 3546 2543 2253 3119 3750 3047 1947 1997 2949 3095 2147 1566 1854 2310 2438 1959 1185 1281 2281 2409 1245 746 1735 2522 1972 1285 1667 2293 2076 1531 1406 1375 1142 973 849 628 552 750 972 1069 1193 1413 1585 1696 1829 1916 1870 1765 1735 1760 1618 1210 857 887 1101 1064 743 599 909 1309 1373 1286 1504 2010 2355 2374 2372 2597 2897 2974 2834 2736 2759 2805 2733 2433 2111 2071 2183 2062 1760 1692 1858 1920 1844 1848 2015 2235 2380 2442 2536 2677 2778 2835 2865 2838 2758 2677 2569 2395 2226 2129 2075 1980 1860 1870 1962 2005 2116 2311 2448 2612 2896 3178 3413 3602 3728 3885 4074 4136 4049 3948 3902 3786 3505 3229 3068 2879 2631 2440 2352 2355 2371 2367 2435 2563 2661 2680 2615 2552 2479 2294 2067 1833 1541 1241 965 693 444 242 117 70 55 50 48 46 75 149 222 281 346 421 504 591 675 721 791 997 1229 1339 1434 1628 1821 1893 1914 2002 2127 2183 2159 2179 2303 2404 2416 2472 2609 2698 2706 2751 2928 3115 3148 3118 3173 3244 3215 3152 3131 3078 2974 2915 2890 2844 2801 2770 2733 2682 2606 2501 2398 2339 2336 2371 2420 2411 2352 2352 2366 2289 2188 2140 2112 2051 2020 2026 1899 1695 1583 1457 1292 1188 1081 980 994 1025 1022 1132 1293 1365 1487 1777 2055 2146 2215 2382 2462 2484 2601 2610 2437 2327 2325 2282 2161 2052 1982 1897 1859 1878 1792 1676 1700 1668 1471 1331 1307 1270 1176 1088 1063 1074 1087 1097 1067 1004 980 978 958 975 1012 1056 1154 1239 1289 1418 1609 1765 1917 2071 2185 2300 2394 2435 2493 2572 2656 2748 2819 2877 2969 3063 3079 3067 3109 3128 3103 3144 3197 3180 3173 3211 3264 3312 3348 3404 3468 3475 3472 3463 3343 3149 2974 2816 2629 2425 2253 2104 1971 1875 1815 1788 1818 1905 1958 1989 2082 2173 2224 2261 2250 2238 2245 2205 2165 2119 2002 1900 1858 1799 1690 1521 1332 1182 1027 852 721 652 614 611 653 690 764 932 1077 1162 1305 1498 1648 1733 1763 1777 1805 1821 1806 1804 1864 1923 1872 1779 1769 1801 1802 1761 1733 1735 1718 1715 1732 1736 1807 1947 2050 2157 2316 2423 2451 2489 2563 2663 2745 2800 2935 3129 3263 3384 3531 3637 3721 3807 3794 3659 3570 3546 3414 3220 3131 3091 2980 2860 2876 iris-edu-libmseed-4314359/test/read-Steim1-littleendian.test000077500000000000000000000001531422047135100236210ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Steim1-AllDifferences-LE.mseed -D iris-edu-libmseed-4314359/test/read-Steim1-littleendian.test.ref000066400000000000000000000167611422047135100244050ustar00rootroot00000000000000XX_TEST__BHZ, 000001, D, 4096, 623 samples, 20.00022125 Hz, 1990,337,23:59:28.872500 2757 3299 3030 2326 2472 3201 3280 2753 2305 2371 3077 3287 2313 1828 2649 3199 2685 2127 2365 2810 2631 2261 2296 2325 2127 2134 2092 1599 1324 1535 1449 986 777 828 687 317 63 -30 -223 -545 -817 -962 -1070 -1279 -1509 -1589 -1566 -1563 -1565 -1433 -1091 -719 -457 -181 199 610 954 1249 1520 1763 2132 2607 2856 2856 3041 3548 3918 3861 3732 3946 4312 4293 3951 3861 4088 4217 4129 4140 4376 4532 4547 4636 4702 4692 4793 4864 4709 4581 4564 4408 4193 4081 3884 3521 3213 3044 2819 2467 2207 2147 2120 2017 1934 1936 1927 1854 1809 1806 1730 1548 1427 1522 1657 1531 1310 1383 1611 1683 1640 1520 1421 1532 1633 1569 1630 1825 1799 1562 1524 1728 1744 1499 1345 1330 1230 1073 978 860 749 878 1146 1237 1262 1469 1718 1818 1891 2047 2217 2357 2375 2245 2133 2202 2515 2583 1976 1594 1935 1901 1376 1304 1370 1060 909 1106 1194 1142 1236 1424 1532 1668 1973 2236 2189 2088 2249 2517 2610 2417 2214 2313 2442 2333 2241 2347 2360 2086 1989 2338 2521 2220 2080 2519 2977 2783 2286 2436 3208 3471 2743 2136 2740 3707 3546 2543 2253 3119 3750 3047 1947 1997 2949 3095 2147 1566 1854 2310 2438 1959 1185 1281 2281 2409 1245 746 1735 2522 1972 1285 1667 2293 2076 1531 1406 1375 1142 973 849 628 552 750 972 1069 1193 1413 1585 1696 1829 1916 1870 1765 1735 1760 1618 1210 857 887 1101 1064 743 599 909 1309 1373 1286 1504 2010 2355 2374 2372 2597 2897 2974 2834 2736 2759 2805 2733 2433 2111 2071 2183 2062 1760 1692 1858 1920 1844 1848 2015 2235 2380 2442 2536 2677 2778 2835 2865 2838 2758 2677 2569 2395 2226 2129 2075 1980 1860 1870 1962 2005 2116 2311 2448 2612 2896 3178 3413 3602 3728 3885 4074 4136 4049 3948 3902 3786 3505 3229 3068 2879 2631 2440 2352 2355 2371 2367 2435 2563 2661 2680 2615 2552 2479 2294 2067 1833 1541 1241 965 693 444 242 117 70 55 50 48 46 75 149 222 281 346 421 504 591 675 721 791 997 1229 1339 1434 1628 1821 1893 1914 2002 2127 2183 2159 2179 2303 2404 2416 2472 2609 2698 2706 2751 2928 3115 3148 3118 3173 3244 3215 3152 3131 3078 2974 2915 2890 2844 2801 2770 2733 2682 2606 2501 2398 2339 2336 2371 2420 2411 2352 2352 2366 2289 2188 2140 2112 2051 2020 2026 1899 1695 1583 1457 1292 1188 1081 980 994 1025 1022 1132 1293 1365 1487 1777 2055 2146 2215 2382 2462 2484 2601 2610 2437 2327 2325 2282 2161 2052 1982 1897 1859 1878 1792 1676 1700 1668 1471 1331 1307 1270 1176 1088 1063 1074 1087 1097 1067 1004 980 978 958 975 1012 1056 1154 1239 1289 1418 1609 1765 1917 2071 2185 2300 2394 2435 2493 2572 2656 2748 2819 2877 2969 3063 3079 3067 3109 3128 3103 3144 3197 3180 3173 3211 3264 3312 3348 3404 3468 3475 3472 3463 3343 3149 2974 2816 2629 2425 2253 2104 1971 1875 1815 1788 1818 1905 1958 1989 2082 2173 2224 2261 2250 2238 2245 2205 2165 2119 2002 1900 1858 1799 1690 1521 1332 1182 1027 852 721 652 614 611 653 690 764 932 1077 1162 1305 1498 1648 1733 1763 1777 1805 1821 1806 1804 1864 1923 1872 1779 1769 1801 1802 1761 1733 1735 1718 1715 1732 1736 1807 1947 2050 2157 2316 2423 2451 2489 2563 2663 2745 2800 2935 3129 3263 3384 3531 3637 3721 3807 3794 3659 3570 3546 3414 3220 3131 3091 2980 2860 2876 iris-edu-libmseed-4314359/test/read-Steim2-bigendian.test000077500000000000000000000001531422047135100230660ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Steim2-AllDifferences-BE.mseed -D iris-edu-libmseed-4314359/test/read-Steim2-bigendian.test.ref000066400000000000000000001115611422047135100236440ustar00rootroot00000000000000XX_TEST__LHZ, 000001, R, 4096, 3096 samples, 1 Hz, 2016,062,12:36:06.069538 -10780 -10779 -10782 -10783 -10781 -10781 -10781 -10779 -10778 -10777 -10776 -10774 -10776 -10775 -10772 -10774 -10772 -10771 -10774 -10772 -10768 -10765 -10766 -10768 -10766 -10766 -10764 -10764 -10766 -10764 -10763 -10763 -10761 -10763 -10762 -10761 -10762 -10760 -10762 -10766 -10764 -10762 -10763 -10762 -10758 -10760 -10761 -10755 -10752 -10757 -10757 -10753 -10753 -10755 -10753 -10754 -10755 -10756 -10755 -10751 -10752 -10755 -10751 -10751 -10751 -10749 -10748 -10747 -10750 -10747 -10744 -10747 -10748 -10747 -10745 -10747 -10747 -10743 -10743 -10742 -10741 -10742 -10738 -10738 -10737 -10738 -10738 -10733 -10735 -10737 -10733 -10735 -10735 -10735 -10734 -10731 -10734 -10733 -10730 -10730 -10730 -10729 -10728 -10727 -10727 -10726 -10727 -10729 -10728 -10727 -10726 -10726 -10726 -10721 -10723 -10725 -10720 -10725 -10726 -10723 -10724 -10722 -10722 -10723 -10719 -10718 -10717 -10714 -10715 -10714 -10711 -10711 -10713 -10712 -10709 -10711 -10712 -10710 -10711 -10711 -10709 -10710 -10711 -10708 -10706 -10709 -10707 -10705 -10707 -10707 -10708 -10706 -10705 -10706 -10701 -10701 -10705 -10702 -10700 -10701 -10701 -10700 -10696 -10697 -10698 -10693 -10691 -10694 -10693 -10691 -10689 -10690 -10694 -10690 -10686 -10690 -10692 -10690 -10690 -10693 -10692 -10685 -10688 -10693 -10684 -10680 -10688 -10685 -10680 -10685 -10687 -10684 -10685 -10687 -10685 -10682 -10684 -10686 -10681 -10676 -10679 -10682 -10677 -10676 -10677 -10675 -10674 -10677 -10681 -10677 -10674 -10679 -10677 -10674 -10673 -10671 -10671 -10673 -10673 -10669 -10668 -10670 -10670 -10670 -10668 -10669 -10670 -10668 -10667 -10668 -10664 -10661 -10665 -10665 -10660 -10659 -10662 -10663 -10660 -10659 -10661 -10660 -10659 -10662 -10660 -10656 -10661 -10662 -10656 -10656 -10659 -10658 -10653 -10655 -10657 -10653 -10652 -10655 -10657 -10654 -10652 -10656 -10654 -10649 -10652 -10653 -10651 -10651 -10649 -10647 -10647 -10648 -10649 -10648 -10651 -10651 -10644 -10645 -10651 -10648 -10647 -10647 -10646 -10645 -10647 -10648 -10645 -10643 -10643 -10640 -10637 -10639 -10639 -10635 -10635 -10639 -10637 -10636 -10637 -10635 -10636 -10638 -10636 -10634 -10635 -10632 -10630 -10630 -10630 -10630 -10629 -10629 -10626 -10628 -10631 -10627 -10626 -10628 -10627 -10625 -10624 -10625 -10625 -10623 -10624 -10622 -10622 -10624 -10621 -10618 -10618 -10616 -10618 -10618 -10614 -10613 -10614 -10614 -10613 -10612 -10612 -10610 -10609 -10609 -10608 -10608 -10610 -10608 -10607 -10609 -10609 -10606 -10606 -10608 -10608 -10607 -10604 -10605 -10608 -10603 -10604 -10602 -10597 -10603 -10602 -10595 -10598 -10604 -10601 -10596 -10597 -10601 -10599 -10595 -10598 -10598 -10594 -10594 -10597 -10596 -10595 -10597 -10595 -10591 -10594 -10595 -10590 -10588 -10592 -10592 -10589 -10590 -10590 -10591 -10590 -10590 -10593 -10589 -10585 -10589 -10589 -10584 -10585 -10588 -10586 -10581 -10582 -10584 -10580 -10580 -10583 -10581 -10580 -10578 -10578 -10581 -10579 -10575 -10576 -10577 -10574 -10571 -10574 -10575 -10572 -10572 -10576 -10573 -10567 -10570 -10570 -10566 -10568 -10565 -10564 -10567 -10566 -10563 -10565 -10568 -10566 -10564 -10563 -10562 -10563 -10563 -10561 -10563 -10560 -10559 -10561 -10556 -10554 -10559 -10558 -10555 -10557 -10558 -10554 -10555 -10557 -10552 -10551 -10555 -10555 -10551 -10555 -10557 -10551 -10551 -10553 -10552 -10549 -10551 -10552 -10549 -10548 -10551 -10549 -10545 -10548 -10549 -10546 -10547 -10550 -10549 -10543 -10543 -10547 -10542 -10539 -10546 -10545 -10540 -10540 -10541 -10537 -10536 -10539 -10539 -10537 -10537 -10537 -10537 -10537 -10536 -10532 -10532 -10536 -10533 -10528 -10533 -10534 -10528 -10528 -10533 -10533 -10530 -10528 -10529 -10529 -10525 -10522 -10526 -10527 -10522 -10521 -10524 -10524 -10521 -10521 -10525 -10519 -10515 -10523 -10522 -10517 -10519 -10521 -10521 -10518 -10518 -10520 -10516 -10516 -10522 -10520 -10517 -10519 -10518 -10516 -10515 -10516 -10513 -10512 -10514 -10512 -10514 -10513 -10510 -10516 -10516 -10510 -10509 -10513 -10510 -10506 -10508 -10507 -10504 -10506 -10505 -10501 -10501 -10502 -10499 -10501 -10502 -10499 -10498 -10498 -10497 -10497 -10499 -10499 -10496 -10498 -10499 -10496 -10496 -10498 -10498 -10497 -10496 -10495 -10496 -10495 -10493 -10495 -10495 -10493 -10492 -10490 -10491 -10492 -10489 -10488 -10490 -10488 -10486 -10487 -10484 -10486 -10485 -10481 -10483 -10481 -10479 -10481 -10480 -10479 -10481 -10478 -10478 -10480 -10478 -10477 -10477 -10479 -10477 -10475 -10477 -10476 -10476 -10477 -10476 -10474 -10470 -10470 -10471 -10468 -10464 -10466 -10471 -10468 -10466 -10471 -10470 -10463 -10464 -10470 -10470 -10463 -10462 -10466 -10463 -10462 -10463 -10463 -10461 -10459 -10464 -10463 -10457 -10461 -10461 -10457 -10461 -10462 -10456 -10458 -10463 -10457 -10455 -10461 -10461 -10454 -10455 -10459 -10454 -10451 -10454 -10457 -10456 -10451 -10454 -10455 -10453 -10454 -10454 -10454 -10453 -10453 -10453 -10451 -10450 -10451 -10449 -10447 -10446 -10445 -10443 -10445 -10447 -10442 -10439 -10443 -10443 -10439 -10438 -10439 -10440 -10438 -10436 -10435 -10436 -10440 -10439 -10436 -10438 -10438 -10435 -10434 -10434 -10433 -10431 -10432 -10431 -10426 -10427 -10432 -10429 -10424 -10428 -10430 -10425 -10423 -10426 -10426 -10423 -10424 -10423 -10420 -10421 -10421 -10419 -10420 -10422 -10421 -10418 -10420 -10420 -10416 -10418 -10419 -10418 -10417 -10415 -10413 -10413 -10416 -10416 -10413 -10412 -10411 -10408 -10410 -10415 -10413 -10409 -10408 -10410 -10406 -10403 -10406 -10405 -10401 -10403 -10405 -10403 -10402 -10404 -10404 -10402 -10403 -10405 -10403 -10402 -10401 -10403 -10401 -10400 -10402 -10398 -10399 -10399 -10396 -10398 -10400 -10398 -10398 -10399 -10398 -10395 -10395 -10395 -10394 -10395 -10394 -10393 -10392 -10391 -10392 -10390 -10387 -10389 -10388 -10383 -10385 -10389 -10384 -10383 -10387 -10382 -10377 -10382 -10384 -10378 -10379 -10381 -10378 -10377 -10378 -10377 -10377 -10375 -10376 -10377 -10374 -10376 -10377 -10373 -10376 -10378 -10374 -10372 -10373 -10375 -10375 -10375 -10374 -10372 -10373 -10373 -10371 -10371 -10372 -10368 -10366 -10367 -10363 -10362 -10366 -10364 -10359 -10362 -10365 -10361 -10362 -10366 -10365 -10361 -10362 -10363 -10360 -10358 -10360 -10358 -10355 -10356 -10358 -10356 -10353 -10356 -10354 -10353 -10356 -10352 -10350 -10350 -10352 -10352 -10350 -10349 -10351 -10349 -10349 -10352 -10351 -10350 -10349 -10348 -10351 -10347 -10342 -10348 -10348 -10341 -10342 -10347 -10345 -10342 -10343 -10344 -10343 -10338 -10339 -10343 -10339 -10334 -10338 -10342 -10339 -10335 -10334 -10343 -10327 -10298 -10336 -10317 -10263 -10300 -10291 -10268 -10319 -10302 -10247 -10327 -10264 -10206 -10267 -10072 -10143 -10325 -10213 -10378 -10713 -10725 -10793 -11084 -10919 -10599 -10628 -10318 -9770 -9886 -9864 -9531 -9993 -10473 -10391 -10591 -10850 -10492 -10336 -10310 -9802 -9782 -10105 -10087 -10336 -10867 -10899 -10730 -10883 -10623 -9973 -9925 -9913 -9582 -9881 -10118 -10246 -10812 -10831 -10822 -10813 -10545 -10291 -9869 -9966 -9986 -9904 -10193 -10401 -10485 -10321 -10507 -10616 -10356 -10491 -10556 -10278 -10001 -10091 -9964 -10032 -10315 -10175 -10748 -10746 -10247 -10635 -11201 -10600 -9376 -9977 -10272 -9393 -9956 -11159 -10513 -10002 -11648 -12045 -10467 -10277 -10748 -8569 -7693 -9365 -8484 -7257 -8609 -10074 -10843 -12659 -15516 -16785 -15251 -13967 -12585 -8092 -3214 -1429 -1066 -1650 -7261 -11979 -17105 -22930 -20483 -20365 -14187 -3839 -1833 4001 2611 -3992 -10685 -20509 -24390 -25678 -19783 -11049 -3305 5018 3852 -1333 -8150 -20120 -24824 -21106 -17111 -5702 2170 -124 -678 -8673 -18329 -18995 -20536 -18197 -7414 -1955 -897 -711 -10679 -19294 -20331 -18416 -9124 -715 -126 -3860 -10864 -17394 -17835 -14648 -10044 -6159 -7018 -10109 -11541 -10703 -9393 -8837 -9983 -10613 -13572 -14675 -7797 -5465 -5932 -7109 -12561 -13709 -13122 -14120 -13031 -10469 -7988 -10732 50000 70000 -11856 -16163 -15418 -8923 -4570 -5851 -10209 -15227 -15128 -11056 -8548 -6905 -8118 -11024 -11159 -10140 -9856 -9890 -12082 -12865 -9140 -7173 -8279 -10098 -12740 -12752 -10194 -10014 -9020 -8242 -12070 -11886 -8202 -9177 -9633 -9548 -12777 -12480 -9855 -9541 -7653 -8164 -12603 -12205 -10939 -12048 -9456 -8194 -8216 -7513 -10801 -13470 -13410 -10075 -7001 -8853 -9609 -12803 -13986 -8623 -8209 -8699 -9266 -12043 -12100 -10332 -8163 -9213 -10055 -10164 -11968 -11454 -10960 -10701 -9554 -8712 -8664 -9438 -10332 -11440 -10962 -10604 -10846 -9890 -10880 -10987 -8086 -8050 -9701 -11349 -13557 -11918 -8944 -8338 -8882 -10246 -10108 -9262 -9600 -11435 -13319 -11678 -8805 -8648 -10560 -11405 -10046 -7870 -7446 -9729 -12269 -13701 -12123 -9193 -8668 -9178 -9542 -9801 -9900 -10806 -12096 -10934 -9721 -9655 -8704 -9735 -11010 -11012 -10239 -8716 -9277 -11451 -12830 -10759 -8668 -9046 -9876 -12047 -10766 -7746 -7991 -9146 -11817 -13436 -11990 -10038 -9001 -9099 -9313 -9973 -10600 -10786 -11149 -9656 -8218 -9416 -10181 -11365 -12122 -10421 -10372 -10143 -9323 -10636 -9662 -8544 -10203 -9834 -10112 -11951 -10770 -10317 -10637 -9339 -9867 -10202 -9382 -10428 -11260 -10459 -9155 -8530 -9813 -11510 -12039 -11433 -9395 -7658 -8622 -10572 -11372 -11415 -11258 -11307 -10852 -9047 -7551 -7974 -9693 -11360 -11560 -10631 -10259 -10138 -10342 -11235 -10896 -10137 -10281 -9418 -8656 -8874 -8315 -9156 -11769 -12864 -12807 -11711 -9261 -8226 -8509 -8568 -10089 -11742 -11302 -10854 -10138 -9049 -9126 -8868 -9099 -11008 -12384 -12281 -11048 -9579 -8936 -9316 -10076 -9788 -8969 -9109 -10369 -12058 -11883 -9761 -8928 -9629 -10225 -10595 -10353 -10519 -11598 -10978 -8836 -7993 -8561 -9804 -11111 -10832 -10295 -11088 -11624 -11131 -9634 -8727 -9716 -10718 -10091 -8647 -8719 -10318 -11043 -10767 -10721 -10773 -10697 -9815 -9119 -10235 -11325 -11078 -9553 -7995 -8307 -9844 -11166 -11270 -10471 -10315 -11194 -11682 -10607 -8860 -8113 -9309 -10573 -10219 -9807 -9861 -10442 -10734 -9826 -9991 -10819 -11028 -11145 -10298 -9512 -9400 -9269 -9607 -9711 -9609 -9878 -10412 -11243 -11164 -10341 -10299 -10479 -10411 -10245 -9815 -9380 -8696 -8720 -10051 -10738 -10558 -10354 -10578 -11624 -11423 -9542 -8837 -9661 -10871 -11248 -9679 -8144 -8501 -9842 -10791 -10610 -10191 -10854 -11634 -11367 -10474 -9544 -9317 -9402 -8839 -8547 -9300 -10594 -11712 -11572 -10700 -10391 -9871 -9374 -9715 -10119 -10716 -10847 -9829 -9190 -8986 -8856 -9547 -10763 -11731 -11736 -10971 -10362 -9760 -9328 -9373 -9223 -9243 -9808 -10459 -10913 -10549 -9752 -9769 -10590 -11069 -10738 -10198 -9594 -9230 -9645 -10246 -10484 -10315 -9692 -9001 -8940 -9866 -11338 -12117 -11348 -10281 -9911 -9423 -9136 -9370 -9584 -10037 -10247 -9810 -9634 -9892 -10666 -11584 -11360 -10625 -10257 -9863 -9540 -9099 -8498 -8601 -9387 -10364 -11330 -11800 -11636 -10906 -10073 -9677 -9421 -9293 -9253 -9318 -10017 -10402 -9729 -9631 -10700 -11514 -11285 -10182 -9315 -9818 -10581 -10100 -9120 -8785 -9358 -10524 -11056 -10392 -9738 -9974 -10659 -11128 -10863 -10028 -9406 -9320 -9518 -9524 -9388 -9610 -10255 -11054 -11296 -10660 -10054 -9979 -10179 -10219 -9640 -9192 -9478 -9830 -10053 -10012 -9774 -10328 -11250 -11130 -10391 -9969 -9908 -9723 -9084 -8909 -9775 -10864 -11039 -10192 -9555 -9422 -9660 -10518 -11054 -10927 -10661 -10192 -9732 -9240 -8661 -8713 -9497 -10512 -11316 -11253 -10706 -10636 -10531 -9772 -8935 -9017 -9863 -10164 -9966 -9842 -9652 -9827 -10423 -10902 -11155 -11020 -10496 -9818 -9097 -8765 -8986 -9433 -10053 -10557 -10820 -11047 -10635 -9625 -9229 -9940 -10943 -10889 -9993 -9540 -9391 -9090 -9126 -9909 -10964 -11253 -10496 -9722 -9887 -10440 -10209 -9508 -9589 -10356 -10581 -9783 -8916 -9143 -10214 -10792 -10533 -10425 -10719 -10693 -10063 -9375 -9278 -9477 -9531 -9642 -9992 -10494 -10677 -10415 -10248 -10374 -10529 -10257 -9646 -9280 -9227 -9357 -9528 -9901 -10782 -11469 -11041 -9918 -9491 -9943 -10116 -9647 -9144 -9346 -10210 -10696 -10459 -9996 -9642 -9793 -10392 -10711 -10437 -9999 -9801 -9843 -9843 -9491 -9155 -9413 -10153 -10887 -11181 -10801 -10106 -9733 -9475 -9214 -9554 -10216 -10418 -10096 -9656 -9593 -10125 -10860 -10929 -10175 -9416 -9313 -9804 -10160 -10035 -9893 -10002 -10132 -10064 -9962 -10045 -10205 -10307 -10165 -9694 -9461 -9729 -10187 -10538 -10342 -9915 -9843 -9972 -9934 -9603 -9567 -10097 -10507 -10440 -10124 -9918 -9958 -10168 -10226 -9670 -8969 -9128 -10190 -11168 -11168 -10371 -9624 -9430 -9536 -9545 -9642 -10001 -10385 -10505 -10167 -9872 -10160 -10380 -10161 -9921 -9711 -9506 -9467 -9749 -10056 -9981 -9871 -10214 -10887 -11122 -10472 -9556 -9083 -9187 -9587 -9942 -10179 -10130 -9814 -9844 -10420 -10880 -10675 -10023 -9442 -9378 -9759 -9893 -9766 -9835 -10007 -10176 -10243 -10242 -10443 -10427 -9840 -9227 -9171 -9774 -10463 -10626 -10264 -9761 -9698 -10061 -10170 -9799 -9521 -9850 -10361 -10423 -10114 -9882 -9882 -9798 -9764 -10078 -10273 -10026 -9638 -9516 -9826 -10218 -10302 -10284 -10377 -10307 -9945 -9437 -9217 -9616 -10115 -10257 -10210 -10154 -10135 -10018 -9780 -9670 -9868 -10258 -10384 -10053 -9635 -9527 -9782 -10088 -10192 -10097 -9928 -9944 -10093 -10038 -9878 -9835 -9859 -9943 -10075 -10118 -10058 -10026 -9928 -9639 -9460 -9709 -10190 -10408 -10290 -10225 -10253 -10044 -9601 -9360 -9567 -9913 -10055 -10063 -10102 -10076 -10004 -10124 -10361 -10340 -9894 -9358 -9191 -9484 -9933 -10163 -10296 -10649 -10877 -10404 -9403 -8659 -8744 -9584 -10569 -11056 -10911 -10381 -9826 -9563 -9449 -9232 -9129 -9508 -10339 -11046 -11022 -10372 -9678 -9235 -9164 -9529 -10138 -10638 -10607 -9993 -9412 -9360 -9581 -9721 -9990 -10524 -10848 -10542 -9810 -9246 -9236 -9542 -9800 -10112 -10451 -10474 -10195 -9886 -9621 -9431 -9472 -9786 -10221 -10558 -10594 -10251 -9715 -9319 -9214 -9392 -9844 -10378 -10619 -10414 -10073 -9922 -9804 -9577 -9542 -9792 -10008 -10029 -9956 -9932 -9995 -10047 -10009 -9967 -10013 -9972 -9769 -9685 -9861 -10075 -10085 -9879 -9656 -9682 -9982 -10261 -10255 -10009 -9805 -9835 -9933 -9837 -9643 -9664 -9930 -10157 -10151 -10016 -9974 -10017 -9945 -9766 -9703 -9833 -9984 -9933 -9743 -9775 -10152 -10461 -10275 -9731 -9313 -9372 -9885 -10365 -10358 -10026 -9771 -9716 -9785 -9853 -9874 -9952 -10068 -10110 -10060 -9882 -9708 -9761 -9895 -9877 -9780 -9864 -10170 -10341 -10128 -9741 -9568 -9722 -9955 -10029 -9914 -9718 -9634 -9797 -10165 -10426 -10321 -9999 -9698 -9554 -9648 -9846 -9923 -9811 -9726 -9941 -10267 -10256 -9895 -9660 -9892 -10273 -10221 -9711 -9308 -9385 -9731 -9970 -10028 -10090 -10260 -10401 -10349 -10043 -9569 -9206 -9240 -9671 -10150 -10262 -9976 -9748 -9939 -10315 -10376 -10041 -9679 -9552 -9620 -9707 -9713 -9741 -9907 -10167 -10323 -10222 -9955 -9662 -9490 -9602 -9873 -10051 -10082 -10030 -9968 -9893 -9829 -9821 -9802 -9741 -9692 -9792 -10088 -10276 -10123 -9887 -9867 -9876 -9645 -9434 -9633 -10063 -10244 -10105 -9953 -9904 -9792 -9624 -9676 -9984 -10192 -10069 -9808 -9678 -9705 -9797 -9903 -9970 -9929 -9831 -9846 -9967 -10019 -9976 -9958 -9974 -9884 -9693 -9578 -9595 -9690 -9837 -10055 -10285 -10347 -10142 -9770 -9500 -9546 -9767 -9875 -9817 -9787 -9890 -9987 -9964 -9921 -9999 -10145 -10135 -9850 -9454 -9283 -9502 -9928 -10246 -10316 -10199 -9953 -9658 -9466 -9474 -9728 -10134 -10375 -10246 -9912 -9648 -9545 -9546 -9601 -9767 -10037 -10199 -10115 -9919 -9799 -9799 -9826 -9812 -9831 -9913 -9943 -9829 -9651 -9582 -9703 -9931 -10126 -10189 -10083 -9862 -9664 -9607 -9707 -9880 -9990 -9965 -9860 -9766 -9727 -9731 -9739 -9809 -10012 -10211 -10175 -9887 -9614 -9583 -9681 -9715 -9720 -9811 -9981 -10119 -10158 -10091 -9917 -9701 -9551 -9522 -9593 -9736 -9977 -10222 -10241 -9974 -9637 -9528 -9687 -9880 -9937 -9907 -9888 -9903 -9907 -9835 -9711 -9689 -9834 -9981 -9934 -9759 -9691 -9787 -9861 -9837 -9897 -10104 -10215 -10023 -9636 -9337 -9309 -9539 -9909 -10227 -10305 -10146 -9912 -9740 -9672 -9670 -9678 -9687 -9717 -9822 -9998 -10111 -10052 -9864 -9686 -9631 -9691 -9770 -9817 -9868 -9966 -10042 -9991 -9862 -9772 -9734 -9694 -9636 -9597 -9649 -9857 -10160 -10326 -10176 -9832 -9563 -9504 -9577 -9645 -9697 -9825 -10042 -10201 -10156 -9955 -9770 -9676 -9615 -9555 -9594 -9804 -10064 -10142 -9939 -9655 -9605 -9787 -9911 -9864 -9817 -9878 -9934 -9869 -9758 -9710 -9705 -9693 -9725 -9872 -10054 -10070 -9885 -9700 -9673 -9738 -9777 -9800 -9855 -9868 -9795 -9735 -9775 -9860 -9880 -9830 -9799 -9836 -9857 -9785 -9739 -9837 -9936 -9842 -9644 -9603 -9774 -9964 -10015 -9924 -9779 -9683 -9707 -9776 -9738 -9649 -9731 -10022 -10254 -10136 -9743 -9443 -9422 -9553 -9709 -9888 -10055 -10103 -9998 -9847 -9751 -9710 -9697 -9703 -9692 -9666 -9701 -9843 -9994 -9997 -9878 -9805 -9851 -9876 -9724 -9502 -9471 -9704 -9989 -10084 -9991 -9858 -9725 -9619 -9644 -9812 -9928 -9825 -9645 -9625 -9784 -9967 -10030 -9951 -9780 -9611 -9562 -9659 -9823 -9940 -9931 -9829 -9747 -9725 -9690 -9616 -9643 -9852 -10100 -10196 -10058 -9749 -9442 -9333 -9483 -9751 -9941 -9994 -9982 -9955 -9874 -9718 -9590 -9596 -9704 -9804 -9843 -9873 -9934 -9950 -9792 -9516 -9412 -9658 -10036 -10179 -9993 -9687 -9490 -9463 -9566 -9758 -9974 -10102 -10073 -9922 -9744 -9623 -9581 -9602 -9647 -9689 -9746 -9811 -9845 -9884 -9977 -10057 -9986 -9754 -9502 -9382 -9441 -9605 -9783 -9936 -10037 -10073 -10039 -9930 -9746 -9557 -9472 -9525 -9627 -9691 -9766 -9910 -10044 -10056 -9942 -9802 -9684 -9545 -9392 -9374 -9610 -9987 -10221 -10162 -9927 -9693 -9550 -9521 -9582 -9678 -9756 -9817 -9910 -10002 -9974 -9803 -9613 -9514 -9526 -9612 -9737 -9877 -9962 -9933 -9838 -9780 -9761 -9683 -9550 -9507 -9637 -9853 -9986 -9967 -9863 -9759 -9674 -9592 -9549 -9588 -9684 -9813 -9958 -10066 -10052 -9848 -9517 -9286 -9353 -9670 -9992 -10122 -10068 -9907 -9685 -9484 -9432 -9558 -9747 -9864 -9880 -9829 -9772 -9785 -9852 -9850 -9734 -9620 -9609 -9642 -9639 -9642 -9729 -9873 -9948 -9874 -9744 -9708 -9761 -9766 -9678 -9599 -9622 -9716 -9784 -9790 -9777 -9771 -9757 -9758 -9787 -9775 -9682 -9612 -9666 -9788 -9831 -9773 -9733 -9735 -9694 -9623 -9659 -9847 -10000 -9911 -9632 -9429 -9487 -9705 -9852 -9844 -9778 -9768 -9804 -9802 -9730 -9653 -9673 -9782 -9844 -9731 -9506 -9402 -9562 -9848 -10007 -9972 -9868 -9808 -9767 -9668 -9523 -9432 -9473 -9622 -9795 -9914 -9948 -9910 -9825 -9746 -9739 -9759 -9682 -9490 -9329 -9378 -9644 -9946 -10108 -10106 -10006 -9822 -9551 -9319 -9304 -9518 -9784 -9931 -9938 -9880 -9806 -9706 -9592 -9525 -9547 -9656 -9795 -9879 -9882 -9826 -9721 -9587 -9509 -9581 -9766 -9891 -9836 -9665 -9549 -9568 -9664 -9756 -9833 -9901 -9891 -9742 -9531 -9438 -9530 -9691 -9779 -9785 -9807 -9868 -9870 -9742 -9553 -9457 -9521 -9678 -9814 -9861 -9816 -9724 -9664 -9680 -9738 -9757 -9681 -9557 -9503 -9599 -9791 -9921 -9881 -9723 -9596 -9587 -9641 -9674 -9697 -9740 -9768 -9735 -9662 -9632 -9691 -9787 -9804 -9710 -9596 -9567 -9637 -9719 -9722 -9662 -9642 -9722 -9833 -9853 -9745 -9607 -9558 -9626 -9728 -9759 -9690 -9590 -9546 -9596 -9715 -9854 -9931 -9887 -9757 -9624 -9520 -9434 -9409 -9518 -9750 -9990 -10087 -9983 -9738 -9484 -9350 -9381 -9546 -9751 -9890 -9911 -9835 -9730 -9646 -9592 -9567 -9564 -9594 -9672 -9775 -9833 -9786 -9670 -9592 -9611 -9708 -9807 -9815 -9692 -9506 -9407 -9508 -9757 -9972 -9997 -9826 -9597 -9448 -9433 -9524 -9650 -9759 -9829 -9850 -9822 -9753 -9653 -9557 -9519 -9564 -9652 -9713 -9723 -9712 -9714 -9720 -9699 -9653 -9632 -9674 -9740 -9758 -9696 -9593 -9542 -9587 -9677 -9730 -9712 -9675 -9686 -9743 -9783 -9741 -9633 -9546 -9548 -9621 -9681 -9695 -9706 -9733 -9743 -9707 -9649 -9609 -9605 -9613 -9615 -9647 -9745 -9837 -9811 -9667 -9522 -9474 -9521 -9604 -9687 -9768 -9851 -9899 -9836 -9647 -9440 -9362 -9448 -9595 -9685 -9718 -9767 -9841 -9867 -9790 -9638 -9497 -9435 -9460 -9554 -9691 -9817 -9869 -9826 -9717 -9584 -9465 -9402 -9450 -9622 -9837 -9958 -9917 -9768 -9603 -9459 -9353 -9352 -9516 -9792 -9988 -9944 -9703 -9484 -9469 -9618 -9731 -9706 -9622 -9589 -9612 -9625 -9620 -9632 -9667 -9696 -9689 -9651 -9623 -9641 -9708 -9771 -9732 -9558 -9376 -9371 -9563 -9785 -9871 -9819 -9738 -9673 -9598 -9497 -9423 -9452 -9594 -9768 -9864 -9827 -9696 -9570 -9534 -9562 -9575 -9556 -9567 -9640 -9728 -9775 -9756 -9668 -9548 -9473 -9514 -9641 -9746 -9749 -9663 -9566 -9516 -9522 -9584 -9687 -9790 -9830 -9750 -9575 -9409 -9371 -9496 -9694 -9820 -9809 -9722 -9625 -9537 -9492 -9531 -9639 -9726 -9725 -9651 -9568 -9525 -9541 -9607 -9705 -9783 -9778 -9685 -9551 -9441 -9419 -9510 -9661 -9760 -9751 -9676 -9605 -9585 -9604 -9630 -9651 -9654 -9614 -9540 -9489 -9521 -9633 -9747 -9783 -9733 -9627 -9506 -9433 -9456 -9585 -9743 -9807 -9742 iris-edu-libmseed-4314359/test/read-Steim2-littleendian.test000077500000000000000000000001531422047135100236220ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Steim2-AllDifferences-LE.mseed -D iris-edu-libmseed-4314359/test/read-Steim2-littleendian.test.ref000066400000000000000000001115611422047135100244000ustar00rootroot00000000000000XX_TEST__LHZ, 000001, R, 4096, 3096 samples, 1 Hz, 2016,062,12:36:06.069538 -10780 -10779 -10782 -10783 -10781 -10781 -10781 -10779 -10778 -10777 -10776 -10774 -10776 -10775 -10772 -10774 -10772 -10771 -10774 -10772 -10768 -10765 -10766 -10768 -10766 -10766 -10764 -10764 -10766 -10764 -10763 -10763 -10761 -10763 -10762 -10761 -10762 -10760 -10762 -10766 -10764 -10762 -10763 -10762 -10758 -10760 -10761 -10755 -10752 -10757 -10757 -10753 -10753 -10755 -10753 -10754 -10755 -10756 -10755 -10751 -10752 -10755 -10751 -10751 -10751 -10749 -10748 -10747 -10750 -10747 -10744 -10747 -10748 -10747 -10745 -10747 -10747 -10743 -10743 -10742 -10741 -10742 -10738 -10738 -10737 -10738 -10738 -10733 -10735 -10737 -10733 -10735 -10735 -10735 -10734 -10731 -10734 -10733 -10730 -10730 -10730 -10729 -10728 -10727 -10727 -10726 -10727 -10729 -10728 -10727 -10726 -10726 -10726 -10721 -10723 -10725 -10720 -10725 -10726 -10723 -10724 -10722 -10722 -10723 -10719 -10718 -10717 -10714 -10715 -10714 -10711 -10711 -10713 -10712 -10709 -10711 -10712 -10710 -10711 -10711 -10709 -10710 -10711 -10708 -10706 -10709 -10707 -10705 -10707 -10707 -10708 -10706 -10705 -10706 -10701 -10701 -10705 -10702 -10700 -10701 -10701 -10700 -10696 -10697 -10698 -10693 -10691 -10694 -10693 -10691 -10689 -10690 -10694 -10690 -10686 -10690 -10692 -10690 -10690 -10693 -10692 -10685 -10688 -10693 -10684 -10680 -10688 -10685 -10680 -10685 -10687 -10684 -10685 -10687 -10685 -10682 -10684 -10686 -10681 -10676 -10679 -10682 -10677 -10676 -10677 -10675 -10674 -10677 -10681 -10677 -10674 -10679 -10677 -10674 -10673 -10671 -10671 -10673 -10673 -10669 -10668 -10670 -10670 -10670 -10668 -10669 -10670 -10668 -10667 -10668 -10664 -10661 -10665 -10665 -10660 -10659 -10662 -10663 -10660 -10659 -10661 -10660 -10659 -10662 -10660 -10656 -10661 -10662 -10656 -10656 -10659 -10658 -10653 -10655 -10657 -10653 -10652 -10655 -10657 -10654 -10652 -10656 -10654 -10649 -10652 -10653 -10651 -10651 -10649 -10647 -10647 -10648 -10649 -10648 -10651 -10651 -10644 -10645 -10651 -10648 -10647 -10647 -10646 -10645 -10647 -10648 -10645 -10643 -10643 -10640 -10637 -10639 -10639 -10635 -10635 -10639 -10637 -10636 -10637 -10635 -10636 -10638 -10636 -10634 -10635 -10632 -10630 -10630 -10630 -10630 -10629 -10629 -10626 -10628 -10631 -10627 -10626 -10628 -10627 -10625 -10624 -10625 -10625 -10623 -10624 -10622 -10622 -10624 -10621 -10618 -10618 -10616 -10618 -10618 -10614 -10613 -10614 -10614 -10613 -10612 -10612 -10610 -10609 -10609 -10608 -10608 -10610 -10608 -10607 -10609 -10609 -10606 -10606 -10608 -10608 -10607 -10604 -10605 -10608 -10603 -10604 -10602 -10597 -10603 -10602 -10595 -10598 -10604 -10601 -10596 -10597 -10601 -10599 -10595 -10598 -10598 -10594 -10594 -10597 -10596 -10595 -10597 -10595 -10591 -10594 -10595 -10590 -10588 -10592 -10592 -10589 -10590 -10590 -10591 -10590 -10590 -10593 -10589 -10585 -10589 -10589 -10584 -10585 -10588 -10586 -10581 -10582 -10584 -10580 -10580 -10583 -10581 -10580 -10578 -10578 -10581 -10579 -10575 -10576 -10577 -10574 -10571 -10574 -10575 -10572 -10572 -10576 -10573 -10567 -10570 -10570 -10566 -10568 -10565 -10564 -10567 -10566 -10563 -10565 -10568 -10566 -10564 -10563 -10562 -10563 -10563 -10561 -10563 -10560 -10559 -10561 -10556 -10554 -10559 -10558 -10555 -10557 -10558 -10554 -10555 -10557 -10552 -10551 -10555 -10555 -10551 -10555 -10557 -10551 -10551 -10553 -10552 -10549 -10551 -10552 -10549 -10548 -10551 -10549 -10545 -10548 -10549 -10546 -10547 -10550 -10549 -10543 -10543 -10547 -10542 -10539 -10546 -10545 -10540 -10540 -10541 -10537 -10536 -10539 -10539 -10537 -10537 -10537 -10537 -10537 -10536 -10532 -10532 -10536 -10533 -10528 -10533 -10534 -10528 -10528 -10533 -10533 -10530 -10528 -10529 -10529 -10525 -10522 -10526 -10527 -10522 -10521 -10524 -10524 -10521 -10521 -10525 -10519 -10515 -10523 -10522 -10517 -10519 -10521 -10521 -10518 -10518 -10520 -10516 -10516 -10522 -10520 -10517 -10519 -10518 -10516 -10515 -10516 -10513 -10512 -10514 -10512 -10514 -10513 -10510 -10516 -10516 -10510 -10509 -10513 -10510 -10506 -10508 -10507 -10504 -10506 -10505 -10501 -10501 -10502 -10499 -10501 -10502 -10499 -10498 -10498 -10497 -10497 -10499 -10499 -10496 -10498 -10499 -10496 -10496 -10498 -10498 -10497 -10496 -10495 -10496 -10495 -10493 -10495 -10495 -10493 -10492 -10490 -10491 -10492 -10489 -10488 -10490 -10488 -10486 -10487 -10484 -10486 -10485 -10481 -10483 -10481 -10479 -10481 -10480 -10479 -10481 -10478 -10478 -10480 -10478 -10477 -10477 -10479 -10477 -10475 -10477 -10476 -10476 -10477 -10476 -10474 -10470 -10470 -10471 -10468 -10464 -10466 -10471 -10468 -10466 -10471 -10470 -10463 -10464 -10470 -10470 -10463 -10462 -10466 -10463 -10462 -10463 -10463 -10461 -10459 -10464 -10463 -10457 -10461 -10461 -10457 -10461 -10462 -10456 -10458 -10463 -10457 -10455 -10461 -10461 -10454 -10455 -10459 -10454 -10451 -10454 -10457 -10456 -10451 -10454 -10455 -10453 -10454 -10454 -10454 -10453 -10453 -10453 -10451 -10450 -10451 -10449 -10447 -10446 -10445 -10443 -10445 -10447 -10442 -10439 -10443 -10443 -10439 -10438 -10439 -10440 -10438 -10436 -10435 -10436 -10440 -10439 -10436 -10438 -10438 -10435 -10434 -10434 -10433 -10431 -10432 -10431 -10426 -10427 -10432 -10429 -10424 -10428 -10430 -10425 -10423 -10426 -10426 -10423 -10424 -10423 -10420 -10421 -10421 -10419 -10420 -10422 -10421 -10418 -10420 -10420 -10416 -10418 -10419 -10418 -10417 -10415 -10413 -10413 -10416 -10416 -10413 -10412 -10411 -10408 -10410 -10415 -10413 -10409 -10408 -10410 -10406 -10403 -10406 -10405 -10401 -10403 -10405 -10403 -10402 -10404 -10404 -10402 -10403 -10405 -10403 -10402 -10401 -10403 -10401 -10400 -10402 -10398 -10399 -10399 -10396 -10398 -10400 -10398 -10398 -10399 -10398 -10395 -10395 -10395 -10394 -10395 -10394 -10393 -10392 -10391 -10392 -10390 -10387 -10389 -10388 -10383 -10385 -10389 -10384 -10383 -10387 -10382 -10377 -10382 -10384 -10378 -10379 -10381 -10378 -10377 -10378 -10377 -10377 -10375 -10376 -10377 -10374 -10376 -10377 -10373 -10376 -10378 -10374 -10372 -10373 -10375 -10375 -10375 -10374 -10372 -10373 -10373 -10371 -10371 -10372 -10368 -10366 -10367 -10363 -10362 -10366 -10364 -10359 -10362 -10365 -10361 -10362 -10366 -10365 -10361 -10362 -10363 -10360 -10358 -10360 -10358 -10355 -10356 -10358 -10356 -10353 -10356 -10354 -10353 -10356 -10352 -10350 -10350 -10352 -10352 -10350 -10349 -10351 -10349 -10349 -10352 -10351 -10350 -10349 -10348 -10351 -10347 -10342 -10348 -10348 -10341 -10342 -10347 -10345 -10342 -10343 -10344 -10343 -10338 -10339 -10343 -10339 -10334 -10338 -10342 -10339 -10335 -10334 -10343 -10327 -10298 -10336 -10317 -10263 -10300 -10291 -10268 -10319 -10302 -10247 -10327 -10264 -10206 -10267 -10072 -10143 -10325 -10213 -10378 -10713 -10725 -10793 -11084 -10919 -10599 -10628 -10318 -9770 -9886 -9864 -9531 -9993 -10473 -10391 -10591 -10850 -10492 -10336 -10310 -9802 -9782 -10105 -10087 -10336 -10867 -10899 -10730 -10883 -10623 -9973 -9925 -9913 -9582 -9881 -10118 -10246 -10812 -10831 -10822 -10813 -10545 -10291 -9869 -9966 -9986 -9904 -10193 -10401 -10485 -10321 -10507 -10616 -10356 -10491 -10556 -10278 -10001 -10091 -9964 -10032 -10315 -10175 -10748 -10746 -10247 -10635 -11201 -10600 -9376 -9977 -10272 -9393 -9956 -11159 -10513 -10002 -11648 -12045 -10467 -10277 -10748 -8569 -7693 -9365 -8484 -7257 -8609 -10074 -10843 -12659 -15516 -16785 -15251 -13967 -12585 -8092 -3214 -1429 -1066 -1650 -7261 -11979 -17105 -22930 -20483 -20365 -14187 -3839 -1833 4001 2611 -3992 -10685 -20509 -24390 -25678 -19783 -11049 -3305 5018 3852 -1333 -8150 -20120 -24824 -21106 -17111 -5702 2170 -124 -678 -8673 -18329 -18995 -20536 -18197 -7414 -1955 -897 -711 -10679 -19294 -20331 -18416 -9124 -715 -126 -3860 -10864 -17394 -17835 -14648 -10044 -6159 -7018 -10109 -11541 -10703 -9393 -8837 -9983 -10613 -13572 -14675 -7797 -5465 -5932 -7109 -12561 -13709 -13122 -14120 -13031 -10469 -7988 -10732 50000 70000 -11856 -16163 -15418 -8923 -4570 -5851 -10209 -15227 -15128 -11056 -8548 -6905 -8118 -11024 -11159 -10140 -9856 -9890 -12082 -12865 -9140 -7173 -8279 -10098 -12740 -12752 -10194 -10014 -9020 -8242 -12070 -11886 -8202 -9177 -9633 -9548 -12777 -12480 -9855 -9541 -7653 -8164 -12603 -12205 -10939 -12048 -9456 -8194 -8216 -7513 -10801 -13470 -13410 -10075 -7001 -8853 -9609 -12803 -13986 -8623 -8209 -8699 -9266 -12043 -12100 -10332 -8163 -9213 -10055 -10164 -11968 -11454 -10960 -10701 -9554 -8712 -8664 -9438 -10332 -11440 -10962 -10604 -10846 -9890 -10880 -10987 -8086 -8050 -9701 -11349 -13557 -11918 -8944 -8338 -8882 -10246 -10108 -9262 -9600 -11435 -13319 -11678 -8805 -8648 -10560 -11405 -10046 -7870 -7446 -9729 -12269 -13701 -12123 -9193 -8668 -9178 -9542 -9801 -9900 -10806 -12096 -10934 -9721 -9655 -8704 -9735 -11010 -11012 -10239 -8716 -9277 -11451 -12830 -10759 -8668 -9046 -9876 -12047 -10766 -7746 -7991 -9146 -11817 -13436 -11990 -10038 -9001 -9099 -9313 -9973 -10600 -10786 -11149 -9656 -8218 -9416 -10181 -11365 -12122 -10421 -10372 -10143 -9323 -10636 -9662 -8544 -10203 -9834 -10112 -11951 -10770 -10317 -10637 -9339 -9867 -10202 -9382 -10428 -11260 -10459 -9155 -8530 -9813 -11510 -12039 -11433 -9395 -7658 -8622 -10572 -11372 -11415 -11258 -11307 -10852 -9047 -7551 -7974 -9693 -11360 -11560 -10631 -10259 -10138 -10342 -11235 -10896 -10137 -10281 -9418 -8656 -8874 -8315 -9156 -11769 -12864 -12807 -11711 -9261 -8226 -8509 -8568 -10089 -11742 -11302 -10854 -10138 -9049 -9126 -8868 -9099 -11008 -12384 -12281 -11048 -9579 -8936 -9316 -10076 -9788 -8969 -9109 -10369 -12058 -11883 -9761 -8928 -9629 -10225 -10595 -10353 -10519 -11598 -10978 -8836 -7993 -8561 -9804 -11111 -10832 -10295 -11088 -11624 -11131 -9634 -8727 -9716 -10718 -10091 -8647 -8719 -10318 -11043 -10767 -10721 -10773 -10697 -9815 -9119 -10235 -11325 -11078 -9553 -7995 -8307 -9844 -11166 -11270 -10471 -10315 -11194 -11682 -10607 -8860 -8113 -9309 -10573 -10219 -9807 -9861 -10442 -10734 -9826 -9991 -10819 -11028 -11145 -10298 -9512 -9400 -9269 -9607 -9711 -9609 -9878 -10412 -11243 -11164 -10341 -10299 -10479 -10411 -10245 -9815 -9380 -8696 -8720 -10051 -10738 -10558 -10354 -10578 -11624 -11423 -9542 -8837 -9661 -10871 -11248 -9679 -8144 -8501 -9842 -10791 -10610 -10191 -10854 -11634 -11367 -10474 -9544 -9317 -9402 -8839 -8547 -9300 -10594 -11712 -11572 -10700 -10391 -9871 -9374 -9715 -10119 -10716 -10847 -9829 -9190 -8986 -8856 -9547 -10763 -11731 -11736 -10971 -10362 -9760 -9328 -9373 -9223 -9243 -9808 -10459 -10913 -10549 -9752 -9769 -10590 -11069 -10738 -10198 -9594 -9230 -9645 -10246 -10484 -10315 -9692 -9001 -8940 -9866 -11338 -12117 -11348 -10281 -9911 -9423 -9136 -9370 -9584 -10037 -10247 -9810 -9634 -9892 -10666 -11584 -11360 -10625 -10257 -9863 -9540 -9099 -8498 -8601 -9387 -10364 -11330 -11800 -11636 -10906 -10073 -9677 -9421 -9293 -9253 -9318 -10017 -10402 -9729 -9631 -10700 -11514 -11285 -10182 -9315 -9818 -10581 -10100 -9120 -8785 -9358 -10524 -11056 -10392 -9738 -9974 -10659 -11128 -10863 -10028 -9406 -9320 -9518 -9524 -9388 -9610 -10255 -11054 -11296 -10660 -10054 -9979 -10179 -10219 -9640 -9192 -9478 -9830 -10053 -10012 -9774 -10328 -11250 -11130 -10391 -9969 -9908 -9723 -9084 -8909 -9775 -10864 -11039 -10192 -9555 -9422 -9660 -10518 -11054 -10927 -10661 -10192 -9732 -9240 -8661 -8713 -9497 -10512 -11316 -11253 -10706 -10636 -10531 -9772 -8935 -9017 -9863 -10164 -9966 -9842 -9652 -9827 -10423 -10902 -11155 -11020 -10496 -9818 -9097 -8765 -8986 -9433 -10053 -10557 -10820 -11047 -10635 -9625 -9229 -9940 -10943 -10889 -9993 -9540 -9391 -9090 -9126 -9909 -10964 -11253 -10496 -9722 -9887 -10440 -10209 -9508 -9589 -10356 -10581 -9783 -8916 -9143 -10214 -10792 -10533 -10425 -10719 -10693 -10063 -9375 -9278 -9477 -9531 -9642 -9992 -10494 -10677 -10415 -10248 -10374 -10529 -10257 -9646 -9280 -9227 -9357 -9528 -9901 -10782 -11469 -11041 -9918 -9491 -9943 -10116 -9647 -9144 -9346 -10210 -10696 -10459 -9996 -9642 -9793 -10392 -10711 -10437 -9999 -9801 -9843 -9843 -9491 -9155 -9413 -10153 -10887 -11181 -10801 -10106 -9733 -9475 -9214 -9554 -10216 -10418 -10096 -9656 -9593 -10125 -10860 -10929 -10175 -9416 -9313 -9804 -10160 -10035 -9893 -10002 -10132 -10064 -9962 -10045 -10205 -10307 -10165 -9694 -9461 -9729 -10187 -10538 -10342 -9915 -9843 -9972 -9934 -9603 -9567 -10097 -10507 -10440 -10124 -9918 -9958 -10168 -10226 -9670 -8969 -9128 -10190 -11168 -11168 -10371 -9624 -9430 -9536 -9545 -9642 -10001 -10385 -10505 -10167 -9872 -10160 -10380 -10161 -9921 -9711 -9506 -9467 -9749 -10056 -9981 -9871 -10214 -10887 -11122 -10472 -9556 -9083 -9187 -9587 -9942 -10179 -10130 -9814 -9844 -10420 -10880 -10675 -10023 -9442 -9378 -9759 -9893 -9766 -9835 -10007 -10176 -10243 -10242 -10443 -10427 -9840 -9227 -9171 -9774 -10463 -10626 -10264 -9761 -9698 -10061 -10170 -9799 -9521 -9850 -10361 -10423 -10114 -9882 -9882 -9798 -9764 -10078 -10273 -10026 -9638 -9516 -9826 -10218 -10302 -10284 -10377 -10307 -9945 -9437 -9217 -9616 -10115 -10257 -10210 -10154 -10135 -10018 -9780 -9670 -9868 -10258 -10384 -10053 -9635 -9527 -9782 -10088 -10192 -10097 -9928 -9944 -10093 -10038 -9878 -9835 -9859 -9943 -10075 -10118 -10058 -10026 -9928 -9639 -9460 -9709 -10190 -10408 -10290 -10225 -10253 -10044 -9601 -9360 -9567 -9913 -10055 -10063 -10102 -10076 -10004 -10124 -10361 -10340 -9894 -9358 -9191 -9484 -9933 -10163 -10296 -10649 -10877 -10404 -9403 -8659 -8744 -9584 -10569 -11056 -10911 -10381 -9826 -9563 -9449 -9232 -9129 -9508 -10339 -11046 -11022 -10372 -9678 -9235 -9164 -9529 -10138 -10638 -10607 -9993 -9412 -9360 -9581 -9721 -9990 -10524 -10848 -10542 -9810 -9246 -9236 -9542 -9800 -10112 -10451 -10474 -10195 -9886 -9621 -9431 -9472 -9786 -10221 -10558 -10594 -10251 -9715 -9319 -9214 -9392 -9844 -10378 -10619 -10414 -10073 -9922 -9804 -9577 -9542 -9792 -10008 -10029 -9956 -9932 -9995 -10047 -10009 -9967 -10013 -9972 -9769 -9685 -9861 -10075 -10085 -9879 -9656 -9682 -9982 -10261 -10255 -10009 -9805 -9835 -9933 -9837 -9643 -9664 -9930 -10157 -10151 -10016 -9974 -10017 -9945 -9766 -9703 -9833 -9984 -9933 -9743 -9775 -10152 -10461 -10275 -9731 -9313 -9372 -9885 -10365 -10358 -10026 -9771 -9716 -9785 -9853 -9874 -9952 -10068 -10110 -10060 -9882 -9708 -9761 -9895 -9877 -9780 -9864 -10170 -10341 -10128 -9741 -9568 -9722 -9955 -10029 -9914 -9718 -9634 -9797 -10165 -10426 -10321 -9999 -9698 -9554 -9648 -9846 -9923 -9811 -9726 -9941 -10267 -10256 -9895 -9660 -9892 -10273 -10221 -9711 -9308 -9385 -9731 -9970 -10028 -10090 -10260 -10401 -10349 -10043 -9569 -9206 -9240 -9671 -10150 -10262 -9976 -9748 -9939 -10315 -10376 -10041 -9679 -9552 -9620 -9707 -9713 -9741 -9907 -10167 -10323 -10222 -9955 -9662 -9490 -9602 -9873 -10051 -10082 -10030 -9968 -9893 -9829 -9821 -9802 -9741 -9692 -9792 -10088 -10276 -10123 -9887 -9867 -9876 -9645 -9434 -9633 -10063 -10244 -10105 -9953 -9904 -9792 -9624 -9676 -9984 -10192 -10069 -9808 -9678 -9705 -9797 -9903 -9970 -9929 -9831 -9846 -9967 -10019 -9976 -9958 -9974 -9884 -9693 -9578 -9595 -9690 -9837 -10055 -10285 -10347 -10142 -9770 -9500 -9546 -9767 -9875 -9817 -9787 -9890 -9987 -9964 -9921 -9999 -10145 -10135 -9850 -9454 -9283 -9502 -9928 -10246 -10316 -10199 -9953 -9658 -9466 -9474 -9728 -10134 -10375 -10246 -9912 -9648 -9545 -9546 -9601 -9767 -10037 -10199 -10115 -9919 -9799 -9799 -9826 -9812 -9831 -9913 -9943 -9829 -9651 -9582 -9703 -9931 -10126 -10189 -10083 -9862 -9664 -9607 -9707 -9880 -9990 -9965 -9860 -9766 -9727 -9731 -9739 -9809 -10012 -10211 -10175 -9887 -9614 -9583 -9681 -9715 -9720 -9811 -9981 -10119 -10158 -10091 -9917 -9701 -9551 -9522 -9593 -9736 -9977 -10222 -10241 -9974 -9637 -9528 -9687 -9880 -9937 -9907 -9888 -9903 -9907 -9835 -9711 -9689 -9834 -9981 -9934 -9759 -9691 -9787 -9861 -9837 -9897 -10104 -10215 -10023 -9636 -9337 -9309 -9539 -9909 -10227 -10305 -10146 -9912 -9740 -9672 -9670 -9678 -9687 -9717 -9822 -9998 -10111 -10052 -9864 -9686 -9631 -9691 -9770 -9817 -9868 -9966 -10042 -9991 -9862 -9772 -9734 -9694 -9636 -9597 -9649 -9857 -10160 -10326 -10176 -9832 -9563 -9504 -9577 -9645 -9697 -9825 -10042 -10201 -10156 -9955 -9770 -9676 -9615 -9555 -9594 -9804 -10064 -10142 -9939 -9655 -9605 -9787 -9911 -9864 -9817 -9878 -9934 -9869 -9758 -9710 -9705 -9693 -9725 -9872 -10054 -10070 -9885 -9700 -9673 -9738 -9777 -9800 -9855 -9868 -9795 -9735 -9775 -9860 -9880 -9830 -9799 -9836 -9857 -9785 -9739 -9837 -9936 -9842 -9644 -9603 -9774 -9964 -10015 -9924 -9779 -9683 -9707 -9776 -9738 -9649 -9731 -10022 -10254 -10136 -9743 -9443 -9422 -9553 -9709 -9888 -10055 -10103 -9998 -9847 -9751 -9710 -9697 -9703 -9692 -9666 -9701 -9843 -9994 -9997 -9878 -9805 -9851 -9876 -9724 -9502 -9471 -9704 -9989 -10084 -9991 -9858 -9725 -9619 -9644 -9812 -9928 -9825 -9645 -9625 -9784 -9967 -10030 -9951 -9780 -9611 -9562 -9659 -9823 -9940 -9931 -9829 -9747 -9725 -9690 -9616 -9643 -9852 -10100 -10196 -10058 -9749 -9442 -9333 -9483 -9751 -9941 -9994 -9982 -9955 -9874 -9718 -9590 -9596 -9704 -9804 -9843 -9873 -9934 -9950 -9792 -9516 -9412 -9658 -10036 -10179 -9993 -9687 -9490 -9463 -9566 -9758 -9974 -10102 -10073 -9922 -9744 -9623 -9581 -9602 -9647 -9689 -9746 -9811 -9845 -9884 -9977 -10057 -9986 -9754 -9502 -9382 -9441 -9605 -9783 -9936 -10037 -10073 -10039 -9930 -9746 -9557 -9472 -9525 -9627 -9691 -9766 -9910 -10044 -10056 -9942 -9802 -9684 -9545 -9392 -9374 -9610 -9987 -10221 -10162 -9927 -9693 -9550 -9521 -9582 -9678 -9756 -9817 -9910 -10002 -9974 -9803 -9613 -9514 -9526 -9612 -9737 -9877 -9962 -9933 -9838 -9780 -9761 -9683 -9550 -9507 -9637 -9853 -9986 -9967 -9863 -9759 -9674 -9592 -9549 -9588 -9684 -9813 -9958 -10066 -10052 -9848 -9517 -9286 -9353 -9670 -9992 -10122 -10068 -9907 -9685 -9484 -9432 -9558 -9747 -9864 -9880 -9829 -9772 -9785 -9852 -9850 -9734 -9620 -9609 -9642 -9639 -9642 -9729 -9873 -9948 -9874 -9744 -9708 -9761 -9766 -9678 -9599 -9622 -9716 -9784 -9790 -9777 -9771 -9757 -9758 -9787 -9775 -9682 -9612 -9666 -9788 -9831 -9773 -9733 -9735 -9694 -9623 -9659 -9847 -10000 -9911 -9632 -9429 -9487 -9705 -9852 -9844 -9778 -9768 -9804 -9802 -9730 -9653 -9673 -9782 -9844 -9731 -9506 -9402 -9562 -9848 -10007 -9972 -9868 -9808 -9767 -9668 -9523 -9432 -9473 -9622 -9795 -9914 -9948 -9910 -9825 -9746 -9739 -9759 -9682 -9490 -9329 -9378 -9644 -9946 -10108 -10106 -10006 -9822 -9551 -9319 -9304 -9518 -9784 -9931 -9938 -9880 -9806 -9706 -9592 -9525 -9547 -9656 -9795 -9879 -9882 -9826 -9721 -9587 -9509 -9581 -9766 -9891 -9836 -9665 -9549 -9568 -9664 -9756 -9833 -9901 -9891 -9742 -9531 -9438 -9530 -9691 -9779 -9785 -9807 -9868 -9870 -9742 -9553 -9457 -9521 -9678 -9814 -9861 -9816 -9724 -9664 -9680 -9738 -9757 -9681 -9557 -9503 -9599 -9791 -9921 -9881 -9723 -9596 -9587 -9641 -9674 -9697 -9740 -9768 -9735 -9662 -9632 -9691 -9787 -9804 -9710 -9596 -9567 -9637 -9719 -9722 -9662 -9642 -9722 -9833 -9853 -9745 -9607 -9558 -9626 -9728 -9759 -9690 -9590 -9546 -9596 -9715 -9854 -9931 -9887 -9757 -9624 -9520 -9434 -9409 -9518 -9750 -9990 -10087 -9983 -9738 -9484 -9350 -9381 -9546 -9751 -9890 -9911 -9835 -9730 -9646 -9592 -9567 -9564 -9594 -9672 -9775 -9833 -9786 -9670 -9592 -9611 -9708 -9807 -9815 -9692 -9506 -9407 -9508 -9757 -9972 -9997 -9826 -9597 -9448 -9433 -9524 -9650 -9759 -9829 -9850 -9822 -9753 -9653 -9557 -9519 -9564 -9652 -9713 -9723 -9712 -9714 -9720 -9699 -9653 -9632 -9674 -9740 -9758 -9696 -9593 -9542 -9587 -9677 -9730 -9712 -9675 -9686 -9743 -9783 -9741 -9633 -9546 -9548 -9621 -9681 -9695 -9706 -9733 -9743 -9707 -9649 -9609 -9605 -9613 -9615 -9647 -9745 -9837 -9811 -9667 -9522 -9474 -9521 -9604 -9687 -9768 -9851 -9899 -9836 -9647 -9440 -9362 -9448 -9595 -9685 -9718 -9767 -9841 -9867 -9790 -9638 -9497 -9435 -9460 -9554 -9691 -9817 -9869 -9826 -9717 -9584 -9465 -9402 -9450 -9622 -9837 -9958 -9917 -9768 -9603 -9459 -9353 -9352 -9516 -9792 -9988 -9944 -9703 -9484 -9469 -9618 -9731 -9706 -9622 -9589 -9612 -9625 -9620 -9632 -9667 -9696 -9689 -9651 -9623 -9641 -9708 -9771 -9732 -9558 -9376 -9371 -9563 -9785 -9871 -9819 -9738 -9673 -9598 -9497 -9423 -9452 -9594 -9768 -9864 -9827 -9696 -9570 -9534 -9562 -9575 -9556 -9567 -9640 -9728 -9775 -9756 -9668 -9548 -9473 -9514 -9641 -9746 -9749 -9663 -9566 -9516 -9522 -9584 -9687 -9790 -9830 -9750 -9575 -9409 -9371 -9496 -9694 -9820 -9809 -9722 -9625 -9537 -9492 -9531 -9639 -9726 -9725 -9651 -9568 -9525 -9541 -9607 -9705 -9783 -9778 -9685 -9551 -9441 -9419 -9510 -9661 -9760 -9751 -9676 -9605 -9585 -9604 -9630 -9651 -9654 -9614 -9540 -9489 -9521 -9633 -9747 -9783 -9733 -9627 -9506 -9433 -9456 -9585 -9743 -9807 -9742 iris-edu-libmseed-4314359/test/read-detection-record.test000077500000000000000000000001441422047135100232370ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/detection.record.mseed -pp iris-edu-libmseed-4314359/test/read-detection-record.test.ref000066400000000000000000000022601422047135100240100ustar00rootroot00000000000000XX_TEST_00_BHZ, 656063, D start time: 2004,210,20:28:09.000000 number of samples: 0 sample rate factor: 0 (0 samples per second) sample rate multiplier: 0 activity flags: [00000000] 8 bits I/O and clock flags: [00000000] 8 bits data quality flags: [00000000] 8 bits number of blockettes: 2 time correction: 0 data offset: 0 first blockette offset: 48 BLOCKETTE 1000: (Data Only SEED) next blockette: 56 encoding: ASCII text (val:0) byte order: Big endian (val:1) record length: 512 (val:9) reserved byte: 0 BLOCKETTE 201: (Murdock Event Detection) next blockette: 0 signal amplitude: 80 signal period: 0.4 background estimate: 18 event detection flags: [10000000] 8 bits [Bit 0] 1: Dilation wave reserved byte: 0 signal onset time: 2004,210,20:28:06.1850 SNR values: 1 3 2 1 4 0 loopback value: 2 pick algorithm: 0 detector name: Z_SPWWSS iris-edu-libmseed-4314359/test/read-invalid-blockette-offset.test000077500000000000000000000001501422047135100246660ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/invalid-blockette-offset.mseed iris-edu-libmseed-4314359/test/read-invalid-blockette-offset.test.ref000066400000000000000000000003551422047135100254450ustar00rootroot00000000000000XX_TEST_00_LHZ, 000001, M, 512, 112 samples, 1 Hz, 2010,058,06:50:00.069539 XX_TEST_00_LHZ, 000000, M, 512, 185 samples, 1 Hz, 2010,058,06:51:52.069541 Error: Invalid blockette offset (12365) less than or equal to current offset (12365) iris-edu-libmseed-4314359/test/read-mixed-order-mixed-length-trace.test000077500000000000000000000001731422047135100257050ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/Int32-oneseries-mixedlengths-mixedorder.mseed -tg iris-edu-libmseed-4314359/test/read-mixed-order-mixed-length-trace.test.ref000066400000000000000000000003131422047135100264510ustar00rootroot00000000000000 Source Start sample End sample Gap Hz Samples XX_TEST_00_LHZ 2010,058,06:50:00.069539 2010,058,07:55:51.069539 == 1 3952 Total: 1 trace(s) with 1 segment(s) iris-edu-libmseed-4314359/test/read-no-blockette1000.test000077500000000000000000000001561422047135100226770ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/no-blockette1000-steim1.mseed -d -pp iris-edu-libmseed-4314359/test/read-no-blockette1000.test.ref000066400000000000000000000017361422047135100234540ustar00rootroot00000000000000XX_TEST__BHE, 000000, D start time: 1995,265,00:00:18.238400 number of samples: 3632 sample rate factor: 20 (20 samples per second) sample rate multiplier: 1 activity flags: [00000000] 8 bits I/O and clock flags: [00000000] 8 bits data quality flags: [00000000] 8 bits number of blockettes: 0 time correction: 0 data offset: 48 first blockette offset: 0 337 396 454 503 547 581 XX_TEST__BHE, 000000, D start time: 1995,265,00:03:19.838500 number of samples: 3680 sample rate factor: 20 (20 samples per second) sample rate multiplier: 1 activity flags: [00000000] 8 bits I/O and clock flags: [00000000] 8 bits data quality flags: [00000000] 8 bits number of blockettes: 0 time correction: 0 data offset: 48 first blockette offset: 0 -110 -188 -261 -329 -391 -448 iris-edu-libmseed-4314359/test/read-text-encoded.test000077500000000000000000000001371422047135100223720ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/text-encoded.mseed -D iris-edu-libmseed-4314359/test/read-text-encoded.test.ref000066400000000000000000000077631422047135100231560ustar00rootroot00000000000000XX_TEST__LOG, 000030, D, 4096, 3994 samples, 0 Hz, 2004,160,10:47:32.810000 ASCII Data: Quanterra Packet Baler Model 14 Restart. Version 1.45 Control Port 3512 Opened Baler ready on Serial at 115200 baud Retry of command type 5A Retry of command type 5A Retry of command type 5A Retry of command type 5A Retry of command type 5A Power Cycled Baler Acknowledged Commands Accepted by Q330 Access timeout: 11265 sec Control Port 1490 Opened Data Port 1491 Opened Registered with Q330 Combination Record Received Window=4 Min. Timeout=10 Max. Timeout=30 Link Reset, starting window sequence: 9705 GPS Receiver ID Received Msg From 1xx.xx.xx.xxx:Baler readback. 368 recs. seq end: 9698 Baler clock set to 2004-06-08 10:47:31 Starting to Read DP Tokens Msg From 1xx.xx.xx.xxx:Baler14-1.45 registered. clock set: 2004-06-08 10:47:31 DP Tokens loaded, size=1274 bytes Webserver advertising 1xx.xx.xx.xxx:80 filters & delay BHZ:1@40,Linear below 100sps=0.405462 filters & delay BHN:2@40,Linear below 100sps=0.405462 filters & delay BHE:3@40,Linear below 100sps=0.405462 filters & delay LHZ:1@1,Linear below 100sps=14.930462 filters & delay LHN:2@1,Linear below 100sps=14.930462 filters & delay LHE:3@1,Linear below 100sps=14.930462 filters & delay VHZ:LHZ@0.1000=214.430462 filters & delay VHN:LHN@0.1000=214.430462 filters & delay VHE:LHE@0.1000=214.430462 filters & delay UHZ:VHZ@0.0100=2209.430462 filters & delay UHN:VHN@0.0100=2209.430462 filters & delay UHE:VHE@0.0100=2209.430462 [2004-06-08 00:57:51.000000] continuity found: 9698 139971471.000000 Q=58 [2004-06-08 00:57:51.000000] restoring continuity Sending DT_OPEN Station: TA-V04C Q330 Serial Number: 0100000000000000 AMB Serial Number: 0100000000000000 Seismo 1 Serial Number: 0000000000000000 Seismo 2 Serial Number: 0000000000000000 QAPCHP 1 Serial Number: 0000000 QAPCHP 2 Serial Number: 0 KMI Property Tag Number: 000 System Software Version: 1.53 Slave Processor Version: 1.10 Calibrator Type: QCAL330 Calibrator Version: 1.6 Clock Type: Motorola M12 PLD Version: 4.6 GPS Engine Identification SFTW P/N # 61-G10002A SOFTWARE VER # 1 SOFTWARE REV # 8 SOFTWARE DATE MAY 15 2002 MODEL # P273000000 HWDR P/N # 2 SERIAL # P05ISY MANUFACTUR DATE 3D17 Total Hours: 4188.05 Power On Hours: 1737.89 Time of Last Boot: 2004-06-07 22:15:01 Total Number of Boots: 34 Time of Last Re-Sync: 2004-06-07 22:28:15 Total Number of Re-Syncs: 39 Status Inputs: 00000000 AC OK: Off, Input 1,2: Off,Off, Analog Fault: Off Clock Quality: 44% Clock quality mapping: L=100 T=90 H=80 N=0 zone=0 Clock Phase: 1 usec. max allowed=50000 Boom positions: Ch1: -11 Ch2: 0 Ch3: -2 Ch4: 20 Ch5: 20 Ch6: 20 Analog Status Analog Positive Supply: 5.47V Input Voltage: 12.00V System Temperature: 23C Main Current: 39ma Antenna Current: 0ma GPS Status Time: Date: Fix Type: OFF Height: Latitude: Longitude: Off Time: 169min Sat. Used: 0 In View: 0 Checksum Errors: 0 Last GPS timemark: 2004-06-08 07:58:07 PLL Status State: Hold Intitial VCO: 1955.836792 Time Error: 0.000003 RMS VCO: 0.0000000 Best VCO: 1955.84 Seconds Since Track or Lock: 10169.4 Vco Control: 1957 timing mode: internal GPS internal GPS power management mode: Until PLL lock tempco normal power off-time: 180m max on-time: 120m resync at: 0 PLL update: 10s PLL lock criterion: 5us Pfrac: 150.00 VCO slope: -0.0175000 VCO intercept: 7.1100001 Km delta: 600.0000000 Logical Port 4 Status Data Packets Sent: 9715 Flood Packets Sent: 0 Packets Re-Sent: 18 Sequence Errors: 0 Packet Buffer Used: 4194044 Physical Port: Serial 2 Baler Model: 14 Software Version: 1.45 MAC Address: F2:3F:09:9E:AF:C2 Disk Size: 20000669696 Percent of 1177 data files in use: 2.2 DMU2 Software Version=4, Serial Number=0100000000000000 Supply Voltage=11.9 Temperature=20C Disk Model: IC250000000000-0 Revision: C0000000 [2004-06-08 00:57:51.000000] SEQUENCE GAP 16134 FROM 9698 TO 25832 [2004-06-08 05:26:45.000003] time label discontinuity: LCQ 16133.000003 iris-edu-libmseed-4314359/test/read-unapplied-timecorrection.test000077500000000000000000000001541422047135100250130ustar00rootroot00000000000000#!/bin/sh LD_LIBRARY_PATH=.. \ DYLD_LIBRARY_PATH=.. \ ./lmtestparse data/unapplied-timecorrection.mseed -pp iris-edu-libmseed-4314359/test/read-unapplied-timecorrection.test.ref000066400000000000000000000015631422047135100255700ustar00rootroot00000000000000XX_TEST_00_BHZ, 000001, R start time: 2003,149,02:13:23.043400 number of samples: 5980 sample rate factor: 32760 (40 samples per second) sample rate multiplier: -819 activity flags: [00000000] 8 bits I/O and clock flags: [00000000] 8 bits data quality flags: [00000000] 8 bits number of blockettes: 2 time correction: 10000 data offset: 128 first blockette offset: 48 BLOCKETTE 1000: (Data Only SEED) next blockette: 64 encoding: STEIM 2 Compression (val:11) byte order: Big endian (val:1) record length: 4096 (val:12) reserved byte: 0 BLOCKETTE 100: (Sample Rate) next blockette: 0 actual sample rate: 40 undefined flags: [00000000] 8 bits reserved bytes (3): 0,0,0 iris-edu-libmseed-4314359/tracelist.c000066400000000000000000001072761422047135100173650ustar00rootroot00000000000000/*************************************************************************** * tracelist.c: * * Routines to handle TraceList and related structures. * * Written by Chad Trabant, IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include "libmseed.h" MSTraceSeg *mstl_msr2seg (MSRecord *msr, hptime_t endtime); MSTraceSeg *mstl_addmsrtoseg (MSTraceSeg *seg, MSRecord *msr, hptime_t endtime, flag whence); MSTraceSeg *mstl_addsegtoseg (MSTraceSeg *seg1, MSTraceSeg *seg2); /*************************************************************************** * mstl_init: * * Initialize and return a MSTraceList struct, allocating memory if * needed. If the supplied MSTraceList is not NULL any associated * memory it will be freed including data at prvtptr pointers. * * Returns a pointer to a MSTraceList struct on success or NULL on error. ***************************************************************************/ MSTraceList * mstl_init (MSTraceList *mstl) { if (mstl) { mstl_free (&mstl, 1); } mstl = (MSTraceList *)malloc (sizeof (MSTraceList)); if (mstl == NULL) { ms_log (2, "mstl_init(): Cannot allocate memory\n"); return NULL; } memset (mstl, 0, sizeof (MSTraceList)); return mstl; } /* End of mstl_init() */ /*************************************************************************** * mstl_free: * * Free all memory associated with a MSTraceList struct and set the * pointer to 0. * * If the freeprvtptr flag is true any private pointer data will also * be freed when present. ***************************************************************************/ void mstl_free (MSTraceList **ppmstl, flag freeprvtptr) { MSTraceID *id = 0; MSTraceID *nextid = 0; MSTraceSeg *seg = 0; MSTraceSeg *nextseg = 0; if (!ppmstl) return; if (*ppmstl) { /* Free any associated traces */ id = (*ppmstl)->traces; while (id) { nextid = id->next; /* Free any associated trace segments */ seg = id->first; while (seg) { nextseg = seg->next; /* Free private pointer data if present and requested*/ if (freeprvtptr && seg->prvtptr) free (seg->prvtptr); /* Free data array if allocated */ if (seg->datasamples) free (seg->datasamples); free (seg); seg = nextseg; } /* Free private pointer data if present and requested*/ if (freeprvtptr && id->prvtptr) free (id->prvtptr); free (id); id = nextid; } free (*ppmstl); *ppmstl = NULL; } return; } /* End of mstl_free() */ /*************************************************************************** * mstl_addmsr: * * Add data coverage from an MSRecord to a MSTraceList by searching the * list for the appropriate MSTraceID and MSTraceSeg and either adding * data to it or creating a new MStraceID and/or MSTraceSeg if needed. * * If the dataquality flag is true the data quality bytes must also * match otherwise they are ignored. * * If the autoheal flag is true extra processing is invoked to conjoin * trace segments that fit together after the MSRecord coverage is * added. For segments that are removed, any memory at the prvtptr * will be freed. * * An MSTraceList is always maintained with the MSTraceIDs in * descending alphanumeric order. MSTraceIDs are always maintained * with MSTraceSegs in data time time order. * * Return a pointer to the MSTraceSeg updated or 0 on error. ***************************************************************************/ MSTraceSeg * mstl_addmsr (MSTraceList *mstl, MSRecord *msr, flag dataquality, flag autoheal, double timetol, double sampratetol) { MSTraceID *id = 0; MSTraceID *searchid = 0; MSTraceID *ltid = 0; MSTraceSeg *seg = 0; MSTraceSeg *searchseg = 0; MSTraceSeg *segbefore = 0; MSTraceSeg *segafter = 0; MSTraceSeg *followseg = 0; hptime_t endtime; hptime_t pregap; hptime_t postgap; hptime_t lastgap; hptime_t firstgap; hptime_t hpdelta; hptime_t hptimetol = 0; hptime_t nhptimetol = 0; char srcname[45]; char *s1, *s2; flag whence; flag lastratecheck; flag firstratecheck; int mag; int cmp; int ltmag; int ltcmp; if (!mstl || !msr) return 0; /* Calculate end time for MSRecord */ if ((endtime = msr_endtime (msr)) == HPTERROR) { ms_log (2, "mstl_addmsr(): Error calculating record end time\n"); return 0; } /* Generate source name string */ if (!msr_srcname (msr, srcname, dataquality)) { ms_log (2, "mstl_addmsr(): Error generating srcname for MSRecord\n"); return 0; } /* Search for matching trace ID starting with last accessed ID and then looping through the trace ID list. */ if (mstl->last) { s1 = mstl->last->srcname; s2 = srcname; while (*s1 == *s2++) { if (*s1++ == '\0') break; } cmp = (*s1 - *--s2); if (!cmp) { id = mstl->last; } else { /* Loop through trace ID list searching for a match, simultaneously track the source name which is closest but less than the MSRecord to allow for later insertion with sort order. */ searchid = mstl->traces; ltcmp = 0; ltmag = 0; while (searchid) { /* Compare source names */ s1 = searchid->srcname; s2 = srcname; mag = 0; while (*s1 == *s2++) { mag++; if (*s1++ == '\0') break; } cmp = (*s1 - *--s2); /* If source names did not match track closest "less than" value and continue searching. */ if (cmp != 0) { if (cmp < 0) { if ((ltcmp == 0 || cmp >= ltcmp) && mag >= ltmag) { ltcmp = cmp; ltmag = mag; ltid = searchid; } else if (mag > ltmag) { ltcmp = cmp; ltmag = mag; ltid = searchid; } } searchid = searchid->next; continue; } /* If we made it this far we found a match */ id = searchid; break; } } } /* Done searching for match in trace ID list */ /* If no matching ID was found create new MSTraceID and MSTraceSeg entries */ if (!id) { if (!(id = (MSTraceID *)calloc (1, sizeof (MSTraceID)))) { ms_log (2, "mstl_addmsr(): Error allocating memory\n"); return 0; } /* Populate MSTraceID */ strcpy (id->network, msr->network); strcpy (id->station, msr->station); strcpy (id->location, msr->location); strcpy (id->channel, msr->channel); id->dataquality = msr->dataquality; strcpy (id->srcname, srcname); id->earliest = msr->starttime; id->latest = endtime; id->numsegments = 1; if (!(seg = mstl_msr2seg (msr, endtime))) { return 0; } id->first = id->last = seg; /* Add new MSTraceID to MSTraceList */ if (!mstl->traces || !ltid) { id->next = mstl->traces; mstl->traces = id; } else { id->next = ltid->next; ltid->next = id; } mstl->numtraces++; } /* Add data coverage to the matching MSTraceID */ else { /* Calculate high-precision sample period */ hpdelta = (hptime_t) ((msr->samprate) ? (HPTMODULUS / msr->samprate) : 0.0); /* Calculate high-precision time tolerance */ if (timetol == -1.0) hptimetol = (hptime_t) (0.5 * hpdelta); /* Default time tolerance is 1/2 sample period */ else if (timetol >= 0.0) hptimetol = (hptime_t) (timetol * HPTMODULUS); nhptimetol = (hptimetol) ? -hptimetol : 0; /* last/firstgap are negative when the record overlaps the trace * segment and positive when there is a time gap. */ /* Gap relative to the last segment */ lastgap = msr->starttime - id->last->endtime - hpdelta; /* Gap relative to the first segment */ firstgap = id->first->starttime - endtime - hpdelta; /* Sample rate tolerance checks for first and last segments */ if (sampratetol == -1.0) { lastratecheck = MS_ISRATETOLERABLE (msr->samprate, id->last->samprate); firstratecheck = MS_ISRATETOLERABLE (msr->samprate, id->first->samprate); } else { lastratecheck = (ms_dabs (msr->samprate - id->last->samprate) > sampratetol) ? 0 : 1; firstratecheck = (ms_dabs (msr->samprate - id->first->samprate) > sampratetol) ? 0 : 1; } /* Search first for the simple scenarios in order of likelihood: * - Record fits at end of last segment * - Record fits after all coverage * - Record fits before all coverage * - Record fits at beginning of first segment * * If none of those scenarios are true search the complete segment list. */ /* Record coverage fits at end of last segment */ if (lastgap <= hptimetol && lastgap >= nhptimetol && lastratecheck) { if (!mstl_addmsrtoseg (id->last, msr, endtime, 1)) return 0; seg = id->last; if (endtime > id->latest) id->latest = endtime; } /* Record coverage is after all other coverage */ else if ((msr->starttime - hpdelta - hptimetol) > id->latest) { if (!(seg = mstl_msr2seg (msr, endtime))) return 0; /* Add to end of list */ id->last->next = seg; seg->prev = id->last; id->last = seg; id->numsegments++; if (endtime > id->latest) id->latest = endtime; } /* Record coverage is before all other coverage */ else if ((endtime + hpdelta + hptimetol) < id->earliest) { if (!(seg = mstl_msr2seg (msr, endtime))) return 0; /* Add to beginning of list */ id->first->prev = seg; seg->next = id->first; id->first = seg; id->numsegments++; if (msr->starttime < id->earliest) id->earliest = msr->starttime; } /* Record coverage fits at beginning of first segment */ else if (firstgap <= hptimetol && firstgap >= nhptimetol && firstratecheck) { if (!mstl_addmsrtoseg (id->first, msr, endtime, 2)) return 0; seg = id->first; if (msr->starttime < id->earliest) id->earliest = msr->starttime; } /* Search complete segment list for matches */ else { searchseg = id->first; segbefore = 0; /* Find segment that record fits before */ segafter = 0; /* Find segment that record fits after */ followseg = 0; /* Track segment that record follows in time order */ while (searchseg) { if (msr->starttime > searchseg->starttime) followseg = searchseg; whence = 0; postgap = msr->starttime - searchseg->endtime - hpdelta; if (!segbefore && postgap <= hptimetol && postgap >= nhptimetol) whence = 1; pregap = searchseg->starttime - endtime - hpdelta; if (!segafter && pregap <= hptimetol && pregap >= nhptimetol) whence = 2; if (!whence) { searchseg = searchseg->next; continue; } if (sampratetol == -1.0) { if (!MS_ISRATETOLERABLE (msr->samprate, searchseg->samprate)) { searchseg = searchseg->next; continue; } } else { if (ms_dabs (msr->samprate - searchseg->samprate) > sampratetol) { searchseg = searchseg->next; continue; } } if (whence == 1) segbefore = searchseg; else segafter = searchseg; /* Done searching if not autohealing */ if (!autoheal) break; /* Done searching if both before and after segments are found */ if (segbefore && segafter) break; searchseg = searchseg->next; } /* Done looping through segments */ /* Add MSRecord coverage to end of segment before */ if (segbefore) { if (!mstl_addmsrtoseg (segbefore, msr, endtime, 1)) { return 0; } /* Merge two segments that now fit if autohealing */ if (autoheal && segafter && segbefore != segafter) { /* Add segafter coverage to segbefore */ if (!mstl_addsegtoseg (segbefore, segafter)) { return 0; } /* Shift last segment pointer if it's going to be removed */ if (segafter == id->last) id->last = id->last->prev; /* Remove segafter from list */ if (segafter->prev) segafter->prev->next = segafter->next; if (segafter->next) segafter->next->prev = segafter->prev; /* Free data samples, private data and segment structure */ if (segafter->datasamples) free (segafter->datasamples); if (segafter->prvtptr) free (segafter->prvtptr); free (segafter); } seg = segbefore; } /* Add MSRecord coverage to beginning of segment after */ else if (segafter) { if (!mstl_addmsrtoseg (segafter, msr, endtime, 2)) { return 0; } seg = segafter; } /* Add MSRecord coverage to new segment */ else { /* Create new segment */ if (!(seg = mstl_msr2seg (msr, endtime))) { return 0; } /* Add new segment as first in list */ if (!followseg) { seg->next = id->first; if (id->first) id->first->prev = seg; id->first = seg; } /* Add new segment after the followseg segment */ else { seg->next = followseg->next; seg->prev = followseg; if (followseg->next) followseg->next->prev = seg; followseg->next = seg; if (followseg == id->last) id->last = seg; } id->numsegments++; } /* Track earliest and latest times */ if (msr->starttime < id->earliest) id->earliest = msr->starttime; if (endtime > id->latest) id->latest = endtime; } /* End of searching segment list */ } /* End of adding coverage to matching ID */ /* Sort modified segment into place, logic above should limit these to few shifts if any */ while (seg->next && (seg->starttime > seg->next->starttime || (seg->starttime == seg->next->starttime && seg->endtime < seg->next->endtime))) { /* Move segment down list, swap seg and seg->next */ segafter = seg->next; if (seg->prev) seg->prev->next = segafter; if (segafter->next) segafter->next->prev = seg; segafter->prev = seg->prev; seg->prev = segafter; seg->next = segafter->next; segafter->next = seg; /* Reset first and last segment pointers if replaced */ if (id->first == seg) id->first = segafter; if (id->last == segafter) id->last = seg; } while (seg->prev && (seg->starttime < seg->prev->starttime || (seg->starttime == seg->prev->starttime && seg->endtime > seg->prev->endtime))) { /* Move segment up list, swap seg and seg->prev */ segbefore = seg->prev; if (seg->next) seg->next->prev = segbefore; if (segbefore->prev) segbefore->prev->next = seg; segbefore->next = seg->next; seg->next = segbefore; seg->prev = segbefore->prev; segbefore->prev = seg; /* Reset first and last segment pointers if replaced */ if (id->first == segbefore) id->first = seg; if (id->last == seg) id->last = segbefore; } /* Set MSTraceID as last accessed */ mstl->last = id; return seg; } /* End of mstl_addmsr() */ /*************************************************************************** * mstl_msr2seg: * * Create an MSTraceSeg structure from an MSRecord structure. * * Return a pointer to a MSTraceSeg otherwise 0 on error. ***************************************************************************/ MSTraceSeg * mstl_msr2seg (MSRecord *msr, hptime_t endtime) { MSTraceSeg *seg = 0; int samplesize; if (!(seg = (MSTraceSeg *)calloc (1, sizeof (MSTraceSeg)))) { ms_log (2, "mstl_addmsr(): Error allocating memory\n"); return 0; } /* Populate MSTraceSeg */ seg->starttime = msr->starttime; seg->endtime = endtime; seg->samprate = msr->samprate; seg->samplecnt = msr->samplecnt; seg->sampletype = msr->sampletype; seg->numsamples = msr->numsamples; /* Allocate space for and copy datasamples */ if (msr->datasamples && msr->numsamples) { samplesize = ms_samplesize (msr->sampletype); if (!(seg->datasamples = malloc ((size_t) (samplesize * msr->numsamples)))) { ms_log (2, "mstl_msr2seg(): Error allocating memory\n"); return 0; } /* Copy data samples from MSRecord to MSTraceSeg */ memcpy (seg->datasamples, msr->datasamples, (size_t) (samplesize * msr->numsamples)); } return seg; } /* End of mstl_msr2seg() */ /*************************************************************************** * mstl_addmsrtoseg: * * Add data coverage from a MSRecord structure to a MSTraceSeg structure. * * Data coverage is added to the beginning or end of MSTraceSeg * according to the whence flag: * 1 : add coverage to the end * 2 : add coverage to the beginninig * * Return a pointer to a MSTraceSeg otherwise 0 on error. ***************************************************************************/ MSTraceSeg * mstl_addmsrtoseg (MSTraceSeg *seg, MSRecord *msr, hptime_t endtime, flag whence) { int samplesize = 0; void *newdatasamples; if (!seg || !msr) return 0; /* Allocate more memory for data samples if included */ if (msr->datasamples && msr->numsamples > 0) { if (msr->sampletype != seg->sampletype) { ms_log (2, "mstl_addmsrtoseg(): MSRecord sample type (%c) does not match segment sample type (%c)\n", msr->sampletype, seg->sampletype); return 0; } if (!(samplesize = ms_samplesize (msr->sampletype))) { ms_log (2, "mstl_addmsrtoseg(): Unknown sample size for sample type: %c\n", msr->sampletype); return 0; } if (!(newdatasamples = realloc (seg->datasamples, (size_t) ((seg->numsamples + msr->numsamples) * samplesize)))) { ms_log (2, "mstl_addmsrtoseg(): Error allocating memory\n"); return 0; } seg->datasamples = newdatasamples; } /* Add coverage to end of segment */ if (whence == 1) { seg->endtime = endtime; seg->samplecnt += msr->samplecnt; if (msr->datasamples && msr->numsamples > 0) { memcpy ((char *)seg->datasamples + (seg->numsamples * samplesize), msr->datasamples, (size_t) (msr->numsamples * samplesize)); seg->numsamples += msr->numsamples; } } /* Add coverage to beginning of segment */ else if (whence == 2) { seg->starttime = msr->starttime; seg->samplecnt += msr->samplecnt; if (msr->datasamples && msr->numsamples > 0) { memmove ((char *)seg->datasamples + (msr->numsamples * samplesize), seg->datasamples, (size_t) (seg->numsamples * samplesize)); memcpy (seg->datasamples, msr->datasamples, (size_t) (msr->numsamples * samplesize)); seg->numsamples += msr->numsamples; } } else { ms_log (2, "mstl_addmsrtoseg(): unrecognized whence value: %d\n", whence); return 0; } return seg; } /* End of mstl_addmsrtoseg() */ /*************************************************************************** * mstl_addsegtoseg: * * Add data coverage from seg2 to seg1. * * Return a pointer to a seg1 otherwise 0 on error. ***************************************************************************/ MSTraceSeg * mstl_addsegtoseg (MSTraceSeg *seg1, MSTraceSeg *seg2) { int samplesize = 0; void *newdatasamples; if (!seg1 || !seg2) return 0; /* Allocate more memory for data samples if included */ if (seg2->datasamples && seg2->numsamples > 0) { if (seg2->sampletype != seg1->sampletype) { ms_log (2, "mstl_addsegtoseg(): MSTraceSeg sample types do not match (%c and %c)\n", seg1->sampletype, seg2->sampletype); return 0; } if (!(samplesize = ms_samplesize (seg1->sampletype))) { ms_log (2, "mstl_addsegtoseg(): Unknown sample size for sample type: %c\n", seg1->sampletype); return 0; } if (!(newdatasamples = realloc (seg1->datasamples, (size_t) ((seg1->numsamples + seg2->numsamples) * samplesize)))) { ms_log (2, "mstl_addsegtoseg(): Error allocating memory\n"); return 0; } seg1->datasamples = newdatasamples; } /* Add seg2 coverage to end of seg1 */ seg1->endtime = seg2->endtime; seg1->samplecnt += seg2->samplecnt; if (seg2->datasamples && seg2->numsamples > 0) { memcpy ((char *)seg1->datasamples + (seg1->numsamples * samplesize), seg2->datasamples, (size_t) (seg2->numsamples * samplesize)); seg1->numsamples += seg2->numsamples; } return seg1; } /* End of mstl_addsegtoseg() */ /*************************************************************************** * mstl_convertsamples: * * Convert the data samples associated with an MSTraceSeg to another * data type. ASCII data samples cannot be converted, if supplied or * requested an error will be returned. * * When converting float & double sample types to integer type a * simple rounding is applied by adding 0.5 to the sample value before * converting (truncating) to integer. * * If the truncate flag is true data samples will be truncated to * integers even if loss of sample precision is detected. If the * truncate flag is false (0) and loss of precision is detected an * error is returned. * * Returns 0 on success, and -1 on failure. ***************************************************************************/ int mstl_convertsamples (MSTraceSeg *seg, char type, flag truncate) { int32_t *idata; float *fdata; double *ddata; int64_t idx; if (!seg) return -1; /* No conversion necessary, report success */ if (seg->sampletype == type) return 0; if (seg->sampletype == 'a' || type == 'a') { ms_log (2, "mstl_convertsamples: cannot convert ASCII samples to/from numeric type\n"); return -1; } idata = (int32_t *)seg->datasamples; fdata = (float *)seg->datasamples; ddata = (double *)seg->datasamples; /* Convert to 32-bit integers */ if (type == 'i') { if (seg->sampletype == 'f') /* Convert floats to integers with simple rounding */ { for (idx = 0; idx < seg->numsamples; idx++) { /* Check for loss of sub-integer */ if (!truncate && (fdata[idx] - (int32_t)fdata[idx]) > 0.000001) { ms_log (1, "mstl_convertsamples: Warning, loss of precision when converting floats to integers, loss: %g\n", (fdata[idx] - (int32_t)fdata[idx])); return -1; } idata[idx] = (int32_t) (fdata[idx] + 0.5); } } else if (seg->sampletype == 'd') /* Convert doubles to integers with simple rounding */ { for (idx = 0; idx < seg->numsamples; idx++) { /* Check for loss of sub-integer */ if (!truncate && (ddata[idx] - (int32_t)ddata[idx]) > 0.000001) { ms_log (1, "mstl_convertsamples: Warning, loss of precision when converting doubles to integers, loss: %g\n", (ddata[idx] - (int32_t)ddata[idx])); return -1; } idata[idx] = (int32_t) (ddata[idx] + 0.5); } /* Reallocate buffer for reduced size needed */ if (!(seg->datasamples = realloc (seg->datasamples, (size_t) (seg->numsamples * sizeof (int32_t))))) { ms_log (2, "mstl_convertsamples: cannot re-allocate buffer for sample conversion\n"); return -1; } } seg->sampletype = 'i'; } /* Done converting to 32-bit integers */ /* Convert to 32-bit floats */ else if (type == 'f') { if (seg->sampletype == 'i') /* Convert integers to floats */ { for (idx = 0; idx < seg->numsamples; idx++) fdata[idx] = (float)idata[idx]; } else if (seg->sampletype == 'd') /* Convert doubles to floats */ { for (idx = 0; idx < seg->numsamples; idx++) fdata[idx] = (float)ddata[idx]; /* Reallocate buffer for reduced size needed */ if (!(seg->datasamples = realloc (seg->datasamples, (size_t) (seg->numsamples * sizeof (float))))) { ms_log (2, "mstl_convertsamples: cannot re-allocate buffer after sample conversion\n"); return -1; } } seg->sampletype = 'f'; } /* Done converting to 32-bit floats */ /* Convert to 64-bit doubles */ else if (type == 'd') { if (!(ddata = (double *)malloc ((size_t) (seg->numsamples * sizeof (double))))) { ms_log (2, "mstl_convertsamples: cannot allocate buffer for sample conversion to doubles\n"); return -1; } if (seg->sampletype == 'i') /* Convert integers to doubles */ { for (idx = 0; idx < seg->numsamples; idx++) ddata[idx] = (double)idata[idx]; free (idata); } else if (seg->sampletype == 'f') /* Convert floats to doubles */ { for (idx = 0; idx < seg->numsamples; idx++) ddata[idx] = (double)fdata[idx]; free (fdata); } seg->datasamples = ddata; seg->sampletype = 'd'; } /* Done converting to 64-bit doubles */ return 0; } /* End of mstl_convertsamples() */ /*************************************************************************** * mstl_printtracelist: * * Print trace list summary information for the specified MSTraceList. * * By default only print the srcname, starttime and endtime for each * trace. If details is greater than 0 include the sample rate, * number of samples and a total trace count. If gaps is greater than * 0 and the previous trace matches (srcname & samprate) include the * gap between the endtime of the last trace and the starttime of the * current trace. * * The timeformat flag can either be: * 0 : SEED time format (year, day-of-year, hour, min, sec) * 1 : ISO time format (year, month, day, hour, min, sec) * 2 : Epoch time, seconds since the epoch ***************************************************************************/ void mstl_printtracelist (MSTraceList *mstl, flag timeformat, flag details, flag gaps) { MSTraceID *id = 0; MSTraceSeg *seg = 0; char stime[30]; char etime[30]; char gapstr[20]; flag nogap; double gap; double delta; int tracecnt = 0; int segcnt = 0; if (!mstl) { return; } /* Print out the appropriate header */ if (details > 0 && gaps > 0) ms_log (0, " Source Start sample End sample Gap Hz Samples\n"); else if (details <= 0 && gaps > 0) ms_log (0, " Source Start sample End sample Gap\n"); else if (details > 0 && gaps <= 0) ms_log (0, " Source Start sample End sample Hz Samples\n"); else ms_log (0, " Source Start sample End sample\n"); /* Loop through trace list */ id = mstl->traces; while (id) { /* Loop through segment list */ seg = id->first; while (seg) { /* Create formatted time strings */ if (timeformat == 2) { snprintf (stime, sizeof (stime), "%.6f", MS_HPTIME2EPOCH ((double)seg->starttime)); snprintf (etime, sizeof (etime), "%.6f", MS_HPTIME2EPOCH ((double)seg->endtime)); } else if (timeformat == 1) { if (ms_hptime2isotimestr (seg->starttime, stime, 1) == NULL) ms_log (2, "Cannot convert trace start time for %s\n", id->srcname); if (ms_hptime2isotimestr (seg->endtime, etime, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", id->srcname); } else { if (ms_hptime2seedtimestr (seg->starttime, stime, 1) == NULL) ms_log (2, "Cannot convert trace start time for %s\n", id->srcname); if (ms_hptime2seedtimestr (seg->endtime, etime, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", id->srcname); } /* Print segment info at varying levels */ if (gaps > 0) { gap = 0.0; nogap = 0; if (seg->prev) gap = (double)(seg->starttime - seg->prev->endtime) / HPTMODULUS; else nogap = 1; /* Check that any overlap is not larger than the trace coverage */ if (gap < 0.0) { delta = (seg->samprate) ? (1.0 / seg->samprate) : 0.0; if ((gap * -1.0) > (((double)(seg->endtime - seg->starttime) / HPTMODULUS) + delta)) gap = -(((double)(seg->endtime - seg->starttime) / HPTMODULUS) + delta); } /* Fix up gap display */ if (nogap) snprintf (gapstr, sizeof (gapstr), " == "); else if (gap >= 86400.0 || gap <= -86400.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fd", (gap / 86400)); else if (gap >= 3600.0 || gap <= -3600.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fh", (gap / 3600)); else if (gap == 0.0) snprintf (gapstr, sizeof (gapstr), "-0 "); else snprintf (gapstr, sizeof (gapstr), "%-4.4g", gap); if (details <= 0) ms_log (0, "%-17s %-24s %-24s %-4s\n", id->srcname, stime, etime, gapstr); else ms_log (0, "%-17s %-24s %-24s %-s %-3.3g %-" PRId64 "\n", id->srcname, stime, etime, gapstr, seg->samprate, seg->samplecnt); } else if (details > 0 && gaps <= 0) ms_log (0, "%-17s %-24s %-24s %-3.3g %-" PRId64 "\n", id->srcname, stime, etime, seg->samprate, seg->samplecnt); else ms_log (0, "%-17s %-24s %-24s\n", id->srcname, stime, etime); segcnt++; seg = seg->next; } tracecnt++; id = id->next; } if (tracecnt != mstl->numtraces) ms_log (2, "mstl_printtracelist(): number of traces in trace list is inconsistent\n"); if (details > 0) ms_log (0, "Total: %d trace(s) with %d segment(s)\n", tracecnt, segcnt); return; } /* End of mstl_printtracelist() */ /*************************************************************************** * mstl_printsynclist: * * Print SYNC trace list summary information for the specified MSTraceList. * * The SYNC header line will be created using the supplied dccid, if * the pointer is NULL the string "DCC" will be used instead. * * If the subsecond flag is true the segment start and end times will * include subsecond precision, otherwise they will be truncated to * integer seconds. * ***************************************************************************/ void mstl_printsynclist (MSTraceList *mstl, char *dccid, flag subsecond) { MSTraceID *id = 0; MSTraceSeg *seg = 0; char starttime[30]; char endtime[30]; char yearday[24]; time_t now; struct tm *nt; if (!mstl) { return; } /* Generate current time stamp */ now = time (NULL); nt = localtime (&now); nt->tm_year += 1900; nt->tm_yday += 1; snprintf (yearday, sizeof (yearday), "%04d,%03d", nt->tm_year, nt->tm_yday); /* Print SYNC header line */ ms_log (0, "%s|%s\n", (dccid) ? dccid : "DCC", yearday); /* Loop through trace list */ id = mstl->traces; while (id) { /* Loop through segment list */ seg = id->first; while (seg) { ms_hptime2seedtimestr (seg->starttime, starttime, subsecond); ms_hptime2seedtimestr (seg->endtime, endtime, subsecond); /* Print SYNC line */ ms_log (0, "%s|%s|%s|%s|%s|%s||%.10g|%" PRId64 "|||||||%s\n", id->network, id->station, id->location, id->channel, starttime, endtime, seg->samprate, seg->samplecnt, yearday); seg = seg->next; } id = id->next; } return; } /* End of mstl_printsynclist() */ /*************************************************************************** * mstl_printgaplist: * * Print gap/overlap list summary information for the specified * MSTraceList. Overlaps are printed as negative gaps. * * If mingap and maxgap are not NULL their values will be enforced and * only gaps/overlaps matching their implied criteria will be printed. * * The timeformat flag can either be: * 0 : SEED time format (year, day-of-year, hour, min, sec) * 1 : ISO time format (year, month, day, hour, min, sec) * 2 : Epoch time, seconds since the epoch ***************************************************************************/ void mstl_printgaplist (MSTraceList *mstl, flag timeformat, double *mingap, double *maxgap) { MSTraceID *id = 0; MSTraceSeg *seg = 0; char time1[30], time2[30]; char gapstr[30]; double gap; double delta; double nsamples; flag printflag; int gapcnt = 0; if (!mstl) return; if (!mstl->traces) return; ms_log (0, " Source Last Sample Next Sample Gap Samples\n"); id = mstl->traces; while (id) { seg = id->first; while (seg->next) { /* Skip segments with 0 sample rate, usually from SOH records */ if (seg->samprate == 0.0) { seg = seg->next; continue; } gap = (double)(seg->next->starttime - seg->endtime) / HPTMODULUS; /* Check that any overlap is not larger than the trace coverage */ if (gap < 0.0) { delta = (seg->next->samprate) ? (1.0 / seg->next->samprate) : 0.0; if ((gap * -1.0) > (((double)(seg->next->endtime - seg->next->starttime) / HPTMODULUS) + delta)) gap = -(((double)(seg->next->endtime - seg->next->starttime) / HPTMODULUS) + delta); } printflag = 1; /* Check gap/overlap criteria */ if (mingap) if (gap < *mingap) printflag = 0; if (maxgap) if (gap > *maxgap) printflag = 0; if (printflag) { nsamples = ms_dabs (gap) * seg->samprate; if (gap > 0.0) nsamples -= 1.0; else nsamples += 1.0; /* Fix up gap display */ if (gap >= 86400.0 || gap <= -86400.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fd", (gap / 86400)); else if (gap >= 3600.0 || gap <= -3600.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fh", (gap / 3600)); else if (gap == 0.0) snprintf (gapstr, sizeof (gapstr), "-0 "); else snprintf (gapstr, sizeof (gapstr), "%-4.4g", gap); /* Create formatted time strings */ if (timeformat == 2) { snprintf (time1, sizeof (time1), "%.6f", MS_HPTIME2EPOCH ((double)seg->endtime)); snprintf (time2, sizeof (time2), "%.6f", MS_HPTIME2EPOCH ((double)seg->next->starttime)); } else if (timeformat == 1) { if (ms_hptime2isotimestr (seg->endtime, time1, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", id->srcname); if (ms_hptime2isotimestr (seg->next->starttime, time2, 1) == NULL) ms_log (2, "Cannot convert next trace start time for %s\n", id->srcname); } else { if (ms_hptime2seedtimestr (seg->endtime, time1, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", id->srcname); if (ms_hptime2seedtimestr (seg->next->starttime, time2, 1) == NULL) ms_log (2, "Cannot convert next trace start time for %s\n", id->srcname); } ms_log (0, "%-17s %-24s %-24s %-4s %-.8g\n", id->srcname, time1, time2, gapstr, nsamples); gapcnt++; } seg = seg->next; } id = id->next; } ms_log (0, "Total: %d gap(s)\n", gapcnt); return; } /* End of mstl_printgaplist() */ iris-edu-libmseed-4314359/traceutils.c000066400000000000000000001450541422047135100175460ustar00rootroot00000000000000/*************************************************************************** * traceutils.c: * * Generic routines to handle Traces. * * Written by Chad Trabant, IRIS Data Management Center * * modified: 2015.108 ***************************************************************************/ #include #include #include #include #include "libmseed.h" static int mst_groupsort_cmp (MSTrace *mst1, MSTrace *mst2, flag quality); /*************************************************************************** * mst_init: * * Initialize and return a MSTrace struct, allocating memory if needed. * If the specified MSTrace includes data samples they will be freed. * * Returns a pointer to a MSTrace struct on success or NULL on error. ***************************************************************************/ MSTrace * mst_init (MSTrace *mst) { /* Free datasamples, prvtptr and stream state if present */ if (mst) { if (mst->datasamples) free (mst->datasamples); if (mst->prvtptr) free (mst->prvtptr); if (mst->ststate) free (mst->ststate); } else { mst = (MSTrace *)malloc (sizeof (MSTrace)); } if (mst == NULL) { ms_log (2, "mst_init(): Cannot allocate memory\n"); return NULL; } memset (mst, 0, sizeof (MSTrace)); return mst; } /* End of mst_init() */ /*************************************************************************** * mst_free: * * Free all memory associated with a MSTrace struct and set the pointer * to 0. ***************************************************************************/ void mst_free (MSTrace **ppmst) { if (ppmst && *ppmst) { /* Free datasamples if present */ if ((*ppmst)->datasamples) free ((*ppmst)->datasamples); /* Free private memory if present */ if ((*ppmst)->prvtptr) free ((*ppmst)->prvtptr); /* Free stream processing state if present */ if ((*ppmst)->ststate) free ((*ppmst)->ststate); free (*ppmst); *ppmst = 0; } } /* End of mst_free() */ /*************************************************************************** * mst_initgroup: * * Initialize and return a MSTraceGroup struct, allocating memory if * needed. If the supplied MSTraceGroup is not NULL any associated * memory it will be freed. * * Returns a pointer to a MSTraceGroup struct on success or NULL on error. ***************************************************************************/ MSTraceGroup * mst_initgroup (MSTraceGroup *mstg) { MSTrace *mst = 0; MSTrace *next = 0; if (mstg) { mst = mstg->traces; while (mst) { next = mst->next; mst_free (&mst); mst = next; } } else { mstg = (MSTraceGroup *)malloc (sizeof (MSTraceGroup)); } if (mstg == NULL) { ms_log (2, "mst_initgroup(): Cannot allocate memory\n"); return NULL; } memset (mstg, 0, sizeof (MSTraceGroup)); return mstg; } /* End of mst_initgroup() */ /*************************************************************************** * mst_freegroup: * * Free all memory associated with a MSTraceGroup struct and set the * pointer to 0. ***************************************************************************/ void mst_freegroup (MSTraceGroup **ppmstg) { MSTrace *mst = 0; MSTrace *next = 0; if (*ppmstg) { mst = (*ppmstg)->traces; while (mst) { next = mst->next; mst_free (&mst); mst = next; } free (*ppmstg); *ppmstg = 0; } } /* End of mst_freegroup() */ /*************************************************************************** * mst_findmatch: * * Traverse the MSTrace chain starting at 'startmst' until a MSTrace * is found that matches the given name identifiers. If the dataquality * byte is not 0 it must also match. * * Return a pointer a matching MSTrace otherwise 0 if no match found. ***************************************************************************/ MSTrace * mst_findmatch (MSTrace *startmst, char dataquality, char *network, char *station, char *location, char *channel) { int idx; if (!startmst || !network || !station || !location || !channel) return 0; while (startmst) { if (dataquality && dataquality != startmst->dataquality) { startmst = startmst->next; continue; } /* Compare network */ idx = 0; while (network[idx] == startmst->network[idx]) { if (network[idx] == '\0') break; idx++; } if (network[idx] != '\0' || startmst->network[idx] != '\0') { startmst = startmst->next; continue; } /* Compare station */ idx = 0; while (station[idx] == startmst->station[idx]) { if (station[idx] == '\0') break; idx++; } if (station[idx] != '\0' || startmst->station[idx] != '\0') { startmst = startmst->next; continue; } /* Compare location */ idx = 0; while (location[idx] == startmst->location[idx]) { if (location[idx] == '\0') break; idx++; } if (location[idx] != '\0' || startmst->location[idx] != '\0') { startmst = startmst->next; continue; } /* Compare channel */ idx = 0; while (channel[idx] == startmst->channel[idx]) { if (channel[idx] == '\0') break; idx++; } if (channel[idx] != '\0' || startmst->channel[idx] != '\0') { startmst = startmst->next; continue; } /* A match was found if we made it this far */ break; } return startmst; } /* End of mst_findmatch() */ /*************************************************************************** * mst_findadjacent: * * Find a MSTrace in a MSTraceGroup matching the given name * identifiers, samplerate and is adjacent with a time span. If the * dataquality byte is not 0 it must also match. * * The time tolerance and sample rate tolerance are used to determine * if traces abut. If timetol is -1.0 the default tolerance of 1/2 * the sample period will be used. If samprratetol is -1.0 the * default tolerance check of abs(1-sr1/sr2) < 0.0001 is used (defined * in libmseed.h). If timetol or sampratetol is -2.0 the respective * tolerance check will not be performed. * * The 'whence' flag will be set, when a matching MSTrace is found, to * indicate where the indicated time span is adjacent to the MSTrace * using the following values: * 1: time span fits at the end of the MSTrace * 2: time span fits at the beginning of the MSTrace * * Return a pointer a matching MSTrace and set the 'whence' flag * otherwise 0 if no match found. ***************************************************************************/ MSTrace * mst_findadjacent (MSTraceGroup *mstg, flag *whence, char dataquality, char *network, char *station, char *location, char *channel, double samprate, double sampratetol, hptime_t starttime, hptime_t endtime, double timetol) { MSTrace *mst = 0; hptime_t pregap; hptime_t postgap; hptime_t hpdelta; hptime_t hptimetol = 0; hptime_t nhptimetol = 0; int idx; if (!mstg || !whence || !network || !station || !location || !channel) return 0; *whence = 0; /* Calculate high-precision sample period */ hpdelta = (hptime_t) ((samprate) ? (HPTMODULUS / samprate) : 0.0); /* Calculate high-precision time tolerance */ if (timetol == -1.0) hptimetol = (hptime_t) (0.5 * hpdelta); /* Default time tolerance is 1/2 sample period */ else if (timetol >= 0.0) hptimetol = (hptime_t) (timetol * HPTMODULUS); nhptimetol = (hptimetol) ? -hptimetol : 0; mst = mstg->traces; while (mst) { /* post/pregap are negative when the record overlaps the trace * segment and positive when there is a time gap. */ postgap = starttime - mst->endtime - hpdelta; pregap = mst->starttime - endtime - hpdelta; /* If not checking the time tolerance decide if beginning or end is a better fit */ if (timetol == -2.0) { if (ms_dabs ((double)postgap) < ms_dabs ((double)pregap)) *whence = 1; else *whence = 2; } else { if (postgap <= hptimetol && postgap >= nhptimetol) { /* Span fits right at the end of the trace */ *whence = 1; } else if (pregap <= hptimetol && pregap >= nhptimetol) { /* Span fits right at the beginning of the trace */ *whence = 2; } else { /* Span does not fit with this Trace */ mst = mst->next; continue; } } /* Perform samprate tolerance check if requested */ if (sampratetol != -2.0) { /* Perform default samprate tolerance check if requested */ if (sampratetol == -1.0) { if (!MS_ISRATETOLERABLE (samprate, mst->samprate)) { mst = mst->next; continue; } } /* Otherwise check against the specified sample rate tolerance */ else if (ms_dabs (samprate - mst->samprate) > sampratetol) { mst = mst->next; continue; } } /* Compare data qualities */ if (dataquality && dataquality != mst->dataquality) { mst = mst->next; continue; } /* Compare network */ idx = 0; while (network[idx] == mst->network[idx]) { if (network[idx] == '\0') break; idx++; } if (network[idx] != '\0' || mst->network[idx] != '\0') { mst = mst->next; continue; } /* Compare station */ idx = 0; while (station[idx] == mst->station[idx]) { if (station[idx] == '\0') break; idx++; } if (station[idx] != '\0' || mst->station[idx] != '\0') { mst = mst->next; continue; } /* Compare location */ idx = 0; while (location[idx] == mst->location[idx]) { if (location[idx] == '\0') break; idx++; } if (location[idx] != '\0' || mst->location[idx] != '\0') { mst = mst->next; continue; } /* Compare channel */ idx = 0; while (channel[idx] == mst->channel[idx]) { if (channel[idx] == '\0') break; idx++; } if (channel[idx] != '\0' || mst->channel[idx] != '\0') { mst = mst->next; continue; } /* A match was found if we made it this far */ break; } return mst; } /* End of mst_findadjacent() */ /*************************************************************************** * mst_addmsr: * * Add MSRecord time coverage to a MSTrace. The start or end time will * be updated and samples will be copied if they exist. No checking * is done to verify that the record matches the trace in any way. * * If whence is 1 the coverage will be added at the end of the trace, * whereas if whence is 2 the coverage will be added at the beginning * of the trace. * * Return 0 on success and -1 on error. ***************************************************************************/ int mst_addmsr (MSTrace *mst, MSRecord *msr, flag whence) { int samplesize = 0; if (!mst || !msr || (whence != 1 && whence != 2)) return -1; /* Reallocate data sample buffer if samples are present */ if (msr->datasamples && msr->numsamples >= 0) { /* Check that the entire record was decompressed */ if (msr->samplecnt != msr->numsamples) { ms_log (2, "mst_addmsr(): Sample counts do not match, record not fully decompressed?\n"); ms_log (2, " The sample buffer will likely contain a discontinuity.\n"); } if ((samplesize = ms_samplesize (msr->sampletype)) == 0) { ms_log (2, "mst_addmsr(): Unrecognized sample type: '%c'\n", msr->sampletype); return -1; } if (msr->sampletype != mst->sampletype) { ms_log (2, "mst_addmsr(): Mismatched sample type, '%c' and '%c'\n", msr->sampletype, mst->sampletype); return -1; } mst->datasamples = realloc (mst->datasamples, (size_t) (mst->numsamples * samplesize + msr->numsamples * samplesize)); if (mst->datasamples == NULL) { ms_log (2, "mst_addmsr(): Cannot allocate memory\n"); return -1; } /* Add samples at end of trace */ if (whence == 1) { memcpy ((char *)mst->datasamples + (mst->numsamples * samplesize), msr->datasamples, (size_t) (msr->numsamples * samplesize)); mst->numsamples += msr->numsamples; mst->endtime = msr_endtime (msr); if (mst->endtime == HPTERROR) { ms_log (2, "mst_addmsr(): Error calculating record end time\n"); return -1; } } /* Add samples at the beginning of trace */ else if (whence == 2) { /* Move any samples to end of buffer */ if (mst->numsamples > 0) { memmove ((char *)mst->datasamples + (msr->numsamples * samplesize), mst->datasamples, (size_t) (mst->numsamples * samplesize)); } memcpy (mst->datasamples, msr->datasamples, (size_t) (msr->numsamples * samplesize)); mst->numsamples += msr->numsamples; mst->starttime = msr->starttime; } /* If two different data qualities reset the MSTrace.dataquality to 0 */ if (mst->dataquality && msr->dataquality && mst->dataquality != msr->dataquality) mst->dataquality = 0; /* Update MSTrace sample count */ mst->samplecnt += msr->numsamples; } return 0; } /* End of mst_addmsr() */ /*************************************************************************** * mst_addspan: * * Add a time span to a MSTrace. The start or end time will be updated * and samples will be copied if they are provided. No checking is done to * verify that the record matches the trace in any way. * * If whence is 1 the coverage will be added at the end of the trace, * whereas if whence is 2 the coverage will be added at the beginning * of the trace. * * Return 0 on success and -1 on error. ***************************************************************************/ int mst_addspan (MSTrace *mst, hptime_t starttime, hptime_t endtime, void *datasamples, int64_t numsamples, char sampletype, flag whence) { int samplesize = 0; if (!mst || (whence != 1 && whence != 2)) return -1; if (datasamples && numsamples > 0) { if ((samplesize = ms_samplesize (sampletype)) == 0) { ms_log (2, "mst_addspan(): Unrecognized sample type: '%c'\n", sampletype); return -1; } if (sampletype != mst->sampletype) { ms_log (2, "mst_addspan(): Mismatched sample type, '%c' and '%c'\n", sampletype, mst->sampletype); return -1; } mst->datasamples = realloc (mst->datasamples, (size_t) (mst->numsamples * samplesize + numsamples * samplesize)); if (mst->datasamples == NULL) { ms_log (2, "mst_addspan(): Cannot allocate memory\n"); return -1; } /* Add samples at end of trace */ if (whence == 1) { memcpy ((char *)mst->datasamples + (mst->numsamples * samplesize), datasamples, (size_t) (numsamples * samplesize)); mst->numsamples += numsamples; mst->endtime = endtime; } /* Add samples at the beginning of trace */ else if (whence == 2) { /* Move any samples to end of buffer */ if (mst->numsamples > 0) { memmove ((char *)mst->datasamples + (numsamples * samplesize), mst->datasamples, (size_t) (mst->numsamples * samplesize)); } memcpy (mst->datasamples, datasamples, (size_t) (numsamples * samplesize)); mst->numsamples += numsamples; mst->starttime = starttime; } /* Update MSTrace sample count */ if (numsamples > 0) mst->samplecnt += numsamples; } return 0; } /* End of mst_addspan() */ /*************************************************************************** * mst_addmsrtogroup: * * Add data samples from a MSRecord to a MSTrace in a MSTraceGroup by * searching the group for the approriate MSTrace and either adding data * to it or creating a new MSTrace if no match found. * * Matching traces are found using the mst_findadjacent() routine. If * the dataquality flag is true the data quality bytes must also match * otherwise they are ignored. * * Return a pointer to the MSTrace updated or 0 on error. ***************************************************************************/ MSTrace * mst_addmsrtogroup (MSTraceGroup *mstg, MSRecord *msr, flag dataquality, double timetol, double sampratetol) { MSTrace *mst = 0; hptime_t endtime; flag whence; char dq; if (!mstg || !msr) return 0; dq = (dataquality) ? msr->dataquality : 0; endtime = msr_endtime (msr); if (endtime == HPTERROR) { ms_log (2, "mst_addmsrtogroup(): Error calculating record end time\n"); return 0; } /* Find matching, time adjacent MSTrace */ mst = mst_findadjacent (mstg, &whence, dq, msr->network, msr->station, msr->location, msr->channel, msr->samprate, sampratetol, msr->starttime, endtime, timetol); /* If a match was found update it otherwise create a new MSTrace and add to end of MSTrace chain */ if (mst) { /* Records with no time coverage do not contribute to a trace */ if (msr->samplecnt <= 0 || msr->samprate <= 0.0) return mst; if (mst_addmsr (mst, msr, whence)) { return 0; } } else { mst = mst_init (NULL); mst->dataquality = dq; strncpy (mst->network, msr->network, sizeof (mst->network)); strncpy (mst->station, msr->station, sizeof (mst->station)); strncpy (mst->location, msr->location, sizeof (mst->location)); strncpy (mst->channel, msr->channel, sizeof (mst->channel)); mst->starttime = msr->starttime; mst->samprate = msr->samprate; mst->sampletype = msr->sampletype; if (mst_addmsr (mst, msr, 1)) { mst_free (&mst); return 0; } /* Link new MSTrace into the end of the chain */ if (!mstg->traces) { mstg->traces = mst; } else { MSTrace *lasttrace = mstg->traces; while (lasttrace->next) lasttrace = lasttrace->next; lasttrace->next = mst; } mstg->numtraces++; } return mst; } /* End of mst_addmsrtogroup() */ /*************************************************************************** * mst_addtracetogroup: * * Add a MSTrace to a MSTraceGroup at the end of the MSTrace chain. * * Return a pointer to the MSTrace added or 0 on error. ***************************************************************************/ MSTrace * mst_addtracetogroup (MSTraceGroup *mstg, MSTrace *mst) { MSTrace *lasttrace; if (!mstg || !mst) return 0; if (!mstg->traces) { mstg->traces = mst; } else { lasttrace = mstg->traces; while (lasttrace->next) lasttrace = lasttrace->next; lasttrace->next = mst; } mst->next = 0; mstg->numtraces++; return mst; } /* End of mst_addtracetogroup() */ /*************************************************************************** * mst_groupheal: * * Check if traces in MSTraceGroup can be healed, if contiguous segments * belong together they will be merged. This routine is only useful * if the trace group was assembled from segments out of time order * (e.g. a file of Mini-SEED records not in time order) but forming * contiguous time coverage. The MSTraceGroup will be sorted using * mst_groupsort() before healing. * * The time tolerance and sample rate tolerance are used to determine * if the traces are indeed the same. If timetol is -1.0 the default * tolerance of 1/2 the sample period will be used. If samprratetol * is -1.0 the default tolerance check of abs(1-sr1/sr2) < 0.0001 is * used (defined in libmseed.h). * * Return number of trace mergings on success otherwise -1 on error. ***************************************************************************/ int mst_groupheal (MSTraceGroup *mstg, double timetol, double sampratetol) { int mergings = 0; MSTrace *curtrace = 0; MSTrace *nexttrace = 0; MSTrace *searchtrace = 0; MSTrace *prevtrace = 0; int8_t merged = 0; double postgap, pregap, delta; if (!mstg) return -1; /* Sort MSTraceGroup before any healing */ if (mst_groupsort (mstg, 1)) return -1; curtrace = mstg->traces; while (curtrace) { nexttrace = mstg->traces; prevtrace = mstg->traces; while (nexttrace) { searchtrace = nexttrace; nexttrace = searchtrace->next; /* Do not process the same MSTrace we are trying to match */ if (searchtrace == curtrace) { prevtrace = searchtrace; continue; } /* Check if this trace matches the curtrace */ if (strcmp (searchtrace->network, curtrace->network) || strcmp (searchtrace->station, curtrace->station) || strcmp (searchtrace->location, curtrace->location) || strcmp (searchtrace->channel, curtrace->channel)) { prevtrace = searchtrace; continue; } /* Perform default samprate tolerance check if requested */ if (sampratetol == -1.0) { if (!MS_ISRATETOLERABLE (searchtrace->samprate, curtrace->samprate)) { prevtrace = searchtrace; continue; } } /* Otherwise check against the specified sample rates tolerance */ else if (ms_dabs (searchtrace->samprate - curtrace->samprate) > sampratetol) { prevtrace = searchtrace; continue; } merged = 0; /* post/pregap are negative when searchtrace overlaps curtrace segment and positive when there is a time gap. */ delta = (curtrace->samprate) ? (1.0 / curtrace->samprate) : 0.0; postgap = ((double)(searchtrace->starttime - curtrace->endtime) / HPTMODULUS) - delta; pregap = ((double)(curtrace->starttime - searchtrace->endtime) / HPTMODULUS) - delta; /* Calculate default time tolerance (1/2 sample period) if needed */ if (timetol == -1.0) timetol = 0.5 * delta; /* Fits right at the end of curtrace */ if (ms_dabs (postgap) <= timetol) { /* Merge searchtrace with curtrace */ mst_addspan (curtrace, searchtrace->starttime, searchtrace->endtime, searchtrace->datasamples, searchtrace->numsamples, searchtrace->sampletype, 1); /* If no data is present, make sure sample count is updated */ if (searchtrace->numsamples <= 0) curtrace->samplecnt += searchtrace->samplecnt; /* If qualities do not match reset the indicator */ if (curtrace->dataquality != searchtrace->dataquality) curtrace->dataquality = 0; merged = 1; } /* Fits right at the beginning of curtrace */ else if (ms_dabs (pregap) <= timetol) { /* Merge searchtrace with curtrace */ mst_addspan (curtrace, searchtrace->starttime, searchtrace->endtime, searchtrace->datasamples, searchtrace->numsamples, searchtrace->sampletype, 2); /* If no data is present, make sure sample count is updated */ if (searchtrace->numsamples <= 0) curtrace->samplecnt += searchtrace->samplecnt; /* If qualities do not match reset the indicator */ if (curtrace->dataquality != searchtrace->dataquality) curtrace->dataquality = 0; merged = 1; } /* If searchtrace was merged with curtrace remove it from the chain */ if (merged) { /* Re-link trace chain and free searchtrace */ if (searchtrace == mstg->traces) mstg->traces = nexttrace; else prevtrace->next = nexttrace; mst_free (&searchtrace); mstg->numtraces--; mergings++; } else { prevtrace = searchtrace; } } curtrace = curtrace->next; } return mergings; } /* End of mst_groupheal() */ /*************************************************************************** * mst_groupsort: * * Sort a MSTraceGroup using a mergesort algorithm. MSTrace entries * are compared using the mst_groupsort_cmp() function. * * The mergesort implementation was inspired by the listsort function * published and copyright 2001 by Simon Tatham. * * Return 0 on success and -1 on error. ***************************************************************************/ int mst_groupsort (MSTraceGroup *mstg, flag quality) { MSTrace *p, *q, *e, *top, *tail; int nmerges; int insize, psize, qsize, i; if (!mstg) return -1; if (!mstg->traces) return 0; top = mstg->traces; insize = 1; for (;;) { p = top; top = NULL; tail = NULL; nmerges = 0; /* count number of merges we do in this pass */ while (p) { nmerges++; /* there exists a merge to be done */ /* step `insize' places along from p */ q = p; psize = 0; for (i = 0; i < insize; i++) { psize++; q = q->next; if (!q) break; } /* if q hasn't fallen off end, we have two lists to merge */ qsize = insize; /* now we have two lists; merge them */ while (psize > 0 || (qsize > 0 && q)) { /* decide whether next element of merge comes from p or q */ if (psize == 0) { /* p is empty; e must come from q. */ e = q; q = q->next; qsize--; } else if (qsize == 0 || !q) { /* q is empty; e must come from p. */ e = p; p = p->next; psize--; } else if (mst_groupsort_cmp (p, q, quality) <= 0) { /* First element of p is lower (or same), e must come from p. */ e = p; p = p->next; psize--; } else { /* First element of q is lower; e must come from q. */ e = q; q = q->next; qsize--; } /* add the next element to the merged list */ if (tail) tail->next = e; else top = e; tail = e; } /* now p has stepped `insize' places along, and q has too */ p = q; } tail->next = NULL; /* If we have done only one merge, we're finished. */ if (nmerges <= 1) /* allow for nmerges==0, the empty list case */ { mstg->traces = top; return 0; } /* Otherwise repeat, merging lists twice the size */ insize *= 2; } } /* End of mst_groupsort() */ /*************************************************************************** * mst_groupsort_cmp: * * Compare two MSTrace entities for the purposes of sorting a * MSTraceGroup. Criteria for MSTrace comparison are (in order of * testing): source name, start time, descending endtime (longest * trace first) and sample rate. * * Return 1 if mst1 is "greater" than mst2, otherwise return 0. ***************************************************************************/ static int mst_groupsort_cmp (MSTrace *mst1, MSTrace *mst2, flag quality) { char src1[50], src2[50]; int strcmpval; if (!mst1 || !mst2) return -1; mst_srcname (mst1, src1, quality); mst_srcname (mst2, src2, quality); strcmpval = strcmp (src1, src2); /* If the source names do not match make sure the "greater" string is 2nd, * otherwise, if source names do match, make sure the later start time is 2nd * otherwise, if start times match, make sure the earlier end time is 2nd * otherwise, if end times match, make sure the highest sample rate is 2nd */ if (strcmpval > 0) { return 1; } else if (strcmpval == 0) { if (mst1->starttime > mst2->starttime) { return 1; } else if (mst1->starttime == mst2->starttime) { if (mst1->endtime < mst2->endtime) { return 1; } else if (mst1->endtime == mst2->endtime) { if (!MS_ISRATETOLERABLE (mst1->samprate, mst2->samprate) && mst1->samprate > mst2->samprate) { return 1; } } } } return 0; } /* End of mst_groupsort_cmp() */ /*************************************************************************** * mst_convertsamples: * * Convert the data samples associated with an MSTrace to another data * type. ASCII data samples cannot be converted, if supplied or * requested an error will be returned. * * When converting float & double sample types to integer type a * simple rounding is applied by adding 0.5 to the sample value before * converting (truncating) to integer. * * If the truncate flag is true data samples will be truncated to * integers even if loss of sample precision is detected. If the * truncate flag is false (0) and loss of precision is detected an * error is returned. * * Returns 0 on success, and -1 on failure. ***************************************************************************/ int mst_convertsamples (MSTrace *mst, char type, flag truncate) { int32_t *idata; float *fdata; double *ddata; int64_t idx; if (!mst) return -1; /* No conversion necessary, report success */ if (mst->sampletype == type) return 0; if (mst->sampletype == 'a' || type == 'a') { ms_log (2, "mst_convertsamples: cannot convert ASCII samples to/from numeric type\n"); return -1; } idata = (int32_t *)mst->datasamples; fdata = (float *)mst->datasamples; ddata = (double *)mst->datasamples; /* Convert to 32-bit integers */ if (type == 'i') { if (mst->sampletype == 'f') /* Convert floats to integers with simple rounding */ { for (idx = 0; idx < mst->numsamples; idx++) { /* Check for loss of sub-integer */ if (!truncate && (fdata[idx] - (int32_t)fdata[idx]) > 0.000001) { ms_log (1, "mst_convertsamples: Warning, loss of precision when converting floats to integers, loss: %g\n", (fdata[idx] - (int32_t)fdata[idx])); return -1; } idata[idx] = (int32_t) (fdata[idx] + 0.5); } } else if (mst->sampletype == 'd') /* Convert doubles to integers with simple rounding */ { for (idx = 0; idx < mst->numsamples; idx++) { /* Check for loss of sub-integer */ if (!truncate && (ddata[idx] - (int32_t)ddata[idx]) > 0.000001) { ms_log (1, "mst_convertsamples: Warning, loss of precision when converting doubles to integers, loss: %g\n", (ddata[idx] - (int32_t)ddata[idx])); return -1; } idata[idx] = (int32_t) (ddata[idx] + 0.5); } /* Reallocate buffer for reduced size needed */ if (!(mst->datasamples = realloc (mst->datasamples, (size_t) (mst->numsamples * sizeof (int32_t))))) { ms_log (2, "mst_convertsamples: cannot re-allocate buffer for sample conversion\n"); return -1; } } mst->sampletype = 'i'; } /* Done converting to 32-bit integers */ /* Convert to 32-bit floats */ else if (type == 'f') { if (mst->sampletype == 'i') /* Convert integers to floats */ { for (idx = 0; idx < mst->numsamples; idx++) fdata[idx] = (float)idata[idx]; } else if (mst->sampletype == 'd') /* Convert doubles to floats */ { for (idx = 0; idx < mst->numsamples; idx++) fdata[idx] = (float)ddata[idx]; /* Reallocate buffer for reduced size needed */ if (!(mst->datasamples = realloc (mst->datasamples, (size_t) (mst->numsamples * sizeof (float))))) { ms_log (2, "mst_convertsamples: cannot re-allocate buffer after sample conversion\n"); return -1; } } mst->sampletype = 'f'; } /* Done converting to 32-bit floats */ /* Convert to 64-bit doubles */ else if (type == 'd') { if (!(ddata = (double *)malloc ((size_t) (mst->numsamples * sizeof (double))))) { ms_log (2, "mst_convertsamples: cannot allocate buffer for sample conversion to doubles\n"); return -1; } if (mst->sampletype == 'i') /* Convert integers to doubles */ { for (idx = 0; idx < mst->numsamples; idx++) ddata[idx] = (double)idata[idx]; free (idata); } else if (mst->sampletype == 'f') /* Convert floats to doubles */ { for (idx = 0; idx < mst->numsamples; idx++) ddata[idx] = (double)fdata[idx]; free (fdata); } mst->datasamples = ddata; mst->sampletype = 'd'; } /* Done converting to 64-bit doubles */ return 0; } /* End of mst_convertsamples() */ /*************************************************************************** * mst_srcname: * * Generate a source name string for a specified MSTrace in the * format: 'NET_STA_LOC_CHAN[_QUAL]'. The quality is added to the * srcname if the quality flag argument is 1 and mst->dataquality is * not zero. The passed srcname must have enough room for the * resulting string. * * Returns a pointer to the resulting string or NULL on error. ***************************************************************************/ char * mst_srcname (MSTrace *mst, char *srcname, flag quality) { char *src = srcname; char *cp = srcname; if (!mst || !srcname) return NULL; /* Build the source name string */ cp = mst->network; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = mst->station; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = mst->location; while (*cp) { *src++ = *cp++; } *src++ = '_'; cp = mst->channel; while (*cp) { *src++ = *cp++; } if (quality && mst->dataquality) { *src++ = '_'; *src++ = mst->dataquality; } *src = '\0'; return srcname; } /* End of mst_srcname() */ /*************************************************************************** * mst_printtracelist: * * Print trace list summary information for the specified MSTraceGroup. * * By default only print the srcname, starttime and endtime for each * trace. If details is greater than 0 include the sample rate, * number of samples and a total trace count. If gaps is greater than * 0 and the previous trace matches (srcname & samprate) include the * gap between the endtime of the last trace and the starttime of the * current trace. * * The timeformat flag can either be: * 0 : SEED time format (year, day-of-year, hour, min, sec) * 1 : ISO time format (year, month, day, hour, min, sec) * 2 : Epoch time, seconds since the epoch ***************************************************************************/ void mst_printtracelist (MSTraceGroup *mstg, flag timeformat, flag details, flag gaps) { MSTrace *mst = 0; char srcname[50]; char prevsrcname[50]; char stime[30]; char etime[30]; char gapstr[20]; flag nogap; double gap; double delta; double prevsamprate; hptime_t prevendtime; int tracecnt = 0; if (!mstg) return; mst = mstg->traces; /* Print out the appropriate header */ if (details > 0 && gaps > 0) ms_log (0, " Source Start sample End sample Gap Hz Samples\n"); else if (details <= 0 && gaps > 0) ms_log (0, " Source Start sample End sample Gap\n"); else if (details > 0 && gaps <= 0) ms_log (0, " Source Start sample End sample Hz Samples\n"); else ms_log (0, " Source Start sample End sample\n"); prevsrcname[0] = '\0'; prevsamprate = -1.0; prevendtime = 0; while (mst) { mst_srcname (mst, srcname, 1); /* Create formatted time strings */ if (timeformat == 2) { snprintf (stime, sizeof (stime), "%.6f", MS_HPTIME2EPOCH ((double)mst->starttime)); snprintf (etime, sizeof (etime), "%.6f", MS_HPTIME2EPOCH ((double)mst->endtime)); } else if (timeformat == 1) { if (ms_hptime2isotimestr (mst->starttime, stime, 1) == NULL) ms_log (2, "Cannot convert trace start time for %s\n", srcname); if (ms_hptime2isotimestr (mst->endtime, etime, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", srcname); } else { if (ms_hptime2seedtimestr (mst->starttime, stime, 1) == NULL) ms_log (2, "Cannot convert trace start time for %s\n", srcname); if (ms_hptime2seedtimestr (mst->endtime, etime, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", srcname); } /* Print trace info at varying levels */ if (gaps > 0) { gap = 0.0; nogap = 0; if (!strcmp (prevsrcname, srcname) && prevsamprate != -1.0 && MS_ISRATETOLERABLE (prevsamprate, mst->samprate)) gap = (double)(mst->starttime - prevendtime) / HPTMODULUS; else nogap = 1; /* Check that any overlap is not larger than the trace coverage */ if (gap < 0.0) { delta = (mst->samprate) ? (1.0 / mst->samprate) : 0.0; if ((gap * -1.0) > (((double)(mst->endtime - mst->starttime) / HPTMODULUS) + delta)) gap = -(((double)(mst->endtime - mst->starttime) / HPTMODULUS) + delta); } /* Fix up gap display */ if (nogap) snprintf (gapstr, sizeof (gapstr), " == "); else if (gap >= 86400.0 || gap <= -86400.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fd", (gap / 86400)); else if (gap >= 3600.0 || gap <= -3600.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fh", (gap / 3600)); else if (gap == 0.0) snprintf (gapstr, sizeof (gapstr), "-0 "); else snprintf (gapstr, sizeof (gapstr), "%-4.4g", gap); if (details <= 0) ms_log (0, "%-17s %-24s %-24s %-4s\n", srcname, stime, etime, gapstr); else ms_log (0, "%-17s %-24s %-24s %-s %-3.3g %-" PRId64 "\n", srcname, stime, etime, gapstr, mst->samprate, mst->samplecnt); } else if (details > 0 && gaps <= 0) ms_log (0, "%-17s %-24s %-24s %-3.3g %-" PRId64 "\n", srcname, stime, etime, mst->samprate, mst->samplecnt); else ms_log (0, "%-17s %-24s %-24s\n", srcname, stime, etime); if (gaps > 0) { strcpy (prevsrcname, srcname); prevsamprate = mst->samprate; prevendtime = mst->endtime; } tracecnt++; mst = mst->next; } if (tracecnt != mstg->numtraces) ms_log (2, "mst_printtracelist(): number of traces in trace group is inconsistent\n"); if (details > 0) ms_log (0, "Total: %d trace segment(s)\n", tracecnt); } /* End of mst_printtracelist() */ /*************************************************************************** * mst_printsynclist: * * Print SYNC trace list summary information for the specified MSTraceGroup. * * The SYNC header line will be created using the supplied dccid, if * the pointer is NULL the string "DCC" will be used instead. * * If the subsecond flag is true the segment start and end times will * include subsecond precision, otherwise they will be truncated to * integer seconds. * ***************************************************************************/ void mst_printsynclist (MSTraceGroup *mstg, char *dccid, flag subsecond) { MSTrace *mst = 0; char stime[30]; char etime[30]; char yearday[24]; time_t now; struct tm *nt; if (!mstg) { return; } /* Generate current time stamp */ now = time (NULL); nt = localtime (&now); nt->tm_year += 1900; nt->tm_yday += 1; snprintf (yearday, sizeof (yearday), "%04d,%03d", nt->tm_year, nt->tm_yday); /* Print SYNC header line */ ms_log (0, "%s|%s\n", (dccid) ? dccid : "DCC", yearday); /* Loope through trace list */ mst = mstg->traces; while (mst) { ms_hptime2seedtimestr (mst->starttime, stime, subsecond); ms_hptime2seedtimestr (mst->endtime, etime, subsecond); /* Print SYNC line */ ms_log (0, "%s|%s|%s|%s|%s|%s||%.10g|%" PRId64 "|||||||%s\n", mst->network, mst->station, mst->location, mst->channel, stime, etime, mst->samprate, mst->samplecnt, yearday); mst = mst->next; } } /* End of mst_printsynclist() */ /*************************************************************************** * mst_printgaplist: * * Print gap/overlap list summary information for the specified * MSTraceGroup. Overlaps are printed as negative gaps. The trace * summary information in the MSTraceGroup is logically inverted so gaps * for like channels are identified. * * If mingap and maxgap are not NULL their values will be enforced and * only gaps/overlaps matching their implied criteria will be printed. * * The timeformat flag can either be: * 0 : SEED time format (year, day-of-year, hour, min, sec) * 1 : ISO time format (year, month, day, hour, min, sec) * 2 : Epoch time, seconds since the epoch ***************************************************************************/ void mst_printgaplist (MSTraceGroup *mstg, flag timeformat, double *mingap, double *maxgap) { MSTrace *mst; char src1[50], src2[50]; char time1[30], time2[30]; char gapstr[30]; double gap; double delta; double nsamples; flag printflag; int gapcnt = 0; if (!mstg) return; if (!mstg->traces) return; mst = mstg->traces; ms_log (0, " Source Last Sample Next Sample Gap Samples\n"); while (mst->next) { mst_srcname (mst, src1, 1); mst_srcname (mst->next, src2, 1); if (!strcmp (src1, src2)) { /* Skip MSTraces with 0 sample rate, usually from SOH records */ if (mst->samprate == 0.0) { mst = mst->next; continue; } /* Check that sample rates match using default tolerance */ if (!MS_ISRATETOLERABLE (mst->samprate, mst->next->samprate)) { ms_log (2, "%s Sample rate changed! %.10g -> %.10g\n", src1, mst->samprate, mst->next->samprate); } gap = (double)(mst->next->starttime - mst->endtime) / HPTMODULUS; /* Check that any overlap is not larger than the trace coverage */ if (gap < 0.0) { delta = (mst->next->samprate) ? (1.0 / mst->next->samprate) : 0.0; if ((gap * -1.0) > (((double)(mst->next->endtime - mst->next->starttime) / HPTMODULUS) + delta)) gap = -(((double)(mst->next->endtime - mst->next->starttime) / HPTMODULUS) + delta); } printflag = 1; /* Check gap/overlap criteria */ if (mingap) if (gap < *mingap) printflag = 0; if (maxgap) if (gap > *maxgap) printflag = 0; if (printflag) { nsamples = ms_dabs (gap) * mst->samprate; if (gap > 0.0) nsamples -= 1.0; else nsamples += 1.0; /* Fix up gap display */ if (gap >= 86400.0 || gap <= -86400.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fd", (gap / 86400)); else if (gap >= 3600.0 || gap <= -3600.0) snprintf (gapstr, sizeof (gapstr), "%-3.1fh", (gap / 3600)); else if (gap == 0.0) snprintf (gapstr, sizeof (gapstr), "-0 "); else snprintf (gapstr, sizeof (gapstr), "%-4.4g", gap); /* Create formatted time strings */ if (timeformat == 2) { snprintf (time1, sizeof (time1), "%.6f", MS_HPTIME2EPOCH ((double)mst->endtime)); snprintf (time2, sizeof (time2), "%.6f", MS_HPTIME2EPOCH ((double)mst->next->starttime)); } else if (timeformat == 1) { if (ms_hptime2isotimestr (mst->endtime, time1, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", src1); if (ms_hptime2isotimestr (mst->next->starttime, time2, 1) == NULL) ms_log (2, "Cannot convert next trace start time for %s\n", src1); } else { if (ms_hptime2seedtimestr (mst->endtime, time1, 1) == NULL) ms_log (2, "Cannot convert trace end time for %s\n", src1); if (ms_hptime2seedtimestr (mst->next->starttime, time2, 1) == NULL) ms_log (2, "Cannot convert next trace start time for %s\n", src1); } ms_log (0, "%-17s %-24s %-24s %-4s %-.8g\n", src1, time1, time2, gapstr, nsamples); gapcnt++; } } mst = mst->next; } ms_log (0, "Total: %d gap(s)\n", gapcnt); } /* End of mst_printgaplist() */ /*************************************************************************** * mst_pack: * * Pack MSTrace data into Mini-SEED records using the specified record * length, encoding format and byte order. The datasamples array and * numsamples field will be adjusted (reduced) based on how many * samples were packed. * * As each record is filled and finished they are passed to * record_handler which expects 1) a char * to the record, 2) the * length of the record and 3) a pointer supplied by the original * caller containing optional private data (handlerdata). It is the * responsibility of record_handler to process the record, the memory * will be re-used or freed when record_handler returns. * * If the flush flag is > 0 all of the data will be packed into data * records even though the last one will probably not be filled. * * If the mstemplate argument is not NULL it will be used as the * template for the packed Mini-SEED records. Otherwise a new * MSRecord will be initialized and populated from values in the * MSTrace. The reclen, encoding and byteorder arguments take * precedence over those in the template. The start time, sample * rate, datasamples, numsamples and sampletype values from the * template will be preserved. * * Returns the number of records created on success and -1 on error. ***************************************************************************/ int mst_pack (MSTrace *mst, void (*record_handler) (char *, int, void *), void *handlerdata, int reclen, flag encoding, flag byteorder, int64_t *packedsamples, flag flush, flag verbose, MSRecord *mstemplate) { MSRecord *msr; char srcname[50]; int trpackedrecords = 0; int64_t trpackedsamples = 0; int samplesize; int64_t bufsize; hptime_t preservestarttime = 0; double preservesamprate = 0.0; void *preservedatasamples = 0; int64_t preservenumsamples = 0; char preservesampletype = 0; StreamState *preserveststate = 0; if (packedsamples) *packedsamples = 0; /* Allocate stream processing state space if needed */ if (!mst->ststate) { mst->ststate = (StreamState *)malloc (sizeof (StreamState)); if (!mst->ststate) { ms_log (2, "mst_pack(): Could not allocate memory for StreamState\n"); return -1; } memset (mst->ststate, 0, sizeof (StreamState)); } if (mstemplate) { msr = mstemplate; preservestarttime = msr->starttime; preservesamprate = msr->samprate; preservedatasamples = msr->datasamples; preservenumsamples = msr->numsamples; preservesampletype = msr->sampletype; preserveststate = msr->ststate; } else { msr = msr_init (NULL); if (msr == NULL) { ms_log (2, "mst_pack(): Error initializing msr\n"); return -1; } msr->dataquality = 'D'; strcpy (msr->network, mst->network); strcpy (msr->station, mst->station); strcpy (msr->location, mst->location); strcpy (msr->channel, mst->channel); } /* Setup MSRecord template for packing */ msr->reclen = reclen; msr->encoding = encoding; msr->byteorder = byteorder; msr->starttime = mst->starttime; msr->samprate = mst->samprate; msr->datasamples = mst->datasamples; msr->numsamples = mst->numsamples; msr->sampletype = mst->sampletype; msr->ststate = mst->ststate; /* Sample count sanity check */ if (mst->samplecnt != mst->numsamples) { ms_log (2, "mst_pack(): Sample counts do not match, abort\n"); return -1; } /* Pack data */ trpackedrecords = msr_pack (msr, record_handler, handlerdata, &trpackedsamples, flush, verbose); if (verbose > 1) { ms_log (1, "Packed %d records for %s trace\n", trpackedrecords, mst_srcname (mst, srcname, 1)); } /* Adjust MSTrace start time, data array and sample count */ if (trpackedsamples > 0) { /* The new start time was calculated my msr_pack */ mst->starttime = msr->starttime; samplesize = ms_samplesize (mst->sampletype); bufsize = (mst->numsamples - trpackedsamples) * samplesize; if (bufsize) { memmove (mst->datasamples, (char *)mst->datasamples + (trpackedsamples * samplesize), (size_t)bufsize); mst->datasamples = realloc (mst->datasamples, (size_t)bufsize); if (mst->datasamples == NULL) { ms_log (2, "mst_pack(): Cannot (re)allocate datasamples buffer\n"); return -1; } } else { if (mst->datasamples) free (mst->datasamples); mst->datasamples = 0; } mst->samplecnt -= trpackedsamples; mst->numsamples -= trpackedsamples; } /* Reinstate preserved values if a template was used */ if (mstemplate) { msr->starttime = preservestarttime; msr->samprate = preservesamprate; msr->datasamples = preservedatasamples; msr->numsamples = preservenumsamples; msr->sampletype = preservesampletype; msr->ststate = preserveststate; } else { msr->datasamples = 0; msr->ststate = 0; msr_free (&msr); } if (packedsamples) *packedsamples = trpackedsamples; return trpackedrecords; } /* End of mst_pack() */ /*************************************************************************** * mst_packgroup: * * Pack MSTraceGroup data into Mini-SEED records by calling mst_pack() * for each MSTrace in the group. * * Returns the number of records created on success and -1 on error. ***************************************************************************/ int mst_packgroup (MSTraceGroup *mstg, void (*record_handler) (char *, int, void *), void *handlerdata, int reclen, flag encoding, flag byteorder, int64_t *packedsamples, flag flush, flag verbose, MSRecord *mstemplate) { MSTrace *mst; int trpackedrecords = 0; int64_t trpackedsamples = 0; char srcname[50]; if (!mstg) { return -1; } if (packedsamples) *packedsamples = 0; mst = mstg->traces; while (mst) { if (mst->numsamples <= 0) { if (verbose > 1) { mst_srcname (mst, srcname, 1); ms_log (1, "No data samples for %s, skipping\n", srcname); } } else { trpackedrecords += mst_pack (mst, record_handler, handlerdata, reclen, encoding, byteorder, &trpackedsamples, flush, verbose, mstemplate); if (trpackedrecords == -1) break; if (packedsamples) *packedsamples += trpackedsamples; } mst = mst->next; } return trpackedrecords; } /* End of mst_packgroup() */ iris-edu-libmseed-4314359/unpack.c000066400000000000000000000761731422047135100166550ustar00rootroot00000000000000/*************************************************************************** * unpack.c: * * Generic routines to unpack Mini-SEED records. * * Appropriate values from the record header will be byte-swapped to * the host order. The purpose of this code is to provide a portable * way of accessing common SEED data record header information. All * data structures in SEED 2.4 data records are supported. The data * samples are optionally decompressed/unpacked. * * Written by Chad Trabant, * ORFEUS/EC-Project MEREDIAN * IRIS Data Management Center ***************************************************************************/ #include #include #include #include #include #include "libmseed.h" #include "unpackdata.h" /* Function(s) internal to this file */ static int check_environment (int verbose); /* Header and data byte order flags controlled by environment variables */ /* -2 = not checked, -1 = checked but not set, or 0 = LE and 1 = BE */ flag unpackheaderbyteorder = -2; flag unpackdatabyteorder = -2; /* Data encoding format/fallback controlled by environment variable */ /* -2 = not checked, -1 = checked but not set, or = encoding */ int unpackencodingformat = -2; int unpackencodingfallback = -2; /*************************************************************************** * msr_unpack: * * Unpack a SEED data record header/blockettes and populate a MSRecord * struct. All approriate fields are byteswapped, if needed, and * pointers to structured data are setup in addition to setting the * common header fields. * * If 'dataflag' is true the data samples are unpacked/decompressed * and the MSRecord->datasamples pointer is set appropriately. The * data samples will be either 32-bit integers, 32-bit floats or * 64-bit floats (doubles) with the same byte order as the host * machine. The MSRecord->numsamples will be set to the actual number * of samples unpacked/decompressed and MSRecord->sampletype will * indicated the sample type. * * All appropriate values will be byte-swapped to the host order, * including the data samples. * * All header values, blockette values and data samples will be * overwritten by subsequent calls to this function. * * If the msr struct is NULL it will be allocated. * * Returns MS_NOERROR and populates the MSRecord struct at *ppmsr on * success, otherwise returns a libmseed error code (listed in * libmseed.h). ***************************************************************************/ int msr_unpack (char *record, int reclen, MSRecord **ppmsr, flag dataflag, flag verbose) { flag headerswapflag = 0; flag dataswapflag = 0; int retval; MSRecord *msr = NULL; char sequence_number[7]; char srcname[50]; /* For blockette parsing */ BlktLink *blkt_link = 0; uint16_t blkt_type; uint16_t next_blkt; uint32_t blkt_offset; uint32_t blkt_length; int blkt_count = 0; if (!ppmsr) { ms_log (2, "msr_unpack(): ppmsr argument cannot be NULL\n"); return MS_GENERROR; } /* Verify that record includes a valid header */ if (!MS_ISVALIDHEADER (record)) { ms_recsrcname (record, srcname, 1); ms_log (2, "msr_unpack(%s) Record header & quality indicator unrecognized: '%c'\n", srcname); ms_log (2, "msr_unpack(%s) This is not a valid Mini-SEED record\n", srcname); return MS_NOTSEED; } /* Verify that passed record length is within supported range */ if (reclen < MINRECLEN || reclen > MAXRECLEN) { ms_recsrcname (record, srcname, 1); ms_log (2, "msr_unpack(%s): Record length is out of range: %d\n", srcname, reclen); return MS_OUTOFRANGE; } /* Initialize the MSRecord */ if (!(*ppmsr = msr_init (*ppmsr))) return MS_GENERROR; /* Shortcut pointer, historical and help readability */ msr = *ppmsr; /* Set raw record pointer and record length */ msr->record = record; msr->reclen = reclen; /* Check environment variables if necessary */ if (unpackheaderbyteorder == -2 || unpackdatabyteorder == -2 || unpackencodingformat == -2 || unpackencodingfallback == -2) if (check_environment (verbose)) return MS_GENERROR; /* Allocate and copy fixed section of data header */ msr->fsdh = realloc (msr->fsdh, sizeof (struct fsdh_s)); if (msr->fsdh == NULL) { ms_log (2, "msr_unpack(): Cannot allocate memory\n"); return MS_GENERROR; } memcpy (msr->fsdh, record, sizeof (struct fsdh_s)); /* Check to see if byte swapping is needed by testing the year and day */ if (!MS_ISVALIDYEARDAY (msr->fsdh->start_time.year, msr->fsdh->start_time.day)) headerswapflag = dataswapflag = 1; /* Check if byte order is forced */ if (unpackheaderbyteorder >= 0) { headerswapflag = (ms_bigendianhost () != unpackheaderbyteorder) ? 1 : 0; } if (unpackdatabyteorder >= 0) { dataswapflag = (ms_bigendianhost () != unpackdatabyteorder) ? 1 : 0; } /* Swap byte order? */ if (headerswapflag) { MS_SWAPBTIME (&msr->fsdh->start_time); ms_gswap2 (&msr->fsdh->numsamples); ms_gswap2 (&msr->fsdh->samprate_fact); ms_gswap2 (&msr->fsdh->samprate_mult); ms_gswap4 (&msr->fsdh->time_correct); ms_gswap2 (&msr->fsdh->data_offset); ms_gswap2 (&msr->fsdh->blockette_offset); } /* Populate some of the common header fields */ strncpy (sequence_number, msr->fsdh->sequence_number, 6); sequence_number[6] = '\0'; msr->sequence_number = (int32_t)strtol (sequence_number, NULL, 10); msr->dataquality = msr->fsdh->dataquality; ms_strncpcleantail (msr->network, msr->fsdh->network, 2); ms_strncpcleantail (msr->station, msr->fsdh->station, 5); ms_strncpcleantail (msr->location, msr->fsdh->location, 2); ms_strncpcleantail (msr->channel, msr->fsdh->channel, 3); msr->samplecnt = msr->fsdh->numsamples; /* Generate source name for MSRecord */ if (msr_srcname (msr, srcname, 1) == NULL) { ms_log (2, "msr_unpack(): Cannot generate srcname\n"); return MS_GENERROR; } /* Report byte swapping status */ if (verbose > 2) { if (headerswapflag) ms_log (1, "%s: Byte swapping needed for unpacking of header\n", srcname); else ms_log (1, "%s: Byte swapping NOT needed for unpacking of header\n", srcname); } /* Traverse the blockettes */ blkt_offset = msr->fsdh->blockette_offset; while ((blkt_offset != 0) && ((int)blkt_offset < reclen) && (blkt_offset < MAXRECLEN)) { /* Every blockette has a similar 4 byte header: type and next */ memcpy (&blkt_type, record + blkt_offset, 2); blkt_offset += 2; memcpy (&next_blkt, record + blkt_offset, 2); blkt_offset += 2; if (headerswapflag) { ms_gswap2 (&blkt_type); ms_gswap2 (&next_blkt); } /* Get blockette length */ blkt_length = ms_blktlen (blkt_type, record + blkt_offset - 4, headerswapflag); if (blkt_length == 0) { ms_log (2, "msr_unpack(%s): Unknown blockette length for type %d\n", srcname, blkt_type); break; } /* Make sure blockette is contained within the msrecord buffer */ if ((int)(blkt_offset - 4 + blkt_length) > reclen) { ms_log (2, "msr_unpack(%s): Blockette %d extends beyond record size, truncated?\n", srcname, blkt_type); break; } if (blkt_type == 100) { /* Found a Blockette 100 */ struct blkt_100_s *blkt_100; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_100_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_100 = (struct blkt_100_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap4 (&blkt_100->samprate); } msr->samprate = msr->Blkt100->samprate; } else if (blkt_type == 200) { /* Found a Blockette 200 */ struct blkt_200_s *blkt_200; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_200_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_200 = (struct blkt_200_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap4 (&blkt_200->amplitude); ms_gswap4 (&blkt_200->period); ms_gswap4 (&blkt_200->background_estimate); MS_SWAPBTIME (&blkt_200->time); } } else if (blkt_type == 201) { /* Found a Blockette 201 */ struct blkt_201_s *blkt_201; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_201_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_201 = (struct blkt_201_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap4 (&blkt_201->amplitude); ms_gswap4 (&blkt_201->period); ms_gswap4 (&blkt_201->background_estimate); MS_SWAPBTIME (&blkt_201->time); } } else if (blkt_type == 300) { /* Found a Blockette 300 */ struct blkt_300_s *blkt_300; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_300_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_300 = (struct blkt_300_s *)blkt_link->blktdata; if (headerswapflag) { MS_SWAPBTIME (&blkt_300->time); ms_gswap4 (&blkt_300->step_duration); ms_gswap4 (&blkt_300->interval_duration); ms_gswap4 (&blkt_300->amplitude); ms_gswap4 (&blkt_300->reference_amplitude); } } else if (blkt_type == 310) { /* Found a Blockette 310 */ struct blkt_310_s *blkt_310; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_310_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_310 = (struct blkt_310_s *)blkt_link->blktdata; if (headerswapflag) { MS_SWAPBTIME (&blkt_310->time); ms_gswap4 (&blkt_310->duration); ms_gswap4 (&blkt_310->period); ms_gswap4 (&blkt_310->amplitude); ms_gswap4 (&blkt_310->reference_amplitude); } } else if (blkt_type == 320) { /* Found a Blockette 320 */ struct blkt_320_s *blkt_320; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_320_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_320 = (struct blkt_320_s *)blkt_link->blktdata; if (headerswapflag) { MS_SWAPBTIME (&blkt_320->time); ms_gswap4 (&blkt_320->duration); ms_gswap4 (&blkt_320->ptp_amplitude); ms_gswap4 (&blkt_320->reference_amplitude); } } else if (blkt_type == 390) { /* Found a Blockette 390 */ struct blkt_390_s *blkt_390; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_390_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_390 = (struct blkt_390_s *)blkt_link->blktdata; if (headerswapflag) { MS_SWAPBTIME (&blkt_390->time); ms_gswap4 (&blkt_390->duration); ms_gswap4 (&blkt_390->amplitude); } } else if (blkt_type == 395) { /* Found a Blockette 395 */ struct blkt_395_s *blkt_395; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_395_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_395 = (struct blkt_395_s *)blkt_link->blktdata; if (headerswapflag) { MS_SWAPBTIME (&blkt_395->time); } } else if (blkt_type == 400) { /* Found a Blockette 400 */ struct blkt_400_s *blkt_400; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_400_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_400 = (struct blkt_400_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap4 (&blkt_400->azimuth); ms_gswap4 (&blkt_400->slowness); ms_gswap2 (&blkt_400->configuration); } } else if (blkt_type == 405) { /* Found a Blockette 405 */ struct blkt_405_s *blkt_405; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_405_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_405 = (struct blkt_405_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap2 (&blkt_405->delay_values); } if (verbose > 0) { ms_log (1, "msr_unpack(%s): WARNING Blockette 405 cannot be fully supported\n", srcname); } } else if (blkt_type == 500) { /* Found a Blockette 500 */ struct blkt_500_s *blkt_500; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_500_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_500 = (struct blkt_500_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap4 (&blkt_500->vco_correction); MS_SWAPBTIME (&blkt_500->time); ms_gswap4 (&blkt_500->exception_count); } } else if (blkt_type == 1000) { /* Found a Blockette 1000 */ struct blkt_1000_s *blkt_1000; blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_1000_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_1000 = (struct blkt_1000_s *)blkt_link->blktdata; /* Calculate record length in bytes as 2^(blkt_1000->reclen) */ msr->reclen = (uint32_t)1 << blkt_1000->reclen; /* Compare against the specified length */ if (msr->reclen != reclen && verbose) { ms_log (2, "msr_unpack(%s): Record length in Blockette 1000 (%d) != specified length (%d)\n", srcname, msr->reclen, reclen); } msr->encoding = blkt_1000->encoding; msr->byteorder = blkt_1000->byteorder; } else if (blkt_type == 1001) { /* Found a Blockette 1001 */ blkt_link = msr_addblockette (msr, record + blkt_offset, sizeof (struct blkt_1001_s), blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; } else if (blkt_type == 2000) { /* Found a Blockette 2000 */ struct blkt_2000_s *blkt_2000; uint16_t b2klen; /* Read the blockette length from blockette */ memcpy (&b2klen, record + blkt_offset, 2); if (headerswapflag) ms_gswap2 (&b2klen); /* Minus four bytes for the blockette type and next fields */ b2klen -= 4; blkt_link = msr_addblockette (msr, record + blkt_offset, b2klen, blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; blkt_2000 = (struct blkt_2000_s *)blkt_link->blktdata; if (headerswapflag) { ms_gswap2 (&blkt_2000->length); ms_gswap2 (&blkt_2000->data_offset); ms_gswap4 (&blkt_2000->recnum); } } else { /* Unknown blockette type */ if (blkt_length >= 4) { blkt_link = msr_addblockette (msr, record + blkt_offset, blkt_length - 4, blkt_type, 0); if (!blkt_link) break; blkt_link->blktoffset = blkt_offset - 4; blkt_link->next_blkt = next_blkt; } } /* Check that the next blockette offset is beyond the current blockette */ if (next_blkt && next_blkt < (blkt_offset + blkt_length - 4)) { ms_log (2, "msr_unpack(%s): Offset to next blockette (%d) is within current blockette ending at byte %d\n", srcname, next_blkt, (blkt_offset + blkt_length - 4)); blkt_offset = 0; } /* Check that the offset is within record length */ else if (next_blkt && next_blkt > reclen) { ms_log (2, "msr_unpack(%s): Offset to next blockette (%d) from type %d is beyond record length\n", srcname, next_blkt, blkt_type); blkt_offset = 0; } else { blkt_offset = next_blkt; } blkt_count++; } /* End of while looping through blockettes */ /* Check for a Blockette 1000 */ if (msr->Blkt1000 == 0) { if (verbose > 1) { ms_log (1, "%s: Warning: No Blockette 1000 found\n", srcname); } } /* Check that the data offset is after the blockette chain */ if (blkt_link && msr->fsdh->numsamples && msr->fsdh->data_offset < (blkt_link->blktoffset + blkt_link->blktdatalen + 4)) { ms_log (1, "%s: Warning: Data offset in fixed header (%d) is within the blockette chain ending at %d\n", srcname, msr->fsdh->data_offset, (blkt_link->blktoffset + blkt_link->blktdatalen + 4)); } /* Check that the blockette count matches the number parsed */ if (msr->fsdh->numblockettes != blkt_count) { ms_log (1, "%s: Warning: Number of blockettes in fixed header (%d) does not match the number parsed (%d)\n", srcname, msr->fsdh->numblockettes, blkt_count); } /* Populate remaining common header fields */ msr->starttime = msr_starttime (msr); msr->samprate = msr_samprate (msr); /* Set MSRecord->byteorder if data byte order is forced */ if (unpackdatabyteorder >= 0) { msr->byteorder = unpackdatabyteorder; } /* Check if encoding format is forced */ if (unpackencodingformat >= 0) { msr->encoding = unpackencodingformat; } /* Use encoding format fallback if defined and no encoding is set, also make sure the byteorder is set by default to big endian */ if (unpackencodingfallback >= 0 && msr->encoding == -1) { msr->encoding = unpackencodingfallback; if (msr->byteorder == -1) { msr->byteorder = 1; } } /* Unpack the data samples if requested */ if (dataflag && msr->samplecnt > 0) { flag dswapflag = headerswapflag; flag bigendianhost = ms_bigendianhost (); /* Determine byte order of the data and set the dswapflag as needed; if no Blkt1000 or UNPACK_DATA_BYTEORDER environment variable setting assume the order is the same as the header */ if (msr->Blkt1000 != 0 && unpackdatabyteorder < 0) { dswapflag = 0; /* If BE host and LE data need swapping */ if (bigendianhost && msr->byteorder == 0) dswapflag = 1; /* If LE host and BE data (or bad byte order value) need swapping */ else if (!bigendianhost && msr->byteorder > 0) dswapflag = 1; } else if (unpackdatabyteorder >= 0) { dswapflag = dataswapflag; } if (verbose > 2 && dswapflag) ms_log (1, "%s: Byte swapping needed for unpacking of data samples\n", srcname); else if (verbose > 2) ms_log (1, "%s: Byte swapping NOT needed for unpacking of data samples\n", srcname); retval = msr_unpack_data (msr, dswapflag, verbose); if (retval < 0) return retval; else msr->numsamples = retval; } else { if (msr->datasamples) free (msr->datasamples); msr->datasamples = 0; msr->numsamples = 0; } return MS_NOERROR; } /* End of msr_unpack() */ /************************************************************************ * msr_unpack_data: * * Unpack Mini-SEED data samples for a given MSRecord. The packed * data is accessed in the record indicated by MSRecord->record and * the unpacked samples are placed in MSRecord->datasamples. The * resulting data samples are either 32-bit integers, 32-bit floats * or 64-bit floats in host byte order. * * Return number of samples unpacked or negative libmseed error code. ************************************************************************/ int msr_unpack_data (MSRecord *msr, int swapflag, flag verbose) { int datasize; /* byte size of data samples in record */ int nsamples; /* number of samples unpacked */ int unpacksize; /* byte size of unpacked samples */ int samplesize = 0; /* size of the data samples in bytes */ char srcname[50]; const char *dbuf; if (!msr) return MS_GENERROR; /* Check for decode debugging environment variable */ if (getenv ("DECODE_DEBUG")) decodedebug = 1; /* Generate source name for MSRecord */ if (msr_srcname (msr, srcname, 1) == NULL) { ms_log (2, "msr_unpack(): Cannot generate srcname\n"); return MS_GENERROR; } /* Sanity record length */ if (msr->reclen == -1) { ms_log (2, "msr_unpack_data(%s): Record size unknown\n", srcname); return MS_NOTSEED; } else if (msr->reclen < MINRECLEN || msr->reclen > MAXRECLEN) { ms_log (2, "msr_unpack_data(%s): Unsupported record length: %d\n", srcname, msr->reclen); return MS_OUTOFRANGE; } /* Sanity check data offset before creating a pointer based on the value */ if (msr->fsdh->data_offset < 48 || msr->fsdh->data_offset >= msr->reclen) { ms_log (2, "msr_unpack_data(%s): data offset value is not valid: %d\n", srcname, msr->fsdh->data_offset); return MS_GENERROR; } datasize = msr->reclen - msr->fsdh->data_offset; dbuf = msr->record + msr->fsdh->data_offset; switch (msr->encoding) { case DE_ASCII: samplesize = 1; break; case DE_INT16: case DE_INT32: case DE_FLOAT32: case DE_STEIM1: case DE_STEIM2: case DE_GEOSCOPE24: case DE_GEOSCOPE163: case DE_GEOSCOPE164: case DE_CDSN: case DE_SRO: case DE_DWWSSN: samplesize = 4; break; case DE_FLOAT64: samplesize = 8; break; default: samplesize = 0; break; } /* Calculate buffer size needed for unpacked samples */ unpacksize = (int)msr->samplecnt * samplesize; /* (Re)Allocate space for the unpacked data */ if (unpacksize > 0) { msr->datasamples = realloc (msr->datasamples, unpacksize); if (msr->datasamples == NULL) { ms_log (2, "msr_unpack_data(%s): Cannot (re)allocate memory\n", srcname); return MS_GENERROR; } } else { if (msr->datasamples) free (msr->datasamples); msr->datasamples = 0; msr->numsamples = 0; } if (verbose > 2) ms_log (1, "%s: Unpacking %" PRId64 " samples\n", srcname, msr->samplecnt); /* Decode data samples according to encoding */ switch (msr->encoding) { case DE_ASCII: if (verbose > 1) ms_log (1, "%s: Found ASCII data\n", srcname); nsamples = (int)msr->samplecnt; if (nsamples > 0) { memcpy (msr->datasamples, dbuf, nsamples); } else { nsamples = 0; } msr->sampletype = 'a'; break; case DE_INT16: if (verbose > 1) ms_log (1, "%s: Unpacking INT16 data samples\n", srcname); nsamples = msr_decode_int16 ((int16_t *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'i'; break; case DE_INT32: if (verbose > 1) ms_log (1, "%s: Unpacking INT32 data samples\n", srcname); nsamples = msr_decode_int32 ((int32_t *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'i'; break; case DE_FLOAT32: if (verbose > 1) ms_log (1, "%s: Unpacking FLOAT32 data samples\n", srcname); nsamples = msr_decode_float32 ((float *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'f'; break; case DE_FLOAT64: if (verbose > 1) ms_log (1, "%s: Unpacking FLOAT64 data samples\n", srcname); nsamples = msr_decode_float64 ((double *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'd'; break; case DE_STEIM1: if (verbose > 1) ms_log (1, "%s: Unpacking Steim1 data frames\n", srcname); nsamples = msr_decode_steim1 ((int32_t *)dbuf, datasize, (int)msr->samplecnt, msr->datasamples, unpacksize, srcname, swapflag); if (nsamples < 0) return MS_GENERROR; msr->sampletype = 'i'; break; case DE_STEIM2: if (verbose > 1) ms_log (1, "%s: Unpacking Steim2 data frames\n", srcname); nsamples = msr_decode_steim2 ((int32_t *)dbuf, datasize, (int)msr->samplecnt, msr->datasamples, unpacksize, srcname, swapflag); if (nsamples < 0) return MS_GENERROR; msr->sampletype = 'i'; break; case DE_GEOSCOPE24: case DE_GEOSCOPE163: case DE_GEOSCOPE164: if (verbose > 1) { if (msr->encoding == DE_GEOSCOPE24) ms_log (1, "%s: Unpacking GEOSCOPE 24bit integer data samples\n", srcname); if (msr->encoding == DE_GEOSCOPE163) ms_log (1, "%s: Unpacking GEOSCOPE 16bit gain ranged/3bit exponent data samples\n", srcname); if (msr->encoding == DE_GEOSCOPE164) ms_log (1, "%s: Unpacking GEOSCOPE 16bit gain ranged/4bit exponent data samples\n", srcname); } nsamples = msr_decode_geoscope ((char *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, msr->encoding, srcname, swapflag); msr->sampletype = 'f'; break; case DE_CDSN: if (verbose > 1) ms_log (1, "%s: Unpacking CDSN encoded data samples\n", srcname); nsamples = msr_decode_cdsn ((int16_t *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'i'; break; case DE_SRO: if (verbose > 1) ms_log (1, "%s: Unpacking SRO encoded data samples\n", srcname); nsamples = msr_decode_sro ((int16_t *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, srcname, swapflag); msr->sampletype = 'i'; break; case DE_DWWSSN: if (verbose > 1) ms_log (1, "%s: Unpacking DWWSSN encoded data samples\n", srcname); nsamples = msr_decode_dwwssn ((int16_t *)dbuf, (int)msr->samplecnt, msr->datasamples, unpacksize, swapflag); msr->sampletype = 'i'; break; default: ms_log (2, "%s: Unsupported encoding format %d (%s)\n", srcname, msr->encoding, (char *)ms_encodingstr (msr->encoding)); return MS_UNKNOWNFORMAT; } if (nsamples != msr->samplecnt) { ms_log (2, "msr_unpack_data(%s): only decoded %d samples of %d expected\n", srcname, nsamples, msr->samplecnt); return MS_GENERROR; } return nsamples; } /* End of msr_unpack_data() */ /************************************************************************ * check_environment: * * Check environment variables and set global variables appropriately. * * Return 0 on success and -1 on error. ************************************************************************/ static int check_environment (int verbose) { char *envvariable; /* Read possible environmental variables that force byteorder */ if (unpackheaderbyteorder == -2) { if ((envvariable = getenv ("UNPACK_HEADER_BYTEORDER"))) { if (*envvariable != '0' && *envvariable != '1') { ms_log (2, "Environment variable UNPACK_HEADER_BYTEORDER must be set to '0' or '1'\n"); return -1; } else if (*envvariable == '0') { unpackheaderbyteorder = 0; if (verbose > 2) ms_log (1, "UNPACK_HEADER_BYTEORDER=0, unpacking little-endian header\n"); } else { unpackheaderbyteorder = 1; if (verbose > 2) ms_log (1, "UNPACK_HEADER_BYTEORDER=1, unpacking big-endian header\n"); } } else { unpackheaderbyteorder = -1; } } if (unpackdatabyteorder == -2) { if ((envvariable = getenv ("UNPACK_DATA_BYTEORDER"))) { if (*envvariable != '0' && *envvariable != '1') { ms_log (2, "Environment variable UNPACK_DATA_BYTEORDER must be set to '0' or '1'\n"); return -1; } else if (*envvariable == '0') { unpackdatabyteorder = 0; if (verbose > 2) ms_log (1, "UNPACK_DATA_BYTEORDER=0, unpacking little-endian data samples\n"); } else { unpackdatabyteorder = 1; if (verbose > 2) ms_log (1, "UNPACK_DATA_BYTEORDER=1, unpacking big-endian data samples\n"); } } else { unpackdatabyteorder = -1; } } /* Read possible environmental variable that forces encoding format */ if (unpackencodingformat == -2) { if ((envvariable = getenv ("UNPACK_DATA_FORMAT"))) { unpackencodingformat = (int)strtol (envvariable, NULL, 10); if (unpackencodingformat < 0 || unpackencodingformat > 33) { ms_log (2, "Environment variable UNPACK_DATA_FORMAT set to invalid value: '%d'\n", unpackencodingformat); return -1; } else if (verbose > 2) ms_log (1, "UNPACK_DATA_FORMAT, unpacking data in encoding format %d\n", unpackencodingformat); } else { unpackencodingformat = -1; } } /* Read possible environmental variable to be used as a fallback encoding format */ if (unpackencodingfallback == -2) { if ((envvariable = getenv ("UNPACK_DATA_FORMAT_FALLBACK"))) { unpackencodingfallback = (int)strtol (envvariable, NULL, 10); if (unpackencodingfallback < 0 || unpackencodingfallback > 33) { ms_log (2, "Environment variable UNPACK_DATA_FORMAT_FALLBACK set to invalid value: '%d'\n", unpackencodingfallback); return -1; } else if (verbose > 2) ms_log (1, "UNPACK_DATA_FORMAT_FALLBACK, fallback data unpacking encoding format %d\n", unpackencodingfallback); } else { unpackencodingfallback = 10; /* Default fallback is Steim-1 encoding */ } } return 0; } /* End of check_environment() */ iris-edu-libmseed-4314359/unpackdata.c000066400000000000000000000671671422047135100175120ustar00rootroot00000000000000/************************************************************************ * Routines for decoding INT16, INT32, FLOAT32, FLOAT64, STEIM1, * STEIM2, GEOSCOPE (24bit and gain ranged), CDSN, SRO and DWWSSN * encoded data. * * modified: 2017.283 ************************************************************************/ #include #include #include #include "libmseed.h" #include "unpackdata.h" /* Control for printing debugging information */ int decodedebug = 0; /* Extract bit range. Byte order agnostic & defined when used with unsigned values */ #define EXTRACTBITRANGE(VALUE, STARTBIT, LENGTH) ((VALUE >> STARTBIT) & ((1U << LENGTH) - 1)) #define MAX12 0x7FFul /* maximum 12 bit positive # */ #define MAX14 0x1FFFul /* maximum 14 bit positive # */ #define MAX16 0x7FFFul /* maximum 16 bit positive # */ #define MAX24 0x7FFFFFul /* maximum 24 bit positive # */ /************************************************************************ * msr_decode_int16: * * Decode 16-bit integer data and place in supplied buffer as 32-bit * integers. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_int16 (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag) { int16_t sample; int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { sample = input[idx]; if (swapflag) ms_gswap2 (&sample); output[idx] = (int32_t)sample; outputlength -= sizeof (int32_t); } return idx; } /* End of msr_decode_int16() */ /************************************************************************ * msr_decode_int32: * * Decode 32-bit integer data and place in supplied buffer as 32-bit * integers. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_int32 (int32_t *input, int samplecount, int32_t *output, int outputlength, int swapflag) { int32_t sample; int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { sample = input[idx]; if (swapflag) ms_gswap4 (&sample); output[idx] = sample; outputlength -= sizeof (int32_t); } return idx; } /* End of msr_decode_int32() */ /************************************************************************ * msr_decode_float32: * * Decode 32-bit float data and place in supplied buffer as 32-bit * floats. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_float32 (float *input, int samplecount, float *output, int outputlength, int swapflag) { float sample; int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (float); idx++) { memcpy (&sample, &input[idx], sizeof (float)); if (swapflag) ms_gswap4 (&sample); output[idx] = sample; outputlength -= sizeof (float); } return idx; } /* End of msr_decode_float32() */ /************************************************************************ * msr_decode_float64: * * Decode 64-bit float data and place in supplied buffer as 64-bit * floats, aka doubles. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_float64 (double *input, int samplecount, double *output, int outputlength, int swapflag) { double sample; int idx; if (samplecount <= 0) return 0; if (!input || !output || outputlength <= 0) return -1; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (double); idx++) { memcpy (&sample, &input[idx], sizeof (double)); if (swapflag) ms_gswap8 (&sample); output[idx] = sample; outputlength -= sizeof (double); } return idx; } /* End of msr_decode_float64() */ /************************************************************************ * msr_decode_steim1: * * Decode Steim1 encoded miniSEED data and place in supplied buffer * as 32-bit integers. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_steim1 (int32_t *input, int inputlength, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag) { int32_t *outputptr = output; /* Pointer to next output sample location */ uint32_t frame[16]; /* Frame, 16 x 32-bit quantities = 64 bytes */ int32_t X0 = 0; /* Forward integration constant, aka first sample */ int32_t Xn = 0; /* Reverse integration constant, aka last sample */ int maxframes = inputlength / 64; int frameidx; int startnibble; int nibble; int widx; int diffcount; int idx; union dword { int8_t d8[4]; int16_t d16[2]; int32_t d32; } * word; if (inputlength <= 0) return 0; if (!input || !output || outputlength <= 0 || maxframes <= 0) return -1; if (decodedebug) ms_log (1, "Decoding %d Steim1 frames, swapflag: %d, srcname: %s\n", maxframes, swapflag, (srcname) ? srcname : ""); for (frameidx = 0; frameidx < maxframes && samplecount > 0; frameidx++) { /* Copy frame, each is 16x32-bit quantities = 64 bytes */ memcpy (frame, input + (16 * frameidx), 64); /* Save forward integration constant (X0) and reverse integration constant (Xn) and set the starting nibble index depending on frame. */ if (frameidx == 0) { if (swapflag) { ms_gswap4 (&frame[1]); ms_gswap4 (&frame[2]); } X0 = frame[1]; Xn = frame[2]; startnibble = 3; /* First frame: skip nibbles, X0, and Xn */ if (decodedebug) ms_log (1, "Frame %d: X0=%d Xn=%d\n", frameidx, X0, Xn); } else { startnibble = 1; /* Subsequent frames: skip nibbles */ if (decodedebug) ms_log (1, "Frame %d\n", frameidx); } /* Swap 32-bit word containing the nibbles */ if (swapflag) ms_gswap4 (&frame[0]); /* Decode each 32-bit word according to nibble */ for (widx = startnibble; widx < 16 && samplecount > 0; widx++) { /* W0: the first 32-bit contains 16 x 2-bit nibbles for each word */ nibble = EXTRACTBITRANGE (frame[0], (30 - (2 * widx)), 2); word = (union dword *)&frame[widx]; diffcount = 0; switch (nibble) { case 0: /* 00: Special flag, no differences */ if (decodedebug) ms_log (1, " W%02d: 00=special\n", widx); break; case 1: /* 01: Four 1-byte differences */ diffcount = 4; if (decodedebug) ms_log (1, " W%02d: 01=4x8b %d %d %d %d\n", widx, word->d8[0], word->d8[1], word->d8[2], word->d8[3]); break; case 2: /* 10: Two 2-byte differences */ diffcount = 2; if (swapflag) { ms_gswap2 (&word->d16[0]); ms_gswap2 (&word->d16[1]); } if (decodedebug) ms_log (1, " W%02d: 10=2x16b %d %d\n", widx, word->d16[0], word->d16[1]); break; case 3: /* 11: One 4-byte difference */ diffcount = 1; if (swapflag) ms_gswap4 (&word->d32); if (decodedebug) ms_log (1, " W%02d: 11=1x32b %d\n", widx, word->d32); break; } /* Done with decoding 32-bit word based on nibble */ /* Apply accumulated differences to calculate output samples */ if (diffcount > 0) { for (idx = 0; idx < diffcount && samplecount > 0; idx++, outputptr++) { if (outputptr == output) /* Ignore first difference, instead store X0 */ *outputptr = X0; else if (diffcount == 4) /* Otherwise store difference from previous sample */ *outputptr = *(outputptr - 1) + word->d8[idx]; else if (diffcount == 2) *outputptr = *(outputptr - 1) + word->d16[idx]; else if (diffcount == 1) *outputptr = *(outputptr - 1) + word->d32; samplecount--; } } } /* Done looping over nibbles and 32-bit words */ } /* Done looping over frames */ /* Check data integrity by comparing last sample to Xn (reverse integration constant) */ if (outputptr != output && *(outputptr - 1) != Xn) { ms_log (1, "%s: Warning: Data integrity check for Steim1 failed, Last sample=%d, Xn=%d\n", srcname, *(outputptr - 1), Xn); } return (outputptr - output); } /* End of msr_decode_steim1() */ /************************************************************************ * msr_decode_steim2: * * Decode Steim2 encoded miniSEED data and place in supplied buffer * as 32-bit integers. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_steim2 (int32_t *input, int inputlength, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag) { int32_t *outputptr = output; /* Pointer to next output sample location */ uint32_t frame[16]; /* Frame, 16 x 32-bit quantities = 64 bytes */ int32_t X0 = 0; /* Forward integration constant, aka first sample */ int32_t Xn = 0; /* Reverse integration constant, aka last sample */ int32_t diff[7]; int32_t semask; int maxframes = inputlength / 64; int frameidx; int startnibble; int nibble; int widx; int diffcount; int dnib; int idx; union dword { int8_t d8[4]; int32_t d32; } * word; if (inputlength <= 0) return 0; if (!input || !output || outputlength <= 0 || maxframes <= 0) return -1; if (decodedebug) ms_log (1, "Decoding %d Steim2 frames, swapflag: %d, srcname: %s\n", maxframes, swapflag, (srcname) ? srcname : ""); for (frameidx = 0; frameidx < maxframes && samplecount > 0; frameidx++) { /* Copy frame, each is 16x32-bit quantities = 64 bytes */ memcpy (frame, input + (16 * frameidx), 64); /* Save forward integration constant (X0) and reverse integration constant (Xn) and set the starting nibble index depending on frame. */ if (frameidx == 0) { if (swapflag) { ms_gswap4 (&frame[1]); ms_gswap4 (&frame[2]); } X0 = frame[1]; Xn = frame[2]; startnibble = 3; /* First frame: skip nibbles, X0, and Xn */ if (decodedebug) ms_log (1, "Frame %d: X0=%d Xn=%d\n", frameidx, X0, Xn); } else { startnibble = 1; /* Subsequent frames: skip nibbles */ if (decodedebug) ms_log (1, "Frame %d\n", frameidx); } /* Swap 32-bit word containing the nibbles */ if (swapflag) ms_gswap4 (&frame[0]); /* Decode each 32-bit word according to nibble */ for (widx = startnibble; widx < 16 && samplecount > 0; widx++) { /* W0: the first 32-bit quantity contains 16 x 2-bit nibbles */ nibble = EXTRACTBITRANGE (frame[0], (30 - (2 * widx)), 2); diffcount = 0; switch (nibble) { case 0: /* nibble=00: Special flag, no differences */ if (decodedebug) ms_log (1, " W%02d: 00=special\n", widx); break; case 1: /* nibble=01: Four 1-byte differences */ diffcount = 4; word = (union dword *)&frame[widx]; for (idx = 0; idx < diffcount; idx++) { diff[idx] = word->d8[idx]; } if (decodedebug) ms_log (1, " W%02d: 01=4x8b %d %d %d %d\n", widx, diff[0], diff[1], diff[2], diff[3]); break; case 2: /* nibble=10: Must consult dnib, the high order two bits */ if (swapflag) ms_gswap4 (&frame[widx]); dnib = EXTRACTBITRANGE (frame[widx], 30, 2); switch (dnib) { case 0: /* nibble=10, dnib=00: Error, undefined value */ ms_log (2, "%s: Impossible Steim2 dnib=00 for nibble=10\n", srcname); return -1; break; case 1: /* nibble=10, dnib=01: One 30-bit difference */ diffcount = 1; semask = 1ul << (30 - 1); /* Sign extension from bit 30 */ diff[0] = EXTRACTBITRANGE (frame[widx], 0, 30); diff[0] = (diff[0] ^ semask) - semask; if (decodedebug) ms_log (1, " W%02d: 10,01=1x30b %d\n", widx, diff[0]); break; case 2: /* nibble=10, dnib=10: Two 15-bit differences */ diffcount = 2; semask = 1ul << (15 - 1); /* Sign extension from bit 15 */ for (idx = 0; idx < diffcount; idx++) { diff[idx] = EXTRACTBITRANGE (frame[widx], (15 - idx * 15), 15); diff[idx] = (diff[idx] ^ semask) - semask; } if (decodedebug) ms_log (1, " W%02d: 10,10=2x15b %d %d\n", widx, diff[0], diff[1]); break; case 3: /* nibble=10, dnib=11: Three 10-bit differences */ diffcount = 3; semask = 1ul << (10 - 1); /* Sign extension from bit 10 */ for (idx = 0; idx < diffcount; idx++) { diff[idx] = EXTRACTBITRANGE (frame[widx], (20 - idx * 10), 10); diff[idx] = (diff[idx] ^ semask) - semask; } if (decodedebug) ms_log (1, " W%02d: 10,11=3x10b %d %d %d\n", widx, diff[0], diff[1], diff[2]); break; } break; case 3: /* nibble=11: Must consult dnib, the high order two bits */ if (swapflag) ms_gswap4 (&frame[widx]); dnib = EXTRACTBITRANGE (frame[widx], 30, 2); switch (dnib) { case 0: /* nibble=11, dnib=00: Five 6-bit differences */ diffcount = 5; semask = 1ul << (6 - 1); /* Sign extension from bit 6 */ for (idx = 0; idx < diffcount; idx++) { diff[idx] = EXTRACTBITRANGE (frame[widx], (24 - idx * 6), 6); diff[idx] = (diff[idx] ^ semask) - semask; } if (decodedebug) ms_log (1, " W%02d: 11,00=5x6b %d %d %d %d %d\n", widx, diff[0], diff[1], diff[2], diff[3], diff[4]); break; case 1: /* nibble=11, dnib=01: Six 5-bit differences */ diffcount = 6; semask = 1ul << (5 - 1); /* Sign extension from bit 5 */ for (idx = 0; idx < diffcount; idx++) { diff[idx] = EXTRACTBITRANGE (frame[widx], (25 - idx * 5), 5); diff[idx] = (diff[idx] ^ semask) - semask; } if (decodedebug) ms_log (1, " W%02d: 11,01=6x5b %d %d %d %d %d %d\n", widx, diff[0], diff[1], diff[2], diff[3], diff[4], diff[5]); break; case 2: /* nibble=11, dnib=10: Seven 4-bit differences */ diffcount = 7; semask = 1ul << (4 - 1); /* Sign extension from bit 4 */ for (idx = 0; idx < diffcount; idx++) { diff[idx] = EXTRACTBITRANGE (frame[widx], (24 - idx * 4), 4); diff[idx] = (diff[idx] ^ semask) - semask; } if (decodedebug) ms_log (1, " W%02d: 11,10=7x4b %d %d %d %d %d %d %d\n", widx, diff[0], diff[1], diff[2], diff[3], diff[4], diff[5], diff[6]); break; case 3: /* nibble=11, dnib=11: Error, undefined value */ ms_log (2, "%s: Impossible Steim2 dnib=11 for nibble=11\n", srcname); return -1; break; } break; } /* Done with decoding 32-bit word based on nibble */ /* Apply differences to calculate output samples */ if (diffcount > 0) { for (idx = 0; idx < diffcount && samplecount > 0; idx++, outputptr++) { if (outputptr == output) /* Ignore first difference, instead store X0 */ *outputptr = X0; else /* Otherwise store difference from previous sample */ *outputptr = *(outputptr - 1) + diff[idx]; samplecount--; } } } /* Done looping over nibbles and 32-bit words */ } /* Done looping over frames */ /* Check data integrity by comparing last sample to Xn (reverse integration constant) */ if (outputptr != output && *(outputptr - 1) != Xn) { ms_log (1, "%s: Warning: Data integrity check for Steim2 failed, Last sample=%d, Xn=%d\n", srcname, *(outputptr - 1), Xn); } return (outputptr - output); } /* End of msr_decode_steim2() */ /* Defines for GEOSCOPE encoding */ #define GEOSCOPE_MANTISSA_MASK 0x0FFFul /* mask for mantissa */ #define GEOSCOPE_GAIN3_MASK 0x7000ul /* mask for gainrange factor */ #define GEOSCOPE_GAIN4_MASK 0xf000ul /* mask for gainrange factor */ #define GEOSCOPE_SHIFT 12 /* # bits in mantissa */ /************************************************************************ * msr_decode_geoscope: * * Decode GEOSCOPE gain ranged data (demultiplexed only) encoded * miniSEED data and place in supplied buffer as 32-bit floats. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_geoscope (char *input, int samplecount, float *output, int outputlength, int encoding, char *srcname, int swapflag) { int idx = 0; int mantissa; /* mantissa from SEED data */ int gainrange; /* gain range factor */ int exponent; /* total exponent */ int k; uint64_t exp2val; int16_t sint; double dsample = 0.0; union { uint8_t b[4]; uint32_t i; } sample32; if (!input || !output) return -1; if (samplecount <= 0 || outputlength <= 0) return -1; /* Make sure we recognize this as a GEOSCOPE encoding format */ if (encoding != DE_GEOSCOPE24 && encoding != DE_GEOSCOPE163 && encoding != DE_GEOSCOPE164) { ms_log (2, "msr_decode_geoscope(%s): unrecognized GEOSCOPE encoding: %d\n", srcname, encoding); return -1; } for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (float); idx++) { switch (encoding) { case DE_GEOSCOPE24: sample32.i = 0; if (swapflag) for (k = 0; k < 3; k++) sample32.b[2 - k] = input[k]; else for (k = 0; k < 3; k++) sample32.b[1 + k] = input[k]; mantissa = sample32.i; /* Take 2's complement for mantissa for overflow */ if ((unsigned long)mantissa > MAX24) mantissa -= 2 * (MAX24 + 1); /* Store */ dsample = (double)mantissa; break; case DE_GEOSCOPE163: memcpy (&sint, input, sizeof (int16_t)); if (swapflag) ms_gswap2 (&sint); /* Recover mantissa and gain range factor */ mantissa = (sint & GEOSCOPE_MANTISSA_MASK); gainrange = (sint & GEOSCOPE_GAIN3_MASK) >> GEOSCOPE_SHIFT; /* Exponent is just gainrange for GEOSCOPE */ exponent = gainrange; /* Calculate sample as mantissa / 2^exponent */ exp2val = (uint64_t)1 << exponent; dsample = ((double)(mantissa - 2048)) / exp2val; break; case DE_GEOSCOPE164: memcpy (&sint, input, sizeof (int16_t)); if (swapflag) ms_gswap2 (&sint); /* Recover mantissa and gain range factor */ mantissa = (sint & GEOSCOPE_MANTISSA_MASK); gainrange = (sint & GEOSCOPE_GAIN4_MASK) >> GEOSCOPE_SHIFT; /* Exponent is just gainrange for GEOSCOPE */ exponent = gainrange; /* Calculate sample as mantissa / 2^exponent */ exp2val = (uint64_t)1 << exponent; dsample = ((double)(mantissa - 2048)) / exp2val; break; } /* Save sample in output array */ output[idx] = (float)dsample; outputlength -= sizeof (float); /* Increment edata pointer depending on size */ switch (encoding) { case DE_GEOSCOPE24: input += 3; break; case DE_GEOSCOPE163: case DE_GEOSCOPE164: input += 2; break; } } return idx; } /* End of msr_decode_geoscope() */ /* Defines for CDSN encoding */ #define CDSN_MANTISSA_MASK 0x3FFFul /* mask for mantissa */ #define CDSN_GAINRANGE_MASK 0xC000ul /* mask for gainrange factor */ #define CDSN_SHIFT 14 /* # bits in mantissa */ /************************************************************************ * msr_decode_cdsn: * * Decode CDSN gain ranged data encoded miniSEED data and place in * supplied buffer as 32-bit integers. * * Notes from original rdseed routine: * CDSN data are compressed according to the formula * * sample = M * (2 exp G) * * where * sample = seismic data sample * M = mantissa; biased mantissa B is written to tape * G = exponent of multiplier (i.e. gain range factor); * key K is written to tape * exp = exponentiation operation * B = M + 8191, biased mantissa, written to tape * K = key to multiplier exponent, written to tape * K may have any of the values 0 - 3, as follows: * 0 => G = 0, multiplier = 2 exp 0 = 1 * 1 => G = 2, multiplier = 2 exp 2 = 4 * 2 => G = 4, multiplier = 2 exp 4 = 16 * 3 => G = 7, multiplier = 2 exp 7 = 128 * Data are stored on tape in two bytes as follows: * fedc ba98 7654 3210 = bit number, power of two * KKBB BBBB BBBB BBBB = form of SEED data * where K = key to multiplier exponent and B = biased mantissa * * Masks to recover key to multiplier exponent and biased mantissa * from tape are: * fedc ba98 7654 3210 = bit number = power of two * 0011 1111 1111 1111 = 0x3fff = mask for biased mantissa * 1100 0000 0000 0000 = 0xc000 = mask for gain range key * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_cdsn (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag) { int32_t idx = 0; int32_t mantissa; /* mantissa */ int32_t gainrange; /* gain range factor */ int32_t mult = -1; /* multiplier for gain range */ uint16_t sint; int32_t sample; if (samplecount <= 0) return 0; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { memcpy (&sint, &input[idx], sizeof (int16_t)); if (swapflag) ms_gswap2 (&sint); /* Recover mantissa and gain range factor */ mantissa = (sint & CDSN_MANTISSA_MASK); gainrange = (sint & CDSN_GAINRANGE_MASK) >> CDSN_SHIFT; /* Determine multiplier from the gain range factor and format definition * because shift operator is used later, these are powers of two */ if (gainrange == 0) mult = 0; else if (gainrange == 1) mult = 2; else if (gainrange == 2) mult = 4; else if (gainrange == 3) mult = 7; /* Unbias the mantissa */ mantissa -= MAX14; /* Calculate sample from mantissa and multiplier using left shift * mantissa << mult is equivalent to mantissa * (2 exp (mult)) */ sample = ((uint32_t)mantissa << mult); /* Save sample in output array */ output[idx] = sample; outputlength -= sizeof (int32_t); } return idx; } /* End of msr_decode_cdsn() */ /* Defines for SRO encoding */ #define SRO_MANTISSA_MASK 0x0FFFul /* mask for mantissa */ #define SRO_GAINRANGE_MASK 0xF000ul /* mask for gainrange factor */ #define SRO_SHIFT 12 /* # bits in mantissa */ /************************************************************************ * msr_decode_sro: * * Decode SRO gain ranged data encoded miniSEED data and place in * supplied buffer as 32-bit integers. * * Notes from original rdseed routine: * SRO data are represented according to the formula * * sample = M * (b exp {[m * (G + agr)] + ar}) * * where * sample = seismic data sample * M = mantissa * G = gain range factor * b = base to be exponentiated = 2 for SRO * m = multiplier = -1 for SRO * agr = term to be added to gain range factor = 0 for SRO * ar = term to be added to [m * (gr + agr)] = 10 for SRO * exp = exponentiation operation * Data are stored in two bytes as follows: * fedc ba98 7654 3210 = bit number, power of two * GGGG MMMM MMMM MMMM = form of SEED data * where G = gain range factor and M = mantissa * Masks to recover gain range and mantissa: * fedc ba98 7654 3210 = bit number = power of two * 0000 1111 1111 1111 = 0x0fff = mask for mantissa * 1111 0000 0000 0000 = 0xf000 = mask for gain range * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_sro (int16_t *input, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag) { int32_t idx = 0; int32_t mantissa; /* mantissa */ int32_t gainrange; /* gain range factor */ int32_t add2gr; /* added to gainrage factor */ int32_t mult; /* multiplier for gain range */ int32_t add2result; /* added to multiplied gain rage */ int32_t exponent; /* total exponent */ uint16_t sint; int32_t sample; if (samplecount <= 0) return 0; add2gr = 0; mult = -1; add2result = 10; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { memcpy (&sint, &input[idx], sizeof (int16_t)); if (swapflag) ms_gswap2 (&sint); /* Recover mantissa and gain range factor */ mantissa = (sint & SRO_MANTISSA_MASK); gainrange = (sint & SRO_GAINRANGE_MASK) >> SRO_SHIFT; /* Take 2's complement for mantissa */ if ((unsigned long)mantissa > MAX12) mantissa -= 2 * (MAX12 + 1); /* Calculate exponent, SRO exponent = 0..10 */ exponent = (mult * (gainrange + add2gr)) + add2result; if (exponent < 0 || exponent > 10) { ms_log (2, "msr_decode_sro(%s): SRO gain ranging exponent out of range: %d\n", srcname, exponent); return MS_GENERROR; } /* Calculate sample as mantissa * 2^exponent */ sample = mantissa * ((uint64_t)1 << exponent); /* Save sample in output array */ output[idx] = sample; outputlength -= sizeof (int32_t); } return idx; } /* End of msr_decode_sro() */ /************************************************************************ * msr_decode_dwwssn: * * Decode DWWSSN encoded miniSEED data and place in supplied buffer * as 32-bit integers. * * Return number of samples in output buffer on success, -1 on error. ************************************************************************/ int msr_decode_dwwssn (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag) { int32_t idx = 0; int32_t sample; uint16_t sint; if (samplecount < 0) return 0; for (idx = 0; idx < samplecount && outputlength >= (int)sizeof (int32_t); idx++) { memcpy (&sint, &input[idx], sizeof (uint16_t)); if (swapflag) ms_gswap2 (&sint); sample = (int32_t)sint; /* Take 2's complement for sample */ if ((unsigned long)sample > MAX16) sample -= 2 * (MAX16 + 1); /* Save sample in output array */ output[idx] = sample; outputlength -= sizeof (int32_t); } return idx; } /* End of msr_decode_dwwssn() */ iris-edu-libmseed-4314359/unpackdata.h000066400000000000000000000041061422047135100174770ustar00rootroot00000000000000/*************************************************************************** * unpackdata.h: * * Interface declarations for the Mini-SEED unpacking routines in * unpackdata.c * * modified: 2016.273 ***************************************************************************/ #ifndef UNPACKDATA_H #define UNPACKDATA_H 1 #ifdef __cplusplus extern "C" { #endif /* Control for printing debugging information, declared in unpackdata.c */ extern int decodedebug; extern int msr_decode_int16 (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag); extern int msr_decode_int32 (int32_t *input, int samplecount, int32_t *output, int outputlength, int swapflag); extern int msr_decode_float32 (float *input, int samplecount, float *output, int outputlength, int swapflag); extern int msr_decode_float64 (double *input, int samplecount, double *output, int outputlength, int swapflag); extern int msr_decode_steim1 (int32_t *input, int inputlength, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag); extern int msr_decode_steim2 (int32_t *input, int inputlength, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag); extern int msr_decode_geoscope (char *input, int samplecount, float *output, int outputlength, int encoding, char *srcname, int swapflag); extern int msr_decode_cdsn (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag); extern int msr_decode_sro (int16_t *input, int samplecount, int32_t *output, int outputlength, char *srcname, int swapflag); extern int msr_decode_dwwssn (int16_t *input, int samplecount, int32_t *output, int outputlength, int swapflag); #ifdef __cplusplus } #endif #endif