#please set file name of fits image.
fitsfile='test.fits'
#please set the rest frequency of molecule which you are interested (in unit of MHz):
restfreq=221199
#please give the name of molecule
molname='CH3CN_v8=1'
#please set the channel range which includes the spetral profile, example:chans='457~477'.
chans = '457~477'
#please do not modify following contents.
imagename = fitsfile + '.imgage'
restfreq_Hz = restfreq * 1e6
#import fits file into casa file format.
os.system('rm -rf '+ imagename)
importfits(fitsimage=fitsfile,imagename=imagename)
#modify restfreq in header, please notice that the hdvalue should be in type of string rather than double.
#thus the str() has been adopted to convert restfreq_Hz into a string.
imhead(imagename=imagename, mode='put', hdkey='restfreq', hdvalue=str(restfreq_Hz))
#moment maps:
#this is just a basic moment maps, if you want to include more features of immoments task like to constrain pixel range, mask, box, etc.
#please visit the casa task web page : https://casa.nrao.edu/casadocs-devel/stable/global-task-list/task_immoments/parameters
os.system('rm -rf ' + molname + str(restfreq) + '.m0')
immoments(imagename=imagename, chans=chans, moments=0, outfile=molname + '_' + str(restfreq) + '.m0')
os.system('rm -rf ' + molname + str(restfreq) + '.m1')
immoments(imagename=imagename, chans=chans, moments=1, outfile=molname + '_' + str(restfreq) + '.m1')
CASA制作光谱的moments图
最新推荐文章于 2024-04-23 17:08:22 发布