This file contains hidden or 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
"""non-cycled 1d test of LETKF with multiscale localization""" | |
import numpy as np | |
from scipy.linalg import eigh, lapack, solve | |
from scipy.fft import rfft, irfft, rfftfreq | |
from argparse import ArgumentParser | |
# set random seed for reproducibility | |
#np.random.seed(42) | |
def syminv(C): |
This file contains hidden or 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
"""non-cycled 2d test of LETKF solver with B or R localization""" | |
import numpy as np | |
from scipy.linalg import eigh, inv, pinvh | |
from scipy.special import gamma, kv | |
from argparse import ArgumentParser | |
# function definitions. | |
def cartdist(x1,y1,x2,y2,xmax,ymax): | |
"""cartesian distance on doubly periodic plane""" |
This file contains hidden or 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
import shtns | |
import numpy as np | |
class Spharmt(object): | |
""" | |
wrapper class for commonly used spectral transform operations in | |
atmospheric models. | |
""" | |
def __init__(self,nlons,nlats,ntrunc,rsphere=6.3712e6,gridtype='gaussian'): | |
self._shtns = shtns.sht(ntrunc, ntrunc, 1, \ | |
norm=shtns.sht_orthonormal+shtns.SHT_NO_CS_PHASE) |
This file contains hidden or 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
from __future__ import print_function # Python 3 compatible print function | |
"""find nearest neighbors for points on a sphere when locations to be compared | |
are distributed across MPI tasks""" | |
# to run: mpirun -np 4 python parallel_nn_sphere.py | |
# requires mpi4py ('conda install mpi4py' in anaconda python) | |
from mpi4py import MPI | |
import numpy as np | |
import sys | |
# generate lat,lon values for random points on the surface of a unit sphere |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
import shtns | |
import numpy as np | |
class Spharmt(object): | |
""" | |
wrapper class for commonly used spectral transform operations in | |
atmospheric models. Provides an interface to shtns compatible | |
with pyspharm (pyspharm.googlecode.com). | |
""" | |
def __init__(self,nlons,nlats,ntrunc,rsphere,gridtype='gaussian'): |