Skip to content

Hogbom class

pgabor edited this page Oct 3, 2017 · 1 revision

Hogbom class

Purpose

If your visibility data is not perfect, or if the u, v coordinates do not form a regular grid, different artifacts going to appear on the final image when you convert the visibility data to an intensity map. CLEAN's purpose to eliminate the artifacts coming from the previously mentioned causes. This approach works in the image space.

Use of the class

First of all, it should be imported:

from xrayvision.Clean import Hogbom

You have two ways to use CLEAN on your data. The first option when you have an np.array with the image what should be cleaned, and you also have the dirty beam as an np.array too.

In that case you can use the Hogbom.clean() function to do the work for you.

In the other case, you have your Visibility object with data, and a np.array which represents the dirty beam. It can be smaller than the shape of the final image. In that case you have to create a Hogbom object to clean your data. See the information about that later.

Note: Hogbom uses the v2 functions for Fourier transformation which means it is fully compatible with data from RHESSI Fits file containing visibilities for example.

Hogbom.clean()

Högbom's CLEAN can be imagined in a way that we are slowly shaving off the tip of our data while we our building a sky map from point sources. To clean our data the following should be issued:

result = Hogbom.clean(dirty_map, dirty_beam, clean_beam_width=4.0, gain=0.1, thres=0.01, niter=1000)

The clean_beam_width parameter sets the standard deviation of the gaussian which is convolved with the sky map.

The gain parameter sets the strongness of the "shaving" for each iteration.

The thres parameter sets a limit for the iteration process. It is going to stop if the maximal value in the dirty_map goes under this.

The niter parameter sets an iteration count limit for the process.

CLEANing based on a Visbility object

To work with the visibilities you need the following approach:

clean = Hogbom(vis, dirty_beam, threshold, output_image_size, gain=0.01, niter=1000)

Import the ReasonOfStop class which is needed to iterate and it also helps to determine why the iterations stopped:

from xrayvision.Clean import ReasonOfStop

Start to iterate:

while clean.iterate(gain=False) is ReasonOfStop.NOT_FINISHED: # The gain can be reset for each step
    pass

After this state is reached the final image can be generated with the following:

# stdev is the standard deviation of
# the Gaussian which is convolved with the sky map
result_image = clean.finish(stdev)

Voilá! You have a CLEANed image, just play around with the parameters to find the best results!