Skip to main content

A simple and universal package for loading large amounts of distributed acoustic sensing (DAS) data.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

das2numpy-1.2.0.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

das2numpy-1.2.0-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file das2numpy-1.2.0.tar.gz.

File metadata

  • Download URL: das2numpy-1.2.0.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for das2numpy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 1de78a6af110aef965533bd22b1d7dc88c81aa6502339bfda5b2580ea2e8447c
MD5 46f51cec119c8b31a9f213c94734d1e2
BLAKE2b-256 9ebcccff239864ba730ba9d7d5f35c3596c23862f00b698ae7042121bf72df40

See more details on using hashes here.

File details

Details for the file das2numpy-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: das2numpy-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for das2numpy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 002ff7ff98d1b8c0f7a53f57032c5bc128c75118f3bdfcd6bedd4ddb265f55e4
MD5 5686b64ec08bc6b4a333f20ac5251153
BLAKE2b-256 e1d1ba61fbcb3bc0f304390475b5082523b6481a8ee3ef6d08168eaa19f45939

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page