Page 1 of 1

CLEAN iterations

PostPosted: Thu Aug 01, 2019 3:56 pm
by bnorfolk
Hi again,

I'm uncertain how exactly clean and its iterations (niters) can best be used. From my understanding, you set a cut off value and set a max iteration value(niters). The task then cleans until either the cut off is reached or the max iterations is reached. However, if the residual min, max, and rms values that is printed as the task runs begins to rise then have I cleaned too much?
And if this is the case then am I always going to want to clean just until this value is reached regardless of high the niters input has to be?
Also, before this increase in min, max, and rms values are reached how do I know that I'm cleaning away just noise?/How do I determine if I'm actually cleaning away signal?

Cheers,
Brodie

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 10:44 am
by Mark.Wieringa
Hi Brodie,

yes, if the numbers start to rise, the clean is diverging and there is no point continuing.
There can be many reasons for a diverging clean, but common ones are:
* Clean area too large for the size of the beam - use options=double in invert
* Beam patch too small for side lobes levels in the beam - increase value of minpatch
* Non physical structures in the image, i.e., stripes due to strong RFI - flag out bad data and try again
* If using Clark clean - try reducing the speed parameter from default of 0 to -1.

If you are cleaning a large area of the image your cut off value should be about 5 times the noise level, otherwise you are cleaning noise peaks and artificially reducing the image rms.
To set this you should know the expected rms level in the image - invert prints an estimate of the theoretical noise, but a better way is to make a stokes V image and measure the noise level.

If there are sidelobes left from extended structure you may need to set a clean region (you could do this after you've cleaned to 5 sigma) and clean just this region to 2 sigma. Alternatively you can use the deep clean option (second clean limit) to clean existing components to below the noise level without over cleaning the noise.

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 11:34 am
by bnorfolk
Thanks for the reply!

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 2:44 pm
by bnorfolk
Hi Mark,

I'm a little more confused now. So on the principle that it's appropriate to clean a source until the min,max,rms values start to rise I re-cleaned some of my brighter targets. Attached are two images (natural weighting), the first is for niters=1000 (what I use to always use as a default) and one for niters=12000. At niters=13000 there's a spike in the max value (however it continues to decrease after this) so I take 12000 as my iteration cutoff. Not sure if this is the right procedure? Since the rms still decreases after the spike, and what's more confusing is for a uniform weighting I can set niters=100000 and all min,max, rms values continually decrease. What I mainly don't understand is I'm apparently cleaning away noise up to niters=12000 but my image for this process lacks a significant amount of detail that was pick up by the niters=1000 case. Does this mean all that structure was just noise?

Clean inputs:
clean map=mapfile beam=beamfile out=cleanfile cutoff=(rms from histo) region=percent(33) niters=12000

Cheers,
Brodie

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 3:56 pm
by Mark.Wieringa
Hi Brodie,

You say you use:
clean map=mapfile beam=beamfile out=cleanfile cutoff=(rms from histo) region=percent(33) niters=12000

I would use:
clean map=mapfile beam=beamfile out=cleanfile cutoff=(5*rms from histo) region=percent(33) niters=12000

instead. As I said, it is NOT a good idea to clean large areas down to below 5*rms. You should get the rms from an 'empty' area of the image, or a Stokes V image.
You could also use cutoff=5*rms,rms, i.e, two values, second one only cleans where it has found peaks before, so it doesn't affect the noise.

The values clean reports as it progress are the min, max and rms in the residual image, after subtracting all the previous components. So ideally all these should decrease as the clean progresses. The max value is not related to your source peak, except in the first few iterations.

If the beam is well behaved, you can theoretically clean forever, but there is really no point because below 5 sigma, there are usually no sidelobes left to remove and you start cleaning noise peaks instead. So if you only need 1000 components to get to 5 sigma (5*rms), just stop there.

Cheers,

Mark

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 5:22 pm
by bnorfolk
Thanks mark, this has significantly help in my imaging process.

Here's my image now, looking much better.

Re: CLEAN iterations

PostPosted: Mon Aug 05, 2019 6:22 pm
by bnorfolk
Hi Mark,

Just going back to my fainter sources (~2 sigma detection), when I set the cutoff to 5*rms in clean no iterations are completed because the cutoff is already reached. Is this an issue at all?

I've tried adding the second clean i.e. cutoff=5*rms,rms but this seems to not iterate at all.

Cheers,
Brodie

Re: CLEAN iterations

PostPosted: Tue Aug 06, 2019 11:04 am
by Mark.Wieringa
Hi Brodie,

No, if your brightest source is 2 sigma, there is nothing to clean - any image of a reasonable size should have 4 sigma noise peaks though.
You might want to set the limit low enough (4 sigma) that you get a few components in the model so you can run restor and get a beam fit in the header - the analysis tasks complain otherwise.

The second cutoff only cleans components found with the first cutoff, so if there's nothing to clean it won't get to that stage.

Cheers,

Mark

Re: CLEAN iterations

PostPosted: Tue Aug 06, 2019 3:04 pm
by bnorfolk
Great thanks again!