Giter Site home page Giter Site logo

Comments (4)

mpvginde avatar mpvginde commented on August 26, 2024 2

Created a new helper function in the pysteps.blending.steps.py file which initializes each level of the noise cascade with noise having the correct spatial correlation.
All ar_order steps have identical noise to ensure that noise cascade immediately has the correct power in the subsequent timesteps (no spinup needed).

def _init_noise_cascade(
    shape,
    n_ens_members,
    n_cascade_levels,
    generate_noise,
    decompositor,
    pp,
    randgen_prec,
    fft_objs,
    bp_filter,
    domain,
    noise_method,
    noise_std_coeffs,
    ar_order
):
    noise_cascade = np.zeros(shape)
    if noise_method:
        for j in range(n_ens_members):        
            EPS = generate_noise(
                pp,
                randstate=randgen_prec[j],
                fft_method=fft_objs[j],
                domain=domain
                )
            EPS = decompositor(
                EPS,
                bp_filter,
                fft_method=fft_objs[j],
                input_domain=domain,
                output_domain=domain,
                compute_stats=True,
                normalize=True,
                compact_output=True
                )
            for i in range(n_cascade_levels):
                EPS_ = EPS["cascade_levels"][i]
                EPS_ *= noise_std_coeffs[i]
                for n in range(ar_order):
                    noise_cascade[j][i][n] = EPS_
            EPS = None
            EPS_ = None
    return(noise_cascade)

from pysteps.

mpvginde avatar mpvginde commented on August 26, 2024

The noise was previously initialized before the initialization of the random generator. But since you now need them to initialize the noise.
The noise_cascade = _init_noise_cascade(...) should be called after the random generator initializations.
Also check with developments in issue #1

from pysteps.

mpvginde avatar mpvginde commented on August 26, 2024

Fixed with commit 2eb125b

from pysteps.

RubenImhoff avatar RubenImhoff commented on August 26, 2024

This is excellent!!

from pysteps.

Related Issues (16)

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.