Determine spectral slope of science source

From CARMA
Revision as of 15:55, 7 December 2011 by Sstorm (Talk | contribs)

Jump to: navigation, search

These notes are from a project to determine the spectral slope of DG Tau, which is a protostellar object.

We assume your data has been properly flagged.

There are 16 continuum windows (500 MHz BW) in this example.

Derive Spectral Index of Passband Calibrator

1. Loop over windows:

#Select individual window
uvcat vis=$vis out=$vis.$window select="'win(window)'" options=nocal,nopass,nopol
# Run mfcal on this window on very show timescale to minimize decorrelation
mfcal vis=$vis.$window select="source("$pass")" interval=0.1,1000. refant=$refant edge=2 line=chan,39,1,1,1
# Check your mfcal solution with ggplt!
# Apply mfcal solution to correct for variation across the bandpass
uvcat vis=$vis.$window out=$vis.$window.pb options=nocal,nopol


foreach band ( $bands )

 #Select individual window
 /bin/rm -Rf $vis.$band
 uvcat vis=$vis out=$vis.$band select="'win($band)'" options=nocal,nopol,nopass
 #Run mfcal on this window on very short timescale to minimize decorrelation
 mfcal vis=$vis.$band select="source("$pass")" interval=0.1,10000. refant=$refant edge=2 line=chan,39,1,1,1
 #Check mfcal solution
 #gpplt vis=$vis.$band yaxis=amp device=1/xs nxy=4,4  
 #set text = "Press ENTER .."
 #if ($#argv > 0) set text = "$* >>" 
 #printf "\n$text" 
 #set junk = ($<)
 #Apply mfcal solution to correct for variation across the bandpass
 /bin/rm -Rf $vis.$band.pb 
 uvcat vis=$vis.$band out=$vis.$band.pb options=nocal,nopol

 #STARTING STEPS FOR BOOTFLUX 
   #BANDPASS SOURCE PHASE CALIBRATION
   #Run selfcal on bandpass source do derive gain solutions for the bandpass source
   #Interval can be short since just applying it to the same source (?)
   mselfcal vis=$vis.$band.pb select="source("$pass")" interval=1.01 options=apriori,noscale,phase refant=$refant line=chan,1,1,39,39
   
   #Check selfcal solution for bandpass source
   #smagpplt vis=$vis.$band.pb yaxis=phase device=1/xs nxy=4,4
   #set text = "Press ENTER .."
   #if ($#argv > 0) set text = "$* >>" 
   #printf "\n$text" 
   #set junk = ($<)
   #smagpplt vis=$vis.$band.pb yaxis=amp device=1/xs nxy=4,4
   #set text = "Press ENTER .."
   #if ($#argv > 0) set text = "$* >>" 
   #printf "\n$text" 
   #set junk = ($<)
   
   #Apply selfcal phase solution from the bandpass calibrator to the bandpass calibrator
   /bin/rm -Rf $vis.$band.$pass.scp
   uvcat vis=$vis.$band.pb out=$vis.$band.$pass.scp select="source("$pass")" options=nopass,nopol
   
   #FLUX SOURCE PHASE CALIBRATION
   #Run selfcal on flux source to derive gain solutions for the flux source
   #Interval can be short since just applying it to the same source (?)
   mselfcal vis=$vis.$band.pb select="source("$flux")" interval=1.01 options=apriori,noscale,phase refant=$refant line=chan,1,1,39,39

   #Check selfcal solution for flux source
   #smagpplt vis=$vis.$band.pb yaxis=phase device=1/xs nxy=4,4
   #set text = "press ENTER .."
   #if ($#argv > 0) set text = "$* >>" 
   #printf "\n$text" 
   #set junk = ($<)
   #smagpplt vis=$vis.$band.pb yaxis=amp device=1/xs nxy=4,4
   #set text = "Press ENTER .."
   #if ($#argv > 0) set text = "$* >>" 
   #printf "\n$text" 
   #set junk = ($<)
   #Apply selfcal phase solution from the flux calibrator to the flux calibrator
   /bin/rm -Rf $vis.$band.$flux.scp
   uvcat vis=$vis.$band.pb out=$vis.$band.$flux.scp select="source("$flux")" options=nopass,nopol
   #UVCAT bandpass and phase corrected visiblity data for the BANDPASS and FLUX calibrator together
   #This is the visibility file to use in bootflux
   /bin/rm -Rf $vis.$band.btrdy
   uvcat vis=$vis.$band.$pass.scp,$vis.$band.$flux.scp out=$vis.$band.btrdy options=nopass,nopol,nocal
   #BOOTFLUX STEP
   #print out Tb of URANUS at this window
   echo $uranustb[$band]
   #run bootflux and dump output into log file
   bootflux vis=$vis.$band.btrdy select="source("$pass,$flux")" line=chan,1,1,39,39 taver=5.01 primary=$flux,$uranustb[$band] badres=70 log=bootfluxJ.$pass.log2
   #grep that log file and extract the bootstrapped Average Flux and Flux Error of 3C84 at this window
   grep Average bootfluxJ.$pass.log2 | grep Flux | cut -c 17-31 > script1_bootflux.$pass.$band
   #print the result to the screen
   set tempfluxpass = `awk 'NR==1' script1_bootflux.$pass.$band`
   echo $tempfluxpass
   
   #clean up
   /bin/rm -Rf $vis.$band $vis.$band.pb $vis.$band.$pass.scp $vis.$band.$flux.scp $vis.$band.btrdy bootflux.$pass.log2

end

Personal tools