Skip to main content

Fourth_Day

Authors:

  1. Stephan Meighen-Berger, developed the Fourth Day Code
  2. Li Ruohan, implemented the detector simulation
  3. Golo Wimmer, developed the Navier-Stokes code

Table of contents

  1. Introduction

  2. Citation

  3. Documentation

  4. Installation

  5. Emission PDFs

  6. Code Example

  7. Calibration mode

  8. Code structure

  9. BETA

    1. Probabilistic Modeling

    2. VEGAN

Introduction

A python package to simulate the bioluminescence in the deep sea. It calculates the light emissions and progates it to a detector. The detector response and properties can be (rudementarily) modelled using this code as well.

Citation

Please cite our work arXiv:2103.03816.

Documentation

The package provides automatically generated documentation under Documentation.

Installation

The easiest way to install the package is to use pip install:

pip install fourth_day

Then simply run

from fourth_day import Fourth_Day, config
# Initialize the object
fd = Fourth_Day()
# Fetch water current data. This may take a while
fd.load_data()

to get the necessary data sets (this requires an internet connection). Please note this requires pyDataverse, which you may not find using Anaconda (we suggest pip instead if it hasn't already been installed).

Another method is: To install please clone the repository or download the latest release. Then follow the instructions given in INSTALL.txt. Note this should install all necessary components except for the beta developments and the Navier_Stokes_code. Additionally, basic water current simulations can be downloaded under [https://doi.org/10.7910/DVN/CNMW2S]. The location of these files needs to be specified by setting

config['water']['model']['directory'] = "../PATH/TO/FOLDER/"

example_dataverse_downloader.ipynb shows an example how to download the dataset using the pyDataverse package.

Emission PDFs

The emission pdfs are constructed from data taken from Latz, M.I., Frank, T.M. & Case, J.F. "Spectral composition of bioluminescence of epipelagic organisms from the Sargasso Sea." Marine Biology 98, 441-446 (1988) https://doi.org/10.1007/BF00391120.

Unweighted PDFs

Code Example

A basic running example to interface with the package

# Importing the package
from fourth_day import Fourth_Day, config
# Creating fourth day object
fd = Fourth_Day()
# Running the simulation
fd.sim()
# The time array
t = fd.time
# The produced light
data = np.array([np.sum(fd.statistics[i].loc[:, 'photons'].values)
                 for i in range(len(fd.t))])
# Measured light
measured_detector = np.array([fd.measured["Detector 1"].values])

The last line produces results of the form

Example results

Depending on the detector specifications. In general, organism properties and emissions are stored in fd.statistics, while the expected measured time-series by the detectors is stored in fd.measured. For a more in-depth example, use the python notebook example_basics.ipynb in the examples folder. There you can find additional examples covering most use cases for the package.

Calibration mode

Besides the typical bioluminescence simulation, the code also offers a calibration mode. In this mode, standardized flashers (as defined by the user) are modeled and placed. The resulting measurements (time series) can then be extracted, allowing for quick and dirty calibration measurements in water. By defining possible errors in the different aspects of the measurement realistic data sets for calibration analysis can be generated. An example of such a simulation run is shown here

Calibration Measurement

Code structure

The code is structed as Sketch of the model

BETA

All projects listed here are currently in devolpment. We provide in the hopes they may help future development or advanced users. The installation requirements are not designed to accomodate these new modules and the user needs to install them themselves.

Probabilistic Modeling

Here examples are given how to construct emission pdfs (depending on location). These can in turn be used to construct simplified models for bioluminescence and when analyzing data.

VEGAN

A rudimentary GAN network, testing the waters if data generation can be replaced by using neural networks. One thing that needs improvement is the measure. We suggest introducing a Wasserstein Loss function. Here we give an example of the output of the NN after a few generations (black), compared to an example set from the MC sim (red).

Vegan Example

Metadata

Release files for fourth-day 1.0.12

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

Source distribution (sdist)

Source distribution for fourth-day 1.0.12
File Size Uploaded
fourth_day-1.0.12.tar.gz 39.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fourth-day 1.0.12
File Interpreter ABI Platform
fourth_day-1.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 84.9 kB

Release files / fourth_day-1.0.12.tar.gz

Download URL fourth_day-1.0.12.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93a47e7254058f44815bb53f101e4221f8001fa7d75468a1789d6c455912f041
BLAKE2b-256 checksum
How to use checksums
1b8dcf12117b2ab5d21d9ce3de3300d50e57fec6c1ae2244a4177e6754514c8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / fourth_day-1.0.12-py3-none-any.whl

Download URL fourth_day-1.0.12-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b51fe761e8ff4f1163d8c241fe9b81d3fa2abde96c0719938b6ce41566996af
BLAKE2b-256 checksum
How to use checksums
70476461df481b04899b8a4052b25f3b461fbbc700b784dd30210374436f588b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.12 This release

2 release files

1.0.11

1 release file

1.0.10

1 release file

1.0.9

2 release files

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