Python(3)
-
Documentation of Python
https://physics.nyu.edu/pine/pymanual/html/ If you just start learning Python, this site would be very useful. Welcome to PyMan’s documentation! — PyMan 0.9.16 documentation physics.nyu.edu
2023.11.16 -
Transpose multiple array into single array
Python 을 계산 결과를 다른 프로그램으로 그래프로 그리기 위해 결과를 data파일로 저장하는 것이 필요하다. 만약, 결과가 여러개의 배열로 되어있다면, 하나의 배열로 합쳐서 결과를 출력하면, 그래프를 그릴때도 용이하다. import numpy as np from scipy import signal import matplotlib.pyplot as plt x = np.linspace(0, 10, 100) y = np.sin(x) # Savitzky-Golay 필터를 사용한 스무딩 smoothed_y = signal.savgol_filter(y, window_length=5, polyorder=3) #plot x,y in red-colored dotted line and x, smoothed_y in ..
2023.11.14 -
Python을 이용한 Hecht equation fitting
운반자의 이동도와 수명의 곱을 계산하기 위한 파이썬 프로그래밍의 예제이다. import matplotlib import matplotlib.pyplot as plt from matplotlib import style from matplotlib import pylab import numpy as np from scipy.optimize import curve_fit # bias data and peak position channel data xs=np.array([35,100,150,200,250,300]) ys=np.array([100,133,145,152,159,162]) #detector thickness in cm. det_thick=0.2 #define fitting function def ex..
2022.12.26