Sunspot Band6 SingleDish for CASA 6.5.4: Difference between revisions

From CASA Guides
Jump to navigationJump to search
mNo edit summary
Line 8: Line 8:


==Import the data and split into the files for each antenna==
==Import the data and split into the files for each antenna==
We assume that you already complete the calibration of the visibility data along the Sunspot Band6 Calibration for CASA 5.1, and you are working in the directory ‘Sunspot_Band6_UncalibratedData’. After starting CASA, we start by defining the directory name of the ASDM and Measurement set for the calibration.
If you completed the calibration of the visibility data following [[Sunspot_Band6_Calibration_for_CASA_6.5.4]], we assume you are working in the directory 'Sunspot_Band6_UncalibratedData'. After starting CASA, we start by defining the directory name of the ASDM and Measurement Set.


<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
sduid ='uid___A002_Xae00c5_X2e6b'
sd_asdm = 'uid___A002_Xae00c5_X2e6b'   # single dish ASDM file
sdmsd = sduid + '.ms'
sd_mso = sd_asdm + '.ms'               # measurement set original
sdmsc = sdmsd + '.split.cal'
sd_msc = sd_asdm + '.ms' + '.split.cal' # measurement set calibrated
ant='PM03'
ant = 'PM03'                           # antenna


import numpy as np
import numpy as np
</source>
</source>


In the tutorial, we will use the data obtained with the PM03 antenna.  
In this tutorial, we will use the data obtained with the PM03 antenna.  


Before we can proceed to the calibration, we will need to convert those data to the CASA MS format. This is done simply with the task {{importasdm_6.5.4}}.
First we will need to convert the data to MS format. This is done with the task {{importasdm_6.5.4}}.


<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
importasdm(asdm=sduid,with_pointing_correction=True, verbose=True,vis=sdmsd,overwrite=True)
importasdm(asdm=sd_asdm, with_pointing_correction=True, verbose=True, vis=sd_mso, overwrite=True)
</source>
</source>
The usual first step is then to get some basic information about the data.  
 
Then we get some basic information about the data using {{listobs_6.5.4}}.
 
<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
listobs(sdmsd, listfile = sduid + '.listobs')
listobs(vis='sd_mso', listfile=sd_asdm+'.listobs')
</source>
</source>


==Calibration ==
==Calibration ==
In the observation, the atmospheric calibration was done before the fast-scanning of the Sun. We use the calibration date to apply the solar data using '''calmode = '.ps, tsys, apply'''.
In the observation, the atmospheric calibration scan was done before the fast-scanning of the Sun. We derive calibrations for position switching (ps) and system temperature (Tsys) from the calibration scan, and apply them to the science data using ''calmode='ps,tsys,apply''' in {{sdcal_6.5.4}}.


<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
sdcal(infile=sdmsd, calmode = 'ps,tsys,apply', spw='0,1,2,3')
sdcal(infile=sd_mso, calmode='ps,tsys,apply', spw='0,1,2,3')
split(vis = sdmsd, spw = '0,1,2,3', outputvis = sdmsc, scan = '2', datacolumn = 'corrected', keepflags = True)
split(vis=sd_mso, spw='0,1,2,3', outputvis=sd_msc, scan='2', datacolumn='corrected', keepflags=True)
</source>
</source>
Unlike non-solar single-dish observations, the flux calibrator is not observed in solar single-dish observations in Cycle 4. Therefore, we have to calibrate the data using a correction factor which includes various antenna efficiencies of the PM antenna.  
Unlike non-solar single-dish observations, the flux calibrator is not observed in solar single-dish observations in Cycle 4. Therefore, we have to calibrate the data using a correction factor which includes various antenna efficiencies of the PM antenna.  


Based on the commissioning observations, the average correction factor of the PM antennas with Band6 is 0.862, which enables us to calibrate the observed antenna temperature to the absolute brightness temperature. We will calibrate using the value, as follows.
Based on the commissioning observations, the average correction factor of the PM antennas with Band6 is 0.862, which enables us to calibrate the observed antenna temperature to the absolute brightness temperature. We will calibrate using the value, as follows.
<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
gencal(vis=sdmsc,caltable=sduid+'.cal.eff.tbl', caltype='amp', spw='',parameter=[np.sqrt(0.862)])
gencal(vis=sd_msc, caltable=sd_asdm+'.cal.eff.tbl', caltype='amp', spw='', parameter=[np.sqrt(0.862)])
applycal(vis=sdmsc, gaintable=sduid+'.cal.eff.tbl')
applycal(vis=sd_msc, gaintable=sd_asdm+'.cal.eff.tbl')
</source>
</source>


Line 58: Line 62:


To create the full sun map, we use the data of the spectrum window #3 obtained with the PM03 antenna. The command for the process is as follows.
To create the full sun map, we use the data of the spectrum window #3 obtained with the PM03 antenna. The command for the process is as follows.
<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
sd_img =sduid+ '.'+ant+'.StkI.Spw3'  
sd_img = sd_asdm + '.' + ant + '.StkI.Spw3'  
tsdimaging(infiles = sdmsc, spw = '3', antenna =ant, field='0', nchan = 1, cell = ['3.0arcsec','3.0arcsec'], outfile = sd_img, imsize=[800,800], gridfunction = 'SF', convsupport = 6, intent ='*ON_SOURCE*', stokes = 'I')
tsdimaging(infiles=sd_msc, spw='3', antenna=ant, field='0', nchan=1, cell=['3.0arcsec','3.0arcsec'], outfile=sd_img, imsize=[800,800], gridfunction='SF', convsupport=6, intent='*ON_SOURCE*', stokes='I')
</source>
</source>
After finishing the process successfully, you can see the full-sun image as shown in Figure 1.
After finishing the process successfully, you can see the full-sun image as shown in Figure 1.
When you carry out the imaging of Band3 data, we recommend the following parameters for the {{sdimaging_6.5.4}} task.
When you carry out the imaging of Band3 data, we recommend the following parameters for the {{sdimaging_6.5.4}} task.
<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
tsdimaging(infiles = sdmsc, spw = '3', antenna =ant, field='0', nchan = 1, cell = ['6.0arcsec','6.0arcsec'], outfile = sd_img, imsize=[400,400], gridfunction = 'SF', convsupport = 6, intent ='*ON_SOURCE*', stokes = 'I')
tsdimaging(infiles=sd_msc, spw='3', antenna=ant, field='0', nchan=1, cell=['6.0arcsec','6.0arcsec'], outfile=sd_img, imsize=[400,400], gridfunction='SF', convsupport=6, intent='*ON_SOURCE*', stokes='I')
</source>
</source>


Line 77: Line 84:
#In CASA
#In CASA
res = imstat(sd_img+'.image', region='circle[[400pix,400pix],80pix]')
res = imstat(sd_img+'.image', region='circle[[400pix,400pix],80pix]')
immath(imagename=sd_img+'.image', expr = 'IM0*'+str(5900./res['mean'][0]), outfile = sd_img+'.rescl')
immath(imagename=sd_img+'.image', expr='IM0*'+str(5900./res['mean'][0]), outfile=sd_img+'.rescl')
</source>
</source>


For Band3
For Band3:
 
<source lang='python'>
<source lang='python'>
#In CASA
#In CASA
res = imstat(sd_img+'.image', region='circle[[200pix,200pix],40pix]')   
res = imstat(sd_img+'.image', region='circle[[200pix,200pix],40pix]')   
immath(imagename=sd_img+'.image', expr = 'IM0*'+str(7300./res['mean'][0]), outfile = sd_img+'.rescl')
immath(imagename=sd_img+'.image', expr='IM0*'+str(7300./res['mean'][0]), outfile=sd_img+'.rescl')
</source>
</source>



Revision as of 16:29, 11 April 2024

Last checked on CASA Version 6.5.4

Overview

This guide features CARTA, the “Cube Analysis and Rendering Tool for Astronomy,” which is the new NRAO visualization tool for images and cubes. The CASA viewer (imview) has not been maintained for a few years and will be removed from future versions of CASA. We strongly recommend using CARTA, as it provides a much more efficient, stable, and feature rich user experience. A comparison of the CASA viewer and CARTA, as well as instructions on how to use CARTA at NRAO, is provided in the CARTA section of the CASA docs.

This portion of the Sunspot Band6 guide will cover the calibration and imaging of the data obtained with the Total Power array. We create the map of a full Sun with Band6.

Import the data and split into the files for each antenna

If you completed the calibration of the visibility data following Sunspot_Band6_Calibration_for_CASA_6.5.4, we assume you are working in the directory 'Sunspot_Band6_UncalibratedData'. After starting CASA, we start by defining the directory name of the ASDM and Measurement Set.

#In CASA
sd_asdm = 'uid___A002_Xae00c5_X2e6b'    # single dish ASDM file
sd_mso = sd_asdm + '.ms'                # measurement set original
sd_msc = sd_asdm + '.ms' + '.split.cal' # measurement set calibrated
ant = 'PM03'                            # antenna

import numpy as np

In this tutorial, we will use the data obtained with the PM03 antenna.

First we will need to convert the data to MS format. This is done with the task importasdm.

#In CASA
importasdm(asdm=sd_asdm, with_pointing_correction=True, verbose=True, vis=sd_mso, overwrite=True)

Then we get some basic information about the data using listobs.

#In CASA
listobs(vis='sd_mso', listfile=sd_asdm+'.listobs')

Calibration

In the observation, the atmospheric calibration scan was done before the fast-scanning of the Sun. We derive calibrations for position switching (ps) and system temperature (Tsys) from the calibration scan, and apply them to the science data using calmode='ps,tsys,apply' in sdcal.

#In CASA
sdcal(infile=sd_mso, calmode='ps,tsys,apply', spw='0,1,2,3')
split(vis=sd_mso, spw='0,1,2,3', outputvis=sd_msc, scan='2', datacolumn='corrected', keepflags=True)

Unlike non-solar single-dish observations, the flux calibrator is not observed in solar single-dish observations in Cycle 4. Therefore, we have to calibrate the data using a correction factor which includes various antenna efficiencies of the PM antenna.

Based on the commissioning observations, the average correction factor of the PM antennas with Band6 is 0.862, which enables us to calibrate the observed antenna temperature to the absolute brightness temperature. We will calibrate using the value, as follows.

#In CASA
gencal(vis=sd_msc, caltable=sd_asdm+'.cal.eff.tbl', caltype='amp', spw='', parameter=[np.sqrt(0.862)])
applycal(vis=sd_msc, gaintable=sd_asdm+'.cal.eff.tbl')

Caution: The correction factor in this document is written in White et al. (2017)

Imaging

Fig. 1. The full-sun image with Band6

To create the full sun map, we use the data of the spectrum window #3 obtained with the PM03 antenna. The command for the process is as follows.

#In CASA
sd_img = sd_asdm + '.' + ant + '.StkI.Spw3' 
tsdimaging(infiles=sd_msc, spw='3', antenna=ant, field='0', nchan=1, cell=['3.0arcsec','3.0arcsec'], outfile=sd_img, imsize=[800,800], gridfunction='SF', convsupport=6, intent='*ON_SOURCE*', stokes='I')

After finishing the process successfully, you can see the full-sun image as shown in Figure 1. When you carry out the imaging of Band3 data, we recommend the following parameters for the sdimaging task.

#In CASA
tsdimaging(infiles=sd_msc, spw='3', antenna=ant, field='0', nchan=1, cell=['6.0arcsec','6.0arcsec'], outfile=sd_img, imsize=[400,400], gridfunction='SF', convsupport=6, intent='*ON_SOURCE*', stokes='I')

Calibration (re-scaling) after Imaging

White et al. (2017) recommended that the standard ALMA single-dish image products be scaled to match their best determination of quiet-Sun temperatures at disk center (specifically, 5900 K averaged over an 80″-square region centered on the apparent disk center at Band 6, and 7300 K averaged over a 120″-square region centered on the apparent disk center at Band 3, with uncertainties of about 100 K). For the re-scaling, the following commands are executed.

#In CASA
res = imstat(sd_img+'.image', region='circle[[400pix,400pix],80pix]')
immath(imagename=sd_img+'.image', expr='IM0*'+str(5900./res['mean'][0]), outfile=sd_img+'.rescl')

For Band3:

#In CASA
res = imstat(sd_img+'.image', region='circle[[200pix,200pix],40pix]')  
immath(imagename=sd_img+'.image', expr='IM0*'+str(7300./res['mean'][0]), outfile=sd_img+'.rescl')

Note: All full-sun images that are included in the SV data package (ex. Sunspot_Band6_ReferenceImages.tgz) were not applied the re-scaling because the SV data were released before publishing White et al. (2017). When you use the full-sun image of the SV data for your studies, you should be done the re-scaling process. While the archive data obtained in Cycles were applied the re-scaling process.