CasaPy

Do you use (or want to use) other tools to reduce ATCA data?

Moderator: Mark.Wieringa

len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

CasaPy

Post by len067 »

Hi All,

I've been playing a bit using CasaPy to process CABB data - in particular my interest is in dealing with wide bandwidths and sources with extended structure (as these have been difficult to calibrate for in Miriad). The good news is that CasaPy can read in FITS-format files (which you can export from Miriad) and has a very exciting multi-scale-multi-frequency CLEAN (that can even handle spectral curvature in the sources). The bad news is that there a number of bugs in the beta version of CasaPy (version 2.4) and the latest full release (version 3.0.0) that make it near-impossible to run self-cal on the models produced from this CLEAN. So if you intend to do anything like this you will need to wait for the next release. I'll post further information as I hear back from the developers.

Cheers,

Emil.
ste616
Site Admin
Posts: 220
Joined: Thu Feb 04, 2010 3:27 pm
Location: Paul Wild Observatory Narrabri NSW

Re: CasaPy

Post by ste616 »

That sounds great Emil! Could you provide a link to a CasaPy guide that you've found useful, so others can have a bit of a play around?
cheers
Jamie Stevens
ATCA Senior System Scientist
len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

Re: CasaPy

Post by len067 »

Hi Jamie,

The place for all things Casa is over here:

http://casa.nrao.edu/" onclick="window.open(this.href);return false

There are two main approaches to reducing data in CasaPy. The traditional way is using the toolkit approach (which is basically taking everything one step at a time) and involves calling the Casa tools directly. The second approach is the task-based method which is a bit of a hack around the toolkit approach to make it look more like the tasks we are familiar with in AIPS or Miriad. I personally do not like the task-based approach as it hides a lot of the details behind a facade and for more refined techniques I prefer to know exactly what is being done to my data (even worse, it makes use of global-like variables and a broken object model and the software engineer in me just screams out when I see this). However, the task approach may be easier to grasp for people coming in from a Miriad/AIPS background and with limited experience in running Python.

There is a fairly extensive cookbook over here that covers many aspects of Casa:

http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf" onclick="window.open(this.href);return false

I would suggest that if anyone wants to use Casa that they first calibrate their data using the tools we know and love in Miriad and then export the data (via fits) to Casa as I'm not entirely sure how well Casa can deal with the calibration side of things yet.

For those that are more adventurous you can try the toolkit directly - there is an online reference for the toolkit that is accessible via the main casa site I referred to earlier along with a number of wikis and assorted guides. Unfortunately these seem to be in a constant state of flux and do not always reflect exactly what is currently implemented in the latest release :-( So there is often some trial and error involved (generally more error than trial I find).

Cheers,

Emil.
Arpad
Posts: 12
Joined: Thu Feb 24, 2011 1:50 am
Location: Germany

Re: CasaPy

Post by Arpad »

Hello,

Since I am using Casapy and am very fond of it, I also want to use it on ATCA CABB data.

Heres what I did:

miriad:

Atlod to import into miriad.
Flagging if necessary

uvsplit to to convert it.

fits to convert it into a uvfits file. options are out=uvfits, stokes=xx,yy,xy,yx options=nocal,nopol,nopass

then in casa:

importuvfits to convert from uvfits to MS.
This seems to work, at least for Stokes I.

And now there is my big problem. I want to see (if there is any) polarization, but I am not sure if the observations were carried out properly. I did not do the observation myself.
I have 1934-638 as the primary calibrator, 0008-421 as a secondary (phase) calibrator, and then there is also 0823-500. It is the only one of those for which the ATCA calibrator information gives some polarization information. But this one was just observed once for about 20 minutes.
I used the primary to get a bandpass and gaincalibration, the secondary to get the phases and the leakage, and the last one for the polarization angle. But the solutions are very strange....

So, am I right that 20 minutes is not enough time to get a proper polarization calibration?
Did somebody maybe achieve polarization using casa?

Thx.
saracmbr
Posts: 38
Joined: Fri Jan 20, 2012 3:40 pm

Re: CasaPy

Post by saracmbr »

len067 wrote:Hi All,

I've been playing a bit using CasaPy to process CABB data - in particular my interest is in dealing with wide bandwidths and sources with extended structure (as these have been difficult to calibrate for in Miriad). The good news is that CasaPy can read in FITS-format files (which you can export from Miriad) and has a very exciting multi-scale-multi-frequency CLEAN (that can even handle spectral curvature in the sources). The bad news is that there a number of bugs in the beta version of CasaPy (version 2.4) and the latest full release (version 3.0.0) that make it near-impossible to run self-cal on the models produced from this CLEAN. So if you intend to do anything like this you will need to wait for the next release. I'll post further information as I hear back from the developers.

Cheers,

Emil.
Hi Emil,
I've been trying to use MS-MFS cleaning in CASA to make images in CABB band(16cm). I've been using nterms=2 and nterms=3. When I use then I get different images not exactly in shape but this difference is obvious when I put the same contour levels. This is most the case when dealing with rather large scale diffuse emissions like HT galaxies. I'm wondering if you have found a way to accurately decide which nterms to pick.
Do you know if the task called "widebandpbcor" recognizes the ATCA to perform PB correction on the alpha and the other images.

Many thanks,
Sara
Mark.Wieringa
ATCA Expert
Posts: 298
Joined: Mon Feb 08, 2010 1:37 pm

Re: CasaPy

Post by Mark.Wieringa »

Hi Sara,

MSMFS clean: you would expect small differences if you increase the order of the frequency terms - you could check if the 3rd plane contains signal or just noise to decide if you need 2 or 3 terms.
For diffuse sources I would expect the multi-scale parameters to make more of a difference - make sure you have a range of scales specified to cover the size of the diffuse structure.

On your second question: I just checked the CASA code (PBMath.cc) and it has the exact same primary beam fits as Miriad. So widebandpbcor should do the right thing. We are still trying to improve the 16cm beam fits across the band, but it is not as easy to do this as we hoped.

Cheers,

Mark
len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

Re: CasaPy

Post by len067 »

Hi Sara,

I agree with Mark, check the content of the additional planes. If you don't have sufficient signal-to-noise then the Taylor terms may fit something a bit wild to the data and that could result in images that are not as good as if you just used a smaller number of terms.

Cheers,

Emil.
saracmbr
Posts: 38
Joined: Fri Jan 20, 2012 3:40 pm

Re: CasaPy

Post by saracmbr »

I have 2 more questions now:

1- I've used different scales and I've got different images. How I can decided which image is the final image? should I pick the one which has less alpha error?
2- Can I use nterms>1 for polarization images?

Cheers,
Sara
Mark.Wieringa
ATCA Expert
Posts: 298
Joined: Mon Feb 08, 2010 1:37 pm

Re: CasaPy

Post by Mark.Wieringa »

Hi Sara,

Not sure I can answer these questions - if others have suggestions please add them.

1. You tend to pick the one that looks best - fewest obvious artefacts (sidelobes, negative areas etc), and yes you can include the alpha planes in this judgement - the image that has recovered the most flux will tend to have the lowest alpha errors as well I'd suspect.

2. You can, but if there is significant Faraday rotation it will not work very well - In that case you'll have to go back to imaging per channel/chunk of channels and doing RM synthesis. I don't think CASA can do this yet, but Miriad has a task called rmclean for this. Of course you'll have trouble with the extended emission again, since it is only doing a standard delta function type clean. I think you've reached the limit of what the current software can do here.

Cheers,

Mark
len067
ATCA Expert
Posts: 66
Joined: Mon Feb 08, 2010 2:35 pm

Re: CasaPy

Post by len067 »

Hi Sara,

I'm going to sound like a parrot ... but once again I agree with Marks response. :-)

With regards to (1) - I often check the rms of the residual image and look for artefacts there - that is a good guideline and it is a bit easier to wrap your mind around. It is also useful to look at the model image to ensure that components aren't being placed in locations that would probably not be physical e.g. components on PSF sidelobes around sources.

For (2) - unless you are expecting sources with only small amounts of Faraday rotation you'll need to do as Mark suggests i.e. image on a per-channel (or small band of channels) basis so that you can either do QU fitting or RM synthesis (imaging over larger bands will cause depolarisation in the signal for sources with large rotation measure) - the wider your image band is the lower your maximum RM threshold is. I'm not aware of any inbuilt code to do these in CASA but it is relatively easy to implement something in Python.

Cheers,

Emil.
Post Reply