DASCore

A python library for distributed fiber optic sensing.

coverage PyPI Version supported versions PyPI Downloads Conda Downloads DOI Licence

Code

Documentation [stable, development]

Version-specific documentation builds are attached to the release pages.

Highlights

DASCore is a Python library for distributed acoustic sensing (DAS). It provides:

  1. IO support for various DAS data formats
  2. Common processing routines
  3. Basic visualizations
Note

DASCore is a foundational package of the DAS Data Analysis Ecosystem (DASDAE). It facilitates rapid development of other DASDAE packages that do more specialized analysis/visualization.

Supported file formats

name version scan get_format read write
APSENSING 10
DASDAE 1
DASHDF5 1.0
FEBUS 2
FEBUS 1
H5SIMPLE 1
NEUBREX 1
OPTODAS 8
PICKLE
PRODML 2.0
PRODML 2.1
RSF 1
SEGY 2
SENTEK 5
SILIXA_H5 1
TDMS 4713
TERRA15 4
TERRA15 5
TERRA15 6
WAV
XMLBINARY 1

Introductory usage

Read a file

import dascore as dc
from dascore.utils.downloader import fetch

# get a path to an example file, replace with your path
file_path = fetch('terra15_das_1_trimmed.hdf5')

spool = dc.spool(file_path)
patch = spool[0]

Working with a directory of DAS files

import dascore as dc
from dascore.utils.downloader import fetch

# get a path to a directory of das files, replace with your path
directory_path = fetch('terra15_das_1_trimmed.hdf5').parent

spool = (
    # Create a spool to interact with directory data
    dc.spool(directory_path)
    # Index the directory contents
    .update()
    # Sub-select a specific time range
    .select(time_min=('2020-01-01', ...))
    # Specify chunk of the output patches
    .chunk(time=60, overlap=10)
)

Get patches (array w/ metadata)

import dascore as dc

spool = dc.get_example_spool('diverse_das')

# Spools are like lists, you can get patches through iteration
for patch in spool:
    ...

# or through indexing
patch = spool[0]

Perform processing

import dascore as dc

patch = dc.get_example_patch('random_das')

out = (
    # Decimate along time axis (keep every 8th sample)
    patch.decimate(time=8)
    # Detrend along the distance dimension
    .detrend(dim='distance') 
    # Apply 10Hz low-pass filter along time dimension
    .pass_filter(time=(..., 10))
)

Visualize

import dascore as dc

patch = dc.get_example_patch('example_event_2')

patch.viz.waterfall(show=True, scale=0.2);

Installation

Use pip or conda to install DASCore:

pip install dascore
conda install dascore -c conda-forge

See this recipe for installation with Docker.

See the contributing docs for development installations.

Feedback and Support

Use the project discussions to ask a question.

Use the project issues to report an issue.