### ### Script for PdBI GG Tau data: ### 3mm & 1mm LSB continuum data reduction and imaging ### 3mm (HCO+) & 1mm (13CO) line data reduction ########################################################### ## Include relevant tools if not already done: ## include 'almati2ms.g'; include 'ms.g'; include 'flagger.g'; include 'msplot.g'; include 'calibrater.g'; include 'viewer.g'; include 'imager.g'; include 'image.g'; include 'imagepol.g'; ########################################################### ## 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 stored, obsmode="CORR", # and specify that all files chanzero="TIME_AVG"); # beginning with '07-feb-1997' # should be combined into one. ########################################################### ## 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. ########################################################### ## Swap out IRAM PdBI on-line phase corrected data if not good: ## # Phase correction selection of all data: include 'iramcalibrater.g'; ical:=iramcalibrater(msname="07feb97-g067.ms", initcal=T); ical.phcor(trial=F); ical.done(); ########################################################### ########## 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 scale imgr.done(); ### CRL618 spwid= 3 [I=1.55, Q=0, U=0, V=0] Jy, (user-specified) ########################################################### ## Get first cut phase solutions to improve S/N for BPass determination: ## (this step optional - use if needed) ## 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.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.gcal0 cal.solve(); # Solve for the solutions. ### mv 07feb97-g067.ms.PHAS.ps 07feb97-g067.ms.PHAS-0.3mm.ps ########################################################### ## Derive bandpass calibration for 3mm LSB: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==3'); # Select 3mm LSB continuum # & BPass cal (Field 2) # Default: Select all channels cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.3mm.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=3, # do not use last 3 edge chans, refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.3mm.bpoly cal.solve(); # Solve for the BPass solutions. ### mv 07feb97-g067.ms.RF_PHASE.ps 07feb97-g067.ms.RF_PHASE.3mm.ps ### mv 07feb97-g067.ms.RF_AMP.ps 07feb97-g067.ms.RF_AMP.3mm.ps ########################################################### ## Determine phase solutions for 3mm LSB: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); # Select 3mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels cal.setapply(type='BPOLY', # Arrange to apply 3mm B solutions table='ggtau.3mm.bpoly'); # before deriving phase solns cal.setsolvegainspline(table='ggtau.3mm.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 ### mv 07feb97-g067.ms.PHAS.ps 07feb97-g067.ms.PHAS.3mm.ps ########################################################### ## Apply all solutions derived so far, determine any residual ## phase errors, then derive the absolute flux density ## calibration of 3mm LSB continuum data: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); # Select 3mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels 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.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. 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=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: ## ### Trick: write amp solutions to a different table until you find ### the inputs which give good solutions. Then write them into the ### ggtau.3mm.gcal table so they can be applied to the source data ### along with the phase solutions. cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID==3'); # Select 3mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels 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.gcal'); # before deriving amp solns cal.setsolvegainspline(table='ggtau.3mm.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.gcal2 table cal.solve(); # Solve for the amps at 3mm ### mv 07feb97-g067.ms.AMP.ps 07feb97-g067.ms.AMP.3mm.ps ########################################################### ## Correct the target source and all other 3mm LSB data: ## 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.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=64, # write out all 64 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.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=64, 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) dv.gui(); # Start default viewer tool to examine image ########################################################### ## 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.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.gcal0 cal.solve(); # Solve for the solutions. ### mv 07feb97-g067.ms.PHAS.ps 07feb97-g067.ms.PHAS-0.1mm.ps ########################################################### ## Derive bandpass calibration for 1mm LSB: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID IN [11,15,19]'); # Select 1mm LSB continuum # & BPass cal (Field 2) # Default: Select all channels cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.1mm.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=3, # Mask end last 3 end channels, refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.1mm.bpoly cal.solve(); # Solve for the BPass solutions. ### mv 07feb97-g067.ms.RF_PHASE.ps 07feb97-g067.ms.RF_PHASE.1mm.ps ### mv 07feb97-g067.ms.RF_AMP.ps 07feb97-g067.ms.RF_AMP.1mm.ps ### Note: data has larger scatter - use lower order polynomial fit to ### the phase solutions to get a better match (data doesn't support ### higher fits.) ########################################################### ## Determine phase solutions for 1mm LSB: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); # Select 1mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels 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.gcal'); # from spwid=3, scaled by the # appropriate frequency ratio. cal.setsolvegainspline(table='ggtau.1mm.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.gcal cal.solve(); # Solve for the phase at 1mm ### mv 07feb97-g067.ms.PHAS.ps 07feb97-g067.ms.PHAS.1mm.ps ########################################################### ## Apply all solutions derived so far, determine any residual ## phase errors, then derive the absolute flux density ## calibration of 1mm LSB continuum data: ## cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); # Select 1mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels 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.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: ### Trick: write solutions to a temporary table until you find the ### correct inputs to get good solutions. Then write them to the ### final ggtau.1mm.gcal table (if you write poor solutions to the ### final table you have to generate a new table if you want clean ### solutions inserted next time). cal.reset(); # Reset setapply/setsolve cal.setdata(msselect='FIELD_ID IN [1,2,4] && SPECTRAL_WINDOW_ID IN [11,15,19]'); # Select 3mm LSB continuum # & all cals (Fields 1,2,4) # Default: select all channels 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.gcal'); # before deriving amp solns cal.setsolvegainspline(table='ggtau.1mm.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.gcal2 table cal.solve(); # Solve for the amps at 1mm ### mv 07feb97-g067.ms.AMP.ps 07feb97-g067.ms.AMP.1mm.ps ########################################################### ## Correct the target source and all other 1mm LSB continuum data: ## 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.gcal'); # solns from ggtau.1mm.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=64, # write out all 64 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.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=64, 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); dv.gui(); # Use the default GUI to look at the image ########################################################### ########## 3 mm HCO+(1-0) line Calibration ########## ########################################################### ### Note: during the continuum reduction above, phase and amplitude ### solutions were derived using the wider bandwidth 3 mm LSB ### continuum data. These can be applied directly to the line data. ### The flux density of the gain calibrator was also determined and ### included in the amplitude solutions. The only additional thing ### needed at this point is a bandpass solution for the HCO+(1-0) ### line in spwid 7. ########################################################### ## Derive bandpass calibration for the 3mm HCO+(1-0) line: ## (use 3mm LSB phase solutions to improve fit *optional*) ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==7'); # Select 3mm line (spwid 7) # & BPass cal (Field 2) # Default: Select all channels cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.3mm.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=10, # do not use last 10 end chans, 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. ### Also crop more of the mask edge to well-behaved inner channels. ### mv 07feb97-g067.ms.RF_PHASE.ps 07feb97-g067.ms.RF_PHASE.hco.ps ### mv 07feb97-g067.ms.RF_AMP.ps 07feb97-g067.ms.RF_AMP.hco.ps ########################################################### ## Correct the target source HCO+(1-0) line data (spwid 7): ## 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.gcal'); # from ggtau.3mm.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=256, # 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.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=256, 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=100, # 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); dv.gui(); # Use the default GUI to look at the image ### 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, 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 flux density of the gain calibrator was also determined and ### included in the amplitude solutions. The only additional thing ### needed at this point is a bandpass solution for the 1mm 13CO(2-1) ### line in spwid 23. ########################################################### ## Derive bandpass calibration for the spectral line: ## cal:=calibrater(filename='07feb97-g067.ms'); # Create calibrater tool for cal.reset(); # Reset calibrator. cal.setdata(msselect='FIELD_ID==2 && SPECTRAL_WINDOW_ID==23'); # Select 1mm 13CO(2-1) line # & BPass cal (Field 2) # Default: Select all channels cal.setapply(type='GSPLINE', # Setup to apply 1st phase solutions table='ggtau.1mm.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=3, # do not use last 3 end chans, refant=1, # choose ant 1 as refant, append=F); # create new table ggtau.co.bpoly cal.solve(); # Solve for the BPass solutions. ### mv 07feb97-g067.ms.RF_PHASE.ps 07feb97-g067.ms.RF_PHASE.co.ps ### mv 07feb97-g067.ms.RF_AMP.ps 07feb97-g067.ms.RF_AMP.co.ps ########################################################### ## Correct the target source 13CO(2-1) line data (spwid 23): ## 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.gcal'); # flux-scaled amp solns # from ggtau.1mm.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=256, # 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=256, 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=100, # 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); dv.gui(); # Use the default GUI to look at the image ### Emission is too weak to image with only 1 day of data.