-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from HajimeKawahara/nustitch
unittests added for preparing nu stitch (this is not nu stitch itself)
- Loading branch information
Showing
16 changed files
with
613 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import jax.numpy as jnp | ||
from exojax.spec.lpf import voigt | ||
|
||
def generate_lpffilter(nfilter, nsigmaD, ngammaL): | ||
"""Generates LPF filter | ||
Args: | ||
nfilter (int): length of the wavenumber grid of lpffilter | ||
nsigmaD (float): normalized gaussian standard deviation, resolution*betaT/nu betaT is the STD of Doppler broadening | ||
ngammaL (float): normalized Lorentzian half width | ||
Notes: | ||
The filter structure is filter[1:M] = vkfilter[M+1:][::-1]m where M=N/2 | ||
filter[0] is the DC component, Nyquist component. | ||
filter[M] is the Nyquist component. | ||
Returns: | ||
array: filter | ||
""" | ||
# dq is equivalent to resolution*jnp.log(nu_grid) - resolutiona*jnp.log(nu_grid[0]) (+ Nyquist) | ||
dq = jnp.arange(0, nfilter + 1) | ||
lpffilter_oneside = voigt(dq, nsigmaD, ngammaL) | ||
return jnp.concatenate([lpffilter_oneside, lpffilter_oneside[1:-1][::-1]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.