the path file pathdef.m might be read-only
In Matlab, enter:
>> which pathdef
/usr/local/MATLAB/R2018a/toolbox/local/pathdef.m
Enter a Linux terminal and change file permissions to read and write for anyone.
| # 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) |
| # 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) |
| get(0, 'factory') % lists all the options | |
| set(0, 'defaultAxesBox', 'on') | |
| set(0, 'defaultAxesXColor', [0 0 0]) | |
| set(0, 'defaultAxesYColor', [0 0 0]) | |
| set(0, 'defaultAxesLineWidth', 1.5) | |
| set(0, 'defaultAxesFontSize', 10) |
| % load some example data | |
| sampleDepth = [0.9500; 0.9500; 0.9500; 0.8500; 0.8500; 0.8500; 0.7500; 0.7500; 0.7500; 0.5000; 0.5000; 0.5000; 0.1000; 0.1000; 0.1000]; | |
| sampleZ = [0.0850; 0.0850; 0.0850; 0.2550; 0.2550; 0.2550; 0.4250; 0.4250; 0.4250; 0.8500; 0.8500; 0.8500; 1.5300; 1.5300; 1.5300]; | |
| conc = [1.5897; 1.8884; 2.3833; 1.0620; 0.8321; 0.8760; 0.4087; 0.5752; 0.4819; 0.4908; 0.6069; 0.5313; 0.2321; 0.2569; 0.2492]; | |
| % organize into a model structure | |
| modelParams.flowDepth = 1.7; | |
| modelParams.b = 0.0850; |
the path file pathdef.m might be read-only
In Matlab, enter:
>> which pathdef
/usr/local/MATLAB/R2018a/toolbox/local/pathdef.m
Enter a Linux terminal and change file permissions to read and write for anyone.
| # added by AM | |
| # Show git branch name | |
| # based largely on code from ankurk91: https://gist.github.com/ankurk91/2efe14650d54d7d09528cea3ed432f6d#file-bashrc-md | |
| # and | |
| # Dominik Schoeler: https://makandracards.com/makandra/1090-customize-your-bash-prompt | |
| # | |
| force_color_prompt=yes | |
| color_prompt=yes | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' |
| % function for normal flow depth following from Ganti et a., 2014 supplementary material | |
| HnfunDW = (@(Q, B, Cf, S0, g) ((Q./B).^(2/3).*(Cf./(g.*S0)).^(1/3))); % generalized Darcy Weisbach, from Ganti et al., 2014 supp info |
The following code is written for Python3. Complete random name function in next file.
The first bit of code grabs a disctionary listing from the web and returns a list of all the entries in that dictionary.
(see https://stackoverflow.com/a/49524775/4038393)
import urllib.request
word_url = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = urllib.request.urlopen(word_url)
| fps=20 | |
| scale=800 | |
| nzero=4 | |
| ffmpeg -r $fps -i %0"$nzero"d.png -c:v libx264 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p -y out.mp4 | |
| ffmpeg -i out.mp4 -vf fps=$fps,scale=$scale:-1:flags=lanczos,palettegen -y palette.png | |
| ffmpeg -i out.mp4 -i palette.png -filter_complex "fps=$fps,scale=$scale:-1:flags=lanczos[x];[x][1:v]paletteuse" -y output.gif |