Page 1 of 1

difmap, CABB and modelling in the uv plane

Posted: Wed Mar 28, 2012 1:20 pm
by len067
Hi All,

I've actually had a reasonable amount of success using difmap to perform uv-modelling for a number of ATCA-CABB data sets (reaching dynamic ranges approaching 10^6:1) ... and I've posted results of these elsewhere on the forum. The nice thing with difmap is that it allows modelling of numerous (very large number if you don't mind a slow response) components of various types and most importantly for CABB data it can fit for the spectral index of the component too. The downside was that it was excruciatingly painful to get the CABB data into a form that difmap could digest in a sensible manner (previously it involved exporting to fits format from miriad, importing into aips, using a ParselTongue script to mangle some of the headers, exporting back to a fits file and then some manual editing of the header to finally get it into a suitable format that you can load into difmap - urgh! :-(

To make life easier, I've hacked together a bit of code that does this mangling without too much messing about. All it requires is that you (optionally) average some of channels down and then output your calibrated miriad data set to fits format e.g.

Code: Select all

# Average into 2048 x 1 MHz into 512 x 4 MHz channels.
uvaver vis=mydata line=channel,512,1,4,4 stokes=i out=mydata.aver
# Output to fits format
fits in=mydata.aver op=uvout out=mydata.fits
# Convert the 512 channels into 512 IFs instead (this allows difmap to do multi-frequency synthesis and to model spectral indices).
splitc mydata.fits mynewdata.fits

difmap
>obs mynewdata.fits
>select i
.... and away you go!

I've attached the code in case anyone else wants to make use of it - it was written on the train on the way to work ... so it must work perfectly and there can't possibly be any bugs in it - which is good because I won't actually be able to update or support it ;-) I'm just throwing it out there in case someone else also finds it useful. It should also be possible to update it to make it more general so that it can handle data from other instruments (VLA, VLBA, etc) but again this'll need to be done by someone else. BTW, the code only depends on cfitsio (which is relatively easy to install) and assuming you have that it can be built with:

Code: Select all

g++ splitc.c -o splitc -L/path/to/cfitsio/library -lcfitsio
Hope this is of use to someone out there in CABB-land! If anyone out there does manage to do something useful with the code please share your results and/or code updates here for all to see :-)

Cheers,

Emil.

Re: difmap, CABB and modelling in the uv plane

Posted: Mon Apr 16, 2012 4:53 pm
by len067
Hi All,

It's great to hear that some of you have tried to use the splitc software :-) As it turns out there was a bug in the program that could cause a segmentation fault when running under 64 bit linux (thanks Paul for reporting this issue to me). I've now fixed this and have attached a more up-to-date version of the code (16/04/2012 version).

Cheers,

Emil.

Re: difmap, CABB and modelling in the uv plane

Posted: Sat Oct 08, 2016 1:10 am
by Tony Foley
Does splitc still exist: I would like to try this out for large (4k) number of channels as difmap does not like it.

Re: difmap, CABB and modelling in the uv plane

Posted: Sat Oct 08, 2016 10:27 pm
by len067
Hi Tony,

I don't really know why my earlier attachment is no longer available. I'll try and upload it again.

Cheers,

Emil.