Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mergespec

Spectral merging of a coarse field and of a fine field at a given wavenumber


Description

The input fields are transformed to Fourier space, their Fourier spectra are merged at wavenumber kmax after adapting the variance of the fine field and an inverse Fourier transform is performed.

Usage

mergespec(ra, r, kmax = 0)

Arguments

ra

matrix containing a coarse field of size c(nas, nas).

r

matrix containing a field at higher resolution.

kmax

wavenumber to use for merging (default nas/2).

Value

The merged field, in physical space.

Author(s)

Jost von Hardenberg, j.vonhardenberg@isac.cnr.it

Examples

# Make a coarse field with power-law Fourier spectrum 
fa <- initmetagauss(1.7, 8)
ra <- metagauss(fa)
# Make a fine power-law Fourier spectrum
f <- initmetagauss(1.7, 32)
r <- metagauss(f)
# Merge the two fields in spectral space
rm <- mergespec(ra, r, kmax = 4)
# Check spectral slope of the resulting field
fx <- fft2d(rm)
fitslope(fx)
# 1.678554

rainfarmr

Stochastic Precipitation Downscaling with the RainFARM Method

v0.1
Apache License 2.0
Authors
Jost von Hardenberg [aut, cre, cph] (<https://orcid.org/0000-0002-5312-8070>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.