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
res@gsnPresHgtHeightLabelOn = False |
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
#!/bin/sh | |
if [ $# -lt 1 ]; then | |
echo "Usage :: $0 input.pdf [p1 p2 ...]" | |
exit | |
fi | |
in=${1} | |
shift | |
pdfcrop ${in} | |
crop=`basename -s .pdf ${in}`-crop | |
if [ $# -eq 0 ]; then |
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
# gawk -M -v PREC=100 -v lgaqd=1 -v nlat=120 -f glatwgt.awk | |
function abs(x) | |
{ | |
return (x > 0) ? x : -x | |
} | |
function gamma(y, c) | |
{ | |
c[1] = 1 / 12 |
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
function abs(n) | |
{ | |
return (n>0)? n : -n | |
} | |
function f1(n, i) | |
{ | |
return sqrt(1 - 1 / (4 * n * n)) | |
} |
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
#!/bin/sh | |
FNAME=$1 | |
shift | |
for PAGE in $@; do | |
gs -q -dBATCH -dNOPAUSE -dFirstPage=$PAGE -dLastPage=$PAGE \ | |
-dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode \ | |
-sDEVICE=pdfwrite -sOutputFile=${FNAME%\.pdf}_$PAGE.pdf $FNAME | |
done |
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
" n prevents replace | |
" in line | |
:s/word//gn | |
" in file | |
:%s/word//gn |
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
#!/bin/bash | |
N=25 # number of ensembles | |
NFT0=9 # number of forecast time (including FT=0) | |
NFT=9 | |
VNAME="" | |
while getopts ":v:n:" opt; do | |
case $opt in | |
v) VNAME=$OPTARG ;; | |
n) NFT=$OPTARG ;; | |
\?) echo 'usage:: splitwfm [-v VARNAME -n NFT] FNAME' |
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
#include <iostream> | |
#include <ginac/ginac.h> | |
using namespace std; | |
using namespace GiNaC; | |
ex LegendrePoly(const symbol &x, int n) | |
{ | |
ex PKer = pow(x * x - 1, n); | |
return normal(1 / (pow(2, n) * factorial(n)) * diff(PKer, x, n)); |
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
program grd2grb | |
use grib_api | |
implicit none | |
character(len=*), parameter :: & | |
ifname = "ICMSHepc8INIT", gfname = "out.grd", ofname = "out.grb" | |
integer, parameter :: & | |
ug = 41, ntrunc = 21, nv = (ntrunc + 2) * (ntrunc + 1) | |
real*4, dimension(nv) :: sh |
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
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
template <typename T> | |
std::vector<T> read_ascii(std::string fname, bool verbose = false) | |
{ | |
std::vector<T> data; | |
std::ifstream ifs (fname); | |
T buf; | |
if (ifs.is_open()) |
OlderNewer