Tuesday, November 10, 2009

Heads Up! Inverted Axes for EVLA-VLA data..

I recently encountered an issue with one spectral line data set observed during the EVLA-VLA transition (like all my other data sets). So far, only this data set in particular is affected, but it could possibly apply to others if you notice this behavior. If you notice rotation that should not be there compared to other images, this may affect you!

Here are the weird things about this data set:

  1. The velocity axis appears to be backwards, but the header seems normal (is, the cdelt3 value in the header is not of the opposite sign).
  2. Compared to other observations of the same galaxy taken in different configurations, the map is rotated by 180 degrees on the plane of the sky, but again, the header seems normal (cdelt1/2 are both normal).
I spent a lot of time trying to figure out the cause of this and originally chalked it up to user error - i.e., something went wrong in the calibration, which gave the phases the opposite sign. Or so I thought.

Well! Turns out it was a bona fide problem with the EVLA transition, which inverted the velocity axis and gave the phase an incorrect sign. This has mostly been corrected in the archive, but is apparently still present in a few, lingering data sets. The fix for this is to use the task "FLOPM" on the data (after SPLIT) with opcode "VLAE".

Voila! Problem solved. Now if I could only get back the three weeks I spent banging my head against the proverbial AIPS wall.

Read more!

IMERG SECRETS

IMERG is a program that combines single dish and interferometer data (see Stanimirovic (2002) for details on the algorithm). In short, this algorithm (also referred to as "feathering") fourier transforms both the single dish and the interferometer data, uses the overlap region in uv space between the interferometer and single dish data to determine a scaling factor for the single dish data, adds the interferometer image and the scaled single dish image in fourier space, and then fourier transforms it back.

IMERG has a couple of extra caveats that the user should be aware of before running:

  • Both images need to be square and the dimensions a power of two.
  • Make very sure there are no blanks in either image. Use REMAG to replace any blanks with zero. Note that OHGEO will blank any region in the transformed image that is outside the boundaries of the original image. One of the signs that you may have some blanks in your image is really small scaling factors (~1e-8).
  • Make sure that the single dish image is big enough, i.e., make sure the galaxy is much smaller than the entire image.

Edit (11/13/09): As far as I can tell, IMERG does absolutely no checking that the two images have the same axes, so beware and double check that both images are the same. Also the beam that gets put in the resulting image is the single dish beam, not the interferometer beam. Use ADDBEAM to change.


Read more!

Friday, November 6, 2009

Multi-frequency synthesis in AIPS?

(Edited based on re-reading the documentation this morning.)

Does any one here have experience with multi-frequency synthesis in AIPS? I've got a WSRT data set with 8 continuous IFs each with 64 channels. I'm currently setting

bif=1; eif=8
bchan=2; echan=50; nchav=49

in IMAGR.

I was going to run it through self-calibration as usual.(See the following post for details.) Is there anything else I need to do?

[Edited 11/11/09: See Michael Rupen's comment on this post for the answer.]


Read more!

Friday, September 25, 2009

"Air Mass Chart" for Radio Observations?

A question that has plagued me for quite some time, as I prepare my EVLA proposal:
Do you all know of a tool to find the rise/set times and elevations of radio sources? My favorite tool for seeing the trajectory of an object through the sky is 'airchart' in IRAF, but unfortunately IRAF assumes you are an optical astronomer and only tracks your sources through the nighttime. Anyone know of something similar for all 24 hours? (the GMRT has one, but it assumes the GMRT's latitude, which is rather different than the VLA's).


Read more!

Monday, September 14, 2009

Combining VLA Spectral Line Data with Different Channel Spacings: a Solution!

I remember thinking about this briefly in a post further down, and neither Amanda nor I could come to a good solution without resorting to Miriad. After running into the problem myself and spending a lot of time dealing with AIPS, I think I've come to a solution.

Caveat: this is only valid for combining VLA data with other VLA data. I don't think it will work with ATNF/GMRT + VLA data, but I haven't tried.

I managed to fix this problem in the case of VLA data with a combination of UVCOP, SPECR, and CVEL. Basically, it works because the VLA correlator setup is all multiples of two. In general, if you have a data set with twice as many channels, it has half the channel spacing. This is not always true due to an observer's ability to set up IFs in different ways, but the channel spacings should always differ by some power of two.

Now for the solution(s).

For example, imagine you have spectral line data set A with 127 channels and spacing of 6.1 kHz, and data set B with 255 channels and spacing of 3.05 kHz. (The extra channel from each needed to make a power of two is the Channel 0 data set. So you really only have 127 instead of 128 and 255 instead of 256 channels.) Effectively, you will have to either double the channel spacing of data set B, or half the channel size of data set A.

In order to DBCON, you will need to jump through many AIPS hoops in order to make sure that both data sets have:
- the same number of channels
- the same spectral resolution
- the same frequencies assigned to the same channels

To degrade the high-resolution data:
- First, you will need to use UVCOP to chop off one channel in data set B, so an integer number of channels in SPECR will give you the correct velocity resolution. It shouldn't matter if you chop one off from the beginning or from the end, as these are generally line free.

- Next, use SPECR to regrid data set B to the proper channel spacing. In this case, you will want a channel spacing of 6.1 kHz. This means that you need to tell SPECR to regrid to half as many channels. Each new channel has twice the original channel spacing. In this case, you will tell SPECR to use npoints 127, which is conveniently half of 254.

- Now run CVEL on both data sets. The correct inputs are described at the bottom of this guide. The main APARM values to set are:

aparm(1) = [velocity in m/s to be assigned to..]
aparm(2) = [..this channel number]

Essentially, you have regridded both of your data sets to a system where the given velocity is assigned to the given channel. It may spit out a lot of errors saying that it is shifting the channels by many km/s, but as long as the same channels in both data sets correspond to the same velocities, you're set.

- Run UVCOP to chop off additional channels if necessary. In this case, the data sets should be the same, but depending on correlator settings, you may have to chop off additional channels. This time, always chop them off from the end, because you have regridded your data so that the first channels in the set line up with the first channels in the other data set.

- Run DBCON to combine both data sets. DBCON will shift RA and Dec as long as the pointing centers aren't vastly different.

To oversample the low-resolution data:

- Use SPECR to regrid data set A to 254 (NOT 255) channels. This will effectively chop your channel width in half, so it matches data set B. You will deal with the fact that both data sets have a different number of channels in a few steps, so don't worry.

- Use CVEL to assign the same frequency to the same channel for both observations. This will shift each spectrum in frequency/channel, but will not resize the channel spacing. More instructions for using CVEL are at the bottom of the guide. The important inputs are:

aparm(1) = [velocity in m/s to be assigned to..]
aparm(2) = [..this channel number]


Essentially, you have regridded both of your data sets to a system where the given velocity is assigned to the given channel. CVEL may spit out a LOT of errors telling you that you are shifting your channels by a lot, but as long as your galaxy shows up in the same channels in both datasets, you should be okay.

- use UVCOP to chop off additional channels. Data set A (after SPECR) has 1 fewer channel than data set B. Fix this by chopping off the last channel of data set B using UVCOP. Set BCHAN 0 and ECHAN 254.

- Use DBCON to combine data set A (after SPECR + CVEL) and data set B (after CVEL + UVCOP). It should shift the RA and Dec of the one of the data sets unless they have vastly different pointing centers.


Now for something completely different (aka additional notes):

Occasionally you will have to chop off more channels from data set A, depending on your correlator set up for both observations. The key point is to make sure that both data sets have the same number of channels with the same channel spacing and the same velocity definition (e.g., channel 52 = -50 km/s).

And now some info on running CVEL. In some of our observations, we did not use Doppler tracking (Oh, EVLA, you'll be awesome one day), so we also had to tell CVEL the rest frequency of our HI line so it could calculate gas velocity. You may not need all of these inputs, but here's how I had to set the APARM values, which is really the meat of CVEL:

aparm -50000 52 1 0 1.420e09 5752 1 0

What does this mean? Well!


aparm(1) = -50000
aparm(2) = 52


Together these two values shift the spectrum so that a velocity of -50000 m/s lines up with channel 52. This will be different for each galaxy - in our case, it's a galaxy with a systemic velocity of -50000 m/s (NGC 404 in fact).


aparm(3) = 1
aparm(4) = 0


These set the velocity definition. The first sets the reference to heliocentric velocity, and the second tells AIPS to use the optical definition.


aparm(5) = 1.420e09
aparm(6) = 5752


This sets the rest frequency of your line in GHz. AIPS does not have enough precision for all the significant figures, so you have to use two APARM values. If you're working with something other than HI, I recommend reading the help file to figure out how to input your frequency.


aparm(7) = 1


This is set to 1 for VLA data.

Read more!

Monday, August 24, 2009

Measuring Spectral Lines

From reader Fred:

When you've got spectral lines in emission, what's the best way of actually reliably measuring them in AIPS? Half the time, when JMFIT is run on a line, the peak and integrated fluxes come out identical (which makes me suspicious!).

my (small amount of) insight below the fold...

I don't usually measure spectral lines in AIPS, and am much more likely to do it in say, IDL, so I don't have any direct insight for you. I'm guessing that JMFIT is not a good way to measure lines, though. I have used JMFIT a lot for measuring continuum point sources, and I can tell you that when the peak and the integrated flux come out to be about equal, this usually means that the source is unresolved. I'm guessing that your spectral lines aren't all actually unresolved (<1 channel in width?), so perhaps JMFIT just doesn't really know what to do with spectral lines. The problem might be that it expects everything to be in terms of mJy/beam, and it usually knows what the beam is in RA/Dec coordinates, and so it is all set up to fit a gaussian to a source and figure out how many beams it covers and how many mJy it emits. This whole set-up doesn't makes much sense when you are talking about one of the coordinates being mJy/channel...

So, I'm skeptical of using JMFIT, but it might be possible. Unfortunately I don't have other suggestions in AIPS, but I bet other people do?

Read more!

Monday, August 17, 2009

Multiple contours on one plot

From reader Carl:

Hey I'm bumping this because I have a question regarding contour plots. I'd like to overlay 3 separate contour plots onto each other. The AIPS documentation indicates that it can display plots from multiple images, but is a little ambiguous as to whether it can display the contour plots of both images, or just the contour of one and the greyscale of another. Reading the AIPS help file and playing with the task seem to hint that the latter is the case. I'm just wondering if anyone knows for sure whether this can be done in AIPS, and if so, how. Thanks!


Thanks for the question Carl. See below for my response.

I don't know for sure because I've never tried it, but I'm pretty sure that you can only have one set of contours in KNTR. AIPS plotting is not the most flexible.

Some solutions that might not be great:

1) Use a programming language (Python, IDL, perl, C, fortran, etc) and a fits library to read in your files and then plot them exactly like you want.

2) Make three different contour plots of exactly the same area and overlay them in Illustrator.


Anybody else have some solutions?

I'm wishing that for my latest paper, I'd done custom plots instead of AIPS plots. My hope is that the plotting situation will improve with CASA since it's all plugged into Python and the plotting libraries there.

Read more!