本文整理汇总了Python中pyraf.iraf.imred函数的典型用法代码示例。如果您正苦于以下问题:Python imred函数的具体用法?Python imred怎么用?Python imred使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了imred函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wl_cal
def wl_cal(filename, outname, cals):
print 'run wavelength calibration...'
if os.path.isfile(outname):
print 'file %s is already exist' % outname
else:
iraf.imred()
iraf.specred()
print 'The calibration file is listed below:'
for i in xrange(len(cals)):
print i, cals[i], get_fits_objname(cals[i])
valget = 0
if len(cals) > 1:
valget = raw_input('Which one are you want to use?:')
while type(eval(valget)) != int:
valget = raw_input('input is not a int type, please reinput:')
valget = int(valget)
iraf.refspectra(input = filename
, references = cals[valget], apertures = '', refaps = ''
, ignoreaps = True, select = 'interp', sort = ''
, group = '', time = False, timewrap = 17.0
, override = False, confirm = True, assign = True
, logfiles = 'STDOUT,logfile', verbose = False, answer = 'yes')
print 'make file ' + outname + '...'
iraf.dispcor(input = filename
, output = outname, linearize = True, database = 'database'
, table = '', w1 = 'INDEF', w2 = 'INDEF', dw = 'INDEF'
, nw = 'INDEF', log = False, flux = True, blank = 0.0
, samedisp = False, ignoreaps = True
, confirm = False, listonly = False, verbose = True
, logfile = '')
print 'splot %s' % outname
iraf.splot(images = outname)
示例2: divflat
def divflat(imagesre, flat='Flat'):
'''Run ccdproc task to images'''
imageslist = glob.glob(imagesre)
imagesin = ', '.join(imageslist)
# Load packages
iraf.imred()
iraf.ccdred()
# Unlearn settings
iraf.ccdred.ccdproc.unlearn()
iraf.ccdred.combine.unlearn()
# Setup and run task
iraf.ccdred.ccdproc.ccdtype = ''
iraf.ccdred.ccdproc.noproc = False
iraf.ccdred.ccdproc.fixpix = False
iraf.ccdred.ccdproc.overscan = False
iraf.ccdred.ccdproc.darkcor = False
iraf.ccdred.ccdproc.illumcor = False
iraf.ccdred.ccdproc.fringecor = False
iraf.ccdred.ccdproc.readcor = False
iraf.ccdred.ccdproc.scancor = False
iraf.ccdred.ccdproc.trim = False
iraf.ccdred.ccdproc.trimsec = ''
iraf.ccdred.ccdproc.readaxis = 'line'
iraf.ccdred.ccdproc.zerocor = False
iraf.ccdred.ccdproc.zero = ''
iraf.ccdred.ccdproc.flatcor = True
iraf.ccdred.ccdproc.flat = flat
iraf.ccdred.ccdproc(images=imagesin)
示例3: coroverbiastrim
def coroverbiastrim(lstfile):
iraf.noao()
iraf.imred()
iraf.ccdred()
x1,x2,y1,y2 = get_trim_sec()
iraf.ccdproc(images = '@' + lstfile + '//[1]'
, output = '%bo%bo%@' + lstfile
, ccdtype = '', max_cache = 0, noproc = False
, fixpix = False, overscan = True, trim = False
, zerocor = True, darkcor = False, flatcor = False
, illumcor = False, fringecor = False, readcor = False
, scancor = False, readaxis = 'line', fixfile = ''
, biassec = '[5:45,%s:%s]'%(y1,y2), trimsec = '[%s:%s,%s:%s]'%(x1,x2,y1,y2)
, zero = 'Zero', dark = '', flat = '', illum = '', fringe = ''
, minreplace = 1.0, scantype = 'shortscan', nscan = 1
, interactive = False, function = 'chebyshev', order = 1
, sample = '*', naverage = 1, niterate = 1
, low_reject = 3.0, high_reject = 3.0, grow = 1.0)
iraf.ccdproc(images = '%bo%bo%@' + lstfile
, output = '%tbo%tbo%@' + lstfile
, ccdtype = '', max_cache = 0, noproc = False
, fixpix = False, overscan = False, trim = True
, zerocor = False, darkcor = False, flatcor = False
, illumcor = False, fringecor = False, readcor = False
, scancor = False, readaxis = 'line', fixfile = ''
, biassec = '[5:45,%s:%s]'%(y1,y2), trimsec = '[%s:%s,%s:%s]'%(x1,x2,y1,y2)
, zero = 'Zero', dark = '', flat = '', illum = '', fringe = ''
, minreplace = 1.0, scantype = 'shortscan', nscan = 1
, interactive = False, function = 'chebyshev', order = 1
, sample = '*', naverage = 1, niterate = 1
, low_reject = 3.0, high_reject = 3.0, grow = 1.0)
iraf.flpr()
示例4: correctimages
def correctimages(imagesre, zero='Zero', flat='nFlat'):
'''Run ccdproc task to correct images'''
imageslist = glob.glob(imagesre)
imagesin = ', '.join(imageslist)
trimsection = str(raw_input('Enter trim section (or Hit <Enter>): '))
trimquery = True
if trimsection == '':
trimquery = False
# Load Packages
iraf.imred()
iraf.ccdred()
# Unlearn Settings
iraf.ccdred.ccdproc.unlearn()
iraf.ccdred.combine.unlearn()
# Setup and run task
iraf.ccdred.ccdproc.ccdtype = ''
iraf.ccdred.ccdproc.noproc = False
iraf.ccdred.ccdproc.fixpix = False
iraf.ccdred.ccdproc.overscan = False
iraf.ccdred.ccdproc.darkcor = False
iraf.ccdred.ccdproc.illumcor = False
iraf.ccdred.ccdproc.fringecor = False
iraf.ccdred.ccdproc.readcor = False
iraf.ccdred.ccdproc.scancor = False
iraf.ccdred.ccdproc.trim = trimquery
iraf.ccdred.ccdproc.trimsec = trimsection
iraf.ccdred.ccdproc.readaxis = 'line'
iraf.ccdred.ccdproc.zerocor = True
iraf.ccdred.ccdproc.zero = zero
iraf.ccdred.ccdproc.flatcor = True
iraf.ccdred.ccdproc.flat = flat
iraf.ccdred.ccdproc(images=imagesin)
示例5: subzero
def subzero(imagesre, zero='Zero'):
'''Run ccdproc remove Zero level noise'''
imageslist = glob.glob(imagesre)
imagesin = ', '.join(imageslist)
# Load packages
iraf.imred()
iraf.ccdred()
# Unlearn previouse settings
iraf.ccdred.ccdproc.unlearn()
iraf.ccdred.combine.unlearn()
# setup and run task
iraf.ccdred.ccdproc.ccdtype = ''
iraf.ccdred.ccdproc.noproc = False
iraf.ccdred.ccdproc.fixpix = False
iraf.ccdred.ccdproc.overscan = False
iraf.ccdred.ccdproc.darkcor = False
iraf.ccdred.ccdproc.illumcor = False
iraf.ccdred.ccdproc.fringecor = False
iraf.ccdred.ccdproc.readcor = False
iraf.ccdred.ccdproc.scancor = False
iraf.ccdred.ccdproc.trim = False
iraf.ccdred.ccdproc.trimsec = ''
iraf.ccdred.ccdproc.readaxis = 'line'
iraf.ccdred.ccdproc.zerocor = True
iraf.ccdred.ccdproc.zero = zero
iraf.ccdred.ccdproc.flatcor = False
iraf.ccdred.ccdproc.flat = ''
iraf.ccdred.ccdproc(images=imagesin)
示例6: masterbias
def masterbias(biasre, output='Zero', combine='median', reject='minmax',
ccdtype='', rdnoise='rdnoise', gain='gain'):
'''run the task ccdred.zerocombine with chosen parameters
Input:
-------
str biasre: regular expression to identify zero level images
Output:
-------
file Zero.fits: combined zerolevel images
'''
biaslist = glob.glob(biasre)
biasstring = ', '.join(biaslist)
# load packages
iraf.imred()
iraf.ccdred()
# unlearn settings
iraf.imred.unlearn()
iraf.ccdred.unlearn()
iraf.ccdred.ccdproc.unlearn()
iraf.ccdred.combine.unlearn()
iraf.ccdred.zerocombine.unlearn()
iraf.ccdred.setinstrument.unlearn()
# setup task
iraf.ccdred.zerocombine.output = output
iraf.ccdred.zerocombine.combine = combine
iraf.ccdred.zerocombine.reject = reject
iraf.ccdred.zerocombine.ccdtype = ccdtype
iraf.ccdred.zerocombine.rdnoise = rdnoise
iraf.ccdred.zerocombine.gain = gain
# run task
iraf.ccdred.zerocombine(input=biasstring)
示例7: scalewavelenght
def scalewavelenght(calspec):
''' Creates a wavelenght solution for 'calspec' '''
iraf.imred()
iraf.specred()
linelist = str(raw_input('Enter file with list of lines (linelists$thar.dat) : '))
if linelist == '':
linelist = 'linelists$thar.dat'
iraf.specred.identify.coordlist = linelist
iraf.specred.identify(images=calspec)
示例8: combinebias
def combinebias(filename):
iraf.noao()
iraf.imred()
iraf.ccdred()
iraf.zerocombine(input = 'o//@' + filename
, output = 'Zero', combine = 'average', reject = 'minmax'
, ccdtype = '', process = False, delete = False
, clobber = False, scale = 'none', statsec = ''
, nlow = 0, nhigh = 1, nkeep = 1, mclip = True
, lsigma = 3.0, hsigma = 3.0, rdnoise = 'rdnoise'
, gain = 'gain', snoise = 0.0, pclip = -0.5, blank = 0.0)
示例9: main
def main():
iraf.noao()
iraf.imred()
iraf.ccdred()
print '=' * 20, 'Overscan', '=' * 20
correct_overscan('spec.lst')
print '=' * 20, 'combine bias', '=' * 20
combine_bias('bias.lst')
print '=' * 20, 'correct bias', '=' * 20
correct_bias('spec_no_bias.lst', 'bias_spec.fits')
name = os.popen('ls object*.lst').readlines()
name = [i.split()[0] for i in name]
for i in name:
ntrim_flat(i)
示例10: flatresponse
def flatresponse(input='Flat', output='nFlat'):
''' normalize Flat to correct illumination patterns'''
iraf.imred()
iraf.ccdred()
iraf.specred()
iraf.ccdred.combine.unlearn()
iraf.ccdred.ccdproc.unlearn()
iraf.specred.response.unlearn()
iraf.specred.response.interactive = True
iraf.specred.response.function = 'chebyshev'
iraf.specred.response.order = 1
iraf.specred.response(calibration=input, normalization=input,
response=output)
示例11: ImportPackages
def ImportPackages():
iraf.noao(_doprint=0)
iraf.rv(_doprint=0)
iraf.imred(_doprint=0)
iraf.kpnoslit(_doprint=0)
iraf.ccdred(_doprint=0)
iraf.astutil(_doprint=0)
iraf.keywpars.setParam('ra','CAT-RA')
iraf.keywpars.setParam('dec','CAT-DEC')
iraf.keywpars.setParam('ut','UT')
iraf.keywpars.setParam('utmiddl','UT-M_E')
iraf.keywpars.setParam('exptime','EXPTIME')
iraf.keywpars.setParam('epoch','CAT-EPOC')
iraf.keywpars.setParam('date_ob','DATE-OBS')
iraf.keywpars.setParam('hjd','HJD')
iraf.keywpars.setParam('mjd_obs','MJD-OBS')
iraf.keywpars.setParam('vobs','VOBS')
iraf.keywpars.setParam('vrel','VREL')
iraf.keywpars.setParam('vhelio','VHELIO')
iraf.keywpars.setParam('vlsr','VLSR')
iraf.keywpars.setParam('vsun','VSUN')
iraf.keywpars.setParam('mode','ql')
iraf.fxcor.setParam('continu','both')
iraf.fxcor.setParam('filter','none')
iraf.fxcor.setParam('rebin','smallest')
iraf.fxcor.setParam('pixcorr','no')
iraf.fxcor.setParam('apodize','0.2')
iraf.fxcor.setParam('function','gaussian')
iraf.fxcor.setParam('width','INDEF')
iraf.fxcor.setParam('height','0.')
iraf.fxcor.setParam('peak','no')
iraf.fxcor.setParam('minwidt','3.')
iraf.fxcor.setParam('maxwidt','21.')
iraf.fxcor.setParam('weights','1.')
iraf.fxcor.setParam('backgro','0.')
iraf.fxcor.setParam('window','INDEF')
iraf.fxcor.setParam('wincent','INDEF')
iraf.fxcor.setParam('verbose','long')
iraf.fxcor.setParam('imupdat','no')
iraf.fxcor.setParam('graphic','stdgraph')
iraf.fxcor.setParam('interac','yes')
iraf.fxcor.setParam('autowri','yes')
iraf.fxcor.setParam('autodra','yes')
iraf.fxcor.setParam('ccftype','image')
iraf.fxcor.setParam('observa','lapalma')
iraf.fxcor.setParam('mode','ql')
return 0
示例12: corhalogen
def corhalogen(lstfile):
iraf.noao()
iraf.imred()
iraf.ccdred()
iraf.ccdproc(images = '[email protected]' + lstfile
, output = '%ftbo%ftbo%@' + lstfile
, ccdtype = '', max_cache = 0, noproc = False
, fixpix = False, overscan = False, trim = False
, zerocor = False, darkcor = False, flatcor = True
, illumcor = False, fringecor = False, readcor = False
, scancor = False, readaxis = 'line', fixfile = ''
, biassec = '', trimsec = ''
, zero = 'Zero', dark = '', flat = 'Resp', illum = '', fringe = ''
, minreplace = 1.0, scantype = 'shortscan', nscan = 1
, interactive = False, function = 'chebyshev', order = 1
, sample = '*', naverage = 1, niterate = 1
, low_reject = 3.0, high_reject = 3.0, grow = 1.0)
iraf.flpr()
示例13: coroverscan
def coroverscan(filename):
iraf.noao()
iraf.imred()
iraf.ccdred()
iraf.ccdproc(images = '@' + filename + '//[1]'
, output = '%o%o%@' + filename
, ccdtype = '', max_cache = 0, noproc = False
, fixpix = False, overscan = True, trim = False
, zerocor = False, darkcor = False, flatcor = False
, illumcor = False, fringecor = False, readcor = False
, scancor = False, readaxis = 'line', fixfile = ''
, biassec = '[5:45,1:4612]', trimsec = '', zero = ''
, dark = '', flat = '', illum = '', fringe = ''
, minreplace = 1.0, scantype = 'shortscan', nscan = 1
, interactive = False, function = 'chebyshev', order = 1
, sample = '*', naverage = 1, niterate = 1
, low_reject = 3.0, high_reject = 3.0, grow = 1.0)
iraf.flpr()
示例14: runapall
def runapall(imagesre, gain='gain', rdnoise='rdnoise'):
'''Extract aperture spectra for science images ...'''
imageslist = glob.glob(imagesre)
imagesin = ', '.join(imageslist)
# load packages
iraf.imred()
iraf.ccdred()
iraf.specred()
# unlearn previous settings
iraf.ccdred.combine.unlearn()
iraf.ccdred.ccdproc.unlearn()
iraf.specred.apall.unlearn()
# setup and run task
iraf.specred.apall.format = 'onedspec'
iraf.specred.apall.readnoise = rdnoise
iraf.specred.apall.gain = gain
iraf.specred.apall(input=imagesin)
示例15: findaperture
def findaperture(img, _interactive=False):
# print "LOGX:: Entering `findaperture` method/function in %(__file__)s" %
# globals()
import re
import string
import os
from pyraf import iraf
import ntt
iraf.noao(_doprint=0)
iraf.imred(_doprint=0)
iraf.specred(_doprint=0)
toforget = ['specred.apfind']
for t in toforget:
iraf.unlearn(t)
iraf.specred.databas = 'database'
iraf.specred.dispaxi = 2
iraf.specred.apedit.thresho = 0
dv = ntt.dvex()
grism = ntt.util.readkey3(ntt.util.readhdr(img), 'grism')
if _interactive:
_interac = 'yes'
_edit = 'yes'
else:
_interac = 'no'
_edit = 'no'
if os.path.isfile('database/ap' + re.sub('.fits', '', img)):
ntt.util.delete('database/ap' + re.sub('.fits', '', img))
xx = iraf.specred.apfind(img, interac=_interac, find='yes', recenter='yes', edit=_edit, resize='no',
aperture=1, Stdout=1, nfind=1, line=dv['line'][grism], nsum=50, mode='h')
try:
for line in open('database/ap' + re.sub('.fits', '', img)):
if "center" in line:
center = float(string.split(line)[1])
except:
center = 9999
return center