Dynamic Spectrum and Imaging: Difference between revisions

From EOVSA Wiki
Jump to navigation Jump to search
(Created page with "==Before Starting SunCASA== You will likely be running SunCASA from a working directory that has your data on it, or where you want your output to go. It is easier to start fr...")
 
No edit summary
 
(40 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Before Starting SunCASA==
==Overview==
You will likely be running SunCASA from a working directory that has your data on it, or where you want your output to go. It is easier to start from there than changing directory inside SunCASA. '''Warning''': SunCASA does not like a directory that contains spaces in its path. If you have done the installation as instructed above, then there should be an executable script called ''suncasa'' in your system path. This script will set up the required environment and run the version of SunCASA that it points to.  
This tutorial describes the making dynamic spectrum and imaging the EOVSA microwave data observed on August 21, 2017.


You can open up a terminal, cd to your working directory and typing
==Obtaining the Data==
<pre>
/common/data/eovsa_tutorial/IDB20170821201020-203020.12s.slfcaled.ms on virgo.
suncasa
</pre>
EOVSA data is handled in [https://casa.nrao.edu CASA] tables system, known as a Measurement Set (MS). The actual visibility data are stored in a MAIN table that contains a number of rows, each of which is effectively a single timestamp for a single spectral window and a single baseline. Within SunCASA, you will have access to a collection of tools that allow you to explore and utilize the new radio dynamic spectroscopic imaging data from EOVSA.


==Get Dynamic Sepctrum with SunCASA==
==Get Dynamic Sepctrum with SunCASA==
Within SunCASA, you are using IPython to interact with the system. This does not mean extensive python experience is necessary. Basic Python interactions are straightforward, e.g., assigning parameters, importing modules, running functions. The first module we introduce is ''dspec''. This module allows you to generate and visualize a dynamic spectrum from an MS file.
Within ''SunCASA'', you are using IPython to interact with the system. This does not mean extensive python experience is necessary. Basic Python interactions are straightforward, e.g., assigning parameters, importing modules, running functions. The first module we introduce is ''dspec''. This module allows you to generate a dynamic spectrum from an MS file, and visualize it. You can select a subset of data by specifying a [https://casa.nrao.edu/Release3.3.0/docs/UserMan/UserMansu112.html time range], [https://casaguides.nrao.edu/index.php/Selecting_Spectral_Windows_and_Channels spectral windows/channels],  [https://casaguides.nrao.edu/index.php/Antenna/Baseline_Selection_Syntax_with_or_without_Autocorrelations antenna baseline]. The selection syntax follows the ''CASA'' convention. More information may be found in the CASA guide of  [https://casa.nrao.edu/Release3.3.0/docs/UserMan/UserMansu112.html time range], [https://casaguides.nrao.edu/index.php/Selecting_Spectral_Windows_and_Channels spectral windows/channels],  [https://casaguides.nrao.edu/index.php/Antenna/Baseline_Selection_Syntax_with_or_without_Autocorrelations antenna baseline] selection pages.
 
[[file:fig-dspec.png|thumb|right|200px|Figure 1: EOVSA cross power dynamic spectrum at stokes XX and YY]]
 
<pre style="background-color: #FCEBD9;">
from suncasa.utils import dspec as ds
 
# define the visbility data file
msfile = 'IDB20170821201020-203020.12s.slfcaled.ms'
 
## define the output filename of the dynamic spectrum
specfile = msfile + '.dspec.npz' 
 
##  antenna selection
## leave it blank for selecting all baselines
bl = ''
 
## Spectral Windows and Channels selection
leave it blank for selecting all spectral windows
spw = ''
 
## time range selection
## leave it blank for selecting the entire time interval
timeran = ''
 
## select baselines with a median length (0.2~0.8km)
domedian =True   
 
## this step generates a dynamic spectrum and saves it to specfile
ds.get_dspec(vis=msfile, specfile=specfile, bl=bl, spw=spw, domedian=domedian)


<pre>
## this plot the dynamic spectrum.
from suncasa.utils import dspec
ds.plt_dspec(specfile, pol='XXYY')
vis = 'example.ms' # the visbility data
bl='4&12'  ## specify a baseline between antenna 4 and antenna 12.  
spw='0~7'
specfile = msfile+'.bl4-12.190000-194000.spec.npz'
timeran='17:58:50~17:59:30'
dspec.get_dspec(vis=vis,specfile=specfile,bl=bl,spw=spw,timeran=timeran)
dspec.plt_dspec(specfile=specfile,pol='RR',dmin=1,dmax=12) #dmin and dmax is used to change color,pol can be selected as 'RR''LL'or'I'
</pre>
</pre>


==Imaging with SunCASA ==
==Imaging with SunCASA ==
cd to your working directory where the measurement sets file is located.
<pre style="background-color: #FCEBD9">
from suncasa.utils import qlookplot as ql
msfile = 'IDB20170821201020-203020.12s.slfcaled.ms'
vis = msfile
timerange = '20:21:10~20:21:30'  ## time range selection
spw = '3.4~6.0GHz'  ## Spectral Windows and Channels selection
stokes = 'XXYY'    ## polarizations selection
ql.qlookplot(vis, timerange=timerange, spw=spw, stokes=stokes)
</pre>

Latest revision as of 15:57, 15 May 2019

Overview

This tutorial describes the making dynamic spectrum and imaging the EOVSA microwave data observed on August 21, 2017.

Obtaining the Data

/common/data/eovsa_tutorial/IDB20170821201020-203020.12s.slfcaled.ms on virgo.

Get Dynamic Sepctrum with SunCASA

Within SunCASA, you are using IPython to interact with the system. This does not mean extensive python experience is necessary. Basic Python interactions are straightforward, e.g., assigning parameters, importing modules, running functions. The first module we introduce is dspec. This module allows you to generate a dynamic spectrum from an MS file, and visualize it. You can select a subset of data by specifying a time range, spectral windows/channels, antenna baseline. The selection syntax follows the CASA convention. More information may be found in the CASA guide of time range, spectral windows/channels, antenna baseline selection pages.

Figure 1: EOVSA cross power dynamic spectrum at stokes XX and YY
from suncasa.utils import dspec as ds

# define the visbility data file
msfile = 'IDB20170821201020-203020.12s.slfcaled.ms' 

## define the output filename of the dynamic spectrum 
specfile = msfile + '.dspec.npz'  

##  antenna selection
## leave it blank for selecting all baselines
bl = ''

## Spectral Windows and Channels selection
leave it blank for selecting all spectral windows
spw = ''

## time range selection
## leave it blank for selecting the entire time interval
timeran = ''

## select baselines with a median length (0.2~0.8km)
domedian =True    

## this step generates a dynamic spectrum and saves it to specfile
ds.get_dspec(vis=msfile, specfile=specfile, bl=bl, spw=spw, domedian=domedian)

## this plot the dynamic spectrum.
ds.plt_dspec(specfile, pol='XXYY')



Imaging with SunCASA

cd to your working directory where the measurement sets file is located.

from suncasa.utils import qlookplot as ql
msfile = 'IDB20170821201020-203020.12s.slfcaled.ms'
vis = msfile
timerange = '20:21:10~20:21:30'  ## time range selection
spw = '3.4~6.0GHz'  ## Spectral Windows and Channels selection
stokes = 'XXYY'     ## polarizations selection
ql.qlookplot(vis, timerange=timerange, spw=spw, stokes=stokes)