Atacama Pathfinder EXperiment APEX
APEX Control System
MPIfR Bonn   ESO   Onsala Space Observatory
  APEX TWIKI CONTACT SEARCH HELP NEWS DISCLAIMER

Home > Observing with APEX > APEX Control System > Example APECS macros

Examples of APECS Macros for APEX-2

On this page we show a few example APECS macros. Note the separation into a setup macro and an observing macro which has some practical reason: After the system is set up and knows about the frequency and the source (and its velocity), the astronomer or operator on duty has to tune the receiver. Only after that, an observing macro can be run to perform the actual observations.

Example 1: Long time integration on one source

For this type of project, no source catalog is necessary, since complete source information can be given in the setup macro.

Setup:

# Setup of front- and backends and the molecular line
exec_apecs_script('shfi_commands')
setup_shfi(fename='het345',linename='CO(3-2)',sideband='',mode='spec', cats='sys')
# Optional frequencies can be commented out in the macro.
# setup_shfi(fename='het345',linename='HCN(4-3)',sideband='',mode='spec', cats='sys')

# No catalogs necessary, because we use the system line catalog, and the source information is given in the following command

# Setup of the source
source(name='R-And',x=('00:24:01.939','hms'),y=('38:34:37.12','dms'),system='eq',epoch=2000.0,velocity=-15.0,frame='LSR')

Observing:

# Setup of reference position and offsets
use_ref('on')
reference(x=120.0,y=0.0,time=0.0,on2off=1,unit='arcsec',mode='rel',system='HO',epoch=2000.0)
offset(0,0)

# Do the actual observation
# Loop (10 times, about 2.5hrs incl. dead times) over 1 calibration and 15x On-Off
for i in xrange(10):
    calibrate('cold')
    repeat(15)
    on(20)
repeat(1)

Example 2: Search for 1 molecular line in several sources

Setup:

The following macro contains just one of the sources, since a source change requires interactive observing anyway because of necessary receiver tuning and a pointing check. The other sources could be added to this macro, but commented out, or one macro for each source could be provided.

# Define the line catalog first that the setup_shfi command finds the line
linecats('myproject.lin')

# Setup of front- and backends and the molecular line
exec_apecs_script('shfi_commands')
setup_shfi(fename='het345',linename='H2O(10-9)',sideband='',mode='spec', cats='user')

# Selecting the source catalog
sourcecats(['myproject.cat'])

# Selecting a source from the catalog
source('R-And')

Observing:

The observing procedure for this project is more or less identical to the one shown above.

Example 3: Mapping an area around the source position

Setup:

The setup macro is similar to the other cases.

Observing:

Let's assume we want to make a 9x9 raster map around the catalog position, with a grid spacing of 8". We split this in 3 rasters of size 9x3 to allow a calibration in between. In addition, we observe only one OFF position for each 3 ON spectra.

# Setup of reference position and offsets
use_ref('on')
reference(x=600.0,y=0.0,time=0.0,on2off=3,unit='arcsec',mode='rel',system='HO',epoch=2000.0)

# First 9x3 raster: around the center
offset(0,0)
calibrate('cold')
raster(xlen=64.,xstep=8.,ylen=16.,ystep=8.,time=20.,direction='x')

# Second raster: y-offsets from -40" to -20"
offset(0,-30)
calibrate('cold')
raster(xlen=64.,xstep=8.,ylen=16.,ystep=8.,time=20.,direction='x')

# Third raster, in the north...
offset(0,30)
calibrate('cold')
raster(xlen=64.,xstep=8.,ylen=16.,ystep=8.,time=20.,direction='x')