Load and Map an APEX observation

You must download the file E-085.B-0964A-2010_merge.apex from the archive first

Requires:

An "install script":

Mac:

curl -O http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.0.1-MacOSX-x86_64.sh

Linux:

wget http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.0.1-Linux-x86_64.sh

Both:

conda install scipy
conda install astropy
pip install https://github.com/keflavich/sdpy/archive/master.zip
pip install https://github.com/keflavich/FITS_tools/archive/master.zip
pip install https://bitbucket.org/pyspeckit/pyspeckit/get/master.tar.gz
pip install https://github.com/keflavich/mpl_plot_templates/archive/master.zip
# You can acquire the data with astroquery once a few kinks are worked out (don't try this yet):

from astroquery.eso import Eso
Eso.login('aginsburg') # change this to your username; you may need to enter your password in the terminal!
# this dataset is public, but you still need to log in
filenames = Eso.retrieve_data('E-085.B-0964A')
import os
localpath = os.path.split(filenames[-1])[-1]
if not os.path.exists(localpath):
    os.symlink(filenames[-1],localpath)
%%bash tar -xvf E-085.B-0964A.2010JUL08.TAR
In [1]:
from shfi_otf_pipeline import make_apex_cubes
import time # for performance analysis
In [2]:
# for bigger figures
import pylab as pl
pl.rcParams['figure.figsize'] = (10.0, 8.0)
In [3]:
filename = 'E-085.B-0964A.2010JUL08/E-085.B-0964A-2010_merge.apex'
datapath = 'E-085.B-0964A.2010JUL08/'
dataset = 'E-085.B-0964A-2010'
In []:
# there is a specific wrapper for this dataset
# the lines are split into low/high frequencies
t0 = time.time()
make_apex_cubes.build_cube_ao(window='high',
                              datasets=[dataset],
                              datapath=make_apex_cubes.aorawpath,
                              outpath='./',
                              pcakwargs={'smoothing_scale':50},
                              freq=True,
                              )
print "Total time: ",time.time()-t0," seconds"
In [5]:
import glob
[x for x in glob.glob(os.path.join(make_apex_cubes.diagplotdir, dataset)+"_AP-H201-F101*diagnostics.png") if '_obs' not in x]
# List the diagnostic plots, excluding the (many!) observation-by-observation diagnostics
Out[5]:
['/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_diagnostics.png',
 '/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_preflag_diagnostics.png',
 '/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_presub_diagnostics.png']
In [6]:
# Same for TSYS
tsys_plots = [x for x in glob.glob(os.path.join(make_apex_cubes.diagplotdir, dataset)+"_AP-H201-F101*tsys.png") if '_obs' not in x]
tsys_plots
Out[6]:
['/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_preflag_tsys.png',
 '/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_tsys.png']
In [7]:
from IPython.display import Image
In [8]:
# The overall diagnostic plot before TSYS flagging:
Image('/Users/adam/work/h2co/apex/diagnostic_plots/E-085.B-0964A-2010_AP-H201-F101_preflag_diagnostics.png',)
Out[8]:
In [9]:
# Before time-domain subtraction, after TSYS subtraction
Image(os.path.join(make_apex_cubes.diagplotdir, 'E-085.B-0964A-2010_AP-H201-F101_presub_diagnostics.png'))
Out[9]: