Skip to main content

Simulate InSAR tropospheric noise

Project description

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.

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

troposim-0.2.1.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

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

troposim-0.2.1-py2.py3-none-any.whl (49.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file troposim-0.2.1.tar.gz.

File metadata

  • Download URL: troposim-0.2.1.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for troposim-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e3728653873e3aeb3a01ba631ca186e25cc8a55be6b86d514c5465f81fcbd3de
MD5 03f0235543ebc3f604db4f538f15f069
BLAKE2b-256 2f72ae967bdbc4b912496fd93db94b689f4b3ea75360795c1fe3b39561c7ff82

See more details on using hashes here.

File details

Details for the file troposim-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: troposim-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for troposim-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48fe5a9214eb2d3200256cf4c69c45ce4dd2d095638ce7efb709e60bfc9fbd86
MD5 695b46b4b5f3fb596350bfd968026831
BLAKE2b-256 4632b4cf1e1aa82f140d4ea60422b5126652fa8e8fde582f2209fb4359e492d2

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