Skip to main content

A Data-Driven Probabilistic Time Series Simulator for Chemical Plumes

Project description

DOI

COSMOS: A Data-Driven Probabilistic Time Series Simulator for Chemical Plumes Across Spatial Scales

The development of robust odor navigation strategies for automated environmental monitoring applications requires realistic simulations of odor time series for agents moving across large spatial scales. Traditional approaches that rely on computational fluid dynamics (CFD) methods can capture the spatiotemporal dynamics of odor plumes, but are impractical for large-scale simulations due to their computational expense. On the other hand, puff-based simulations, although computationally tractable for large scales and capable of capturing the stochastic nature of plumes, fail to reproduce naturalistic odor statistics. Here, we present COSMOS (Configurable Odor Simulation Model over Scalable Spaces), a data-driven probabilistic framework that synthesizes realistic odor time series from spatial and temporal features of real datasets. COSMOS generates similar distributions of key statistical features such as whiff frequency, duration, and concentration as observed in real data, while dramatically reducing computational overhead. By reproducing critical statistical properties across a variety of flow regimes and scales, COSMOS enables the development and evaluation of agent-based navigation strategies with naturalistic odor experiences. To demonstrate its utility, we compare odor-tracking agents exposed to CFD-generated plumes versus COSMOS simulations, showing that both their odor experiences and resulting behaviors are quite similar.

Below is a graphical representation of how the algorithm works. COSMOS

License

This repository is dedicated to the public domain under CC0 1.0 Universal.

Requirements

  1. Install Packages:

    pip install pandas
    pip install h5py
    pip install numpy
    pip install matplotlib
    pip install figurefirst
    pip install tables
    pip install POT
    pip install tsfresh
    
  2. To install requirements:

    pip install -r requirements.txt
    
  3. Data Setup (Required):

    All data, trained models and figures are available for download from data dryad. Please place the folder data and svgs in the home folder of COSMOS to run all scripts.

    Rigolli's data can be found here, download and place coordinates.mat, crosswind_v.mat, downwind_v.mat, ground_data.mat, nose_data.mat, vertical_v.mat, in the data/rigolli location.

    After setup, your directory should look like:

    COSMOS/
    ├── cosmos/              # Package code
    ├── data/               # Downloaded from Dryad
    │   ├── hws/
    │   ├── lws/  
    │   ├── forest/
    │   └── rigolli/        # Additional files from Zenodo
    └── svgs/               # Downloaded from Dryad
    
  4. For Package Usage (Simplified Interface):

    pip install -e .  # Install COSMOS as package
    

    Then use the simplified interface:

    import cosmos
    model = cosmos.predictor('desert-hws')
    concentration = model.step_update(1.0, 0.5)
    

    Refer Usage for more details.

  5. To visualize the figures and see the results and calculations, you will need to install the following:

Follow the setup of FigureFirst into inkscape.

Files:

Training

  1. Training COSMOS Spatial : Demonstrates how to train a cosmos spatial model

Testing/Evaluation

  1. Testing Trajectory with COSMOS : Demonstration of how to use the spatial model and test a trajectory using the cosmos algorithm

Agent Based Tracking

  1. Agent Based Tracking : Surge and Cast implementation using COSMOS and CFD Rigolli for odor experience.
  2. Agent Tracking trajectory comparison : Agent based tracking using COSMOS and CFD, trajectory comparison and timing diagram
  3. COSMOS Algorithm for testing Trajectories
  4. COSMOS Algorithm for use with agent tracking
  5. Helper for CFD methods
  6. Helper for odor statistics Calculation

Pre-trained Models and Data and Figure svgs

All data, trained models and figures are available for download from data dryad. Please place the folder data and svgs to in the home folder of COSMOS to run all scripts. Rigolli's data can be found here, download and place coordinates.mat, crosswind_v.mat, downwind_v.mat, ground_data.mat, nose_data.mat, vertical_v.mat, in the data/rigolli location.

Results

Our algorithm achieved similar outdoor statistical distribution, with a high observed wasserstein distance (higher p value representing more similarity). Below is results for desert dataset which had a windspeed ranging between 3.5m/s to 6m/s (HWS). Result The result can be reproduced using this script.

Figures

Below are interactive notebooks, which can be used using Jupyter Notebook and run using python 3.8 and inskcape to generate the figures and results. These figures were generated using figurefirst

Main Text Figures:

  1. Figure 1 : Overview of COSMOS algorithm
  2. Figure 2 : COSMOS results on HWS desert data
  3. Figure 3 : COSMOS results on Rigolli odor simulator data
  4. Figure 4 : Agent based tracking using COSMOS and CFD, trajectory comparison and timing diagram

Supplemental Figure

  1. Figure 5 : COSMOS results on HWS desert data
  2. Figure 6 : COSMOS results on HWS desert data
  3. Figure 7 : Binning of whiff statistics, in depth flow diagram for concentration modeling and intermittency modeling.

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

cosmos_odor-1.0.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

cosmos_odor-1.0.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file cosmos_odor-1.0.1.tar.gz.

File metadata

  • Download URL: cosmos_odor-1.0.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cosmos_odor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0697dbad10a89590503b79bb15c0e2280de092ef5586185cbf687872560e1b8a
MD5 87a44d7a8817fcd7d8bad76da753c822
BLAKE2b-256 2324ee9e32981f749f73edb149ed076d515edef9a17776003b5eded175394567

See more details on using hashes here.

File details

Details for the file cosmos_odor-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cosmos_odor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cosmos_odor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33ebd7b3a3ad9d5e8b11de1cd83f2d17c4d18251343ede67e66ae81a76a2f917
MD5 6d9abdfa15c6caf69195310a231b01c8
BLAKE2b-256 c0916bccd4aa5456238a24ad398e38810681f2ad3e4e7c87b6178b3a15987023

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