### ### Script for PdBI GG Tau data: ### 3mm & 1mm LSB continuum data reduction and imaging ### 3mm (HCO+) & 1mm (13CO) line data reduction ########################################################### ########################################################### ## Fill Data: ## almatifiller(msfile='07feb97-g067.ms', # Create a Measurement Set with fitsdir='./fits', # the almatifiller global function. pattern='07-feb-1997*', # Specify the name of the MS, append=F, # the directory where the compress=F, # ALMA-TI FITS files are obsmode="CORR", # get all files chanzero="TIME_AVG", # beginning with '07-feb-1997' dophcor=T); # apply phcor corrections ########################################################### ## Obtain a detailed summary (with default catalog tool): ## dc.summary('07feb97-g067.ms'); ########################################################### ## Manually plot the data for visual inspection, ## interactively flag bad data: ## ## see the data in x-y plot format: plot := msplot(msfile='07feb97-g067.ms', edit=T); # Allow editing as well as inspection # See cookbook for editing steps. ########################################################### ########## 3 mm Continuum Calibration ########## ########################################################### ########################################################### ## Set flux density scale for the flux density calibrator ## (CRL618=field 4) ## imgr:=imager(filename='07feb97-g067.ms'); imgr.setjy(fieldid=4, # Select field 4 (CRL618) spwid=3, # Select 3mm LSB continuum fluxdensity=[1.55,0,0,0]); # Set flux density imgr.done(); ### CRL618 spwid= 3 [I=1.55, Q=0, U=0, V=0] Jy, (user-specified) ########################################################### ## Get preliminary time-dependent phase solutions to ## improve coherent average for bandpass solution ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for # GG Tau data set cal.reset(); # Reset setapply/setsolve cal.setdata(mode='channel', # Select 3mm LSB continuum, bpcal nchan=30, # choose inner 30 chans start=15, # to avoid band edges. step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==3'); cal.setsolvegainspline(table='ggtau.3mm.ph.gcal0', # Setup to derive phase solns with: mode='PHAS', preavg=120, # 2 min preavg data to increase S/N, splinetime=10000, # spline fit timescale (~3hrs), refant=1, # refant = 1, npointaver=10, # minimize phase wrap pblms phasewrap=260, append=F); # create new table ggtau.3mm.ph.gcal0 cal.solve(); # Solve for the solutions. ### generates plot file called ggtau.3mm.ph.gcal0.PHASE.ps ########################################################### ## Derive bandpass calibration for 3mm LSB: ## cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select B calibrator start=3, # and 3mm LSB continuum spw step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==3'); cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.3mm.ph.gcal0'); # before deriving BPass solns. cal.setsolvebandpoly(table='ggtau.3mm.bpoly', # Derive bandpass solns with: degamp=6, # amp poly order=6, degphase=12, # phase poly order=12, visnorm=F, # do not normalize visibilities, bpnorm=F, # do not normalize bp solutions, maskcenter=4, # do not use center 4 chans, maskedge=0, # avoid use of maskedge refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.3mm.bpoly cal.solve(); # Solve for the BPass solutions. ### generates plot file called ggtau.3mm.bpoly.ps ########################################################### ## Determine new and better phase solutions for 3mm LSB: ## for all calibrators cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 3mm LSB continuum spw step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); cal.setapply(type='BPOLY', # Arrange to apply 3mm B solutions table='ggtau.3mm.bpoly'); # before deriving phase solns cal.setsolvegainspline(table='ggtau.3mm.ph.gcal', mode='PHAS', # Derive phase solns with: preavg=0, # no preaveraging of solns, splinetime=10000, # spline fit timescale (~3hrs) refant=1, # choose ant 1 as refant, npointaver=10, # minimize phase-wrap problems phasewrap=260, append=F); # create new table ggtau.3mm.gcal cal.solve(); # Solve for the phase at 3mm ### generates plot file called ggtau.3mm.ph.gcal.PHASE.ps ########################################################### ## Apply all solutions derived so far, determine ## calibrators' flux densities by solving for T ## and using fluxscale ## cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 3mm LSB continuum spw step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); cal.setapply(type='BPOLY', # Arrange to apply 3mm B solutions table='ggtau.3mm.bpoly'); # cal.setapply(type='GSPLINE', # Arrange to apply 3mm phase solns table='ggtau.3mm.ph.gcal'); # cal.setsolve(type='T', # Solve for any residual phase table='ggtau.3mm.temp', # errors with a timescale of t=600, # 10 min. Use ant 1 as a refant=1); # reference. cal.solve(); # Solve for solutions. cal.plotcal(tablename='ggtau.3mm.temp', # Check plots of solutions. plottype='PHASE'); # (Phase & Amplitude) cal.plotcal(tablename='ggtau.3mm.temp', plottype='AMP'); cal.fluxscale(tablein='ggtau.3mm.temp', # Transfer the flux density scale tableout='ggtau.3mm.flux', # from CRL618 to gain cals reference='CRL618', # 0528+134 & 0415+379. transfer='0415+379 0528+134'); # Write solutions to the table # ggtau.3mm.flux located on disk. ### Logger reports results: ### Flux density for 0415+379 (spw=3) is: 5.849 +/- 0.014 Jy ### Flux density for 0528+134 (spw=3) is: 2.634 +/- 0.007 Jy ########################################################### ## Record flux values from logger window. Set model ## flux densities with imgr.setjy: ## imgr:=imager(filename='07feb97-g067.ms'); # Start imager tool imgr.setjy(fieldid=1, # Set flux density scale for spwid=3, # 0415+379, 3mm LSB continuum fluxdensity=5.849); imgr.setjy(fieldid=2, # Set flux density scale for spwid=3, # 0528+134, 3mm LSB continuum fluxdensity=2.634); imgr.done(); ### Logger reports results: ### 0415+379 spwid= 3 [I=5.849, Q=0, U=0, V=0] Jy, (user-specified) ### 0528+134 spwid= 3 [I=2.634, Q=0, U=0, V=0] Jy, (user-specified) ########################################################### ## Amplitude calibration of 3mm LSB: ## ## phase solutions will be pre-applied as well as carried forward ## to the output solution table. ## cal.reset(); # Reset setapply/setsolve cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 3mm LSB continuum spw step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.3mm.bpoly'); # from the ggtau.3mm.bpoly table. # before deriving amp solns cal.setapply(type='GSPLINE', # Arrange to apply phase solns table='ggtau.3mm.ph.gcal'); # before deriving amp solns cal.setsolvegainspline(table='ggtau.3mm.phamp.gcal', mode='AMP', # Arrange to solve amp solns with: preavg=2500, # preave data to reduce amp bias splinetime=20000, # spline fit timescale (~6hrs) refant=1, # choose ant = 1 as refant npointaver=10, # minimize phase-wrap problems phasewrap=260); # write to ggtau.3mm.phamp.gcal table cal.solve(); # Solve for the amps at 3mm ### generates plot file called ggtau.3mm.phamp.gcal.AMP.ps ########################################################### ## Correct the target source and all other 3mm LSB data: ## ## note that only the 60 central channels will be calibrated ## since the BPOLY solution is only defined for these ## cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='SPECTRAL_WINDOW_ID=3'); # Select all sources # in 3mm LSB continuum data cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.3mm.bpoly'); # from the ggtau.3mm.bpoly table. cal.setapply(type='GSPLINE', # Arrange to apply 3mm phase and table='ggtau.3mm.phamp.gcal'); # flux-scaled amp solutions cal.correct(); # Apply solutions and write the # CORRECTED_DATA column in the MS. cal.done(); # Close the calibrator tool. ########################################################### ## Split out calibrated target source data: ## mset := ms(filename='07feb97-g067.ms', # Create the ms tool readonly=F); # Make sure it is writable! mset.split(outputms='ggtau.3mm.split.ms', # Select output file name, fieldids=3, # write out only ggtau data, spwids=3, # spectral window 3 (3mm LSB), nchan=60, # write out all 64 channels, start=3, # starting with channel 1, step=1, # no channel averaging, whichcol='CORRECTED_DATA'); # write out CORRECTED_DATA column. mset.done(); # Finish this tool dc.summary('ggtau.3mm.split.ms'); # Get a new summary ########################################################### ## Get a first image the target source in 3 mm continuum emission: ## imgr:=imager(filename='ggtau.3mm.split.ms'); # Create imager tool if not already done. imgr.setdata(mode='channel', # Select channel data for GG Tau nchan=60, start=1, # Choose all channels beginning step=1, spwid=1, # at channel 1. fieldid=1); imgr.advise(takeadvice=F, # Determine image and cell size using amplitudeloss=0.05, # advise function. Do not take advice, fieldofview='55arcsec'); # note parameters in logger window # and use as a basis for setimage. imgr.setimage(nx=256, ny=256, # Set image plane parameters cellx='0.2arcsec', celly='0.2arcsec', stokes='I', # Image total intensity mode='mfs', # Use multi-frequency synthesis nchan=1, start=4, # Merge selected 58 channels into 1 step=58, spwid=1, fieldid=1); imgr.weight(type='briggs', # Set up Robust weighting rmode='norm', robust=0.5); imgr.clean(algorithm='clark', # Image & deconvolve with 100 iterations niter=100, # using the Clark CLEAN algorithm. gain=0.1, model='ggtau.3mm.model1', image='ggtau.3mm.im1', # Write the cleaned image to the file residual='ggtau.3mm.resid1',# ggtau.3mm.im1 on disk. mask='', # Clean only the inner quarter (no mask set) interactive=F); dv.gui(); # Use the default GUI to look at the image ########################################################### ## Clean interactively within a mask region, use the first image as ## a template to see the emission better so you can define the mask: ## imgr.clean(algorithm="clark", # Clean down to a threshold niter=6000, # of 0.6 mJy/beam. gain=0.1, threshold=[value=0.6, unit="mJy" ], masktemplate='ggtau.3mm.im1', # Use 1st image to set mask region model="ggtau.3mm.model2", mask="ggtau.3mm.mask" , # Write mask region to this file image="ggtau.3mm.im2" , # Write the cleaned image to the file residual="ggtau.3mm.resid2",# ggtau.3mm.im2 on disk. niter=100, # Look at residual image every 100 iterations interactive=T); # Set mask region interactively imgr.done(); # Close the imager tool ### Beam used in restoration: 1.8652 by 0.97922 (arcsec) at pa 15.9562 (deg) ########################################################### ## Write image to a fits file: ## im:=image(infile="ggtau.3mm.im2"); im.tofits(outfile="ggtau.3mm.fits"); im.done(); ########################################################### ########## 1 mm Continuum Calibration ########## ########################################################### ########################################################### ## Set flux density scale for the flux density calibrator ## (CRL618) imgr:=imager(filename='07feb97-g067.ms'); imgr.setjy(fieldid=4, spwid=11, fluxdensity=[2.2,0,0,0]); imgr.setjy(fieldid=4, spwid=15, fluxdensity=[2.2,0,0,0]); imgr.setjy(fieldid=4, spwid=19, fluxdensity=[2.2,0,0,0]); imgr.done(); ### CRL618 spwid= 11 [I=2.2, Q=0, U=0, V=0] Jy, (user-specified) ### CRL618 spwid= 15 [I=2.2, Q=0, U=0, V=0] Jy, (user-specified) ### CRL618 spwid= 19 [I=2.2, Q=0, U=0, V=0] Jy, (user-specified) ########################################################### ## Get first cut phase solutions to improve S/N for BPass determination: ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for # GG Tau data set cal.setdata(mode='channel', # Select 1mm LSB continuum, bpcal nchan=30, # choose inner 30 chans start=15, # to avoid band edges. step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID IN [11,15,19]'); cal.setsolvegainspline(table='ggtau.1mm.ph.gcal0',# Setup to derive phase solns with: mode='PHAS', preavg=120, # 2 min preavg data to increase S/N, splinetime=10000, # spline fit timescale (~3hrs), refant=1, # refant = 1, npointaver=10, # minimize phase wrap pblms phasewrap=260, append=F); # create new table ggtau.1mm.ph.gcal0 cal.solve(); # Solve for the solutions. ### generates plot file called ggtau.1mm.ph.gcal0.PHASE.ps ########################################################### ## Derive bandpass calibration for 1mm LSB: ## ## Avoid edge channels in each spw using setdata, not maskedge ## cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select B calibrator start=3, # and 1mm LSB continuum spws step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID IN [11,15,19]'); cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.1mm.ph.gcal0'); # before deriving BPass solns. cal.setsolvebandpoly(table='ggtau.1mm.bpoly', # Derive bandpass solns with: degamp=6, # amp poly order=6, degphase=6, # phase poly order=6, visnorm=F, # Do not normalize visibilities, bpnorm=F, # do not normalize bp solutions, maskcenter=4, # do not use center 2 Gibbs chans, maskedge=0, # avoid use of maskedge refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.1mm.bpoly cal.solve(); # Solve for the BPass solutions. ### generates plot file called ggtau.1mm.bpoly.ps ########################################################### ## Determine phase solutions for 1mm LSB for all calibrators ## ## Note, we are using the 3mm phase solution, transferred ## to the 1mm bands, to reduce the phase rate. The ## net solution (transferred 3mm + 1mm) is written ## to the output table cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 1mm LSB continuum spws step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); cal.setapply(type='BPOLY', # Arrange to apply 1mm B solutions table='ggtau.1mm.bpoly'); # before deriving phase solns cal.setapply(type='GSPLINE', # Arrange to apply 3mm phase solutions table='ggtau.3mm.ph.gcal'); # from spwid=3, scaled by the # appropriate frequency ratio. cal.setsolvegainspline(table='ggtau.1mm.ph.gcal', mode='PHAS', # Derive new phase solns with: preavg=0, # no preaveraging of solns, splinetime=10000, # spline fit timescale (~3hrs) refant=1, # choose ant 1 as refant, npointaver=10, # minimize phase-wrap problems phasewrap=260, append=F); # create new table ggtau.1mm.ph.gcal cal.solve(); # Solve for the phase at 1mm ### generates plot file called ggtau.1mm.ph.gcal.PHASE.ps ########################################################### ## Apply all solutions derived so far, determine ## calibrators' flux densities using a solve for T and ## fluxscale ## cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 1mm LSB continuum spws step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); cal.setapply(type='BPOLY', # Arrange to apply 1mm B solutions table='ggtau.1mm.bpoly'); # cal.setapply(type='GSPLINE', # Arrange to apply 1mm phase solns table='ggtau.1mm.ph.gcal'); # cal.setsolve(type='T', # Solve for any residual phase table='ggtau.1mm.temp', # errors with a timescale of t=600, # 10 min. Use ant 1 as a refant=1); # reference. cal.solve(); # Solve for solutions. cal.plotcal(tablename='ggtau.1mm.temp', # Check plots of solutions. plottype='PHASE'); # (Phase & Amplitude) cal.plotcal(tablename='ggtau.1mm.temp', plottype='AMP'); cal.fluxscale(tablein='ggtau.1mm.temp', # Transfer the flux density scale tableout='ggtau.1mm.flux', # from CRL618 to g cals reference='CRL618', # 0528+134 & 0415+379. transfer='0415+379 0528+134'); # Write solutions to the table # cal.3mm.flux located on disk. ### Logger reports results: ### Flux density for 0415+379 (spw=11) is: 4.292 +/- 0.061 Jy ### Flux density for 0415+379 (spw=15) is: 4.426 +/- 0.185 Jy ### Flux density for 0415+379 (spw=19) is: 4.211 +/- 0.081 Jy ### Flux density for 0528+134 (spw=11) is: 1.790 +/- 0.041 Jy ### Flux density for 0528+134 (spw=15) is: 1.956 +/- 0.098 Jy ### Flux density for 0528+134 (spw=19) is: 1.781 +/- 0.044 Jy ### Averages: 0415+379 = 4.310 Jy & 0528+134 = 1.842 Jy ########################################################### ## Record flux values from logger window. Manually insert ## fluxes with imgr.setjy: imgr:=imager(filename='07feb97-g067.ms'); # Start imager tool imgr.setjy(fieldid=1, # Set flux density scale for spwid=11, # 0415+379, 1mm LSB continuum fluxdensity=4.310); imgr.setjy(fieldid=1, spwid=15, fluxdensity=4.310); imgr.setjy(fieldid=1, spwid=19, fluxdensity=4.310); imgr.setjy(fieldid=2, # Set flux density scale for spwid=11, # 0528+134, 1mm LSB continuum fluxdensity=1.842); imgr.setjy(fieldid=2, spwid=15, fluxdensity=1.842); imgr.setjy(fieldid=2, spwid=19, fluxdensity=1.842); imgr.done(); ########################################################### ## Amplitude calibration of 1mm LSB: cal.reset(); # Reset setapply/setsolve cal.setdata(mode='channel', # avoid edge channels nchan=60, # and select all calibrators start=3, # and 1mm LSB continuum spws step=1, msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.1mm.bpoly'); # from the ggtau.1mm.bpoly table. # before deriving amp solns cal.setapply(type='GSPLINE', # Arrange to apply 1mm phase solns table='ggtau.1mm.ph.gcal'); # before deriving amp solns cal.setsolvegainspline(table='ggtau.1mm.phamp.gcal', mode='AMP', # Arrange to solve amp solns with: preavg=2500, # preave data to reduce amp bias splinetime=20000, # spline fit timescale (~6hrs) refant=1, # choose ant = 1 as refant npointaver=10, # minimize phase-wrap problems phasewrap=260); # write to ggtau.1mm.phamp.gcal table cal.solve(); # Solve for the amps at 1mm ### generates plot file called ggtau.1mm.phamp.gcal.AMP.ps ########################################################### ## Correct the target source and all other 1mm LSB continuum data: ## ## Note that edge channels in won't be calibrated because ## BPOLY solution is not defined for them ## cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='SPECTRAL_WINDOW_ID IN [11,15,19]'); # Select all sources # in 1mm LSB continuum data cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.1mm.bpoly'); # from ggtau.1mm.bpoly cal.setapply(type='GSPLINE', # Arrange to apply 1mm phase & amp table='ggtau.1mm.phamp.gcal'); # solns from ggtau.1mm.phamp.gcal cal.correct(); # Apply solutions and write the # CORRECTED_DATA column in the MS. cal.done(); ########################################################### ## Split out calibrated target source 1 mm continuum data: ## mset := ms(filename='07feb97-g067.ms', # Create the ms tool readonly=F); # Make sure it is writable! mset.split(outputms='ggtau.1mm.split.ms', # Select output file name, fieldids=3, # write out only ggtau data, spwids=[11,15,19], # spectral windows 11,15,19 (1mm LSB), nchan=60, # write out 60 channels, start=3, # starting with channel 3, step=1, # no channel averaging, whichcol='CORRECTED_DATA'); # write out CORRECTED_DATA column. mset.done(); # Finish this tool dc.summary('ggtau.1mm.split.ms'); # Get a new summary ########################################################### ## Get a first image the target source in 1 mm continuum emission: ## imgr:=imager(filename='ggtau.1mm.split.ms'); # Create imager tool if not already done. imgr.setdata(mode='channel', # Select channel data for GG Tau nchan=60, start=1, # Choose all channels beginning step=1, spwid=[1,2,3], # at channel 1. fieldid=1); imgr.setimage(nx=256, ny=256, # Set image plane parameters cellx='0.1arcsec', celly='0.1arcsec', stokes='I', # Image total intensity mode='mfs', # Use multi-frequency synthesis nchan=1, start=4, # Merge selected 58 channels into 1 step=58, spwid=[1,2,3], fieldid=1); imgr.weight(type='briggs', # Set up Robust weighting rmode='norm', robust=0.5); imgr.clean(algorithm='clark', # Image & deconvolve with 100 iterations niter=100, # using the Clark CLEAN algorithm. gain=0.1, model='ggtau.1mm.model', image='ggtau.1mm.im', # Write the cleaned image to the file residual='ggtau.1mm.resid',# ggtau.1mm.im on disk. mask='', # Clean only the inner quarter (no mask set) interactive=F); ########################################################### ########## 3 mm HCO+(1-0) line Calibration ########## ########################################################### ### Note: during the continuum reduction above, bandpass and time-dependent ### phase and amplitude solutions were derived using the wider bandwidth 3 mm LSB ### continuum data. These can be applied directly to the line data. ### Since the bandpass solution for the wide, low-resolution continuum band ### may not be ideal for the narrow, high-resolution line band. If there ### is sufficient S/R on the bandpass calibrator in the narrow line band, ### a bandpass solution may be obtained for it as follows: ########################################################### ## Derive bandpass calibration for the 3mm HCO+(1-0) line: ## (use of 3mm LSB phase solutions recommended) ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # Avoid 25 channels at nchan=206, # each end of 3mm line start=26, # band (spw=7) step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==7'); cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.3mm.ph.gcal0'); # before deriving BPass solns. cal.setsolvebandpoly(table='ggtau.hco.bpoly', # Derive bandpass solns with: degamp=1, # amp poly order=1, degphase=1, # phase poly order=1, visnorm=F, # Do not normalize visibilities, bpnorm=F, # do not normalize bp solutions, maskcenter=40, # avoid absorption line, maskedge=0, # don't use maskedge (see setdata) refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.hco.bpoly cal.solve(); # Solve for the BPass solutions. ### NOTE: strong absorption line near the center of the bandpass. ### Increase the maskcenter parameter to avoid having the absorption ### line affect the bandpass. ### ### generates plot file called ggtau.hco.bpoly.ps ########################################################### ## Correct the target source HCO+(1-0) line data (spwid 7): ## ## Note that first and last 25 channels will not be corrected ## since ggtau.hco.bpoly isn't defined for them cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='SPECTRAL_WINDOW_ID=7'); # Select all sources # in spwid 7 (HCO+ data) cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.hco.bpoly'); # from ggtau.hco.bpoly cal.setapply(type='GSPLINE', # Arrange to apply phase & amp solns table='ggtau.3mm.phamp.gcal'); # from ggtau.3mm.phamp.gcal cal.correct(); # Apply solutions and write the # CORRECTED_DATA column in the MS. cal.done(); ########################################################### ## Split out calibrated target source HCO+(1-0) data: ## mset := ms(filename='07feb97-g067.ms', # Create the ms tool readonly=F); # Make sure it is writable! mset.split(outputms='ggtau.hco.split.ms', # Select output file name, fieldids=3, # write out only ggtau data, spwids=7, # spectral window 7 (HCO+ line), nchan=206, # write out 206 channels, start=26, # starting with channel 26, step=1, # no channel averaging, whichcol='CORRECTED_DATA'); # write out CORRECTED_DATA column. mset.done(); # Finish this tool dc.summary('ggtau.hco.split.ms'); # Get a new summary ########################################################### ## Get a first image the target source in the HCO+ line emission: ## imgr:=imager(filename='ggtau.hco.split.ms'); # Create imager tool imgr.setdata(mode='channel', # Select channel data for GG Tau nchan=206, start=1, # Choose all channels beginning step=1, spwid=1, # at channel 1. fieldid=1); imgr.setimage(nx=256, ny=256, # Set image plane parameters cellx='0.2arcsec', # (same as continuum image above) celly='0.2arcsec', stokes='I', # Image total intensity mode='channel', # Make channel maps this time nchan=14, start=75, # Image only central channels, combine step=4, spwid=1, # 4 chans at a time to improve S/N fieldid=1); imgr.weight(type='briggs', # Set up Robust weighting rmode='norm', robust=0.5); imgr.clean(algorithm='clark', # Image & deconvolve with 100 iterations niter=100, # using the Clark CLEAN algorithm. gain=0.1, model='ggtau.hco.model', image='ggtau.hco.im', # Write the cleaned image to the file residual='ggtau.hco.resid',# ggtau.hco.im on disk. mask='', # Clean only the inner quarter (no mask set) interactive=F); ### Emission in central channels is barely visible (too weak to image ### with only 1 day of data but you get the point). ########################################################### ########## 1 mm 13CO(2-1) line Calibration ########## ########################################################### ### Note: during the continuum reduction above, bandpass and time-dependent ### phase and amplitude solutions were derived using the wider bandwidth 1 mm LSB ### continuum data. These can be applied directly to the line data. ### The bandpass solution for the wide, low-resolution continuum band ### may not be ideal for the narrow, high-resolution line band. If there ### is sufficient S/R on the bandpass calibrator in the narrow line band, ### a bandpass solution may be obtained for it as follows: ########################################################### ## Derive bandpass calibration for the spectral line: ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for cal.reset(); # Reset calibrator. cal.setdata(mode='channel', # Avoid 8 channels at nchan=240, # each end of 1mm line start=9, # band (spw=23) step=1, msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==23'); cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.1mm.ph.gcal0'); # before deriving BPass solns. cal.setsolvebandpoly(table='ggtau.co.bpoly', # Derive bandpass solns with: degamp=1, # amp poly order=1, degphase=1, # phase poly order=1, visnorm=F, # Do not normalize visibilities, bpnorm=F, # do not normalize bp solutions, maskcenter=4, # avoid central Gibbs channels, maskedge=0, # don't use maskedge (see setdata) refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.co.bpoly cal.solve(); # Solve for the BPass solutions. ### generates plot file called ggtau.co.bpoly ### ########################################################### ## Correct the target source 13CO(2-1) line data (spwid 23): ## ## Note that first and last 8 channels will not be corrected ## since ggtau.co.bpoly isn't defined for them ## cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='SPECTRAL_WINDOW_ID=23');# Select all sources # in spwid 23 (13CO data) cal.setapply(type='BPOLY', # Arrange to apply B solutions table='ggtau.co.bpoly'); # from the ggtau.co.bpoly table. cal.setapply(type='GSPLINE', # Arrange to apply 1mm phase & table='ggtau.1mm.phamp.gcal'); # flux-scaled amp solns # from ggtau.1mm.phamp.gcal cal.correct(); # Apply solutions and write the # CORRECTED_DATA column in the MS. cal.done(); ########################################################### ## Split out calibrated 13CO(2-1) data: ## mset := ms(filename='07feb97-g067.ms', # Create the ms tool readonly=F); # Make sure it is writable! mset.split(outputms='ggtau.co.split.ms', # Select output file name, fieldids=3, # write out only ggtau data, spwids=23, # spectral window 23 (13CO line), nchan=240, # write out all 256 channels, start=1, # starting with channel 1, step=1, # no channel averaging, whichcol='CORRECTED_DATA'); # write out CORRECTED_DATA column. mset.done(); # Finish this tool dc.summary('ggtau.co.split.ms'); # Get a new summary ########################################################### ## Get a first image of the target source in 13CO(2-1) line emission: ## imgr:=imager(filename='ggtau.co.split.ms'); # Create imager tool imgr.setdata(mode='channel', # Select channel data for GG Tau nchan=240, start=1, # Choose all channels beginning step=1, spwid=1, # at channel 1. fieldid=1); imgr.setimage(nx=256, ny=256, # Set image plane parameters cellx='0.1arcsec', # (same as continuum image above) celly='0.1arcsec', stokes='I', # Image total intensity mode='channel', # Make channel maps this time nchan=14, start=92, # Image only central channels, combine step=4, spwid=1, # 4 chans at a time to improve S/N fieldid=1); imgr.weight(type='briggs', # Set up Robust weighting rmode='norm', robust=0.5); imgr.clean(algorithm='clark', # Image & deconvolve with 100 iterations niter=100, # using the Clark CLEAN algorithm. gain=0.1, model='ggtau.co.model', image='ggtau.co.im', # Write the cleaned image to the file residual='ggtau.co.resid',# ggtau.co.im on disk. mask='', # Clean only the inner quarter (no mask set) interactive=F); ### Emission is too weak to image with only 1 day of data.