import dascore as dc
# Import fetch to read DASCore example files
from dascore.utils.downloader import fetch
# Fetch a sample file path from DASCore
= fetch('terra15_das_1_trimmed.hdf5')
file_path # To read DAS data stored locally on your machine, simply replace the above line with:
# file_path = "/path/to/data/directory/data.EXT"
= dc.spool(file_path)
spool = spool[0] patch
DASCore
A python library for distributed fiber optic sensing.
Documentation [stable, development]
Chambers, D., Jin, G., Tourei, A., Issah, A. H. S., Lellouch, A., Martin, E., Zhu, D., Girard, A., Yuan, S., Cullison, T., Snyder, T., Kim, S., Danes, N., Pnithan, N., Boltz, M. S. & Mendoza, M. M. (2024). DASCore: a Python Library for Distributed Fiber Optic Sensing. Seismica, 3(2).
Highlights
DASCore is a Python library for distributed acoustic sensing (DAS). It provides:
- IO support for various DAS data formats
- Common processing routines
- Basic visualizations
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 | ✅ | ✅ | ✅ | ❌ |
GDR_DAS | 1 | ✅ | ✅ | ✅ | ❌ |
H5SIMPLE | 1 | ✅ | ✅ | ✅ | ❌ |
NEUBREXRFS | 1 | ✅ | ✅ | ✅ | ❌ |
NEUBREXDAS | 1 | ✅ | ✅ | ✅ | ❌ |
OPTODAS | 8 | ✅ | ✅ | ✅ | ❌ |
PICKLE | ❌ | ✅ | ✅ | ✅ | |
PRODML | 2.0 | ✅ | ✅ | ✅ | ❌ |
PRODML | 2.1 | ✅ | ✅ | ✅ | ❌ |
RSF | 1 | ❌ | ❌ | ❌ | ✅ |
SEGY | 1.0 | ✅ | ✅ | ✅ | ✅ |
SEGY | 2.0 | ✅ | ✅ | ✅ | ✅ |
SEGY | 2.1 | ✅ | ✅ | ✅ | ✅ |
SENTEK | 5 | ✅ | ✅ | ✅ | ❌ |
SILIXA_H5 | 1 | ✅ | ✅ | ✅ | ❌ |
TDMS | 4713 | ✅ | ✅ | ✅ | ❌ |
TERRA15 | 4 | ✅ | ✅ | ✅ | ❌ |
TERRA15 | 5 | ✅ | ✅ | ✅ | ❌ |
TERRA15 | 6 | ✅ | ✅ | ✅ | ❌ |
WAV | ❌ | ❌ | ❌ | ✅ | |
XMLBINARY | 1 | ✅ | ✅ | ✅ | ❌ |
Introductory usage
Read a file
Working with a directory of DAS files
import dascore as dc
# Import fetch to read DASCore example files
from dascore.utils.downloader import fetch
# Fetch a sample file path from DASCore (just to get a usable path for the rest of the cell)
= fetch('terra15_das_1_trimmed.hdf5').parent
directory_path # To read a directory of DAS data stored locally on your machine,
# simply replace the above line with:
# directory_path = "/path/to/data/directory/"
= (
spool # Create a spool to interact with directory data
dc.spool(directory_path)# Index the directory contents
.update()# Sub-select a specific time range
=('2020-01-01', ...))
.select(time_min# Specify chunk of the output patches
=60, overlap=10)
.chunk(time )
Get patches (array w/ metadata)
import dascore as dc
= dc.get_example_spool('diverse_das')
spool
# Spools are like lists, you can get patches through iteration
for patch in spool:
...
# or through indexing
= spool[0] patch
Perform processing
import dascore as dc
= dc.get_example_patch('random_das')
patch
= (
out # Decimate along time axis (keep every 8th sample)
=8)
patch.decimate(time# Detrend along the distance dimension
='distance')
.detrend(dim# Apply 10Hz low-pass filter along time dimension
=(..., 10))
.pass_filter(time )
Visualize
import dascore as dc
= dc.get_example_patch('example_event_2')
patch
=True, scale=0.2); patch.viz.waterfall(show
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.
Please note that there is currently a fix in progress for the dependency issue with segyio, which does not yet support Python 3.13, so that segyio will be an optional dependency. For the time being, please use Python 3.12 for the environment.
Feedback and Support
Use the project discussions to ask a question.
Use the project issues to report an issue.