Skip to main content

troposim

Simulate tropospheric noise for InSAR data

Installation

pip install troposim

To make an editable installation

git clone https://github.com/scottstanie/troposim && cd troposim
pip install -e .

Usage

To simulate one turbulence image, you can specify the shape:

from troposim import turbulence
noise = turbulence.simulate(shape=(500, 500))

or add a 3rd dimension to simulate a stack of images

noise = turbulence.simulate(shape=(10, 500, 500))

The beta argument is the slope of the log10(power) vs log10(frequency) graph. The default is to use a single linear slope of $\beta = 8 / 3$:

$$ P(f) \propto \frac{1}{f^\beta} $$

For smaller-scale turbulence, you can use a different beta:

flatter_noise = turbulence.simulate(beta=2.2)

Since real InSAR data typically have a power spectrum that is not a single slope, you can estimate the spectrum from an image and use that to simulate new data:

from troposim.turbulence import Psd
psd = Psd.from_image(noise)
new_noise = psd.simulate()

Here the psd object has attributes

  • p0: the power at the reference frequency freq0
  • beta: a numpy Polynomial which was fit to the log-log PSD along with psd1d, which are the radially averaged spectrum values at the psd.freq frequencies. You can see these with the .plot() method.
# assuming maptlotlib is installed
psd.plot()

# Or, to plot a side-by-side of image and 1D PSD
from troposim import plotting 
plotting.plot_psd(noise, freq=freq, psd1d=psd1d)
# Or just the PSD plot, no image
plotting.plot_psd1d(psd.freq, psd.psd1d)

To simulate a stack of new values from the PSD of one image, you simply pass in a new shape argument to .simulate:

psd.simulate(shape=(10, 400, 400))

Note that the default fit will use a cubic polynomial. To request only a linear fit,

psd = Psd.from_image(noise, deg=1)

You can also save the PSD parameters for later use:

psd.save(outfile="my_psd.npz")
# Later, reload from this file
psd = Psd.load(outfile)

Citation

If you find this library useful, please consider citing our paper:

Staniewicz, S., & Chen, J. (2025). Automatic detection of InSAR deformation and tropospheric noise features using computer vision: A case study over West Texas. Journal of Geophysical Research: Solid Earth, 130(7), e2024JB029614.

Metadata

Release files for troposim 0.2.2

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

Source distribution (sdist)

Source distribution for troposim 0.2.2
File Size Uploaded Provenance Actions
troposim-0.2.2.tar.gz 47.1 kB Without provenance Details for troposim-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for troposim 0.2.2
File Interpreter ABI Platform Actions
troposim-0.2.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for troposim-0.2.2-py2.py3-none-any.whl

Total release size: 96.5 kB

Release files / troposim-0.2.2.tar.gz

Download URL troposim-0.2.2.tar.gz
Size 47.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f0b0502a36e7c891a06a2f79533af94445ee16a0ca133a21400dcd0eec96dd29
BLAKE2b-256 checksum
How to use checksums
a2733897637df4d81d73c8f0a5ac221303030e0beb31356102b7183a7d9dd1ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / troposim-0.2.2-py2.py3-none-any.whl

Download URL troposim-0.2.2-py2.py3-none-any.whl
Size 49.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a06fff216adf2cbb1c00596d0f633ae714aee073301402ab946bdb7f63eded3e
BLAKE2b-256 checksum
How to use checksums
85e3449423b6a10a7380644d0e2071002c10b4c656b1eea8f292e3339624390b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for troposim 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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