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
# 生物季節観測累年値ファイル(CSV) をパースして、「年 1月1日からの日数」に変換する | |
# https://www.data.jma.go.jp/sakura/data/download_ruinenchi.html | |
# replace には全角スペースを入れておくようにする | |
import codecs | |
def readData(file, station): | |
with codecs.open(file, "r", encoding="shift_jis") as ifile: | |
for line in ifile: | |
line = line.strip() | |
line = line.replace(" ", "") |
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
'reinit' | |
'set display color white' | |
'c' | |
'sdfopen composite_z500.nc' | |
'set mproj scaled' | |
'set mpdraw off' | |
* 仮想ページを作成、8.5x11in のキャンバスに、この範囲を仮想的にページをする | |
* 複数の図を掲載する場合は、一つ一つをvpageにして並べる | |
'set vpage 0.0 7.0 0.0 7.0' |
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
#!/bin/bash | |
ifile=composite_z500.nc | |
ofile=out.nc | |
ncks -O --mk_rec_dmn snapshot $ifile tmp.nc # snapshotをunlimited 次元にしてる | |
ncrename -O -d snapshot,time tmp.nc # snapshot を time に | |
cdo settaxis,1981-01-01,00:00:00,1day tmp.nc tmp2.nc # time のカレンダー変更 | |
cdo chname,snap_var129,b tmp2.nc $ofile # snap_var129 を b に |
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
#!/bin/bash | |
# draw a figure | |
function draw_figure(){ | |
local ifile=$1 # local にしておくと、うっかり同じ変数名を | |
local mon=$2 # 使ってしまったときも安心 | |
local ofile=$3 | |
echo "draw: $ifile, $ofile, $mon" | |
cat > tmp.ncl << EOF # ここからEOFまでをtmp.nclというファイルに入れる |
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
begin | |
f1 = addfile("sample1.nc","r") | |
f2 = addfile("sample2.nc","r") | |
v1 = f1->v(0,:,:) ; 0 にした次元は落ちるので、2次元になる | |
v2 = f2->v(0,:,:) | |
printVarSummary(v1) ; 次元を表示してチェック | |
diff = (v2 - v1) - 273.15 ; 算数をするとメタデータが消えたりするので |
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
#!/bin/bash | |
function makefig (){ | |
vmax=$1 | |
vmin=$2 | |
vint=$3 | |
# color=hotcold_18lev | |
color=BlWhRe |
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
{ | |
"title": "Assign Logicool mouse button5 to F11", | |
"rules": [ | |
{ | |
"description": "Maps button 5 to f11", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"pointing_button": "button5" |
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
{{ $paginator := .Paginator }} | |
{{ $adjacent_links := 2 }} | |
{{ $max_links := (add (mul $adjacent_links 2) 1) }} | |
{{ $lower_limit := (add $adjacent_links 1) }} | |
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }} | |
{{ if gt $paginator.TotalPages 1 }} | |
<div class="page"> | |
<ul> |
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 | |
import re | |
import xml.etree.ElementTree as et | |
from markdownify import markdownify as md | |
from shutil import copyfile | |
import datetime | |
import email.utils | |
import pytz | |
# define namespace |
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 | |
import re | |
import xml.etree.ElementTree as et | |
from markdownify import markdownify as md | |
from shutil import copyfile | |
import datetime | |
import email.utils | |
import pytz | |
# define namespace |