Coder Social home page Coder Social logo

klenm / pyatmosphere Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 643 KB

Physics-based simulation of light propagation in turbulent atmosphere

License: GNU General Public License v3.0

Python 21.86% Jupyter Notebook 78.14%
atmospheric-science gpu physics physics-simulation python quantum-optics simulation

pyatmosphere's Introduction

pyAtmosphere

Physics-based simulation of light propagation in turbulent atmosphere.

Installation

*Highly recommend to use virtual environment.

Use the package manager pip to install required packages.

pip install -r requirements.txt

If you want to use GPU for simulation, you need to install CUDA on your machine. Additinally, the cupy python package is required. For example, for CUDA 11.0:

pip install cupy-cuda110

Usage

GPU usage

If you want to enable GPU simulation, execute at the beginning of your script:

from pyatmosphere import gpu
gpu.config['use_gpu'] = True

QuickChannel example

from pyatmosphere import QuickChannel

quick_channel = QuickChannel(
    Cn2=1e-15,
    length=10000,
    count_ps=5,
    beam_w0=0.09,
    beam_wvl=8.08e-07,
    aperture_radius=0.12
    )

quick_channel.plot()

Advanced channel

import numpy as np
from pyatmosphere import (
    Channel,
    RectGrid,
    RandLogPolarGrid,
    GaussianSource,
    IdenticalPhaseScreensPath,
    SSPhaseScreen,
    CirclePupil,
    MVKModel,
    measures
    )

channel = Channel(
    grid=RectGrid(
        resolution=2048, 
        delta=0.0015
    ),
    source=GaussianSource(
        wvl=808e-9,
        w0=0.12,
        F0=np.inf
    ),
    path=IdenticalPhaseScreensPath(
        phase_screen=SSPhaseScreen(
            model=MVKModel(
                Cn2=5e-16,
                l0=6e-3,
                L0=1e3,
            ),
            f_grid=RandLogPolarGrid(
                points=2**10, 
                f_min=1 / 1e3 / 15, 
                f_max=1 / 6e-3 * 2
            )
        ),
        length=50e3,
        count=5
    ),
    pupil=CirclePupil(
        radius=0.2
    ),
)

channel_output = channel.run(pupil=False)
intensity = measures.I(channel, output=channel_output)
mean_x = measures.mean_x(channel, output=channel_output)

Simulations

from pyatmosphere import simulations

beam_result = simulations.BeamResult(quick_channel, max_size=2000)
pdt_result = simulations.PDTResult(quick_channel, max_size=6000)
sim = simulations.Simulation([beam_result, pdt_result])
sim.run(plot_step=1000)

Citing

If you make use of this software, please cite our associated paper:

@article{klen2023,
  title = {Numerical simulations of atmospheric quantum channels},
  author = {Klen, M. and Semenov, A. A.},
  journal = {Phys. Rev. A},
  volume = {108},
  issue = {3},
  pages = {033718},
  numpages = {19},
  year = {2023},
  month = {Sep},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevA.108.033718},
  url = {https://link.aps.org/doi/10.1103/PhysRevA.108.033718}
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Feel free to open new issues if you have any questions.

License

GNU GPLv3

pyatmosphere's People

Contributors

klenm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

pyatmosphere's Issues

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.