Tohban EOVSA Imaging Tutorial A-Z

From EOVSA Wiki
Jump to navigation Jump to search

Connection details to pipeline server

Step 1: Downloading raw data (IDB) on Pipeline machine

On CASA of the Pipeline machine,

If you are not using mobaxterm, directly sshing to pipeline through linux or mac computer, to run casa start tcsh.

from astropy.time import Time
import os
trange = Time(['2017-08-21 20:15:00', '2017-08-21 20:25:00'])
#### (Optional) change output path, default current directory "./" #####
outpath = './msdata/'
if not os.path.exists(outpath):
    os.makedirs(outpath)
######################################################
msfiles = importeovsa(idbfiles=trange, ncpu=1, visprefix=outpath)

OR (for a time range longer than 10 minutes)

from suncasa.tasks import task_calibeovsa as calibeovsa
from suncasa.tasks import task_importeovsa as timporteovsa
from split_cli import split_cli as split
import dump_tsys as dt
from util import Time
import numpy as np
import os
from glob import glob
from eovsapy import util


trange = Time(['2017-08-21 20:15:00', '2017-08-21 20:35:00'])
idbdir = util.get_idbdir(trange[0])

info = dt.rd_fdb(trange[0])
sidx = np.where(
    np.logical_and(info['SOURCEID'] == 'Sun', info['PROJECTID'] == 'NormalObserving') & np.logical_and(
        info['ST_TS'].astype(np.float) >= trange[0].lv,
        info['ST_TS'].astype(np.float) <= trange[
            1].lv))
filelist = info['FILE'][sidx]

outpath = './msdata/'
if not os.path.exists(outpath):
    os.makedirs(outpath)
inpath = idbdir + '{}/'.format(trange[0].datetime.strftime("%Y%m%d"))
ncpu = 1

msfiles = timporteovsa.importeovsa(idbfiles=[inpath + ll for ll in filelist], ncpu=ncpu, timebin="0s", width=1,
                                   visprefix=outpath,
                                   nocreatms=False, doconcat=False,
                                   modelms="", doscaling=False, keep_nsclms=False, udb_corr=True)

Step 2: Concatenate all the 10 mins data, if there are any

# This is to set the path/name for the concatenated files
concatvis = os.path.basename(msfiles[0])[:11] + '_concat.ms'
vis = calibeovsa(msfiles, doconcat=True, concatvis=concatvis[, msoutdir=outpath])

Step 3: Calibration

calibeovsa(vis='IDB20170821202020.ms', caltype=['refpha','phacal'], doimage=True)

Connection details to Inti server

For Windows, on Mobaxterm,

  1. Connect to any afsconnect servers (for example, afsaccess3.njit.edu) using UCID ss2273 and your UCID password.
  2. ssh -X UCID@inti.hpcnet.campus.njit.edu
cd /inti/data/users/YOURDIRECTORY    #YOURDIRECTORY folder was created by Sijie for having enough space with EOVSA data analysis

For Linux or Mac machine,

Transferring details between servers

Software details on the servers

On Inti, when logging in for the first time, please add the following lines to your accounts .bashrc file.

>>vi .bashrc Insert the text given below and save it.

#### setting start ####
if [ $HOSTNAME == "baozi.hpcnet.campus.njit.edu" ]; then
    source /srg/.setenv_baozi
fi
if [ $HOSTNAME == "inti.hpcnet.campus.njit.edu" ]; then
    source /inti/.setenv_inti
fi
if [ $HOSTNAME == "guko.resource.campus.njit.edu" ]; then
    source /data/data/.setenv_guko
fi
#### setting end ####

Both CASA 5 and 6 are available on Inti.

Please enter the bash environment on inti, and load the desired casa environment with the alias below. To load CASA 5: Enter bash environment by giving >>bash

>> loadcasa5
>> suncasa              #This should load the software and you are ready for analysis

To load CASA 6: Enter bash environment by giving >>bash

>>loadcasa6
>>ipython                       #This should load the software and you are ready for analysis

Here, for example, to use clean, first start ipython as given above, then type in >>from casatasks import tclean

Step 4: Self-calibration on Inti server

https://github.com/binchensun/casa-eovsa/blob/master/slfcal_example.py

Step 5: Quick-look imaging

Step 6: Final imaging