Showing posts with label imaging. Show all posts
Showing posts with label imaging. Show all posts

Thursday, July 15, 2010

Gridding with SDIMG

I am trying to use SDIMG to grid some GBT data to 25 arcmin. The gridding parameters are set like in IMAGR, with XTYPE, YTYPE, XPARM, YPARM. Does anyone know how to make sense of the gridding parameters? Right now I use mysterious parameters given to me by Jay Lockman, which are idealized to the 9 arcmin L-band beam. I can't figure out what they mean to change them. The AIPS help files are just as mysterious to me.

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!

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, June 22, 2009

Mulit-Resolution Clean Tutorial?

Here is a very reasonable request from an anonymous reader:

Can someone write about multi-resolution clean(MRC)..basically the steps involved and the way self cal should be carried out while using MRC ? thanks in advance.

which I can not fulfill, as I have never successfully pulled off a MRC. You might try looking at the EXPLAIN file for IMAGR in the section called "Extended Source Options".

If anyone knows better resources for learning about how to implement multi-resolution clean, please let us know!


Read more!

Friday, June 12, 2009

Averaging Image Channels

Here is a good question from Sanch:

I am trying to average spectral channels in an image cube. Can anyone suggest what's the best way
to do it in AIPS?
I don't want to go back to the UV data and re-reduce it to get the image, as the data I am
working on is huge (VLBI data).

And some more details:
She wants to average together channels in a channel map. In other words, she has a channel map with, say, 100 channels and she wants to turn it into a map with 50 channels. Channels 1 and 2 would be averaged together and become the new "Channel 1," channels 3 and 4 would be averaged together and become the new "Channel 2," and so on.

Thoughts, AIPS gurus?


Read more!

Wednesday, May 13, 2009

A Coarse Course on 3-D imaging

An anonymous reader requests:
can someone help me out by writing the detail process of 3d imaging/cleaning after split file is created? I am new to AIPS and any kind of help is welcomed. thanks in advance..

I would recommend that you look at Joe Lazio's write-up, starting right about here:


He discusses using SETFC and IMAGR to image with multiple facets.
Some supplementary personal opinions of mine below the break...


So, what I would do is run SETFC as he instructs-- SETFC parameters look like:

AIPS 2: SETFC: Task to make a BOXFILE for input to IMAGR
AIPS 2: Adverbs Values Comments
AIPS 2: ----------------------------------------------------------------
AIPS 2: INNAME 'NGC3631' UV dataset name (name)
AIPS 2: INCLASS 'AVSPC' UV dataset name (class)
AIPS 2: INSEQ 1 UV dataset name (seq. #)
AIPS 2: INDISK 5 Disk drive #
AIPS 2: SOURCES *all ' ' Source selected
AIPS 2: BCOUNT 1 First field number to use
AIPS 2: BOXFILE 'N3631_610.BOX'
AIPS 2: disk file to write to (the
AIPS 2: input BOXFILE for IMAGR)
AIPS 2: CELLSIZE 0.8 0.8 (X,Y) size of grid in asec
AIPS 2: IMSIZE 2048 2048 field size
AIPS 2: SHIFT 0 0 Position shift (RA,Dec) asec
AIPS 2: for all fields
AIPS 2: FLUX 0 Minimum component flux =
AIPS 2: (source * beam)
AIPS 2: BPARM 0.35 10 (1) Inner region radius (deg)
AIPS 2: 0 1.5 (2) Field overlap (pixels)
AIPS 2: 0.1 512 (3) Factor to scale NVSS
AIPS 2: 512 *rest 0 fluxes, 0 -> 1
AIPS 2: (4) Radius NVSS search (deg)
AIPS 2: (5) Flux limit in NVSS (Jy)
AIPS 2: (6) IMSIZE for NVSS fields
AIPS 2: (7) IMSIZE for Sun fields
AIPS 2: (8) Write Clean boxes for
AIPS 2: NVSS fields
AIPS 2: (9) Maximum allowed phase
AIPS 2: error in imaging
AIPS 2: (10) Points per beaam
AIPS 2: PBPARM *all 0 Beam parameters:
AIPS 2: (1) Cutoff; (2) Use (3)-(7)
AIPS 2: (3)-(7) Beam shape parms
AIPS 2: INFILE ' '
AIPS 2: NVSS input file name
AIPS 2: ' ' => AIPS provided.

But I'd also make sure your CELLSIZE is small enough to thoroughly sample point sources. What i would do is run SETFC once with CELLSIZE= 0 and IMSIZE = 0, and then decrease the CELLSIZE by a factor of 2 or 3, add that to the SETFC parameters, and rerun SETFC. You can let it suggest an IMSIZE to you, given the new CELLSIZE. The max IMSIZE i like to use is 2048, because much bigger than that and IMAGR will average large number of pixels together to show you the field.

Oftentimes I will tile the central portion of the image (out to ~1 primary beam, or to where bandwidth smearing really bites you, depending on the data; set by BPARM(1)) with bigger fields (IMSIZE=2048) and then let SETFC search for NVSS sources out to a radius ~2 times that of the primary beam (Radius set by BPARM(4)). I put smaller fields on these NVSS sources-- say 512 pixels (Set by BPARM(6)).

So, then you will have a list of boxes saved in a file (labelled by BOXFILE). It's now time to image. My IMAGR parameters look like this:

AIPS 2: IMAGR: Wide field imaging/Clean task
AIPS 2: Adverbs Values Comments
AIPS 2: ----------------------------------------------------------------
AIPS 2: INNAME 'NGC3631' Input UV data (name)
AIPS 2: INCLASS 'UVCOP' Input UV data (class)
AIPS 2: INSEQ 2 Input UV data (seq. #)
AIPS 2: INDISK 5 Input UV data disk drive #
AIPS 2: SOURCES *all ' ' Source name
AIPS 2: QUAL -1 Calibrator qualifier -1=>all
AIPS 2: CALCODE ' ' Calibrator code ' '=>all
AIPS 2: TIMERANG *all 0 Time range to use
AIPS 2: SELBAND -1 Bandwidth to select (kHz)
AIPS 2: SELFREQ -1 Frequency to select (MHz)
AIPS 2: FREQID -1 Freq. ID to select.
AIPS 2: SUBARRAY 0 Sub-array, 0=>all
AIPS 2: ANTENNAS *all 0 Antennas to plot
AIPS 2: BASELINE *all 0 Baselines with ANTENNAS
AIPS 2: DOCALIB -1 > 0 calibrate data & weights
AIPS 2: > 99 do NOT calibrate weights
AIPS 2: GAINUSE 0 CL (or SN) table to apply
AIPS 2: DOPOL -1 If >0.5 correct polarization.
AIPS 2: BLVER -1 BL table to apply.
AIPS 2: FLAGVER 0 Flag table version
AIPS 2: DOBAND -1 If >0.5 apply bandpass cal.
AIPS 2: Method used depends on value
AIPS 2: of DOBAND (see HELP file).
AIPS 2: BPVER -1 Bandpass table version
AIPS 2: SMOOTH *all 0 Smoothing function. See
AIPS 2: HELP SMOOTH for details.
AIPS 2: STOKES ' ' Stokes parameters (see HELP)
AIPS 2: BCHAN 1 Low freq. channel 0 for cont.
AIPS 2: ECHAN 56 Highest freq channel
AIPS 2: CHANNEL 0 Restart channel number
AIPS 2: NCHAV 56 Number of chan. to average.
AIPS 2: CHINC 1 Channel incr. between maps.
AIPS 2: BIF 0 First IF in average.
AIPS 2: EIF 0 Last IF in average.
AIPS 2: OUTNAME 'N3631_6' Output image name (name)
AIPS 2: OUTDISK 5 Output image disk drive #
AIPS 2: OUTSEQ 0 Output seq. no.
AIPS 2: OUTVER 0 CC ver. no (Continuum only)
AIPS 2: *** SET OUTVER ON RESTARTS
AIPS 2: IN2NAME ' ' UV work file name
AIPS 2: IN2CLASS ' ' UV work file class
AIPS 2: IN2SEQ 0 UV work file seq
AIPS 2: *** SET TO KEEP WORK FILE
AIPS 2: IN2DISK 0 UV work file disk
AIPS 2: CELLSIZE 0.8 0.8 (X,Y) size of grid in asec
AIPS 2: IMSIZE 512 512 Minimum image size
AIPS 2: NFIELD 21 Number of fields (max 4096)
AIPS 2: DO3DIMAG 1 > 0 => use different tangent
AIPS 2: points for each field
AIPS 2: FLDSIZE *all 0 Clean size of each field.
AIPS 2: RASHIFT *all 0 RA shift per field (asec)
AIPS 2: DECSHIFT *all 0 DEC shift per field (asec)
AIPS 2: UVTAPER 0 0 (U,V) Gaussian taper
AIPS 2: units are kilo-lambda
AIPS 2: UVRANGE 0 0 Min & max baseline (klambda)
AIPS 2: GUARD 0 0 x,y guard band fractional
AIPS 2: radius
AIPS 2: ROTATE 0 Rotate image CCW from N by
AIPS 2: ROTATE degrees
AIPS 2: ZEROSP *all 0 0-spacing fluxes and weights
AIPS 2: SEE HELP!!
AIPS 2: UVWTFN ' ' UV dist. weight function
AIPS 2: UVSIZE 0 0 Array size for doing uniform
AIPS 2: weights. 0 -> actual field
AIPS 2: size.
AIPS 2: ROBUST 0 Robustness power: -5 -> pure
AIPS 2: uniform weights, 5 => natural
AIPS 2: UVBOX 0 Additional rows and columns
AIPS 2: used in weighting.
AIPS 2: UVBXFN 1 Box function type when UVBOX
AIPS 2: > 0. 0 -> 1 round pill box.
AIPS 2: XTYPE 5 Conv. function type in x
AIPS 2: default spheroidal
AIPS 2: YTYPE 5 Conv. function type in y
AIPS 2: default spheroidal
AIPS 2: XPARM *all 0 Conv. function parms for x
AIPS 2: YPARM *all 0 Conv. function parms for y
AIPS 2: NITER 130000 Maximum # of Clean components
AIPS 2: BCOMP *all 0 Begin at BCOMP component
AIPS 2: Specify for each field.
AIPS 2: ALLOKAY 0 For restart: > 0 => beams
AIPS 2: okay, > 1 => work file too
AIPS 2: NBOXES 0 Number of boxes for Clean
AIPS 2: NB: field 1 only.
AIPS 2: CLBOX *all 0 Four coordinates for each box
AIPS 2: BOXFILE 'N3631_610.BOX' Input file of field params
AIPS 2: and Clean boxes; ' ' => use
AIPS 2: FLDSIZE, RASHIFT, DECSHIFT,
AIPS 2: NBOXES, CLBOX only.
AIPS 2: OBOXFILE 'N3631_610.BOX' Output file for final Clean
AIPS 2: boxes
AIPS 2: GAIN 0.1 Clean loop gain
AIPS 2: FLUX 0 Minimum Clean component (Jy)
AIPS 2: MINPATCH 121 Min. BEAM half-width in AP.
AIPS 2: BMAJ 0 FWHM(asec) major axis Clean
AIPS 2: restoring beam.
AIPS 2: BMIN 0 FWHM(asec) minor axis Clean
AIPS 2: restoring beam.
AIPS 2: BPA 0 Clean beam position angle
AIPS 2: OVERLAP 2 1 => restore components to
AIPS 2: overlapped fields, >=2=>
AIPS 2: expect overlaps in Cleaning
AIPS 2: PHAT 0 Prussian hat height.
AIPS 2: FACTOR 0 Speedup factor see HELP
AIPS 2: CMETHOD ' ' Modeling method:
AIPS 2: 'DFT','GRID',' '
AIPS 2: IMAGRPRM *all 0 Task enrichment parameters
AIPS 2: (1) Antenna diameter (m)
AIPS 2: (2) Source Spectral index
AIPS 2: (3) Frequency scaling factor
AIPS 2: (4) > 0 -> SDI Clean factor
AIPS 2: (5) >0 => scale residuals
AIPS 2: (6) Half-width in x of box
AIPS 2: (7) Half-width in y of box
AIPS 2: (8) Filter components whose
AIPS 2: neighborhood is weaker than
AIPS 2: IMAGRPRM(8) Jy. 0 -> don't
AIPS 2: (9) Radius in pixels for the
AIPS 2: IMAGRPRM(8) test.
AIPS 2: (10) multiplier of image size
AIPS 2: to get beam size: 0 => 2;
AIPS 2: 2, 1, 0.5 0.25 supported
AIPS 2: (11-16) Multi-resolution
AIPS 2: added controls
AIPS 2: (17) spectral index radius
AIPS 2: 0 -> no correction
AIPS 2: (19) Dynamic range limit
AIPS 2: (20) Retry factor (see help)
AIPS 2: NGAUSS 0 Number of resolutions to use
AIPS 2: WGAUSS *all 0 Resolutions in arc sec >= 0
AIPS 2: FGAUSS *all 0 Minimum flux for each resol.
AIPS 2: MAXPIXEL 0 Maximum pixels searched in
AIPS 2: each major cycle.
AIPS 2: IN3NAME ' ' Spectral index image name
AIPS 2: IN3CLASS ' ' Spectral index image class
AIPS 2: IN3SEQ 0 Spectral index image sequence
AIPS 2: number
AIPS 2: IN3DISK 0 Spectral index image disk
AIPS 2: IN4NAME ' ' Spectral curvature name
AIPS 2: IN4CLASS ' ' Spectral curvature class
AIPS 2: IN4SEQ 0 Spectral curvature sequence
AIPS 2: number
AIPS 2: IN4DISK 0 Spectral curvature disk
AIPS 2: FQTOL -1 Frequency tolerance in kHz
AIPS 2: (primary beam & spec index)
AIPS 2: DOTV 1 Display residuals on TV ?
AIPS 2: Start with field = DOTV
AIPS 2: GRCHAN 0 Graphics channel of boundary
AIPS 2: BADDISK *all 0 Disks to avoid for scratch.
You're going to want to set CELLSIZE to the same value you used with SETFC. IMSIZE should be the size of the smallest field you are using-- so in this case, 512. Don't worry, IMAGR is smart enough to know that some of the fields are bigger than this.  NFIELD should be set to the number of fields output by SETFC. Set DO3D = 1 whenever you use facets. Set BOXFILE and OBOXFILE to the name of the file outputted from SETFC. Finally, set OVERLAP=2 and DOTV=1. See Joe Lazio's write-up for more detail on other parameters. 

Don't be surprised that imaging with multiple facets can be realllly slooow...especially if you also have multiple channels. You're going to want to watch IMAGR run on the TV and set clean boxes around your sources, which can sometimes swallow up an entire afternoon or more. On the bright side, now that you have set OBOXFILE, all the clean boxes will be saved to it, so you might not have to watch IMAGR run on the TV next time (unless you say, have self-caled and a bunch of new sources have popped up which now need to be boxed).

The rough general idea is that IMAGR is going to try to find the facet with the brightest flux peak in it, and it will present this facet to you for cleaning. Put boxes around the sources in the facet with TVBOX/REBOX, and then click on CONTINUE CLEAN. IMAGR will now clean some flux out of these boxes, and search again for the facet with the brightest peak. Just keep boxing and continuing to clean until it seems like you've cleaned pretty deeply. There's a good chance some of the facets don't have any sources in them, in which case you can just not box anything at all and then tell IMAGR to CONTINUE CLEAN. If there are no boxes, it will not clean anything.

When you finally STOP CLEANING, IMAGR will restore all the clean components and present you with NFIELD images. You can then use these images to self calibrate, if you like.

If I am planning on doing several self cal iterations, I will often go through the facets and eliminate those with no sources. I just edit the BOX file to remove the facets with no sources, and then decrease the NFIELD parameter in IMAGR appropriately.

When you're happy with your imaging, you can use FLATN to turn the many facets into one single big image. See the Lazio instructions here:

Read more!

Tuesday, May 12, 2009

Super Resolution

When people say they have 'super-resolved' their source-- say, by having a 0.75" beam for VLA 20 cm A config observations-- what do they mean? Did they just ask CLEAN to give them a 0.75" restoring beam? This makes me feel very nervous. What do you guys think? Is it a good idea in some cases?



Read more!

Thursday, March 5, 2009

Imaging with AIPS

Reader Elena has a question:

Could some of you indicate me a tutorial for imaging with AIPS ?
I would need something with examples, and possibly considering both point-like and extended sources.
So far I found this :
http://www-astro.physics.ox.ac.uk/~hrk/AIPS_TUTORIAL/HRK_AIPS_1.html#24.
It's not focused on imaging, but there are some useful images as examples. Besides, it doesn't consider the case when one can not self-calibrate (e.g. looking for all Stokes parameters), that would be very interesting for me.

My response is below.



Elena, I would suggest that you read the AIPS COOKBOOK section on imaging and check out the synthesis imaging summer school book on imaging as well. I also encourage you to play around with IMAGR and see how changing the different parameters changes the image.

Read more!

Wednesday, March 4, 2009

Why is imaging quick sometimes and slloooow others?

I have 6 sources, each with 2-3 hours of continuum L-band data on them. For five of them, imaging and self-calibration are really quite quick, but one of the sources takes a factor of 5-6 longer to image/calibrate than the others! Its correlator setup is not different, it was taken only one day previous to the other sources, and it has a similar amount of time on source. Any ideas about why imagr seems to choke for this source? Thanks!


Read more!

Wednesday, January 28, 2009

Clean Boxes from SETFC

Here is a question from an anonymous reader:

I'm new to AIPS, and noticed that using SETFC automatically sets clean boxes for every facet, the same size as every facet. When I've been wide field imaging, I've just been adding smaller clean boxes around sources on top of these. Is this ok, or is it better to delete these automatic boxes, and just manually add ones around obvious sources? Thanks.


I think I know the answer to this, if you click to read on...

You definitely want to delete the big clean box. By and large, you don't want clean boxes to overlap, and you do not want to clean your entire field (which is what you're doing if you leave that big clean box). Someone at NRAO once really stressed to me that you want your clean boxes placed as tightly around the real flux in your sources as possible. So get rid of those big boxes.

Read more!

Monday, October 20, 2008

Multi-scale clean vs. regular clean

Those of you clean afficiandos should check out this recent astro-ph article:
Multi-Scale CLEAN: A comparison of its performance against classical CLEAN in galaxies using THINGS



Read more!

Tuesday, October 14, 2008

Imaging GMRT Data

A plea for advice from an anonymous reader:

Off topic, & quite possibly a stupid question from an AIPS newbie, but I'd really appreciate any help. I'm currently processing some GMRT data (30mins, 610MHz, 38 facets, each imsize 512, cellsize 1.5), & IMAGR seems to take a very long time to run, ~2hrs for 1000 iterations. I'm wondering if this is normal, or if something has gone wrong during the SPLAT process, where I split off the source from the multi source dataset, and averaged every 7 channels between channels 1 & 105.

IMAGR, with NCHAV=15,when running, appears to process channels 1-15, then 2-16,3-17 etc, is this normal for data that has been averaged as above?
Thanks.


Read more!

Monday, August 11, 2008

Mosaicing: AIPS/Miriad/whatever works!

Is anyone familiar with mosacing techniques in AIPS, Miriad, or both? I have 21cm VLA spectral line data, taken mosaic-style, and am having a heck of a time trying to stitch the pointings together. Here's what I have done so far:

Reduced in the standard manner with AIPS up until the 'SPLIT' step
Wrote out each pointing with FITTP
Loaded into Miriad
In Miriad, 'invert', 'mossdi', and 'restor', mostly with the defaults for parameters

The best way I can describe the results is like a bad patchwork quilt...does anyone know of a good cookbook or guide for putting together pointings into a mosaic? I know AIPS has some tasks for this (VTESS/UTESS/LTESS) but I haven't had success with them. Thanks!

Katie

Read more!

Friday, January 4, 2008

Double Sources-- and not the AGN kind

I'm having this problem with some archival data from 1990. I have two nights of data on a galaxy, spaced a few nights apart from one another. I calibrate the nights separately, and image them separately. It rapidly becomes obvious that the images from the two nights are shifted relative to one another, but not in any simple way. The galaxy center, at the image center, is at the same position in both, but as you go out radially, the first night's sources are further out, radially. It's as if the image is stretched one night, relative to the other.

AIPS thinks that both images have the same pixel scale, so that means a source will have different R.A. and Dec (by about an arcminute, pretty bad!) between the two nights' images. If I DBCON the two nights, I get lots of double sources.

The observational setup claims to be exactly the same between the two nights-- same pointing center, same correlator set-up.

Anyone have any idea what might be causing this? I think I've had a similar problem with GMRT data before, and gave up temporarily and went on to a different project. I'm guessing it's a calibration issue?


Read more!

Monday, September 17, 2007

Complications with Shamelessly Raiding the Archive

Amanda and I are spending the week in Socorro, so hopefully we will be learning little new AIPS facts every day! Here's my first one:

Sometimes I have dreams about raiding the VLA archive and combining like 6 different data sets. However, often times the data sets will have slightly different centers-- in my case, often one observer centers on the galaxy's center, while another observer center on a supernova that goes off in the outskirts of the galaxy, some 5 arcminutes away. I was wondering, can you just DBCON these two data sets together, and AIPS can handle it?

The answer is...

DBCON can adjust the phases, so yes, it can image data from two pointings with significantly different centers. What Miller Goss said you have to be wary of is that DBCON doesn't adjust amplitudes. So, if there are two different pointing centers, the center of your galaxy is going to fall in different locations of the primary beam in the different observations. If you are combining two observations separated by 5 arcminutes at 20cm, where the primary beam is 30 arcminutes, this shouldn't be a big issue...probably the primary beam sensitivity of the two pointings will only vary by a few percent. However, if the separation of your pointings starts approaching the size of the primary beam, then you can no longer use DBCON and need to think of some other way to combine the data.

Read more!

Monday, April 16, 2007

Flux Conservation in Self Calibration?

Any one know what self calibration really does to your flux? I need fluxes of sources that are mostly point-ish, and I like self calibrating because it makes them look more like circles and less like amorphous blobs. But I wonder if I can trust my fluxes after self cal? If I do only phase self cal, should I be ok?

I found in someone's Ph.D. thesis that your fluxes are no longer "absolute" after self calibration. I guess because you're no longer comparing everything with 3C286, you're comparing your target source with itself.

Anyway, when i just do an imean on my images, the total flux density doesn't change a huge amount. Maybe 20% (well, sometimes I get factors of 2, but I avoid those cases). I don't really want to be introducing 20% errors into my flux measurements, though....
Maybe I shouldn't be self caling if I want robust fluxes?

Anyone really understand what cparm(2) does in calib? Is it only important for A&P self cal, or P self cal too?
Squawk!

Read more!

Sunday, April 15, 2007

Self Cal according to Claudia (as inspired by Crystal Brogan)

I'm pasting Claudia's notes below, about how she self calibrated her SMA data. I always like to see how people do their self cals! I'll probably post later some more details about how I personally do it.



CLEANING/SELF-CAL
Clean in IMAGR
To get a circle (as opposed to a square):
tvbox
"a"
"c"
to get another one, keep hitting c until you get a circle (may take a few times)
When cleaning interactively, in order not to have to redraw the boxes every time:

to create a boxfile, set a filename in oboxfile parameter in imagr (with the logical name ahead of it, same as when you're reading in a fits file)

Then, to use it once you've created in, set boxfile=oboxfile. This will read in the file, allow you to modify it, then spit it out again (with any modifications). Can leave this set in imagr through all the steps that follow

REBOX _not_ TVBOX to add boxes when you're working with a file--otherwise it will delete everything you already have

Stop cleaning when the image looks about uniform. A good way to decide when to stop is when the min and max (see pasted in example below) are about equal.

IMAGR2: I Polarization model processed
IMAGR2: Field 1 min = -15.4 MilliJy,max = 16.1 MilliJy

In a self-cal cycle, can tell that your image is improving if it includes more visibilities than the last iteration.

NB: The best self-cal model (the model is the image you're making of the UV dataset that comes out of a calib run) is the one that contains the most flux--but beware of boxing dubious sources, since anything you put into the model will create a source around it. If a dubious source gets weaker when you box another, more probably real source, that's a good indication
that it's not real.

Herringbone pattern can be due to amplitude errors, poor UV coverage, the beam shape being poorly defined.

HOW TO DO A PROPER SELF-CAL:
i) To get started, make an image of your original UV database (say BASFIT from UVLSF)and clean it as described above--probably only with on box.

ii) Task 'calib'
Do phase-only first: CALIB SOLMODE ='P '/Solution mode
Feed in as your model (get2n) the map made in (i)
Pick a short solution interval for phase, since phase varies quickly as a function of the atmosphere (say 2
minutes)
CALIB SOLINT = 2.00 /Soln. inter. (min)
CALIB APARM(1) = 4 /Min. no antennas
CALIB APARM(7) = 3.0 /SNR cutoff

Can use a lower S/N cutoff than the default b/c phase is constrained by phase closure.
set OUTCLASS for calib to 'calib' to distinguish the UV files that will come outalso add a _P to the filename to
mark it as phase-cal only

WHAT COMES OUT OF CALIB IS UV DATA WITH THE SN TABLE ALREADY APPLIED

iii) image your _P.CALIB UV file that 'calib' has produced, using imagr

iv) Run calib again. Input is your ORIGINAL UV data. The map (in2name) is the map you made in (iii). see
examples below.
112 CALIB INNAME='S255N_USB ' INCLASS='BASFIT'
113 CALIB INSEQ= 1 INDISK= 1
114 CALIB OUTNAME='S255N_USB_P1' OUTCLASS='CALIB '
115 CALIB OUTSEQ= 2 OUTDISK= 1
116 CALIB /TIMERANG = beginning to end
117 CALIB IN2NAME='S255N_USB ' IN2CLASS='ICL001'
118 CALIB IN2SEQ= 2 IN2DISK= 1
**this is very important. This makes the self-calibration insensitive to errors early on--eg boxing sources that it later becomes apparent you shouldn't have boxed. and it retains flexibility. And means that your original UV data file will accumulate SN tables, and you can correctly copy the last version over to the line data and apply it there. DON'T do iterative self-cal. This is most important with low S/N and poor UV coverage data--certainly the case for SMA.

Repeat steps (iii) and (iv) until the phase is as good as it can get.

Once it is:

v) do an amplitude calibration
NB: amplitude calibration is inherently much less constrained than phase calibration. Never do an amplitude calibration until the phases are fixed as best they can be.
This time, use your last, most correct, .CALIB UV file as an input to task CALIB
set CALIB APARM(7) = /SNR cutoff parameter back to =5 (since amplitude is much less constrained)

Unlike phase, which varies quickly as a function of atmosphere, amplitude should vary slowly, and the variation should be primarily due to instrumental effects
Want to solve for amplitude only once per scan (scan=length of time on source)
(for s255n data, 20 minutes)
set SOLINT=scan length

CALIB SOLMODE ='A&P '/Solution mode

vi) After amplitude calibration, do uvplt as a reality check. If you have crazy amplitude errors, specific baselines may jump way up. (Remember that you're actually changing the amplitudes with the amplitude calibration)

vii) SMA weights are based on tsys. Will (particularly with low S/N, poor UV coverage) get a better image if you apply the weights, rather than pretending all antennas have same tsys (which at SMA they emphatically don't).

So, make an image by running imagr, with your last calib phase file as an input, and applying the SN table (which will be the SN table from the amplitude calibration)
To do this:
142 IMAGR INNAME ='S255N_USB_P1'
143 IMAGR INCLASS ='CALIB'
144 IMAGR INSEQ = 4
(for example, if this is your most last phase cal iteration)
149 IMAGR DOCALIB = 2.00000E+00
150 IMAGR GAINUSE = 1

Read more!

Thursday, April 12, 2007

Bandwidth Smearing

Once your radio data is calibrated you can SPLIT off the source and apply these calibrations. During SPLIT you'll want to average together as many channels as possible. The number of channels you can average together will be limited by bandwidth smearing which causes sources to smear out in the radial direction. Bandwidth smearing becomes significant when the product of (\frac{\delta \nu}{\nu})*(# of beams from the image center) reaches unity where \delta \nu is your channel size and \nu is your total bandwidth. So, if you have a really small beam you won't be able to average together very many channels during SPLIT if you want to avoid smearing sources that are far from the center of your field. For VLA data the correlator doesn't give you very many channels so this doesn't matter as much as with GMRT data which always gives 128 channels. I find that with 610 MHz GMRT data I can only average every 2 channels when I SPLIT off the source if I want to avoid radial smearing out to the edge of my primary beam (HPBW of 0.7 degrees). Your source dataset will most likely have greater than one channel when you're ready to run IMAGR but you only want one image in the end so you'll need to set NCHAV and CHINC to be the total number of channels in your dataset. IMAGR is smart and it knows how to combine these channels during the imaging process so that bandwidth smearing isn't an issue. (So, it's actually not imperative that you average any channels together when you SPLIT off your source data but it does help IMAGR to run faster if you do.)

Read more!

Wednesday, April 11, 2007

Speeding Up Self Cal (a tiny bit)

When doing self calibration, you have to do lots of iterations of calib and then imagr. IMAGR has been taking forever for me!

Just realized that imaging goes a lot faster if you use the calibrated UV files which are outputted from CALIB, instead of using the orignal uv file and applying the SN table in IMAGR. Every little bit of speed helps!

Read more!

Imaging with Multiple Fields

There are two reasons you might want to image with multiple facets.
1) To correct for 3D effects, and image degradation that goes along with that.
2) Because there's a really bright source far away from the center of the field that's messing up your image, but you don't want to image all the way out to it. It would be so much nicer if you could just put a small field on it!

Here's some of the tricks of imaging with multiple fields:


You use SETFC to figure out where to put the facets. I think SETFC is really a pretty great program.
The first time you run it, if you set cellsize and imsize to 0, SETFC will actually recommend a pixel size and image size to you! Like this:


1 5 23-MAR-2007 14:08:03 SETFC Task SETFC (release of 31DEC05) begins
1 3 23-MAR-2007 14:08:03 SETFC Found NGC3184 SPLIT Seq 1 Disk: 1 in slot 6
1 4 23-MAR-2007 14:08:20 SETFC SETCEL: recommends IMSIZE 932 CELLSIZE 1.26446
1 4 23-MAR-2007 14:08:20 SETFC SETCEL: returns IMSIZE 1024 CELLSIZE 1.17417
1 2 23-MAR-2007 14:08:20 SETFC ZTXOP2: using translated file name =
1 2 23-MAR-2007 14:08:20 SETFC ZTXOP2: TEST
1 4 23-MAR-2007 14:08:20 SETFC FLYEYE added 7 fields to BOXFILE to .283 deg
1 7 23-MAR-2007 14:08:20 SETFC WARNING: THIS MAY NOT COVER THE DESIRED AREA
1 3 23-MAR-2007 14:08:20 SETFC Searching catalog between .28 and 1.50 degrees radius
1 2 23-MAR-2007 14:08:20 SETFC ZTXOP2: using translated file name =

I often rerun SETFC with a rounded off version of cellsize (like 1.2 in this case) so I can remember it more easily. CHANGE AS OF 5/09: I"ve really decided that the CELLSIZE suggested by SETFC is far too small. It often just barely Nyquist samples your source-- often giving only 2 or 3 pixels across it. I now try to use CELLSIZEs which are 2 or 3 times smaller than that suggested by SETFC. Also, I don't like imaging over fields bigger than 2048 because than IMAGR averages many pixels together to display the field, and it's hard to tell what's going on. So, I often have imsize of 2048 and a cellsize that gives ~5--6 pixels across a point source.

Now, the other cool thing about SETFC is that you can set an inner tiling of facets, and then you can have some external fields on bright sources (SETFC queries the NVSS database to know where there are bright sources around your source). If you want both internal and outlying fields, you're input will look like this:

AIPS 1: SETFC: Task to make a BOXFILE for input to IMAGR
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INNAME 'NGC' UV dataset name (name)
AIPS 1: INCLASS 'SPLIT' UV dataset name (class)
AIPS 1: INSEQ 1 UV dataset name (seq. #)
AIPS 1: INDISK 1 Disk drive #
AIPS 1: SOURCES *all ' ' Source selected
AIPS 1: BCOUNT 1 First field number to use
AIPS 1: BOXFILE 'BOX4736_L.SETFC'
AIPS 1: disk file to write to (the
AIPS 1: input BOXFILE for IMAGR)
AIPS 1: CELLSIZE 1.2 1.2 (X,Y) size of grid in asec
AIPS 1: IMSIZE 1024 1024 field size
AIPS 1: SHIFT 0 0 Position shift (RA,Dec) asec
AIPS 1: for all fields
AIPS 1: FLUX 0 Minimum component flux =
AIPS 1: (source * beam)
AIPS 1: BPARM .3 10 (1) Inner region radius (deg)
AIPS 1: 0 1.2 (2) Field overlap (pixels)
AIPS 1: 5.000E-04 256 (3) Factor to scale NVSS
AIPS 1: *rest 0 fluxes, 0 -> 1
AIPS 1: (4) Radius NVSS search (deg)
AIPS 1: (5) Flux limit in NVSS (Jy)
AIPS 1: (6) IMSIZE for NVSS fields
AIPS 1: (7) IMSIZE for Sun fields
AIPS 1: (8) Write Clean boxes for
AIPS 1: NVSS fields
AIPS 1: (9) Maximum allowed phase
AIPS 1: error in imaging
AIPS 1: (10) Points per beaam
AIPS 1: PBPARM *all 0 Beam parameters:
AIPS 1: (1) Cutoff; (2) Use (3)-(7)
AIPS 1: (3)-(7) Beam shape parms
AIPS 1: INFILE ' '
AIPS 1: NVSS input file name
AIPS 1: ' ' => AIPS provided.

This tiles 7 "big" (1024x1024) fields in the center of my image (within 0.3 degrees).
And then it puts smaller (256x256) fields on any NVSS sources with flux greater than 5e-4 Jy which are located between 0.3 and 1.2 degrees of the center of my field. In this case, that gave 31 external fields.

As Joe Lazio suggests, you might want to do a quick imaging run of all these external fields to see which ones actually contain sources, and delete from the BOX file any fields that don't really contain much of anything in your images. If you do delete some fields, you'll have to renumber the renaming ones or I think IMAGR will balk at you.

When you're ready to image with IMAGR, here are a few important things to keep in mind:
IMSIZE-- is the minimum field size! So in the above case, I'd set it to 256. IMAGR is smart enough to know to make the bigger internal fields 1024x1024 (because the BOX file tells it to).
NFIELD-- set this to the total number of fields in your BOX file.
DO3DIMAG = 1
BOXFILE-- set this to the file that came out of SETFC
OBOXFILE-- IMAGR will be smart enough to print out the field locations/sizes, AND any clean boxes to this file. Hurrah!
OVERLAP = 2

When you do start imaging, if you have DOTV = 1, IMAGR will show you one field at a time, and I think it tries to show you which ever field has the most flux in it (or the most flux remaining in it, after cleaning.)

Read more!