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
import datetime as dt | |
import earthaccess, h5py | |
earthaccess.login() | |
# first DOI succeeds: netCDF4 file, CLIMCAPS Level-2 retrievals | |
# second DOI fails: hdf5 file, OCO-2 Level-1B radiance | |
# h5py.File() fails in AbstractBufferedFile.seek, TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' | |
dois = ["10.5067/LESQUBLWS18H", |
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
import os, psutil | |
from scipy.interpolate import LinearNDInterpolator | |
max_N = 199000 | |
tenth_max_N = int(max_N/10) | |
process = psutil.Process(os.getpid()) | |
interp_pt = [[0.1, 0.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
# copying http://docs.cython.org/src/tutorial/cdef_classes.html | |
cdef class Function: | |
cpdef double evaluate(self, double x) except *: | |
return 0 | |
cdef class func0(Function): | |
cpdef double evaluate(self, double x) except *: | |
return basefunc0(x) | |
cdef class func1(Function): | |
cpdef double evaluate(self, double x) except *: | |
return basefunc1(x) |
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
import numpy as np | |
class ArrSubClass(np.ndarray): | |
def __new__(cls, input_var): | |
obj = np.ndarray(input_var).view(cls) | |
return obj | |
def __array_wrap__(self, obj): | |
raise AssertionError | |
class MatSubClass(np.matrix): |