Page 1 of 1

uvlin set to order=1 but producing 2nd order continuum?

Posted: Thu Sep 15, 2016 12:11 pm
by Anita
Hi all!

I'm using uvlin to generate a continuum image from my uv data.

Input into miriad:
Task: uvlin
vis = g340.79-1.02.1420.5.6
out = g340.79-1.02.1420.cont.uvlin.terminal
order = 1
mode = continuum

Notice order = 1

Then in uvspec:
Task: uvspec
vis = g340.79-1.02.1420.5.6
stokes = xx,yy
interval = 2000
device = g340.cont.uvlin.terminal.ps/vcps
nxy = 4,4


Here's the output:
g340.cont.uvlin.terminal.ps
(625.28 KiB) Downloaded 402 times

Since I set order = 1 I expect all the continuum solutions to be straight. Notice that two of them have discontinuities (top left, bottom left) and a few seem to be 2nd order. I have some other sources where this is worse, ie all baselines have 2nd order continuum solutions.

Any idea what's going on?

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Thu Sep 15, 2016 2:45 pm
by Mark.Wieringa
Hi Anita,

I tried this on some of my data and got similar results. The discontinuities seem to happen where data is flagged.
When I specify order=0 I don't get any unexpected shapes, but with order 1 I see parabolas and with order 2 I see 3rd and 4rd order polynomials from time to time.
I will investigate further and report back here.

Cheers,

Mark

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Fri Sep 16, 2016 11:30 am
by Mark.Wieringa
Hi Anita,

I think what is happening is that the fit is done in real and imaginary and we were plotting amplitude.
For point sources and calibrated data the imaginary component will be close to zero, but when it is not the amp=sqrt(real^2+imag^2) will turn lines in real and imaginary into a more complex shape in amplitude. Similarly for the higher orders I saw.

Try plotting the real or imaginary component and see if the problem goes away.

Cheers,

Mark

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Mon Sep 19, 2016 12:26 pm
by Anita
Thanks for that Mark.

I'm not sure what you mean by
Try plotting the real or imaginary component and see if the problem goes away.
When I plot real and imaginary I can't see the problem but surely it's still there?

The higher order continuum components are causing my profiles in my end data cubes to have a gradient in velocity:
g340.1420.profile.ps
(136.47 KiB) Downloaded 1495 times
I imagine the continuum solutions will need to be linear in order to ensure a realistic profile?

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Mon Sep 19, 2016 1:28 pm
by Mark.Wieringa
Hi Anita,
When I plot real and imaginary I can't see the problem but surely it's still there?
No, if there is still a slope left after continuum subtraction you may need to use a higher order fit.
Have a look at a plot of your original spectrum (before uvlin) in real and imaginary:
if the continuum shape is not linear on all baselines, there must be more complex structure in the field and you need a higher order fit to model it.

As long as your continuum fit doesn't use the line channels that contain the feature of interest, it should be ok to use a higher order fit to get a flat baseline on your final spectrum.
For some fields uvlin may not be able to do a very good job, e.g., if there is a lot of structure away from the phase center. In that case you could try imaging and subtracting the offending emission before running uvlin.

Cheers,

Mark

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Mon Sep 19, 2016 2:16 pm
by Anita
Thanks Mark, I'll give that a go

Re: uvlin set to order=1 but producing 2nd order continuum?

Posted: Mon Sep 19, 2016 3:39 pm
by Anita
Arg... I figured it out :(

I was looking at HI and I thought the features were isolated enough (in channels) that uvlin would make the fit around them. Turns out it was trying to fit to my absorption features. I blocked out the offending channels and it all seems fine now. Thanks for your help!