Sunspot Calibrationbig
Sunspot Calibrationbig
1. Overview
2. Before Starting the Calibration of Visibility Data
3. Unpack the Data
4. Confirm your version of CASA
5. Initial Inspection, A priori calibration
Flagging before creating Tsys and Tsys+Tant tables.
Tsys calibration of the visibilities of the calibrators
Tsys+Tant calibration of the visibilities of the Sun
Flagging after Tsys and Tsys+Tant calibration
6. Additional Data Inspection
7. Set up the Flux Calibration Model
8. Creating the Bandpass Calibration Table
9. Creating the Gain Calibration Table
10. Applying the Calibration Tables
11. Re-calculation of the direction
12. Alternative way of the Calibration
1. Overview
The portion of the Sunspot_Band6 CASA Guide will cover the calibration of
the raw visibility data. To follow this guide you must have downloaded the
file Sunspot_Band6_UncalibratedData.tgz from Sunspot_Band6#Obtaining
the Data1.
1
Sunspot_Band6_Calibration_for_CASA_4.7
Sunspot_Band6_Imaging_for_CASA_4.73.
From next, we will show all commands for the calibration. If you do not want
to cut-&-paste the commands, you can use the script as described in section
12 “Alternative way of the Calibration”.
The “Analysis Utilities” package must be used for the calibration of solar raw
visibility data. Therefore, before starting the tutorial, you need to install the
package to your data-anaylysis environment. The documents and software of
the package can be obtained from the Analysis Utilities page.
cd Sunspot_Band6_UncalibratedData
#Start CASA
casa
3 Hyperlink to “Sunspot_Band6_Imaging_for_CASA_4.7”
2
Sunspot_Band6_Calibration_for_CASA_4.7
This guide has been written for CASA release 4.7. Please confirm your
version before proceeding.
# In Casa
version = casadef.casa_version
else:
import analysisUtils as aU
es = aU.stuffForScienceDataReduction()
execfile(“SunRedUtil.py”)
We start by defining the directory name of the ASDM and some directory
names of the Measurement Sets (MS) for the calibration.
#In Casa
asdm ='uid___A002_Xae00c5_X2a8d'
The raw data have been provided to you in the ASDM format. It is the native
3
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
The usual first step is then to get some basic information about the data. We
do this using the task listobs, which will output a detailed summary of each
dataset supplied.
#In Casa
The output will be sent to the CASA logger, or saved in a text file. Here is a
snippet extracted from the listobs output:
The first section of the output describes the detail of each scan, and the
second section (from line 34) shows the information of the observing targets.
This second section shows that three targets with 151 fields were observed:
The Sun, J1924-2914, nrao350(J1733-1304). From the section, the
J1924-2914 was observed for the calibrations of pointing [2]4, sideband ratio
[3], atmosphere [4], and bandpass [5]. nrao350 was observed for the
calibration of pointing [6], atmosphere [7], flux [8], and phase [9,12,15,18].
The Sun was observed for scientific observations [11,14,17], the calibration of
atmosphere [10,16] and the measurement of zero-signal level [1].
After a prior calibration, we never use the data of the scans for the
calibration of pointing, atmosphere, sideband ratio, and the measurement of
zero-signal level. To reduce the size of the dataset for bandpass and gain
calibrations, we will extract only the data for the calibrations from the raw
4
Sunspot_Band6_Calibration_for_CASA_4.7
dataset. For the extraction, we define the scanIDs for the bandpass/gain
calibrations and scientific observations, now.
#In Casa
sel_scans ='5,8,9,11,12,14,15,17,18'
The third section of the listobs output (from line 47) shows the information of
the spectrum windows (Spw) in the dataset. From first and this sections, the
scientific observations are done with the Spw 0~12, and the IDs of the Spw
with 128 channels, which are used for image synthesis, are 5, 7, 9, and 11.
Therefore, we will calibrate the data of SpwID 5, 7, 9, and 11 only. The data
of spwID 0,1,2,3 are the data from the square-law detectors of the basebands.
The data will be used for creating Tsys+Tant tables, and are archived as the
auto-correlation data in the dataset.
Thirty-one antennas were used for the dataset. Note that numbering in
python always begins with "0", so the antennas have IDs 0-30. To see what
the antenna configuration looked like at the time of this observation, we use
the task plotants.
#In Casa
This will plot the antenna configuration on your screen (see Figure 1) as well
as save it under the specified filename for future reference. We need to
choose a reference antenna that is close to the center of the array (and is also
stable and present for the entire observation). We will use the antenna DA41
as the reference antenna, and we define a variable to be used in the following
command:
#In Casa
ref_ant ='DA41'
5
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
The averaged data of each spectrum window is not used, so we flagged the
averaged data as a follow.
#In Casa
6
Sunspot_Band6_Calibration_for_CASA_4.7
We will then store the current flagging state for each dataset using the
flagmanager:
#In Casa
#In Casa
spw = '5:0~9;116~127,7:0~9;116~127,9:0~9;116~127,11:0~9;116~127',
flagbackup = F)
Since the dataset obtained with TDM, the data in the channels near the both
edges of the spectrum window (~10 channels) are flagged. Then, the plots for
checking are created by the subroutine of Analysis Utilities package (Figure
2). The Tsys of DA54 antennas are significant large, from the plot. In the
later part, we will flag the data of the antenna.
7
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
8
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
flagbackup = F)
#In Casa
ALMA solar development team. The subroutines are already imported at the
section “4. Confirm your version of CASA”. For the Tsys+Tant calibration of
the solar data, you will execute only the following command.
The process takes long time, about one night or day. If you have already
carried out the process before and there is the Tsys+Tant calibration tables
(The directory name of the table includes “tsystant”), you can skip the
generating of the tables using the following command.
9
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
flagbackup = F)
The data in the channels near the both edges of the spectrum window (~10
channels) are flagged:
#In Casa
spw='5:0~9;116~127,7:0~9;116~127,9:0~9;116~127,11:0~9;116~127')
10
Sunspot_Band6_Calibration_for_CASA_4.7
The some sub-scans at the start and end of the scientific scans are used to
measure the sky with the setting of optimized for the Sun. Since the data are
used only for estimating the antenna temperatures at the Sun, we flag the
data:
#In Casa
msmd.open(mso)
sciScan = msmd.scansforintent('*OBSERVE_TARGET*')
msmd.done()
subInf=aU.computeDurationOfScan(sciScan[i], vis=mso,
returnSubscanTimes=True)
subNum = subInf[1]
flagbackup = F)
flagbackup = F)
flagbackup = F)
#In Casa
Then, we store the current flagging state for each dataset using the
flagmanager:
11
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
Now split out the CORRECTED data column, retaining spectral windows
5,7,9, and 11. This will get rid of the extraneous spectral windows.
#In Casa
The solar data frequently include zero values in some channels. To avoid
their influence, we flag the data using the “clip” mode with “clipzeros=True”
option.
#In Casa
The valleys appear in the plot of amplitude vs channel of the Spw #3. It
shows the effect of the lines of the earth atmosphere. We need to flag the
data.
#In Casa
Then, we store the current flagging state for each dataset using the
12
Sunspot_Band6_Calibration_for_CASA_4.7
flagmanager:
#In Casa
It is very rare that a useful planet for the flux calibration is located near the
Sun. Therefore, we usually use a quasar near the Sun as a flux calibrator. In
this observations, there is no quasar that flux is enough for the observations
with the Mixer De-tuning mode, except nrao350. Therefore, the flux
calibrator is the same as the phase calibrator in this observation.
To fill the model data column for nrao350 with a model for the flux density,
we obtain the flux density and spectrum index of the nro350 from the ALMA
calibrator database.
13
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
intentSources=es.getIntentsAndSourceNames(mss)
ampCalId = intentSources['CALIBRATE_AMPLI']['id'] +
intentSources['CALIBRATE_FLUX']['id']
calFieldNames = intentSources['CALIBRATE_AMPLI']['name'] +
intentSources['CALIBRATE_FLUX']['name']
amp_cal_name=calFieldNames[1]
spwInfo=es.getSpwInfo(mss)
obs_freq="%fGHz"%(spwInfo[0]['refFreq']/1e9)
date=aU.getObservationStartDate(mss)
date_obs=date.split()[0]
spw1_flux=aU.getALMAFlux(sourcename=amp_cal_name,
date=date_obs,frequency=obs_freq)
Then, fill the model data column for nrao350 with a model
#In Casa
The bandpass and gain calibrations are the same as the calibrations of
non-solar data basically. Please refer to the other ALMA tutorials of the
CASA guide too. The calibration method presented below is the same as that
used in the QA2 process of the ALMA observatory.
14
Sunspot_Band6_Calibration_for_CASA_4.7
gain solutions. We will use solint='int' for the solution interval, which means
that one gain solution will be determined for every integration time.
#In Casa
#In Casa
The plots look good. Next, create the bandpass calibration table:
#In Casa
gaintable = mss+'.ap_pre_bandpass')
Check the bandpass calibration table using the plots created from the
following command.
#In Casa
15
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
#In Casa
Next we use the flux calibrator (whose flux density was set in setjy above) to
derive the flux density of the other calibrators. Note that the flux table
REPLACES the amp.gcal in terms of future application of the calibration to
the data, i.e. the flux table contains both the amp.gcal and flux scaling.
Unlike the gain calibration steps, this is not an incremental table.
#In Casa
16
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
#In Casa
flagbackup = F)
#In Casa
flagbackup = F)
17
Sunspot_Band6_Calibration_for_CASA_4.7
#In Casa
During most solar observations, the antennas are tracking a structure on the
Sun according to solar differential rotation. The image frame is fixed on the
solar frame, but the frame is moving on the RA/Dec coordinate frame. If we
do not do any measures, the pattern of pointing in the MOSAIC observation
is shown in Figure 3, and the shape of the pattern is a rhombus though the
correct shape is the square.
18
Sunspot_Band6_Calibration_for_CASA_4.7
using fixplanets task. The reference time has to be the time when the
antennas are directed to the field “0”.
#In Casa
reftime = '2015/12/18/19:49:00'
#In Casa
tb.open(msc+'/FIELD', nomodify=T)
phsCenOff = tb.getcol("PHASE_DIR")
tb.close()
deOff, prec=1))
tb.open(msc+'/FIELD', nomodify=F)
tgt_refdir = tb.getcol("RefDir_Ref")
tb.close()
19
Sunspot_Band6_Calibration_for_CASA_4.7
Moreover, the direction in the pointing table has a bad influence to the
coordinate system of the image synthesis. We erase the pointing table as
follows:
#In Casa
a = tb.rownumbers()
tb.removerows(a)
If you do not want to cut-&-past all commands shown in above, you can use
20
Sunspot_Band6_Calibration_for_CASA_4.7
cd Sunspot_Band6_UncalibratedData
#Start CASA
casa
#In CASA
execfile(“SunRedUtil.py”)
execfile(“SunspotBand6Cal.py”)
21