Giter Site home page Giter Site logo

seismic-augmentation's Introduction

Logo

seismic-augmentation

Pytorch library for seismic data augmentation

Setup

pip install --upgrade git+https://github.com/IMGW-univie/seismic-augmentation.git

Usage example

import torch
from seismic_augmentation.composition import Compose
from seismic_augmentation.augmentations import *

aug = Compose([
         FlipChannels(init_channel_order='ZNE'),
         AddRandomNoise(snr_level_db=-10),
         RandomLowPassFilter(cutoff_freq_range=[1,10]),
         RandomHighPassFilter(cutoff_freq_range=[3,14]),
         Taper(max_percentage=0.5, max_length=10),
         PolarityChange(),
         Normalize()
         ],  
         p=0.5)

transformed = aug(data=waveform, sample_rate=30)

Contribute

Contributors welcome!

Documentation

For now this library is very simple

FlipChannels(init_channel_order='ZNE')
'''
Swaps N and E channels. Easiest way to change azimuth of a signal

init_channel_order - ordering of the channels of your seismic data
'''
AddRandomNoise(snr_level_db=-10)
'''
Adds random noise with desired SNR

snr_level_db - desired signal to noise ratio after augmentation
'''
RandomLowPassFilter(cutoff_freq_range=[1,10])
'''
Applies Low Pass Filter with a random cutoff frequency

cutoff_freq_range - range of possible cutoff frequencies
'''
RandomHighPassFilter(cutoff_freq_range=[1,10])
'''
Applies High Pass Filter with a random cutoff frequency

cutoff_freq_range - range of possible cutoff frequencies
'''
LowPassFilter(cutoff_freq=9.)
'''
Applies Low Pass Filter with a desired cutoff frequency

cutoff_freq - desired cutoff frequency
'''
HighPassFilter(cutoff_freq=9.)
'''
Applies High Pass Filter with a desired cutoff frequency

cutoff_freq - desired cutoff frequency
'''
Taper(max_percentage=0.5, max_length=10)
'''
Applies a taper with specified parameters

max_percentage - how strongly the signal is suppresed
max_length - maximum length of a taper in samples
'''
PolarityChange()
'''
Flips polarity of the signal
'''
Normalize()
'''
Global normalization of 3-channel signal
'''
RotateWaveforms(angle_range=[0, 360])
'''
Rotates waveform to a specified angle

angle_range - range of angles in degrees
'''

p - probability that an augmentation would be applied

Inspiration

Highly inspired by Facebook Augly

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.