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 (푸+로+버?)