2021년 10월 7일 목요일

interpolation with multi-dimensional grid data

Suppose we want to interpolate a multi-dimensional function

y = f(x1, x2, x3...) 

and we have numerical table of values at grid points of each axis. 

This interpolation can be done by using scipy.interpolate.interpn 

However, the data have to be prepared in specific forms. 


scipy.interpolate.interpn(pointsvaluesximethod='linear'bounds_error=Truefill_value=nan)


(1) "points" are tuple of grid points in each axis. 
     points = ( [array of possible grid points in 1st axis], [array of possible grid points in 2nd axis],...) 
     in other words, points=(x1,x2,...xn) such that  xn[i] gives i-th grid value in n-th axis. 

(2) "values" are n-dimensional array such that 

     value[ i1][i2][i3]...[in] = f( x1[i1],  x2[i2],..., xn[in] ) 

(3) "xi" is a coordinate to sample the value 



2021년 7월 8일 목요일

Physics journals

Let us list impact factors of related with my research.  (may be not so recent.) 

I am surprised that the rank of Physical Review C is not so high. 


1 REVIEWS OF MODERN PHYSICS 45.037

7 PHYSICS REPORTS-REVIEW SECTION OF PHYSICS LETTERS 25.798

9 Nature Physics 19.256

11 REPORTS ON PROGRESS IN PHYSICS 17.032

14 ADVANCES IN PHYSICS 16.375

17 PROGRESS IN PARTICLE AND NUCLEAR PHYSICS 13.421

18 Physical Review X 12.577

28 Annual Review of Nuclear and Particle Science 8.778

29 PHYSICAL REVIEW LETTERS 8.385

47 NUCLEAR DATA SHEETS 5.944

59 PHYSICAL REVIEW D 4.833

64 PHYSICS LETTERS B 4.384 

72 PHYSICS TODAY 3.875

79 COMPUTER PHYSICS COMMUNICATIONS 3.627

82 PHYSICAL REVIEW B 3.575

115 PHYSICAL REVIEW C 2.988

129 NUCLEAR PHYSICS B 2.817 

130 PHYSICAL REVIEW A 2.777

135 Frontiers in Physics 2.638

353 FEW-BODY SYSTEMS 0.823

396 JOURNAL OF THE KOREAN PHYSICAL SOCIETY 0.535

2021년 6월 11일 금요일

Creating personal library in Linux : 1. Fortran library to be used in Fortran (working)

 The purpose of this post is to summarize the procedure to make personal library of routines so that re-use previous works. 

(1) Fortran library to be used in Fortran 

(2) C/C++ library to be used in C/C++

(3) Fortran library to be used in C/C++

(4) C/C++ library to be used in Fortran

(5) Fortran library to be used in Python 

(6) C/C++ library to be used in Python 


Let us start from the first/second case. 

(1) to make a static library use "ar  crvs" 

ar rc liball.a dog.o cat.o bird.o #rc=replace/create

ranlib liball.a # make symbol indexing or use "s" for ar

to use

gcc main.c -L -l<filename>

(2) to make dynamic/shared library use linker like "gcc" ,"gfortran"

gcc -g -fPIC -Wall -Werror -Wextra -pedantic *.c -shared -o liball.so

to use dynamic library

gcc -g -wall -o app app.c liball.so

* if source file *.f use .mod file, one have to keep them to make shared library.
But once the shared library is created, .mod files are no more necessary. 

-------------------To be continued---------------------------------------------

2021년 6월 8일 화요일

tip: find "*.xxx" files recursively and remove them in linux

my solution: combine "find" and python

(1) find . -type f -name "*.xxx" > tt

(2) do following in python 

    import os

    ff= open('tt','r');fnames=ff.readlines();ff.close()

   for i in fnames:

    os.remove(i[:-1]) # remove \n in the end 


2021년 2월 14일 일요일

2021년 1월 8일 금요일

독일어 ABC 1

 From the D.W. 

독일어의 발음 단위 ( 철자 하나가 아니라, 묶어서 함께 소리나는 단위들) 

Annanas = A+na+nas (아+나+나스)

Paprika = Pa+p+ri+ka (파+프+리+카)

Nase = Na+se (나+즈)

Banane = Ba+na+ne(바+나+느)

Information = In+for+ma+tion(인+포+마+치온)

Musik = Mu+sik(무+지크)

Salat = Sa+lat (자+라트)

die Dose = Do+se(도+즈)

die Schokolade = Sch+o+ko+la+de(ㅅ+ㅛ+코+라+드)

die Uhr = Uh+r (우+어)

der Mund = Mu+n+d(무+ㄴ+트)

die Tomate = To+ma+te(토+마+트)

das Brot = B +ro+t(브+로+트)

der Esel = E+sel(이+즐)

die Ente = En+te(엔+트) 

die Olive = O +li+ve(오+리+브)

die Hose = Ho+se(호+즈)

das Messer = Mes+ser (메스+서)

die Lampe = Lam+pe(람+프)

die Hand = Han+d(한+트)

der Polizist =po+li+zist(포+리+찌스트)

der Fisch = F+i +sch (ㅍ+이+쉬)

der L"offel =L"of+fel (라/로프?+플)

die Pfanne =Pfan+ne  (판+느)

der Apfel =Ap+fel(앞+플)

der Vogel  = Vo+gel (포+글)

der Pullover  = Pul+lo+ver (푸+로+버?)



2020년 10월 26일 월요일

라틴 1-3

( 외우기 위해 발음을 한글로 적어본다.) 

postridie Schintilla Quintum vocat; 포스트리디에 신틸라 퀸툼 보캇.

mittit enum ad agrum.  미팃 에눔 에드 아그룸. 

Quintus cibum ad Flaccum portat; 퀸투스 키붐 에드 플라쿰 포르탓. 

nam Flaccus diu in agro laborat et fessus est. 남 플라쿠스 듀 인 아그로 라보랏 에트 페쑤스 에스트. 

puer ad agrum festinat; 푸에르 에드 아그룸 페스티낫.

Argum secum ducit. 아르굼 세쿰 두킷. 

mox Quintus argrum intrat. 목스 퀸투스 아

Flaccum videt et vocat. 플라쿰 비뎃 에트 보캇.

Flaccus filium audit et ad eum ambulat; 플라쿠스 필리움 아우딧 에트 에드 에움 암부랏.

in terra sedet et cibum consumit. 인 테라 세뎃 에트 키붐 콘수밋.

Quintus domum non redit sed in agro manet et Flaccum iuvat. 퀸투스 도뭄 논 레디트 세드 인 아그로 마넷 에트 프라쿰 유밧.

olivam ascendit et olivas decutit. 올리밤 아센딧 에트 올리바스 데쿠팃. 

Flaccus olivas colligit. 플라쿠스 올리바스 콜리깃. 

Subito lapsat Quintus et ad terram cadit. 수비토 라프삿 퀸투스 에트 에드 테람 카딧.

Flaccus anxius est et ad eum currit, 플라쿠스 앙시우스 에스트 에트 에드 에움 쿠릿.

sed Quintus non saucius est; 세드 퀸투스 논 사우키우스 에스트. 

surgit et domum redit. 수르깃 에트 도뭄 레딧. 

--------------------------------------------------------------------------------------

Quintus domum redit et Scintillam salutat;

Argum in hortum ducit et Horatiam vocat.

Horatia in hortum festinat;

laeta est quod Quintus adest. 

Flaccus ab agro redit; fessus est;

in casa sedet et quiescit.

mox "Quintus" inquit "puer bonus est. in agro manet et me iuvat."

Scintilla laeta est, quod Flaccus puerum laudat.

cenam celeriter parat;

ubi parata est cena,

Horatiam et Quintum in casam vocat. 

Quintus laetus est quod cena parata est;

in casam fetinat.