Skip to content

Instantly share code, notes, and snippets.

View amoodie's full-sized avatar

Andrew Moodie amoodie

View GitHub Profile
# test the possibility of setting and getting mwe within jitted functions
import numpy as np
import numba
@numba.jit
def set_random_seed(_seed):
np.random.seed(_seed)
# test the possibility of setting and getting mwe within jitted functions
import numpy as np
import numba
@numba.jit
def set_random_seed(_seed):
np.random.seed(_seed)
# my answer
from tqdm import tqdm
subaerial = np.zeros(golfcube.shape[0])
topset = np.zeros(golfcube.shape[0])
for T in tqdm(range(golfcube.shape[0])):
# do it with just pixels above sea level
Land_A = golfcube['eta'][T,:,:] > golfcube.meta['H_SL'][T]
Land_C = np.count_nonzero(Land_A)