用途 | IDL | Python |
---|---|---|
搜尋資料夾下的檔名 | file_search | os.listdir, glob.glob |
數陣列裡有幾個元素 | n_elements | len |
傳回符合條件的index | where | numpy.where |
讀取FITS檔案 | mrdfits | astropy.io.fits |
讀寫檔案 | openr/openu/openw | astropy.io.ascii, Input and output routines in NumPy, open |
計算luminosity distance, from redshift to Mpc | lumdist | astropy.cosmology.FLRW.luminosity_distance(z) |
將字串前後空白的部分去除 | strtrim | string.strip() |
將字串中的空白部分去除 | strcompress | string.replace(' ','') |
傳回系統時間 | systime | time.time() |
畫3D圖 | plot3d | mplot3d |
查看兩個向量中哪些元素相同 | match |