Skip to content

Instantly share code, notes, and snippets.

View HajimeKawahara's full-sized avatar
😀

Hajime Kawahara HajimeKawahara

😀
View GitHub Profile
@HajimeKawahara
HajimeKawahara / waxis.ipynb
Created January 13, 2023 04:26
double axis example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@HajimeKawahara
HajimeKawahara / minimum_autodiff.ipynb
Created October 2, 2022 09:31
Minimum Automatic Differentiation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@HajimeKawahara
HajimeKawahara / Reading_SPE.py
Created September 21, 2022 13:18
Gas cell experients Reading SPE
dat1 = pd.read_csv("/home/kawahara/gascell/data/SLD300K2.SPE", skiprows=8)
wav1 = dat1["WaveLength(nm) "]
val1 = dat1["Level(mW) "]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def diad_merge_grids(grid1, grid2):
"""merge two different grids into one grid using diad
Args:
grid1: grid 1
grid2: grid 2
Returns:
merged grid (len(grid1)*len(grid2),2)
@HajimeKawahara
HajimeKawahara / partest.py
Created April 2, 2022 01:10
parameter set a,b,c with condition a+b+c=3
"""
a+b+c=3
"""
def invf(x,y):
if x is not None and y is not None:
return 3 - x - y
else:
return None
import GPy
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(seed=1)
kernel = GPy.kern.Matern32(2, ARD=True)
N = 100
X = np.random.uniform(-3.,3.,(N, 2))
Z = np.sin(X[:,0:1]) * np.sin(X[:,1:2]) + np.random.randn(N,1)*0.05
@HajimeKawahara
HajimeKawahara / mymast_io.py
Created January 9, 2022 04:19
make basic.png using MAST data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tqdm
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
#filename_0="CTLv8_tyotto.csv"
#filename_1="CTLv8_tyotto.csv"
filename_0="CTLv8_0.csv"
import pandas as pd
import numpy as np
from exojax.dynamics.rvfunc import rvf
import jax.numpy as jnp
from jax import random
from jax import vmap, jit
import matplotlib.pyplot as plt
to1=2459370 #fit offset
to2=2450000 #table Toffset
Toff=9370