How hmz-03/daspy works
Project type and purpose
• DASPy is an open-source Python toolbox (library) for Distributed Acoustic Sensing (DAS) data processing.
• It provides core I/O, basic seismic processing routines, visualization, and advanced DAS-specific algorithms.
File structure
• Top-level packaging and metadata:
• setup.py, LICENSE, README.md, .github/workflows (CI)
• Core package directory “daspy/” with three main subpackages:
• core: data I/O (read.py, write.py), fundamental data structures (collection.py, section.py), datetime handling
• basic_tools: generic seismic processing (filtering, frequency attributes, preprocessing, visualization)
• advanced_tools: DAS-specific algorithms (denoising, channel analysis, waveform decomposition, strain→velocity)
• Documentation & examples:
• document/ (MAT file example, Jupyter notebook)
• website/ (logo, tutorial assets)
• Contribution files (CONTRIBUTING.md, CONTRIBUTORS.txt) and CI workflow.
README for additional insights
• Confirms the Python-only toolbox orientation.
• Lists core functionality: preprocessing, filter, spectrum analysis, visualization, denoising, decomposition, channel attributes, strain-velocity conversion.
• Points to tutorials and dependencies (numpy, scipy, matplotlib, geographiclib, pyproj, h5py, segyio, nptdms, tqdm).
Main components & their relationships
a. Core I/O & data model
• read(), write(), Section/Collection classes encapsulate waveform data and metadata
b. Basic Tools
• Consume Section/Collection objects to provide filtering, spectral analysis, visualization
c. Advanced Tools
• Build on core data structures and basic tools to deliver specialized DAS algorithms
d. External dependencies
• Underlying libraries (numpy, scipy, etc.)
e. User interface
• Python API, Jupyter notebook examples, CLI entry point (if any), package distribution via PyPI/Conda
f. Documentation site & CI
• Hosted assets, automated tests/builds via GitHub Actions
Architectural patterns and design principles
• Modular package design: clear separation of core, basic, and advanced toolsets
• Data-centric API: central Section/Collection classes flow through modules
• Extensibility: users can add new processing modules under basic_tools/ or advanced_tools/
• “User Code / Notebook” (entry point)
• Core I/O & Data Model (daspy.core)
• Basic Tools (daspy.basic_tools)
• Advanced Tools (daspy.advanced_tools)
• External Libraries
• Package & CI Infrastructure (setup.py, GitHub Actions, website)
1. User Code → call daspy.read()
2. read() → Core Data Model
3. Core Data Model → Basic Tools → Advanced Tools
4. Tools → Core Data Model updates → write() or plot()
c. Dependencies:
• Daspy modules depend on numpy, scipy, etc.
• CI → runs tests on all modules
• setup.py → bundles modules for distribution
• External dependencies in another
• User interface (notebook/CLI) in a third