Giter Site home page Giter Site logo

mseed-lib's Introduction

mseed-lib

The Standard for the Exchange of Earthquake Data (SEED) is an international standard format for the exchange of digital seismological data. SEED was designed for use by the earthquake research community, primarily for the exchange between institutions of unprocessed earth motion data. It is a format for digital data measured at one point in space and at equal intervals of time. The SEED format consists of Volume Control Headers, Abbreviation Control Headers, Station Control Headers, Time Span Control Headers and finally Data Records. In complement to “Dataless” SEED volumes, exists the “Data-only” volume called Mini-SEED (see http://www.iris.edu for further information).

The purpose of these functions is to read and write miniSEED data files directly from Matlab/Octave, avoiding intermediate format conversion (like SAC or other formats for which many functions exist), having a full control on headers and formats.

The function has the particularity to be respectful of the SEED standard, thus should be able to read ANY miniSEED file: all known encoding formats, multiplexed channels, data sampling, mixed encoding formats, mixed block sizes and even mixed endianness (it appends!).

rdmseed.m: reading miniSEED file

Each data record is imported into a structure array, allowing to adress data blocks and header fields individually (useful for multi-channel files), just as concatenating all data with a simple cat(1,X.d) function. Time stamps are also converted into Matlab datenum format. The function reads miniSEED "data-only" using the two mostly used compression formats Steim-1 and Steim-2. General FDSN formats have also been implemented (ASCII, 16/24/32-bit integers, IEEE floats and doubles), and GEOSCOPE multiplexed old formats (24-bit, 16/3 or 16/4-bit gain ranged). All these formats should work but some of them have not been tested using real data. I also partly coded Steim-3 format but without a clear description and any file example... Since I never met any data file using this format, I don't know if it's really useful.

The function detects also automatically big/little-endian coded files.

Known Blockettes are 1000, 1001, 100, 500 and 2000. If there is no Blockette 1000 (which is mandatory in SEED format...), default 4096-byte record length, big-endian and Steim-1 compression are used. These values can be set using additional arguments.

Using extra output argument, some analysis can be done on the data stream (detection of gaps and overlaps), and channel components are detected. Without any output arguments, or with an additionnal 'plot' input argument, the function plots the imported data in a new figure (works also in case of multi-channel file).

Steim-1/2 compression decoding strategy has been deeply optimized for Matlab. The proposed method, as vectorized as possible, is about 30 times faster than a 'C-like' loops coding... which is still 10 times slower than the same C-compiled program, but, well, this is the Matlab's other side of the coin!

mkmseed.m: writing miniSEED file

The function allows to export a data vector D to miniSEED file, giving origin date and time (for monotonic data) and sampling rate, or a time vector. Header information is specified using the filename string with conventional naming "Network.Station.Location.Channel". Output file names will have appended ".Year.Day" and multiple file may be produced if data exceed a day.

Data encoding format can be specified (16/32-bit integers, IEEE float/double, Steim-1/2, Geoscope 16/3-4). If not, it will depend on the class of variable D. Binary file is big-endian coded, and default record length is 4096 bytes (this may be changed using input argument).

Author

François Beauducel, IPGP, beaudu, [email protected]

Documentation

Type "doc rdmseed" or "doc mkmseed" for detailed usage.

Other repository

Source code available also at MathWorks File Exchange: View RDMSEED and MKMSEED: Read and write miniSEED files on File Exchange with user comments and rating.

mseed-lib's People

Contributors

beaudu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mseed-lib's Issues

BLOCKETTE 1001 Micro_sec: is it used?

Dear developers,

I had a quick look at the source code and I can see the blockette 1001 is properly read and the field Micro_sec populated.

However the Micro_sec value doesn't seem to be used to correct the record start time. Is this intended? Is this a feature not implemented yet?

Thank you for your help and for this code.

problem with little-endian encoding files

Since the commit 4f031d4, an error occurs when reading a little-endian encoded file. This induces wrong data output and a warning about data integrity check for Steim encoding.

This issue has been identified thansk to Sagynbek Orunbaev.

unable to produce mseed file using mkmseed program

I have one hour of 24 files for a day. I am trying to make one mseed file using 24 hourly files. But I am getting the error and my loop is stopped.

Unrecognized function or variable 'dt'.
Error in mkmseed (line 228)
m = [0;(dt > (1 + fs_tol)/H(1).SampleRate/86400 | dt < (1 - fs_tol)/H(1).SampleRate/86400)];

I need your suggestion to resolve the issue.

In order to avoid this issue I have used "try" and "catch" command to avoid the error.
Using these command avoid making continuous mseed files. It is like 1, 2, 5, 7, 10, 13, 15th day etc. It shows that there might be issue with the hourly mseed files. So, using "try" and "catch" is not appropriate here.

On this ground, can we resolve the issue associated with mkmseed.m files.

Kind Regards

Station component length wrong when saving mseed file using mkmseed?

Isn't it that the station component field is 3 characters length?

I had problems reading MSEED files using rdmseed that were created with mkmseed. I noted that in line 146 of mkmseed there is:

X.ChannelIdentifier = sprintf('%-3s',cc{4}(1:min(length(cc{4}),4)));

After changing the last variable to 3:

X.ChannelIdentifier = sprintf('%-3s',cc{4}(1:min(length(cc{4}),3)));

I could successfully read the file I created when using the [X,I] = rdseed(...) option

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.