Skip to main content

Module for loading Distributed Acoustic Sensing (DAS) data. SILIXA / OPTASENSE

Install

You can install via PIP.

python -m pip install das2numpy

To load data from flac files, ffmpeg (https://ffmpeg.org) needs to be installed. It is not possible to install ffmpeg with pip.

On DESY's Maxwell cluster ffmpeg is available as a module. Before using das2numpy execute:

module load maxwell ffmpeg

Python API

Example: If you want to get started quickly, have a look at the example.py.

Create an instance with:

def loader(root_path:str, predefined_setup:str, num_worker_threads):
    Loads data and returns it as a numpy array. 
    Args:
        root_path (str): Path to directory that contains the files to be loaded from. Subdirectories are (recursively) also searched.
        predefined_setup (str): One of ["SILIXA", "FLAC_200HZ", "OPTASENSE"]
        num_worker_threads (int): The number of worker threads used for loading files in parallel.
    Returns:
        A loader instance to load data. Call instance.load_array(...).

Use one of the load_array(..) functions of that instance.

def load_array(t_start:datetime, t_end:datetime, channel_start:int, channel_end:int) -> NP.ndarray:
Loading data into numpy array.
Returns nothing, the data can be accessed by accessing the data field of this instance.
Warning: using a different value then 1 for t_step or channel_step can result in a high cpu-usage.
        Consider using multithreaded=True in the constructor and a high amount of workers if needed.
Args:
    t_start (datetime): datetime object which defines the start of the data to load.
    t_end (datetime): datetime object which defines the end of the data to load.
    channel_start (int): The starting index of the sensor position in the data (inclusive).
    channel_end (int): The ending index of the sensors position in the data (exclusive).
    t_step (int): Reduces the data on the time axis by factor t_step. Uses mean averaging. Default is 1. 
    channel_step (int): Like t_step, but for the sensor position.
Returns:
    A 2d-numpy-array containing the data.
    The first axis corresponds to the time, the second to the channel (sensor position)

For more details have a look at the inline documentation of chunk.py

Command Line Interface

Creates a numpy file from the requested data. Optionally, the binary data can be printed to stdout.

Example call:

python -m das2numpy "SILIXA" /pnfs/desy.de/m/project/iDAS/raw/2024-DESY/2024-07-23-desy 2024-07-23T10:01:00 2024-07-23T10:02:00 10 0 1000 10 default

For more information:

python -m das2numpy -h

Issues

  • Loading from OPTASENSE may not work anymore. I haven't tested it for a long time.

Metadata

Release files for das2numpy 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for das2numpy 1.2.1
File Size Uploaded Provenance Actions
das2numpy-1.2.1.tar.gz 33.6 kB Without provenance Details for das2numpy-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for das2numpy 1.2.1
File Interpreter ABI Platform Actions
das2numpy-1.2.1-py3-none-any.whl Python 3 none any Details for das2numpy-1.2.1-py3-none-any.whl

Total release size: 71.5 kB

Release files / das2numpy-1.2.1.tar.gz

Download URL das2numpy-1.2.1.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
32b3a071d7177936957fe993c6ae4f061a418b22b0d67536e5c7545c3a063c72
BLAKE2b-256 checksum
How to use checksums
b11cb4da42c699fafaa06755bab54e8656eca10201e0fa46362ec4c13ecc92e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release files / das2numpy-1.2.1-py3-none-any.whl

Download URL das2numpy-1.2.1-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cefc104b274829c964e80eeee7237ff6eaeae276d53f6584a205c560fc26680
BLAKE2b-256 checksum
How to use checksums
ff787dff135e5f423d33b960849ae3c2ec2ea7503e90607ff884f093e3abc26b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Security for das2numpy 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page