NGC3256Band3Imaging: Difference between revisions

From CASA Guides
Jump to navigationJump to search
(Created page with "== Continuum image of the galaxy== Now that we have a fully calibrated data set, we do no longer need the calibrator data and hence we create a new measurement set that only con...")
 
(Blanked the page)
 
Line 1: Line 1:
== Continuum image of the galaxy==


Now that we have a fully calibrated data set, we do no longer need the calibrator data and hence we create a new measurement set that only contains the science target NGC 3256. We run {{split}} with field='NGC*' to create ngc3256_line_target.ms:
<source lang="python">
# In CASA
os.system('rm -rf ngc3256_line_target.ms*')
split(vis='ngc3256_line.ms', outputvis='ngc3256_line_target.ms',
field='NGC*')
</source>
We make a continuum image of the galaxy using {{clean}}. Most parameters are equal to our previous clean runs, but this time we are careful to select only the channels that are free from CO and CN line emission. We select a mask that just includes the extent of the continuum emission. Here, we use the default non-interactive mode, but if you want to define the clean boxes more carefully, specify interactive=True. In that case, the {{clean}} task will bring up a viewer where the clean region can be defined, either by selecting boxes or by selecting polygon regions.
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256.cont*')
clean( vis='ngc3256_line_target.ms', imagename='result-ngc3256_cont',
spw='0:20~53;71~120,1:70~120,2:20~120,3:20~120',
mode='mfs', niter=500, mask=[118,119,147,138],
imsize=256, cell='1arcsec', weighting='briggs', robust=0.0)
</source>
[[File:Ngc3256_cont.png|200px|thumb|right|Continuum image of NGC3256]]
Again, we determine some statistics of the image:
<source lang="python">
# In CASA
calstat=imstat(imagename='result-ngc3256_cont.image', region='', box='160,50,210,210')
rms=(calstat['rms'][0])
print '>> rms in continuum image: '+str(rms)
calstat=imstat(imagename='result-ngc3256_cont.image', region='')
peak=(calstat['max'][0])
print '>> Peak in continuum image: '+str(peak)
print '>> Dynamic range in continuum image: '+str(peak/rms)
</source>
This tells us that the peak flux density of the image is ~7 mJy and the dynamic range is approximately 34. For future reference, we create a png file of the continuum image:
<source lang="python">
# In CASA
imview(raster={'file': 'result-ngc3256_cont.image', 'colorwedge':T,
        'range':[-0.0003, 0.005], 'scaling':-1, 'colormap':'Rainbow 2'},
        out='result-ngc3256_cont.png', zoom=2)
</source>
The continuum flux is fairly low in this galaxy, but given the large bandwidth of ALMA, we have sufficient signal-to-noise to attempt to self-calibrate the data. We will therefore do some phase-only self-calibration of the image.  We do this by deriving gain corrections with {{gaincal}}, which will compare the data column with the model column, which has been filled with the clean components from the recent run of {{clean}}. We use a solution interval of 15 minutes as we found that this gives just sufficient signal to noise per antenna.
<source lang="python">
# In CASA
gaincal(vis='ngc3256_line_target.ms', field='NGC*',
    caltable='cal-ngc3256_cont_900.Gp',
    spw='0:20~53;71~120,1:70~120,2:20~120,3:20~120',
    solint='900s', refant='DV04', calmode='p',
    minblperant=3)
</source>
*caltable='cal-ngc3256_cont_900.Gp': The name of the output calibration table
*spw='0:20~53;71~120,1:70~120,2:20~120,3:20~120': To select only the continuum channels
*solint='900s': To specify a 15-minute solution interval
*refant='DV04': Our reference antenna
*calmode='p': To select phase-only solutions
*minblperant=3: To set the minimum number of baselines to other antennas that must be present for a given antenna to have a solution
We then examine the derived phase solutions using {{plotcal}}:
[[File:Ngc3256_selfcal_phase.png|200px|thumb|right|Phases of self-cal solutions for NGC3256 (only the first day is shown)]]
<source lang="python">
# In CASA
plotcal(caltable = 'cal-ngc3256_cont_900.Gp', xaxis = 'time', yaxis =
'phase', poln='X', plotsymbol='o', plotrange = [0,0,-180,180],
iteration = 'spw', figfile='cal-phase_vs_time_XX_900_Gp.png',
subplot = 221)
plotcal(caltable = 'cal-ngc3256_cont_900.Gp', xaxis = 'time', yaxis =
'phase', poln='Y', plotsymbol='o', plotrange = [0,0,-180,180],
iteration = 'spw', figfile='cal-phase_vs_time_YY_900_Gp.png',
subplot = 221)
</source>
The phase-only self-cal solutions look good, so we will apply them to the data with {{applycal}}.  This will overwrite the data in the corrected_data column.
<source lang="python">
# In CASA
applycal(vis='ngc3256_line_target.ms', interp='nearest',
gaintable=['cal-ngc3256_cont_900.Gp'])
</source>
We then make another continuum map from the newly-corrected data, using the same clean parameters as before.
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256.cont_sc1*')
clean( vis='ngc3256_line_target.ms', imagename='result-ngc3256_cont_sc1',
spw='0:20~53;71~120,1:70~120,2:20~120,3:20~120',
mode='mfs', niter=500, mask=[118,119,147,138],
        imsize=256, cell='1arcsec', weighting='briggs', robust=0.0)
</source>
[[File:Ngc3256_cont_sc1.png|200px|thumb|right|Continuum image of NGC 3256 after self-calibration]]
and again generate some statistics:
<source lang="python">
# In CASA
calstat=imstat(imagename='result-ngc3256_cont_sc1.image', region='', box='160,50,210,210')
rms=(calstat['rms'][0])
print '>> rms in continuum image: '+str(rms)
calstat=imstat(imagename='result-ngc3256_cont_sc1.image', region='')
peak=(calstat['max'][0])
print '>> Peak in continuum image: '+str(peak)
print '>> Dynamic range in continuum image: '+str(peak/rms)
</source>
The continuum image has improved a lot. The dynamic range is now ~110, whereas before it was only 34.  The image peak flux density is ~9 mJy.  We will write this new image to the file 'result-ngc3256_cont_sc1.image' to indicate that an iteration of self-calibration was performed.
<source lang="python">
# In CASA
imview(raster={'file': 'result-ngc3256_cont_sc1.image', 'colorwedge':T,
        'range':[-0.0003, 0.007], 'scaling':-1, 'colormap':'Rainbow 2'},
        out='result-ngc3256_cont_sc1.png', zoom=2)
</source>
== Line cubes of the galaxy==
We will start by running {{split}} to apply the latest self-calibration tables to the data column of the output measurement set. 
<source lang="python">
# In CASA
os.system('rm -rf ngc3256_line_target_sc.ms*')
split(vis='ngc3256_line_target.ms', outputvis='ngc3256_line_target_sc.ms')
</source>
We will then subtract the continuum using the task {{uvcontsub}}:
<source lang="python">
# In CASA
uvcontsub(vis = 'ngc3256_line_target_sc.ms',
  fitspw='0:20~53;71~120,1:70~120,2:20~120,3:20~120', solint ='inf',
  fitorder = 1, fitmode = 'subtract')
</source>
*fitspw='0:20~53;71~120,1:70~120,2:20~120,3:20~120': To specify the spectral windows and channels to be used in the fit for the continuum. We avoid the spectral regions that include the CO and CN emission lines.
*solint ='inf': Timescale for the fit.  Here we are electing one fit per scan 
*fitorder = 1: We will fit a first-order polynomial to the continuum
*fitmode = 'subtract': Subtract the continuum from the data and store the result in the corrected_data column
Next, we will {{clean}} the CO (1-0) line emission:
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_line_CO.*')
clean(vis='ngc3256_line_target_sc.ms', imagename='result-ngc3256_line_CO',
spw='0:48~78', mode='channel', start='', nchan=31, width='',
outframe='LSRK', restfreq='115.271201800GHz', mask=[53,50,87,83],
        niter=500, interactive=T, imsize=128, cell='1arcsec',
        weighting='briggs', robust=0.0)
</source>
[[File:interactive_clean_channel.png|200px|thumb|right|One of the channels in the interactive clean, showing CO emission. The white region indicates the clean mask]]
Notable parameters include:
*spw='0:48~78': To specify the CO (1-0) line emission alone
*mode='channel': To produce an image with different planes specified by the "start", "nchan", and "width" parameters
*start='', nchan=31, width='',: To include all 31 channels specified by spw, with no channel averaging
*outframe='LSRK': Shift the output reference frame to the local standard of rest
*restfreq='115.271201800GHz': The rest frequency of the CO line
*mask=[53,50,87,83]: The region in which to fit clean components (i.e., the source)
*niter=500, interactive=T: To do interactive cleaning with the viewer GUI
Using interactive=T the viewer will open when it is ready to start an interactive clean. Step through to the channels to see how extended the emission is. Then either use  "All Channels" to define the same clean mask for all channels or select "This Channel" to select different masks for each channel. Once you have defined a polygon region, you need to double click inside it to save the mask region. You can use the "tape deck" to step through the channels again and check that the emission in all channels fits within the mask(s) you have created.
To continue with clean use the "Next action" buttons in the green area on the Viewer Display GUI: The red X will stop clean where you are, the blue arrow will stop the interactive part of clean, but continue to clean non-interactively until reaching the stopping niter or threshold (whichever comes first), and the green arrow will clean until it reaches the "iterations" parameter on the left side of the green area.
When the cleaning has finished, you may want to inspect the resulting cube and and use the tape deck to play the cube as a movie. Use Spectral Profile in the Tools tab to make an integrated spectrum of the CO(1-0) emission.
<source lang="python">
# In CASA
viewer('result-ngc3256_line_CO.image')
</source>
The rms noise level in the cube is XXX mJy per channel. The ALMA sensitivity calculator gives a noise level of XXX mJy, using 7 antennas and an integration time of 4 hours....
Next, we make the moment maps of the CO (1-0) emission using the task {{immoments}}:
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_CO1-0.mom.*')
immoments(imagename='result-ngc3256_line_CO.image', moments=[0,1],
chans='5~24', box='38,38,90,90', axis='spectral',
includepix=[0.045, 10000], outfile='result-ngc3256_CO1-0.mom')
</source>
[[File:CO_velfield.png|200px|thumb|right|The CO(1-0) velocity field of NGC3256, with contours of the total emission map overlaid]]
[[File:CO_map.png|200px|thumb|right|The CO(1-0) "moment 0" total intensity maps of NGC3256, with contours of the velocity field overlaid]]
*moments=[0,1]: To specify that we wish to make the 0th and 1st moment maps, that is, the integrated emission map and the intensity weighted velocity field
*chans='5~24': These are the channels that show line emission and therefore the ones we want to use for the moment map
*box='38,38,90,90': To select a box region around the emission so as to not include any regions away from the galaxy
*axis='spectral': Indicates the moment axis, in this case 'spectral'
*includepix=[0.045, 10000]: To select which pixel values in the cube to include in the moments. We find these values by looking for the faintest believable emission in the cube
*outfile='result-ngc3256_CO1-0.mom': The output image base name
[NEED TO SAY SOMETHING ABOUT OUTPUT]
Make images of the CO(1-0) emission
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CO1-0.mom.integrated','range': []},
      raster={'file': 'result-ngc3256_CO1-0.mom.weighted_coord','range': [2630,2920],'colorwedge':T,
      'colormap': 'Rainbow 2'}, out='result-CO_velfield.png')
</source>
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CO1-0.mom.weighted_coord','levels':
              [2650,2700,2750,2800,2850,2900],'base':0,'unit':1},
      raster={'file': 'result-ngc3256_CO1-0.mom.integrated','colorwedge':T,
      'colormap': 'Rainbow 2'}, out='result-CO_map.png')
</source>
Next, we clean the CN high line emission:
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_line_CNhi.*')
clean(vis='ngc3256_line_target_sc.ms', imagename='result-ngc3256_line_CNhi',
outframe='LSRK', spw='1:50~76', start='', nchan=27, width='',
restfreq='113.49097GHz', selectdata=T, mode='channel',
niter=500, gain=0.1, psfmode='hogbom', mask=[53,50,87,83],
interactive=True, imsize=128, cell='1arcsec',
weighting='briggs', robust=0.0)
</source>
Make the moment maps of the CN (high) emission:
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_CNhi.mom.*')
immoments( imagename='result-ngc3256_line_CNhi.image', moments=[0,1],
chans='5~18', axis='spectral',box='38,38,90,90',
includepix=[0.005, 10000], outfile='result-ngc3256_CNhi.mom')
</source>
Make images of the CN high emission:
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CNhi.mom.integrated','range': []},
      raster={'file': 'result-ngc3256_CNhi.mom.weighted_coord','range': [2630,2920],'colorwedge':T,
      'colormap': 'Rainbow 2'}, out='CNhi_velfield.png')
</source>
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CNhi.mom.weighted_coord','levels':
              [2650,2700,2750,2800,2850,2900],'base':0,'unit':1},
      raster={'file': 'result-ngc3256_CNhi.mom.integrated','colorwedge':T,
      'colormap': 'Rainbow 2'}, out='CNhi_map.png')
</source>
Clean the CN low emission:
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_line_CNlo.*')
clean( vis='ngc3256_line_target_sc.ms', imagename='result-ngc3256_line_CNlo',
outframe='LSRK', spw='1:29~54', start='', nchan=26, width='',
restfreq='113.18666GHz', selectdata=T, mode='channel',
niter=300, gain=0.1, psfmode='hogbom', mask=[53,50,87,83],
interactive=True, imsize=128, cell='1arcsec',
weighting='briggs', robust=0.0)
</source>
Make the moment maps of the CN (low) emission
<source lang="python">
# In CASA
os.system('rm -rf result-ngc3256_CNlo.mom.*')
immoments( imagename='result-ngc3256_line_CNlo.image', moments=[0,1],
chans='8~18', axis='spectral', box='38,38,90,90',
includepix=[0.003, 10000], outfile='result-ngc3256_CNlo.mom')
</source>
Make images of the CN low emission
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CNlo.mom.integrated','range': []},
      raster={'file': 'result-ngc3256_CNlo.mom.weighted_coord','range': [2630,2920],'colorwedge':T,
      'colormap': 'Rainbow 2'},
      out='result-CNlo_velfield.png')
</source>
<source lang="python">
# In CASA
imview(contour={'file': 'result-ngc3256_CNlo.mom.weighted_coord','levels':
              [2650,2700,2750,2800,2850,2900],'base':0,'unit':1},
      raster={'file': 'result-ngc3256_CNlo.mom.integrated','colorwedge':T,
      'colormap': 'Rainbow 2'},
      out='result-CNlo_map.png')
</source>

Latest revision as of 23:03, 31 May 2011