본문 바로가기

python

python ndarray flip rotation fits image invert & two fits images plot numpy.fliplr, flipud http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.fliplr.html # making fits image inverted in x-y axes # python invertxyfits.py inimage outimage import astropy.io.fits as fits import sys import matplotlib.pyplot as plt import aplpy import numpy as np import os im=sys.argv[1] outim=sys.argv[2] ad=fits.getdata(im) ah=fits.. 더보기
anaconda virtualenv setting using 'conda' conda update% conda update conda Virtual environment settiing% conda create -n mypyenv python=2.7 anaconda ===========================================================================[changsu@localhost PHOTOMETRY]$ conda -Vconda 3.13.0[changsu@localhost PHOTOMETRY]$ conda create -n ana_snpy python=2.7 anacondaFetching package metadata: ....Solving package specifications: .Package plan for install.. 더보기
.pythonrc : python startup python 시작시 환경을 설정할 수 있다. 자주 쓰는 module이나 처음 시작시의 인사말 같은 것도 넣을 수 있다. % cd % vi .pythonrc import os import sys import numpy as np import matplotlib.pyplot as plt print 'from .pythonrc, import os, sys, numpy(np), matplotlib.pyplot(plt)' print 'Hello.' :wq %vi .bashrc export PYTHONSTARTUP=$HOME/.pythonrc :wq %source .bashrc 그리고 다시 python 시작 더보기
secat2reg.py #secat2reg.py ; 20150512, Changsu # read source extractor catalog and make region file of that field # sextracted catalog should have two keywords and ascii-head format #ra=data['ALPHA_J2000'] ; col4 #dec=data['DELTA_J2000'] ; col5 #input : single filename#python secat2reg.py test.cat #need astropy and numpy import string from astropy.io import ascii import numpy as np import math filename=raw_i.. 더보기