AntennaeBand7 Imaging 5.1: Difference between revisions
No edit summary |
|||
(19 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
* '''This guide is designed for CASA 5.1.1. If you are using an older version of CASA please see [[AntennaeBand7_Imaging_4.5]]. | * '''This guide is designed for CASA 5.1.1. If you are using an older version of CASA please see [[AntennaeBand7_Imaging_4.5]]. | ||
* '''This tutorial picks up where [[ | * '''This tutorial picks up where [[AntennaeBand7_Calibration]] leaves off: with fully calibrated, split science target measurement sets. If you wish to skip the Calibration guide: obtain the calibrated data from [[AntennaeBand7#Obtaining_the_Data]]; extract it using <tt>tar -xzvf FILENAME</tt>; and <tt>cd</tt> into the extracted directory.''' | ||
* '''Details of the ALMA data are provided at [[AntennaeBand7]]'''. | * '''Details of the ALMA data are provided at [[AntennaeBand7]]'''. | ||
Line 25: | Line 25: | ||
</pre> | </pre> | ||
Mosaics like other kinds of images are created in the CASA task {{tclean}}. To invoke mosaic mode, you simply set the parameter '''gridder='mosaic''''. This is a joint deconvolution algorithm that works in the uv-plane. A convolution of the primary beam patterns for each pointing in the mosaic is created: the primary beam response function. The corresponding image of the mosaic response function will be called | Mosaics like other kinds of images are created in the CASA task {{tclean}}. To invoke mosaic mode, you simply set the parameter '''gridder='mosaic''''. This is a joint deconvolution algorithm that works in the uv-plane. A convolution of the primary beam patterns for each pointing in the mosaic is created: the primary beam response function. The corresponding image of the mosaic response function will be called ''<imagename>.pb''. | ||
<!-- | <!-- | ||
Line 39: | Line 39: | ||
== Continuum Imaging == | == Continuum Imaging == | ||
We will make 345 GHz continuum images for the two regions covered by the mosaics. We use the task {{clean}} over the channels that are free of the line emission; we avoid the edge channels which tend to be noisier due to bandpass rolloff effects. The line-free channels are found by plotting the average spectrum (all fields). We find the CO(3-2) line from channels 50 to 100 in the southern mosaic ( | [[File:Antennae_South-AMPvsCH.png|200px|thumb|right|<caption>'''Fig. 1.''' Southern mosaic: Amplitude vs. channel. The CO(3-2) line is seen from 50 to 100</caption>]] | ||
[[File:Antennae_North-AMPvsCH.png|200px|thumb|right|<caption>'''Fig. 2.''' Northern mosaic: Amplitude vs. channel. The CO(3-2) line is seen from 70 to 100</caption>]] | |||
We will make 345 GHz continuum images for the two regions covered by the mosaics. We use the task {{clean}} over the channels that are free of the line emission; we avoid the edge channels which tend to be noisier due to bandpass rolloff effects. The line-free channels are found by plotting the average spectrum (all fields). We find the CO(3-2) line from channels 50 to 100 in the southern mosaic (Figure 1), and from 70 to 100 in the northern mosaic (Figure 2). | |||
<source lang="python"> | <source lang="python"> | ||
Line 112: | Line 112: | ||
</pre> --> | </pre> --> | ||
[[File:North_cont_clean.png|200px|thumb|right|<caption>'''Fig. 3.''' Residual for Northern continuum mosaic after 100 iterations; the clean mask is shown by the white contour.</caption>]] | |||
[[ | |||
Next we switch to refined values of '''cell='0.13arcsec' ''' and '''imsize=500''' based on the observed beam size. We also switch to interactive mode so that you can create a clean mask using the polygon tool (note you need to double click inside the polygon region to activate the mask). See [[TWHydraBand7_Imaging_3.4#Image_and_Self-Calibrate_the_Continuum | TWHya casaguide]] for a more complete description of interactive clean and mask creation. | Yes, there is definitely a detection in the vicinity of the Northern nucleus (see Figure 5 and Figure 6 below). Using the square region icon, and drawing a box near but not including the emission, we find the rms noise is about 0.5 mJy/beam in the dirty image. | ||
Next we switch to refined values of '''cell='0.13arcsec' ''' and '''imsize=500''' based on the observed beam size. We also switch to interactive mode so that you can create a clean mask using the polygon tool (note you need to double click inside the polygon region to activate the mask). We have included an example mask to use in Antennae_Band7_CalibratedData.tgz. If you would like to use your own mask, make sure to removed the mask file before running the command below. Otherwise, you can edit the mask within the clean GUI. See [[TWHydraBand7_Imaging_3.4#Image_and_Self-Calibrate_the_Continuum | TWHya casaguide]] for a more complete description of interactive clean and mask creation. | |||
*'''niter=1000''': Maximum number of clean iterations -- '''we will stop interactively''' | *'''niter=1000''': Maximum number of clean iterations -- '''we will stop interactively''' | ||
Line 126: | Line 125: | ||
<source lang="python"> | <source lang="python"> | ||
# In CASA | # In CASA | ||
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']: | |||
rmtables('Antennae_North.Cont.Clean'+ext) | |||
tclean(vis='Antennae_North.cal.ms',imagename='Antennae_North.Cont.Clean', | tclean(vis='Antennae_North.cal.ms',imagename='Antennae_North.Cont.Clean', | ||
field='',phasecenter=12, | field='',phasecenter=12, | ||
Line 138: | Line 139: | ||
</source> | </source> | ||
The residuals are "noise-like" after only ~30 iterations (see | The residuals are "noise-like" after only ~30 iterations (see Figure 3), so hit the red X symbol in the interactive window to stop cleaning here. | ||
Note that if you run the {{tclean}} task again with the same '''imagename''', without deleting the existing <imagename>.* files, {{tclean}} assumes that you want to continue cleaning the existing images. We put an <tt>rm</tt> command before the {{tclean}} command to guard against this, but sometimes this is what you want. | Note that if you run the {{tclean}} task again with the same '''imagename''', without deleting the existing <imagename>.* files, {{tclean}} assumes that you want to continue cleaning the existing images. We put an <tt>rm</tt> command before the {{tclean}} command to guard against this, but sometimes this is what you want. | ||
Line 144: | Line 145: | ||
==== Southern Continuum Mosaic ==== | ==== Southern Continuum Mosaic ==== | ||
For the southern mosaic we modify the '''phasecenter''', mosaic '''imsize''', and the line-free channels ('''spw''') to be consistent for this mosaic. We also bypass the dirty image step we did above for the Northern mosaic. As above, the mosaic size can be judged from the [[AntennaeBand7#ALMA_Data_Overview | Overview]]. We expect the beam to be about the same and use the same '''cell''' size. | [[File:South_cont_clean.png|200px|thumb|right|<caption>'''Fig. 4.''' Residual for Southern continuum mosaic after 100 iterations; the clean mask is shown by the white contour.</caption>]] | ||
For the southern mosaic we modify the '''phasecenter''', mosaic '''imsize''', and the line-free channels ('''spw''') to be consistent for this mosaic. We also bypass the dirty image step we did above for the Northern mosaic. As above, the mosaic size can be judged from the [[AntennaeBand7#ALMA_Data_Overview | Overview]]. We expect the beam to be about the same and use the same '''cell''' size. Again, you can use the provided mask or make your own. | |||
<source lang="python"> | <source lang="python"> | ||
# In CASA | # In CASA | ||
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']: | |||
rmtables('Antennae_South.Cont.Clean'+ext) | |||
tclean(vis='Antennae_South.cal.ms',imagename='Antennae_South.Cont.Clean', | tclean(vis='Antennae_South.cal.ms',imagename='Antennae_South.Cont.Clean', | ||
field='',phasecenter=15, | field='',phasecenter=15, | ||
Line 165: | Line 168: | ||
The beam size reported in the logger for the Southern mosaic: 1.13"x 0.67", and P.A.= 61 deg; which is a little better than the beam for the North owing to better uv-coverage. | The beam size reported in the logger for the Southern mosaic: 1.13"x 0.67", and P.A.= 61 deg; which is a little better than the beam for the North owing to better uv-coverage. | ||
Stop after ~50 iterations ( | Stop after ~50 iterations (Figure 4). | ||
==== Image Statistics ==== | ==== Image Statistics ==== | ||
[[File:North_contstat.png|200px|thumb|right|<caption>Example polygon for rms determination using the viewer.</caption>]] | [[File:North_contstat.png|200px|thumb|right|<caption>'''Fig. 5.''' Example polygon for rms determination using the viewer.</caption>]] | ||
Line 192: | Line 195: | ||
</source> | </source> | ||
Adjust colorscale using the middle mouse button (or reassign to a different mouse button by clicking on "plus" symbol icon). Next, select the polygon tool by clicking on its symbol with a mouse button. Then draw a region that avoids edges and emission ( | Adjust colorscale using the middle mouse button (or reassign to a different mouse button by clicking on "plus" symbol icon). Next, select the polygon tool by clicking on its symbol with a mouse button. Then draw a region that avoids edges and emission (Figure 5), then double click inside the polygon to have the statistic printed to the screen. You may measure an rms that differs by a few percent from the value reported by imstat. | ||
<source lang="python">exit | <source lang="python">exit | ||
Line 199: | Line 202: | ||
</source> | </source> | ||
[[File:Antennae_North.Cont.Clean.image.png|200px|thumb|right|<caption>'''Fig. 6.''' 345 GHz continuum image of the northern mosaic made with {{imview}}.</caption>]] | |||
[[File:Antennae_North.Cont.Clean.image.png|200px|thumb|right|<caption>345 GHz continuum image of the northern mosaic made with {{imview}}.</caption>]] | |||
[[File:Antennae_South.Cont.Clean.image.png|200px|thumb|right|<caption>'''Fig. 7.''' 345 GHz continuum image of the southern mosaic made with {{imview}}.</caption>]] | |||
[[File:Antennae_South.Cont.Clean.image.png|200px|thumb|right|<caption>345 GHz continuum image of the southern mosaic made with {{imview}}.</caption>]] | |||
Again, you may measure an rms slightly different than what we got from using {{imstat}} with no constraints. | Again, you may measure an rms slightly different than what we got from using {{imstat}} with no constraints. | ||
Line 245: | Line 246: | ||
== CO(3-2) Imaging == | == CO(3-2) Imaging == | ||
[[File:North_CO3_2_vel.png|thumb|<caption>'''Fig. 8.''' Northern CO(3-2) uv-spectrum in LSRK velocity space.</caption>]] | |||
[[ | |||
[[File:South_CO3_2_vel.png|thumb|<caption>'''Fig. 9.''' Southern CO(3-2) uv-spectrum in LSRK velocity space.</caption>]] | |||
[[ | |||
Now we are ready to make cubes of the line emission. The imaging parameters are similar to the continuum except for | Now we are ready to make cubes of the line emission. The imaging parameters are similar to the continuum except for | ||
Line 284: | Line 283: | ||
==== Northern Mosaic ==== | ==== Northern Mosaic ==== | ||
As before, it is very important that you make a clean mask. There are many ways to do this ranging from the complicated to simple. For this example we | As before, it is very important that you make a clean mask. There are many ways to do this ranging from the complicated to simple. For this example we provide a single clean mask that encompasses the line emission in every channel and apply it to all channels. This is much better than no clean mask, though not quite as good as making an individual mask for each channel. You can choose to use and edit the provided mask or create your own mask. | ||
Notable parameters included in the {{tclean}} call are: | Notable parameters included in the {{tclean}} call are: | ||
Line 296: | Line 295: | ||
*'''savemodel='modelcolumn'''': This saves the clean model to the ms file. We will need this for self-calibration later. | *'''savemodel='modelcolumn'''': This saves the clean model to the ms file. We will need this for self-calibration later. | ||
[[ | [[File:North_interact.png|200px|thumb|right|<caption>'''Fig. 10.''' Interactive cleaning of northern mosaic. The clean mask is shown in white. In this example we used the same mask for all channels by selecting "all channels" before drawing mask.</caption>]] | ||
<source lang="python"> | <source lang="python"> | ||
# In CASA | # In CASA | ||
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']: | |||
rmtables('Antennae_North.CO3_2Line.Clean'+ext) | |||
tclean(vis='Antennae_North.cal.ms.contsub', | tclean(vis='Antennae_North.cal.ms.contsub', | ||
imagename='Antennae_North.CO3_2Line.Clean', | imagename='Antennae_North.CO3_2Line.Clean', | ||
Line 318: | Line 319: | ||
</source> | </source> | ||
Figure 10 shows what the final clean box should look like. Cycle through the channels until you reach ~1650 km/s, where you can more easily see where to draw the clean box around the CO emission. Be sure the check the circle next to 'All Channels' when making your clean mask. Now clean using the green circle arrow. You can watch the progress in the logger. When the first ~650 iterations are done, the viewer will show the residual map for each channel. Cycle through the channels and see whether you are still happy with the clean box in each channel with significant signal. The "erase button" can help you fix mistakes. If necessary adjust. It is often useful to adjust the colorscale with the "plus" symbol icon. To make it go a bit faster, you can increase '''iteration''' interactively, to 200 or 300, but don't overdo it. | |||
These data are pretty severely ''dynamic range'' limited, in part due to the sparse uv coverage. In other words, the noise in bright channels is set by a maximum signal-to-noise. This effectively prevents us from stopping clean based on an rms based '''threshold''' because the effective rms changes as a function of the brightest signal in each channel. Thus, in this case we need to stop clean interactively. Below an approximate number of '''iterations''' is given to help you decide when to quit. NOTE: the '''threshold''' that is set in the CO(3-2) clean commands are about equal to the noise in a line-free channel and is only there to prevent clean running forever if you fail to stop it. You are not intended to clean to this '''threshold'''. | These data are pretty severely ''dynamic range'' limited, in part due to the sparse uv coverage. In other words, the noise in bright channels is set by a maximum signal-to-noise. This effectively prevents us from stopping clean based on an rms based '''threshold''' because the effective rms changes as a function of the brightest signal in each channel. Thus, in this case we need to stop clean interactively. Below an approximate number of '''iterations''' is given to help you decide when to quit. NOTE: the '''threshold''' that is set in the CO(3-2) clean commands are about equal to the noise in a line-free channel and is only there to prevent clean running forever if you fail to stop it. You are not intended to clean to this '''threshold'''. | ||
Line 333: | Line 334: | ||
==== Southern Mosaic ==== | ==== Southern Mosaic ==== | ||
[[ | [[File:South_interact.png|200px|thumb|right|<caption>'''Fig. 11.''' Interactive cleaning of southern mosaic. The clean mask is shown in white. In this example we used the same mask for all channels by selecting "all channels" before drawing mask.</caption>]] | ||
Repeat process for Southern mosaic. | Repeat process for Southern mosaic. | ||
Line 341: | Line 342: | ||
<source lang="python"> | <source lang="python"> | ||
# In CASA | # In CASA | ||
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']: | |||
rmtables('ntennae_South.CO3_2Line.Clean'+ext) | |||
tclean(vis='Antennae_South.cal.ms.contsub', | tclean(vis='Antennae_South.cal.ms.contsub', | ||
imagename='Antennae_South.CO3_2Line.Clean', | imagename='Antennae_South.CO3_2Line.Clean', | ||
Line 383: | Line 386: | ||
==== Northern Mosaic ==== | ==== Northern Mosaic ==== | ||
[[File:north_selfchan.png|200px|thumb|right|<caption>'''Fig. 12.''' Plot of the CO(3-2) emission from the data column of field 12 of the Northern mosaic.</caption>]] | |||
[[ | |||
The strongest emission in the Northern mosaic comes from the center pointing, already identified above as '''field='12' '''. Below we make a uv-plot of the spectral line emission from this field to chose only the strongest channels to include in the self-calibration. ''It is essential that the self-calibration channel range be chosen based on the UV data and not on the image cube.'' This is because the channels in the image cube were modified by the velocity/channel specifications in the first invocation of clean. This plot shows the channel range of the uv data. | The strongest emission in the Northern mosaic comes from the center pointing, already identified above as '''field='12' '''. Below we make a uv-plot of the spectral line emission from this field to chose only the strongest channels to include in the self-calibration. ''It is essential that the self-calibration channel range be chosen based on the UV data and not on the image cube.'' This is because the channels in the image cube were modified by the velocity/channel specifications in the first invocation of clean. This plot shows the channel range of the uv data. | ||
Line 399: | Line 401: | ||
You will notice that while the model looks reasonable across the channels where we imaged the data, the model amplitudes are set to 1 elsewhere. When {{tclean}} initializes a model, it defaults to an amplitude of 1 and phase 0 (i.e., a point source with an amplitude of 1 in the center of the image). When we set '''savemodel = 'modelcolumn'''' in the {{tclean}} call, the default model was replaced 'only where {{tclean}} had a model to replace it with', namely, over the channels we imaged. In future, CASA will set a flag to let users know that these model points are not valid for the updated model. In our case, we will perform self-calibration only on those channels with significant signal in the line emission, omitting the rest of the channels. | You will notice that while the model looks reasonable across the channels where we imaged the data, the model amplitudes are set to 1 elsewhere. When {{tclean}} initializes a model, it defaults to an amplitude of 1 and phase 0 (i.e., a point source with an amplitude of 1 in the center of the image). When we set '''savemodel = 'modelcolumn'''' in the {{tclean}} call, the default model was replaced 'only where {{tclean}} had a model to replace it with', namely, over the channels we imaged. In future, CASA will set a flag to let users know that these model points are not valid for the updated model. In our case, we will perform self-calibration only on those channels with significant signal in the line emission, omitting the rest of the channels. | ||
[[ | [[File:North_selfchan_model.png|200px|thumb|right|<caption>'''Fig. 13.''' Plot of the CO(3-2) emission from the model column of field 12 of the northern mosaic.</caption>]] | ||
<source lang="python"> | <source lang="python"> | ||
Line 419: | Line 421: | ||
Zooming in on each dataset we see that they are about 1 hour long (you can also check the {{listobs}} output), and that each dataset has 2 or 3 observations of field 12. Each time, it's observed for about 25 seconds. We set '''solint='3600s'''' to get one solution per dataset. | Zooming in on each dataset we see that they are about 1 hour long (you can also check the {{listobs}} output), and that each dataset has 2 or 3 observations of field 12. Each time, it's observed for about 25 seconds. We set '''solint='3600s'''' to get one solution per dataset. | ||
[[File:north_pcal1_phase.png|200px|thumb|right|<caption>'''Fig. 14.''' Phase-only self-calibration solutions for the Northern mosaic.</caption>]] | |||
[[ | |||
<source lang="python"> | <source lang="python"> | ||
Line 451: | Line 452: | ||
Re-image the data with the selfcal applied. Remember that {{tclean}} always uses the corrected data column if it exists: | Re-image the data with the selfcal applied. Remember that {{tclean}} always uses the corrected data column if it exists: | ||
[[ | [[File:North_interact2.png|200px|thumb|right|<caption>'''Fig. 15.''' Interactive cleaning of Northern mosaic after self-cal. The clean mask is shown in white. In this example we used the same mask for all channels by selecting "all channels" before drawing mask.</caption>]] | ||
<source lang="python"> | <source lang="python"> | ||
Line 465: | Line 466: | ||
gridder='mosaic',deconvolver='hogbom', | gridder='mosaic',deconvolver='hogbom', | ||
imsize=500,cell='0.13arcsec',pblimit=0.2, | imsize=500,cell='0.13arcsec',pblimit=0.2, | ||
restoringbeam='common', | |||
interactive=True,mask='Antennae_North.CO3_2Line.Clean.mask', | interactive=True,mask='Antennae_North.CO3_2Line.Clean.mask', | ||
weighting='briggs',robust=0.5, | weighting='briggs',robust=0.5, | ||
Line 471: | Line 473: | ||
</source> | </source> | ||
After 3000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask. Remember to select the "all channels" toggle. Stop after | After 3000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask. Remember to select the "all channels" toggle. Stop after 9,000 or so iterations. | ||
Compare the un-selfcal'ed and selfcal'ed data to determine if there has been improvement. | Compare the un-selfcal'ed and selfcal'ed data to determine if there has been improvement. | ||
Line 480: | Line 482: | ||
'range': [-0.07,0.4]}, | 'range': [-0.07,0.4]}, | ||
{'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image', | {'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image', | ||
'range': [-0.07,0.4]}] | 'range': [-0.07,0.4]}]) | ||
</source> | </source> | ||
<!-- | |||
zoom={'channel': 43}) doesn't work with two images | |||
--> | |||
Then in the viewer, activate the Animator Images sub-panel by clicking the check box next to "Images". Then use the tape deck controls to cycle between the two images. To change the channel use the Channels sub-panel in the Animator. | Then in the viewer, activate the Animator Images sub-panel by clicking the check box next to "Images". Then use the tape deck controls to cycle between the two images. To change the channel use the Channels sub-panel in the Animator. | ||
To make the figure shown in | To make the figure shown in Figure 16, cycle to channel 43. Then you can select the "p wrench" icon and change the number of panels in x to 2. You will need to drag your viewer window rather wide to get both panels to fit well. If you want to compare other channels, you can use the tapedeck to move to the new channel of interest and see the changes in both cubes. | ||
To compare the statistics for each image, click the "Next" button in the "Statistics" tab of the "Region" sub-panel. | |||
What you should notice is that the peak flux density has increased substantially while the rms noise is about the same. This is reasonable for this self-calibration case because we have mostly adjusted relative position offsets between the datasets and not taken out any short-term phase variations which would reduce the rms. | What you should notice is that the peak flux density has increased substantially while the rms noise is about the same. This is reasonable for this self-calibration case because we have mostly adjusted relative position offsets between the datasets and not taken out any short-term phase variations which would reduce the rms. | ||
Line 493: | Line 499: | ||
Note that attempts to push the selfcal to shorter solint (for example to each scan of field=12) did not yield additional improvement. | Note that attempts to push the selfcal to shorter solint (for example to each scan of field=12) did not yield additional improvement. | ||
[[ | [[File:north_ch43compare.png|600px|thumb|center|<caption>'''Fig. 16.''' Comparison of channel 43 before selfcal (left) and after selfcal (right).</caption>]] | ||
<div class="noprint" style="float:none; border:0px solid blue;background-color:#F6CEF5;padding:2px;"> | <div class="noprint" style="float:none; border:0px solid blue;background-color:#F6CEF5;padding:2px;"> | ||
If you used '''standard='Butler-JPL-Horizons 2012' ''' when running {{setjy}} during the calibration process, you will see an increase of approximately | If you used '''standard='Butler-JPL-Horizons 2012' ''' when running {{setjy}} during the calibration process, you will see an increase of approximately 25% in the peak flux density (in channel 43). | ||
</div> | </div> | ||
==== Southern Mosaic ==== | ==== Southern Mosaic ==== | ||
[[File:south_selfchan.png|200px|thumb|right|<caption>'''Fig. 17.''' Plot of the CO(3-2) emission from the data column for Field 7 of the Southern mosaic.</caption>]] | |||
[[ | |||
</ | |||
[[File:South_selfchan_model.png|200px|thumb|right|<caption>'''Fig. 18.''' Plot of the CO(3-2) emission from the model column for Field 7 of the Southern mosaic.</caption>]] | |||
Now repeat the self-calibration process for the Southern mosaic. It is a bit tougher in this case to pick the best field. The most compact bright emission is toward field id 11 in the [[AntennaeBand7#Science_Target_Overview | Overview]]. Adjusting for the renumbering of field ids after the final calibration split, this becomes field='7'. | Now repeat the self-calibration process for the Southern mosaic. It is a bit tougher in this case to pick the best field. The most compact bright emission is toward field id 11 in the [[AntennaeBand7#Science_Target_Overview | Overview]]. Adjusting for the renumbering of field ids after the final calibration split, this becomes field='7'. | ||
Line 534: | Line 539: | ||
</source> | </source> | ||
[[File:south_pcal1_phase.png|200px|thumb|right|<caption>'''Fig. 19.''' Phase-only self-calibration solutions for the Southern mosaic.</caption>]] | |||
[[ | |||
<source lang="python"> | <source lang="python"> | ||
Line 560: | Line 564: | ||
</source> | </source> | ||
[[File:South_interact2.png|200px|thumb|right|<caption>'''Fig. 20.''' Interactive cleaning of Southern mosaic after self-cal. The clean mask is shown in white. In this example we used the same mask for all channels by selecting "All Channels" before drawing mask.</caption>]] | |||
[[ | |||
<source lang="python"> | <source lang="python"> | ||
Line 574: | Line 577: | ||
gridder='mosaic',deconvolver='hogbom', | gridder='mosaic',deconvolver='hogbom', | ||
imsize=750,cell='0.13arcsec',pblimit=0.2, | imsize=750,cell='0.13arcsec',pblimit=0.2, | ||
restoringbeam='common', | |||
interactive=True,mask='Antennae_South.CO3_2Line.Clean.mask', | interactive=True,mask='Antennae_South.CO3_2Line.Clean.mask', | ||
weighting='briggs',robust=0.5, | weighting='briggs',robust=0.5, | ||
Line 580: | Line 584: | ||
</source> | </source> | ||
After 4000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask | After 4000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask. Stop after 25,000 or so iterations. | ||
As for the Northern mosaic, you can compare the before and after self-cal images: | As for the Northern mosaic, you can compare the before and after self-cal images (look, for example, at channel 31): | ||
<source lang="python"> | <source lang="python"> | ||
Line 589: | Line 593: | ||
'range': [-0.05,0.2]}, | 'range': [-0.05,0.2]}, | ||
{'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image', | {'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image', | ||
'range': [-0.05,0.2]}] | 'range': [-0.05,0.2]}]) | ||
</source> | |||
<!-- | |||
zoom={'channel': 31}) | zoom={'channel': 31}) | ||
</ | doesn't work for multiple images | ||
--> | |||
[[File:South_ch31compare.png|600px|thumb|center|<caption>'''Fig. 21.''' Comparison of channel 31 before selfcal (left) and after selfcal (right).</caption>]] | |||
<div class="noprint" style="float:none; border:0px solid blue;background-color:#F6CEF5;padding:2px;"> | <div class="noprint" style="float:none; border:0px solid blue;background-color:#F6CEF5;padding:2px;"> | ||
If you used '''standard='Butler-JPL-Horizons 2012' ''' when running {{setjy}} during the calibration process, you will see an increase of approximately | If you used '''standard='Butler-JPL-Horizons 2012' ''' when running {{setjy}} during the calibration process, you will see an increase of approximately 24% in the peak flux density (in channel 31). | ||
</div> | </div> | ||
Line 605: | Line 613: | ||
==== Moment Maps ==== | ==== Moment Maps ==== | ||
[[File:Antennae_North.CO3_2Line.Clean.pcal1.image.mom0.png|200px|thumb|right|<caption>'''Fig. 22.''' The CO(3-2) integrated intensity map (moment 0) of the Northern mosaic.</caption>]] | |||
[[ | |||
[[File:Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png|200px|thumb|right|<caption>'''Fig. 23.''' The CO(3-2) velocity field (moment 1) of the Northern mosaic.</caption>]] | |||
[[ | |||
[[File:Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png|200px|thumb|right|<caption>'''Fig. 24.''' The CO(3-2) velocity dispersion (moment 2) of the Northern mosaic.</caption>]] | |||
[[ | |||
[[File:Antennae_South.CO3_2Line.Clean.pcal1.image.mom0.png|200px|thumb|right|<caption>'''Fig. 25.''' The CO(3-2) integrated intensity map (moment 0) of the Southern mosaic.</caption>]] | |||
[[ | |||
[[File:Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png|200px|thumb|right|<caption>'''Fig. 26.''' The CO(3-2) velocity field (moment 1) of the Southern mosaic.</caption>]] | |||
[[ | [[File:Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png|200px|thumb|right|<caption>'''Fig. 27.''' The CO(3-2) velocity dispersion (moment 2) of the Southern mosaic.</caption>]] | ||
[[ | |||
Next we will make moment maps for the CO(3-2) emission: Moment 0 is the integrated intensity; Moment 1 is the intensity weighted velocity field; and Moment 2 is the intensity weighted velocity dispersion. | Next we will make moment maps for the CO(3-2) emission: Moment 0 is the integrated intensity; Moment 1 is the intensity weighted velocity field; and Moment 2 is the intensity weighted velocity dispersion. | ||
Line 683: | Line 688: | ||
Next we can create the six moment maps | Next we can create the six moment maps | ||
( | (Figures 22, 23, 24, 25, 26, and 27) | ||
from these images using '''imview'''. | from these images using '''imview'''. | ||
Line 760: | Line 760: | ||
==Comparison with previous SMA CO(3-2) data== | ==Comparison with previous SMA CO(3-2) data== | ||
We compare with SMA CO(3-2) data (Ueda, Iono, Petitpas et al. 2012, ApJ, 745, 65). | We compare with SMA CO(3-2) data (Ueda, Iono, Petitpas et al. 2012, ApJ, 745, 65). Figure 28 shows a comparison plot between the moment 0 maps of ALMA and SMA data using the {{viewer}}. The fluxes, peak locations, and large scale structure are consistent. Both southern and northern components have been combined. | ||
[[File: alma_sma_compare.png|500px|thumb|center|<caption>'''Fig. 28.''' The CO(3-2) total intensity map (moment 0) comparison with SMA data. Colour image is ALMA data, combining southern and northern mosaics. Contours show SMA data (Ueda, Iono, Petitpas et al. 2012, ApJ, 745, 65).</caption>]] | |||
{{Checked 5.1.1}} | |||
{{Checked |
Latest revision as of 20:35, 20 August 2021
- This guide is designed for CASA 5.1.1. If you are using an older version of CASA please see AntennaeBand7_Imaging_4.5.
- This tutorial picks up where AntennaeBand7_Calibration leaves off: with fully calibrated, split science target measurement sets. If you wish to skip the Calibration guide: obtain the calibrated data from AntennaeBand7#Obtaining_the_Data; extract it using tar -xzvf FILENAME; and cd into the extracted directory.
- Details of the ALMA data are provided at AntennaeBand7.
Confirm your version of CASA
This guide has been written for CASA release 5.1.1. Please confirm your version before proceeding.
# In CASA
import casadef
version = casadef.casa_version
print "You are using " + version
if (version < '5.1.1'):
print "YOUR VERSION OF CASA IS TOO OLD FOR THIS GUIDE."
print "PLEASE UPDATE IT BEFORE PROCEEDING."
else:
print "Your version of CASA is appropriate for this guide."
Imaging Mosaics
If you are unfamiliar with the basic concepts of deconvolution and clean, pause here and review, for example, https://science.nrao.edu/science/meetings/2016/15th-synthesis-imaging-workshop/documents/wilner_vla16.pdf
Mosaics like other kinds of images are created in the CASA task tclean. To invoke mosaic mode, you simply set the parameter gridder='mosaic'. This is a joint deconvolution algorithm that works in the uv-plane. A convolution of the primary beam patterns for each pointing in the mosaic is created: the primary beam response function. The corresponding image of the mosaic response function will be called <imagename>.pb.
Additionally, for mosaics it is essential to pick the center of the region to be imaged explicitly using the phasecenter parameter. Otherwise it will default to the first pointing included in the field parameter -- since this is often at one corner of the mosaic, the image will not be centered. For the Northern mosaic, the center pointing corresponds to field id 12. Note that during the final split in the calibration section that selected only the Antennae fields, the field ids were renumbered, so that the original centers (shown in the Overview) have changed: field id 14 becomes 12 for the Northern mosaic and field 18 becomes 15 for the Southern mosaic. You can also set an explicit coordinate (see the tclean help for syntax).
If you want to learn more about mosaicing, pause here and review, for example, https://science.nrao.edu/science/meetings/2016/15th-synthesis-imaging-workshop/documents/bsmMosaicking2016.pdf
Continuum Imaging
We will make 345 GHz continuum images for the two regions covered by the mosaics. We use the task clean over the channels that are free of the line emission; we avoid the edge channels which tend to be noisier due to bandpass rolloff effects. The line-free channels are found by plotting the average spectrum (all fields). We find the CO(3-2) line from channels 50 to 100 in the southern mosaic (Figure 1), and from 70 to 100 in the northern mosaic (Figure 2).
# In CASA
os.system('rm -rf Antennae_North-AMPvsCH.png')
plotms(vis='Antennae_North.cal.ms',xaxis='channel',yaxis='amp',
avgtime='1e8',avgscan=True,plotfile='Antennae_North-AMPvsCH.png', showgui = True)
# In CASA
os.system('rm -rf Antennae_South-AMPvsCH.png')
plotms(vis='Antennae_South.cal.ms',xaxis='channel',yaxis='amp',
avgtime='1e8',avgscan=True,plotfile='Antennae_South-AMPvsCH.png', showgui = True)
The avgtime is set to a large value so that it averages over all the integrations, and avgscan is set to allow averaging of the different scans.
Next we create continuum images from the line-free channels.
Northern Continuum Mosaic
For illustrative purposes we first make a dirty image to see if there is emission and what the exact beam size is. It should be on the order of 1" but this will vary a bit according to the uv-coverage in the actual data. We will start with a cell size of 0.2" to oversample the beam by a factor of 5. The imsize needs to be large enough given the cell size to comfortably encompass the mosaic. From the mosaic footprints shown in the overview, we can see that the Northern mosaic imsize needs to be about 1 arcmin. With 0.2" pixels, this requires imsize=300.
Other essential clean parameters for this case include:
- vis='Antennae_North.cal.ms' : The calibrated dataset on the science target. clean will always use the CORRECTED DATA column (if it exists).
- imagename='Antennae_North.Cont.Dirty' : The base name of the output images:
- <imagename>.image # the final restored image
- <imagename>.pb # the primary beam response
- <imagename>.image.pbcor # the primary beam-corrected image (if pbcor=True)
- <imagename>.weight # the primary beam coverage (gridder=’mosaic’ or 'awproject' only)
- <imagename>.model # the model image
- <imagename>.residual # the residual image
- <imagename>.psf # the synthesized (dirty) beam
- spw='0:1~50;120~164' : To specify only the line-free channels of spectral window 0.
- specmode='mfs' : Multi-Frequency Synthesis: The default mode, which produces one image from all the specified data combined. This will grid each channel independently before imaging. For wide bandwidths this will give a far superior result compared to averaging the channels and then imaging.
- restfreq='345.79599GHz' : The rest frequency of CO(3-2) can be found with splatalogue.
- niter=0: Maximum number of tclean iterations. (niter=0 will do no cleaning)
# In CASA
os.system('rm -rf Antennae_North.Cont.Dirty*')
tclean(vis='Antennae_North.cal.ms',imagename='Antennae_North.Cont.Dirty',
field='',phasecenter=12,
specmode='mfs',
deconvolver='hogbom',
restfreq='345.79599GHz',
spw='0:1~50;120~164',
gridder='mosaic',
imsize=300,cell='0.2arcsec',
interactive=False,niter=0)
The reported beam size is about 1.23" x 0.72", with a position angle (P.A.) of 85.4 degrees.
# In CASA
viewer('Antennae_North.Cont.Dirty.image')
Yes, there is definitely a detection in the vicinity of the Northern nucleus (see Figure 5 and Figure 6 below). Using the square region icon, and drawing a box near but not including the emission, we find the rms noise is about 0.5 mJy/beam in the dirty image.
Next we switch to refined values of cell='0.13arcsec' and imsize=500 based on the observed beam size. We also switch to interactive mode so that you can create a clean mask using the polygon tool (note you need to double click inside the polygon region to activate the mask). We have included an example mask to use in Antennae_Band7_CalibratedData.tgz. If you would like to use your own mask, make sure to removed the mask file before running the command below. Otherwise, you can edit the mask within the clean GUI. See TWHya casaguide for a more complete description of interactive clean and mask creation.
- niter=1000: Maximum number of clean iterations -- we will stop interactively
- threshold='0.4mJy' : Stop cleaning if the maximum residual is below this value (the dirty rms noise)
- interactive=True: Clean will be periodically interrupted to show the residual clean image. Interactive clean mask can be made. If no mask is created, no cleaning is done.
# In CASA
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']:
rmtables('Antennae_North.Cont.Clean'+ext)
tclean(vis='Antennae_North.cal.ms',imagename='Antennae_North.Cont.Clean',
field='',phasecenter=12,
deconvolver='hogbom',
specmode='mfs',restfreq='345.79599GHz',
spw='0:1~50;120~164',
gridder='mosaic',
imsize=500,cell='0.13arcsec',
interactive=True,
niter=1000, threshold='0.4mJy')
The residuals are "noise-like" after only ~30 iterations (see Figure 3), so hit the red X symbol in the interactive window to stop cleaning here.
Note that if you run the tclean task again with the same imagename, without deleting the existing <imagename>.* files, tclean assumes that you want to continue cleaning the existing images. We put an rm command before the tclean command to guard against this, but sometimes this is what you want.
Southern Continuum Mosaic
For the southern mosaic we modify the phasecenter, mosaic imsize, and the line-free channels (spw) to be consistent for this mosaic. We also bypass the dirty image step we did above for the Northern mosaic. As above, the mosaic size can be judged from the Overview. We expect the beam to be about the same and use the same cell size. Again, you can use the provided mask or make your own.
# In CASA
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']:
rmtables('Antennae_South.Cont.Clean'+ext)
tclean(vis='Antennae_South.cal.ms',imagename='Antennae_South.Cont.Clean',
field='',phasecenter=15,
specmode='mfs',restfreq='345.79599GHz',
spw='0:1~30;120~164',
gridder='mosaic',deconvolver='hogbom',
imsize=750,cell='0.13arcsec',
interactive=True,
niter=1000, threshold='0.4mJy')
The beam size reported in the logger for the Southern mosaic: 1.13"x 0.67", and P.A.= 61 deg; which is a little better than the beam for the North owing to better uv-coverage.
Stop after ~50 iterations (Figure 4).
Image Statistics
You can determine statistics for the images using the task imstat:
# In CASA
imstat('Antennae_North.Cont.Clean.image')
imstat('Antennae_South.Cont.Clean.image')
From this we find, that for the Northern continuum image the peak is 3.77 mJy/beam and the rms is 0.49 mJy/beam. For the Southern continuum we find a peak of 4.74 mJy/beam and an rms of 0.41 mJy/beam.
However, the calculation of the rms comes with a couple of caveats. First, the mosaic primary beam response rolls off toward the edges of the mosaic, as do correspondingly the flux density and rms. Thus if you don't restrict the measurement to areas of full sensitivity, the apparent rms is skewed downward. Second, since there is real emission in the image, the rms will be skewed upward (with the error increasing with brighter emission). Both can be solved by picking boxes that exclude the edges of the mosaic and the real emission.
It is often easier to use either the viewer directly or imview (a task wrapper for the viewer; see help imview for more info) to display the image and then interactively use the region tools to get the statistics.
# In CASA
viewer('Antennae_North.Cont.Clean.image')
Adjust colorscale using the middle mouse button (or reassign to a different mouse button by clicking on "plus" symbol icon). Next, select the polygon tool by clicking on its symbol with a mouse button. Then draw a region that avoids edges and emission (Figure 5), then double click inside the polygon to have the statistic printed to the screen. You may measure an rms that differs by a few percent from the value reported by imstat.
exit
# In CASA
viewer('Antennae_South.Cont.Clean.image')
Again, you may measure an rms slightly different than what we got from using imstat with no constraints.
How does this compare to theory? You can find out using the ALMA sensitivity calculator. The continuum bandwidth of the Northern mosaic is about 1 GHz and about 0.85 GHz for the Southern mosaic. The number of antennas is about 12 and the time on a single pointing is about 300s. This yields an expected rms of about 1 mJy/beam. However, this needs to be decreased by about a factor of 2.5 near the center of the mosaic due to the hexagonal Nyquist sampling of the mosaic (radial spacing~0.37*HPBW) for a theoretical rms of about 0.4 mJy/beam, in good agreement with observation.
Next make hardcopy plots of the continuum images using imview. To make the contrast a bit better, set the data range from -1 x sigma to the peak determined above.
# In CASA
imview(raster={'file': 'Antennae_North.Cont.Clean.image',
'colorwedge':True,'range':[-0.00049,0.00377]},
zoom=1, out='Antennae_North.Cont.Clean.image.png')
imview(raster={'file': 'Antennae_South.Cont.Clean.image',
'colorwedge':True,'range':[-0.00041,0.00474]},
zoom=1, out='Antennae_South.Cont.Clean.image.png')
Continuum subtraction
In these data, the continuum emission is too weak to contaminate the line emission (i.e. the peak continuum emission is less than the rms noise in the spectral line channels). Nevertheless, for illustrative purposes we demonstrate how to subtract the continuum emission in the uv-domain using the task uvcontsub.
# In CASA
uvcontsub(vis='Antennae_North.cal.ms',fitspw='0:1~50;120~164',fitorder = 1)
# In CASA
uvcontsub(vis='Antennae_South.cal.ms',fitspw='0:1~30;120~164',fitorder = 1)
Here, fitspw gives the line-free channels for each mosaic and fitorder=1. Higher order fits are not recommended. If you do not have line-free channels on both sides of the line fitorder=0 is recommended. The output MS will have .contsub appended to the name.
In CASA 5.1, you will see a warning that uvcontsub is using the original Visibility Iterator, which is the underlying iteration and retrieval mechanism used when processing visibility data. A new version of the Visibility Iterator has been developed and deployed in several other calibration tasks in CASA 5.0 and later (see CASA eNews for more information). We can ignore this warning.
WARN calibrater Forcing use of OLD VisibilityIterator.
CO(3-2) Imaging
Now we are ready to make cubes of the line emission. The imaging parameters are similar to the continuum except for
those dealing with the spectral setup: specmode, start, width, nchan, restfreq, and outframe parameters.
When making spectral images you have three choices for the specmode parameter: mfs, cube, and cubedata.
As noted above, setting specmode='mfs' gives an output image with only one channel, and is used for continuum imaging. The other specmode options create output data cubes with one or more channels.
Data are taken using constant frequency channels. For spectral line analysis it's often more useful to have constant velocity channels, and this is also the best way to make images of multiple lines with the exact same channelization for later comparison. For specmode='cube', the desired start and width also need to be given in velocity units for the desired output frame.
It is important to note that ALMA does not do on-line Doppler Tracking and the native frame of the data is TOPO. If you do not specify outframe the output cube will also be in TOPO, which is not very useful for scientific analysis. The Doppler Shift is taken out during the regridding to the desired outframe in tclean or alternatively it can be done separately by the cvel task which would need to be run before tclean.
To see what velocity parameters you want to set in tclean, it is useful to make a plot in plotms in the desired output frame. Note these plots take a little longer because of the frame shift. In order to compare with recent SMA data, we chose LSRK, but it should be noted that many papers of this source are in the BARY frame.
# In CASA
os.system('rm -rf North_CO3_2_vel.png')
plotms(vis='Antennae_North.cal.ms.contsub/',xaxis='velocity',yaxis='amp',
avgtime='1e8',avgscan=True,transform=True,freqframe='LSRK',
restfreq='345.79599GHz',plotfile='North_CO3_2_vel.png', showgui = True)
# In CASA
os.system('rm -rf South_CO3_2_vel.png')
plotms(vis='Antennae_South.cal.ms.contsub',xaxis='velocity',yaxis='amp',
avgtime='1e8',avgscan=True,transform=True,freqframe='LSRK',
restfreq='345.79599GHz',plotfile='South_CO3_2_vel.png', showgui = True)
Northern Mosaic
As before, it is very important that you make a clean mask. There are many ways to do this ranging from the complicated to simple. For this example we provide a single clean mask that encompasses the line emission in every channel and apply it to all channels. This is much better than no clean mask, though not quite as good as making an individual mask for each channel. You can choose to use and edit the provided mask or create your own mask.
Notable parameters included in the tclean call are:
- specmode='cube' ,outframe='LSRK' ,restfreq='345.79599GHz' . We use 'cube' mode to create an output data cube. We set the velocity information in the Local Standard of Rest frame (kinematic definition), and use the rest frequency of the CO(3-2) line.
- nchan=60,start='1300km/s' ,width='10km/s' : To produce a data cube with 60 channels ("nchan"=60), starting at 1300km/s and with velocity widths of 10 km/s. That will include all the CO(3-2) emission in both mosaics.
- imsize=500,cell='0.13arcsec' : An image size of 65 arcsec, with pixels of 0.13 arcsec (about one-fifth the minor axis of the synthesized beam). We make the imsize larger than the mosaic to increase the dirty beam image size, as the emission is quite extended along the mosaic.
- weighting='briggs' ,robust=0.5: Weighting to apply to visibilities. We use Briggs' weighting and robustness parameter 0.5 (in between natural and uniform weighting).
- niter=20000: Maximum number of clean iterations. With complex emission structure like that found in the Antennae CO data, we will need a large number of iterations to clean the emission. Note that you can increase the number of iterations allowed on-the-fly in the interactive tclean window.
- threshold='5.0mJy' : Stop cleaning if the maximum residual is below this value.
The threshold is set to roughly the rms of a single line-free channel for each dataset.
- savemodel='modelcolumn': This saves the clean model to the ms file. We will need this for self-calibration later.
# In CASA
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']:
rmtables('Antennae_North.CO3_2Line.Clean'+ext)
tclean(vis='Antennae_North.cal.ms.contsub',
imagename='Antennae_North.CO3_2Line.Clean',
spw='0',field='',phasecenter=12,
specmode='cube',outframe='LSRK',restfreq='345.79599GHz',
nchan=70,start='1200km/s',width='10km/s',
gridder='mosaic',
deconvolver='hogbom',
imsize=500,cell='0.13arcsec',pblimit=0.2,
restoringbeam='common',
interactive=True,
weighting='briggs',robust=0.5,
niter=20000, threshold='5.0mJy',
savemodel='modelcolumn')
Figure 10 shows what the final clean box should look like. Cycle through the channels until you reach ~1650 km/s, where you can more easily see where to draw the clean box around the CO emission. Be sure the check the circle next to 'All Channels' when making your clean mask. Now clean using the green circle arrow. You can watch the progress in the logger. When the first ~650 iterations are done, the viewer will show the residual map for each channel. Cycle through the channels and see whether you are still happy with the clean box in each channel with significant signal. The "erase button" can help you fix mistakes. If necessary adjust. It is often useful to adjust the colorscale with the "plus" symbol icon. To make it go a bit faster, you can increase iteration interactively, to 200 or 300, but don't overdo it.
These data are pretty severely dynamic range limited, in part due to the sparse uv coverage. In other words, the noise in bright channels is set by a maximum signal-to-noise. This effectively prevents us from stopping clean based on an rms based threshold because the effective rms changes as a function of the brightest signal in each channel. Thus, in this case we need to stop clean interactively. Below an approximate number of iterations is given to help you decide when to quit. NOTE: the threshold that is set in the CO(3-2) clean commands are about equal to the noise in a line-free channel and is only there to prevent clean running forever if you fail to stop it. You are not intended to clean to this threshold.
Also, we are going to self-calibrate the data so it's best to be conservative here - it can be difficult in images like these to discern real features from artifacts. If in doubt, don't include it in the clean mask. Keep cleaning and see if the feature becomes weaker. You cannot lose real emission by not masking it, but you can create a brighter feature by masking an artifact.
Stop cleaning after about ~7000 iterations (Red X), when the artifacts start to look as bright as the residual. Note again that we are not cleaning to the theoretical noise level.
Inspect the resulting data cube:
# In CASA
viewer('Antennae_North.CO3_2Line.Clean.image')
Southern Mosaic
Repeat process for Southern mosaic.
# In CASA
for ext in ['.image','.model','.image.pbcor','.psf','.residual','.pb','.sumwt','.weight']:
rmtables('ntennae_South.CO3_2Line.Clean'+ext)
tclean(vis='Antennae_South.cal.ms.contsub',
imagename='Antennae_South.CO3_2Line.Clean',
spw='0',field='',phasecenter=15,
specmode='cube',outframe='LSRK',restfreq='345.79599GHz',
nchan=70,start='1200km/s',width='10km/s',
gridder='mosaic',deconvolver='hogbom',
imsize=750,cell='0.13arcsec',pblimit=0.2,
restoringbeam='common',
interactive=True,
weighting='briggs',robust=0.5,
niter=20000, threshold='5.0mJy',
savemodel='modelcolumn')
Clean about 8,000 iterations before stopping.
Inspect the resulting data cube:
# In CASA
viewer('Antennae_South.CO3_2Line.Clean.image')
For each mosaic use the viewer polygon tool as described above for the continuum, to find the image statistics in both a line-free channel and the channel with the strongest emission.
The line-free channel rms for the northern and southern mosaics are about 4.0 mJy/beam and 3.5 mJy/beam, respectively. However in a bright channel this degrades to about 18 mJy/beam and 9 mJy/beam, respectively. This is the aforementioned dynamic range limit.
Using the ALMA sensitivity calculator, a bandwidth of 10 km/s, dual polarization, 12 antennas, and the time on a single pointing of about 300s yields an rms of about 9.0 mJy/beam. As described above the Nyquist sampled hexagonal mosaic improves this by a factor of about 2.5 for an expected rms noise of about 3.6 mJy. So in line-free channels we are doing close to theoretical.
Self Calibration
Next we attempt to self-calibrate the uv-data. The process of self-calibration tries to adjust the data to better match the model image that you give it. When clean is run, it automatically saves a uv-model of the resulting image in the header of the measurement set. This model can be used to self-calibrate the data using gaincal. That is why it is important to make the model as good as you can by making clean masks.
Mosaics can be tricky to self-calibrate. The reason is that typically only a few of the pointings may have strong emission. The stronger the signal, the stronger the signal-to-noise will be for a given self-calibration solution interval (solint). This means that typically only a few fields are strong enough for self-calibration, though it can still bring about overall improvement to apply these solutions to all fields. The fine tuning of each field in the mosaic over small solutions intervals is often impossible. Indeed fine-tuning only a few fields in the mosaic on small time scales can result in a mosaic with dramatically different noise levels as a function of position. Below, we will simply attempt to self-calibrate on the strongest field in the mosaic, obtaining one average solution per original input dataset.
Here, the continuum is far too weak so we will use the CO(3-2) line emission. To increase signal-to-noise it is often helpful to limit solutions to the range of channels containing the strongest line emission.
We will also use gaintype='T' to tell CASA to average the polarizations before deriving solutions which gains us a sqrt(2) in sensitivity.
Northern Mosaic
The strongest emission in the Northern mosaic comes from the center pointing, already identified above as field='12' . Below we make a uv-plot of the spectral line emission from this field to chose only the strongest channels to include in the self-calibration. It is essential that the self-calibration channel range be chosen based on the UV data and not on the image cube. This is because the channels in the image cube were modified by the velocity/channel specifications in the first invocation of clean. This plot shows the channel range of the uv data.
# In CASA
plotms(vis='Antennae_North.cal.ms.contsub',spw='',xaxis='channel',yaxis='amp',field='12',
avgtime='1e8',avgscan=True,ydatacolumn='data',plotfile='North_selfchan_data.png', showgui = True)
We also want to check the channel amplitudes in the model column of the measurement set. The depth of the initial clean will determine what model channels have emission. (A very shallow clean could potentially produce a model with emission over a small range of channels.) Self calibration will attempt to make the data look like the model. Therefore, it is important that we select a channel range where the model is realistic.
You will notice that while the model looks reasonable across the channels where we imaged the data, the model amplitudes are set to 1 elsewhere. When tclean initializes a model, it defaults to an amplitude of 1 and phase 0 (i.e., a point source with an amplitude of 1 in the center of the image). When we set savemodel = 'modelcolumn' in the tclean call, the default model was replaced 'only where tclean had a model to replace it with', namely, over the channels we imaged. In future, CASA will set a flag to let users know that these model points are not valid for the updated model. In our case, we will perform self-calibration only on those channels with significant signal in the line emission, omitting the rest of the channels.
# In CASA
plotms(vis='Antennae_North.cal.ms.contsub',spw='',xaxis='channel',yaxis='amp',field='12',
avgtime='1e8',avgscan=True,ydatacolumn='model',plotfile='North_selfchan_model.png', showgui = True)
Next remind ourselves of the timing of the various observations.
# In CASA
plotms(vis='Antennae_North.cal.ms.contsub',spw='',xaxis='time',yaxis='amp',field='12',
avgchannel='167',coloraxis='scan',ydatacolumn='data', showgui = True)
Zooming in on each dataset we see that they are about 1 hour long (you can also check the listobs output), and that each dataset has 2 or 3 observations of field 12. Each time, it's observed for about 25 seconds. We set solint='3600s' to get one solution per dataset.
# In CASA
gaincal(vis='Antennae_North.cal.ms.contsub',caltable='north_self_1.pcal',
solint='3600s',combine='scan',gaintype='T',field='12',
refant='DV09',spw='0:82~89',minblperant=4,
calmode='p',minsnr=2)
Plot the calibration solutions.
# In CASA
plotcal(caltable='north_self_1.pcal',xaxis='time',yaxis='phase',
spw='',field='',antenna='',
iteration='antenna',subplot=531,plotrange=[0,0,-80,80],
figfile='north_pcal1_phase.png', showgui = True)
Apply the solutions to all fields and channels with applycal, which will overwrite the corrected data column:
# In CASA
applycal(vis='Antennae_North.cal.ms.contsub',field='',
gaintable=['north_self_1.pcal'],calwt=False)
Re-image the data with the selfcal applied. Remember that tclean always uses the corrected data column if it exists:
# In CASA
os.system('rm -rf Antennae_North.CO3_2Line.Clean.pcal1*')
tclean(vis='Antennae_North.cal.ms.contsub',
imagename='Antennae_North.CO3_2Line.Clean.pcal1',
spw='0',field='',phasecenter=12,
specmode='cube',outframe='LSRK',restfreq='345.79599GHz',
nchan=70,start='1200km/s',width='10km/s',
gridder='mosaic',deconvolver='hogbom',
imsize=500,cell='0.13arcsec',pblimit=0.2,
restoringbeam='common',
interactive=True,mask='Antennae_North.CO3_2Line.Clean.mask',
weighting='briggs',robust=0.5,
niter=20000, threshold='5.0mJy',
savemodel='modelcolumn')
After 3000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask. Remember to select the "all channels" toggle. Stop after 9,000 or so iterations.
Compare the un-selfcal'ed and selfcal'ed data to determine if there has been improvement.
# In CASA
imview(raster=[{'file': 'Antennae_North.CO3_2Line.Clean.image',
'range': [-0.07,0.4]},
{'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image',
'range': [-0.07,0.4]}])
Then in the viewer, activate the Animator Images sub-panel by clicking the check box next to "Images". Then use the tape deck controls to cycle between the two images. To change the channel use the Channels sub-panel in the Animator.
To make the figure shown in Figure 16, cycle to channel 43. Then you can select the "p wrench" icon and change the number of panels in x to 2. You will need to drag your viewer window rather wide to get both panels to fit well. If you want to compare other channels, you can use the tapedeck to move to the new channel of interest and see the changes in both cubes.
To compare the statistics for each image, click the "Next" button in the "Statistics" tab of the "Region" sub-panel.
What you should notice is that the peak flux density has increased substantially while the rms noise is about the same. This is reasonable for this self-calibration case because we have mostly adjusted relative position offsets between the datasets and not taken out any short-term phase variations which would reduce the rms.
Note that attempts to push the selfcal to shorter solint (for example to each scan of field=12) did not yield additional improvement.
Southern Mosaic
Now repeat the self-calibration process for the Southern mosaic. It is a bit tougher in this case to pick the best field. The most compact bright emission is toward field id 11 in the Overview. Adjusting for the renumbering of field ids after the final calibration split, this becomes field='7'.
From the following plots we can assess the brightest channels to pick and see that the timing in the 6 Southern datasets is similar to the North, with each lasting about 1 hour.
# In CASA
plotms(vis='Antennae_South.cal.ms.contsub',spw='',xaxis='channel',yaxis='amp',
field='7',avgtime='1e8',avgscan=True,ydatacolumn='data',
plotfile='South_selfchan_data.png', showgui = True)
plotms(vis='Antennae_South.cal.ms.contsub',spw='',xaxis='channel',yaxis='amp',
field='7',avgtime='1e8',avgscan=True,ydatacolumn='model',
plotfile='South_selfchan_model.png', showgui = True)
# In CASA
plotms(vis='Antennae_South.cal.ms.contsub',spw='',xaxis='time',yaxis='amp',field='7',
avgchannel='167',avgscan=True,coloraxis='scan',ydatacolumn='data', showgui = True)
# In CASA
gaincal(vis='Antennae_South.cal.ms.contsub',caltable='south_self_1.pcal',
solint='3600s',combine='scan',gaintype='T',field='7',
refant='DV09',spw='0:70~85',minblperant=4,
calmode='p',minsnr=2)
# In CASA
plotcal(caltable='south_self_1.pcal',xaxis='time',yaxis='phase',
spw='',field='',antenna='',
iteration='antenna',subplot=531,plotrange=[0,0,-80,80],
figfile='south_pcal1_phase.png', showgui = True)
# In CASA
applycal(vis='Antennae_South.cal.ms.contsub',field='',
gaintable=['south_self_1.pcal'],calwt=False)
# In CASA
os.system('rm -rf Antennae_South.CO3_2Line.Clean.pcal1*')
tclean(vis='Antennae_South.cal.ms.contsub',
imagename='Antennae_South.CO3_2Line.Clean.pcal1',
spw='0',field='',phasecenter=15,
specmode='cube',outframe='LSRK',restfreq='345.79599GHz',
nchan=70,start='1200km/s',width='10km/s',
gridder='mosaic',deconvolver='hogbom',
imsize=750,cell='0.13arcsec',pblimit=0.2,
restoringbeam='common',
interactive=True,mask='Antennae_South.CO3_2Line.Clean.mask',
weighting='briggs',robust=0.5,
niter=40000, threshold='5.0mJy',
savemodel='modelcolumn')
After 4000 iterations or so, inspect each channel to see if there is more emission that needs to be included in the mask. Stop after 25,000 or so iterations.
As for the Northern mosaic, you can compare the before and after self-cal images (look, for example, at channel 31):
# In CASA
imview(raster=[{'file': 'Antennae_South.CO3_2Line.Clean.image',
'range': [-0.05,0.2]},
{'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image',
'range': [-0.05,0.2]}])
Image Analysis
Moment Maps
Next we will make moment maps for the CO(3-2) emission: Moment 0 is the integrated intensity; Moment 1 is the intensity weighted velocity field; and Moment 2 is the intensity weighted velocity dispersion.
Above we determined the rms noise levels for both the North and South mosaics in both a line-free and a line-bright channel. We want to limit the channel range of the moment calculations to those channels with significant emission. One good way to do this is to open the cube in the viewer overlaid with 3-sigma contours, with sigma corresponding to the line-free rms.
# In CASA
imview(raster={'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image',
'range': [-0.04,0.4]},
contour={'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image',
'levels': [0.004],'unit': 5})
We find a channel range for significant emission of 33~63.
# In CASA
imview(raster={'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image',
'range': [-0.04,0.4]},
contour={'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image',
'levels': [0.0035],'unit': 5})
We find a channel range for significant emission of 12~64.
For moment 0 (integrated intensity) maps you do not typically want to set a flux threshold because this will tend to noise bias your integrated intensity.
# In CASA
immoments('Antennae_North.CO3_2Line.Clean.pcal1.image',
moments=[0],chans='33~63',
outfile='Antennae_North.CO3_2Line.Clean.pcal1.image.mom0')
# In CASA
immoments('Antennae_South.CO3_2Line.Clean.pcal1.image',
moments=[0], chans='12~64',
outfile='Antennae_South.CO3_2Line.Clean.pcal1.image.mom0')
For higher order moments it is very important to set a conservative flux threshold. Typically something like 3sigma, using sigma from a bright line channel works well. We do this with the mask parameter in the commands below. When making multiple moments, immoments appends the appropriate file name suffix to the value of outfile.
# In CASA
immoments('Antennae_North.CO3_2Line.Clean.pcal1.image',
moments=[1,2], chans='33~63',
mask='Antennae_North.CO3_2Line.Clean.pcal1.image>0.018*3',
outfile='Antennae_North.CO3_2Line.Clean.pcal1.image.mom')
# In CASA
immoments('Antennae_South.CO3_2Line.Clean.pcal1.image',
moments=[1,2], chans='12~64',
mask=' Antennae_South.CO3_2Line.Clean.pcal1.image>0.009*3',
outfile='Antennae_South.CO3_2Line.Clean.pcal1.image.mom')
Next we can create the six moment maps (Figures 22, 23, 24, 25, 26, and 27) from these images using imview.
# In CASA
os.system('rm -f Antennae_North.CO3_2Line.Clean.pcal1.image.mom0.png')
imview(raster={'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image.mom0',
'colorwedge':True,'scaling': -0.5},
zoom=1,out='Antennae_North.CO3_2Line.Clean.pcal1.image.mom0.png')
os.system('rm -f Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png')
imview(raster={'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord',
'colorwedge':True},
zoom=1,out='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png')
os.system('rm -f Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png')
imview(raster={'file': 'Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord',
'colorwedge':True},
zoom=1,out='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png')
os.system('rm -f Antennae_South.CO3_2Line.Clean.pcal1.image.mom0.png')
imview(raster={'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image.mom0',
'colorwedge':True,'scaling': -0.5},
zoom=1,out='Antennae_South.CO3_2Line.Clean.pcal1.image.mom0.png')
os.system('rm -f Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png')
imview(raster={'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord',
'colorwedge':True},
zoom=1,out='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.png')
os.system('rm -f Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png')
imview(raster={'file': 'Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord',
'colorwedge':True},
zoom=1,out='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.png')
Exporting Images to Fits
If you want to analyze the data using another software package it is easy to convert from CASA format to FITS.
# In CASA
exportfits(imagename='Antennae_North.Cont.Clean.image',
fitsimage='Antennae_North.Cont.Clean.image.fits')
exportfits(imagename='Antennae_North.CO3_2Line.Clean.pcal1.image',
fitsimage='Antennae_North.CO3_2Line.Clean.pcal1.image.fits')
exportfits(imagename='Antennae_North.CO3_2Line.Clean.pcal1.image.mom0',
fitsimage='Antennae_North.CO3_2Line.Clean.pcal1.image.mom0.fits')
exportfits(imagename='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord',
fitsimage='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.fits')
exportfits(imagename='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord',
fitsimage='Antennae_North.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.fits')
# In CASA
exportfits(imagename='Antennae_South.Cont.Clean.image',
fitsimage='Antennae_South.Cont.Clean.image.fits')
exportfits(imagename='Antennae_South.CO3_2Line.Clean.pcal1.image',
fitsimage='Antennae_South.CO3_2Line.Clean.pcal1.image.fits')
exportfits(imagename='Antennae_South.CO3_2Line.Clean.pcal1.image.mom0',
fitsimage='Antennae_South.CO3_2Line.Clean.pcal1.image.mom0.fits')
exportfits(imagename='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord',
fitsimage='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_coord.fits')
exportfits(imagename='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord',
fitsimage='Antennae_South.CO3_2Line.Clean.pcal1.image.mom.weighted_dispersion_coord.fits')
Although "FITS format" is supposed to be a standard, in fact most packages expect slightly different things from a FITS image. If you are having difficulty, try setting velocity=True and/or dropstokes=True.
Comparison with previous SMA CO(3-2) data
We compare with SMA CO(3-2) data (Ueda, Iono, Petitpas et al. 2012, ApJ, 745, 65). Figure 28 shows a comparison plot between the moment 0 maps of ALMA and SMA data using the viewer. The fluxes, peak locations, and large scale structure are consistent. Both southern and northern components have been combined.
Last checked on CASA Version 5.1.1.