Mopra

The following example is of some dual polarisation, position switched data from Mopra. The source has been observed multiple times split into a number of separate RPFITS files. To make the processing easier, the first step is to cat the separate RPFITS files together and load as a whole (future versions of ASAP will make this unnecessary).

# get a list of the individual rpfits files in the current directory
myfiles = list_files()

# Load the data into a scantable
data = scantable(myfiles)
print data

# Form the quotient spectra
q = data.auto_quotient()
print q

# Look at the spectra
plotter.plot(q)

# Set unit and reference frame
q.set_unit('km/s')
q.set_freqframe('LSRK')

# Average all scans in time, aligning in velocity
av = q.average_time(align=True)
plotter.plot(av)

# Remove the baseline
msk = av.create_mask([100,130],[160,200])
av.poly_baseline(msk,2)

# Average the two polarisations together
iav = av.average_pol()
print iav
plotter.plot(iav)

# Set a sensible velocity range on the plot
plotter.set_range(85,200)

# Smooth the data a little
av.smooth('gauss',4)
plotter.plot()

# Fit a guassian to the emission
f = fitter()
f.set_function(gauss=1)
f.set_scan(av)
f.fit()

# View the fit
f.plot()

# Get the fit parameters
f.get_parameters()



Malte Marquarding 2007-08-16