Code Monkey home page Code Monkey logo

stochasticturbulencegeneration's Introduction

StochasticTurbulenceGeneration

Python code to generate passive 3d+time fields representing a passive scalar being convected by Kolmogorov turbulence.

The method and some background is described in the Master's thesis H. Gingsjö, "Modelling and simulation of tropospheric water vapour with gaussian random fields - Time dependence beyond the frozen flow hypothesis", M.S. thesis, Department of Space, Earth and Environment, Chalmers University of Technology, Gothenburg, Sweden, 2018. [Online]. Available: http://studentarbeten.chalmers.se/publication/255146-modelling-and-simulation-of-tropospheric-water-vapour-with-gaussian-random-fields-time-dependence-be [link valid 2019-06-01]

Dependencies: Python 2 or 3 (should be version agnostic) with modules cython, numpy and scipy. The small visualization program additionally requires pyqtgraph and OpenGL. (Probably plus some more that I've forgotten about)

A visualization program that can show some sample realizations of random 3D-fields with different statistics can be run with

python visualizingGUI.py

To run the software first run

python compile_cython.py build_ext --inplace

to compile the cython file "cone.pyx" used for generating integration weights for radiometer cones.

Then try

python example_config.py

which will run a basic simulation.

This creates a directory called 'example' in which a cache file, weight_cache.pkl, and an output file, example_out_000.npy, are written. If the code is run again it will generate an independent realization and store that in example_out_001.npy, and so on.

The files can be loaded using numpy as follows:

import numpy as np
signals = np.load('example_out_000.npy')

Now signals is a 2d array where the first column, signals[:,0], is the timestamps when the process was sampled and the other columns, signals[:,1:], are line integrals over the refractivity field. Parameters for those lines are stored in weight_cache.pkl.

It could be nice to have the output in a '.mat'-file containing both the generated time series and information about the geometry. It would only take a few minutes to add that feature.

stochasticturbulencegeneration's People

Contributors

hengin avatar algmyr avatar

Stargazers

Liu Chen avatar Jinshi Sai avatar  avatar Cole Hudson avatar Alex Liberzon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.