Running PyBDSF

This module contains all the functionality to run a FITS image through the LOFAR source finding software PyBDSF (https://github.com/lofar-astron/PyBDSF). The class BDSFImage() creates an object whose attributes can be any number of PyBDSF parameters. Source finding is performed by calling the object method find_sources(), which calls the PyBDSF function process_image() and returns the output object.

class sourcefinding.runbdsf.BDSFImage(image, **kwargs)[source]

Bases: database.dbclasses.Image

Object to be manipulated and read into PyBDSF. Inherits all methods defined for Image class, but overrides initialization. The number of attributes and their values will change based on what the user specifies in the run configuration file.

find_sources(**kwargs)[source]

Run PyBDSF process_image() task using object attributes as parameter inputs. Returns None if PyBDSF fails. Wrapped in a timeout function so processing is killed if taking longer than 5 minutes.

get_attr()[source]

Return all object attributes as a dictionary. This is fed into bdsf.process_image() as parameter arguments.

minimize_islands()[source]

Incrementally increases and decreases the bdsf.process_image() argument rms_box box size until a minimum number of islands are found. This technique works best on images with significant artifacts where false detections are the biggest concern. This also takes a really long time since it is running bdsf.process_image numerous times, so is probably only ever worth using when analyzing a small number of images.

set_rms_box()[source]

Sets the PyBDSF rms_box parameter to a box size 1/10th of the image size and a step size one third of the box size. This “VLITE default” rms_box yields slightly better results with fewer artifacts than if left as a free parameter for PyBDSF to calculate. A custom rms_box can be defined in the configuratrion file which will supersede the one defined here.

sourcefinding.runbdsf.write_sources(out)[source]

Calls PyBDSF functions write_catalog() and export_image() to record results from source finding on an image.

Parameters:out (bdsf.image.Image instance) – The object output by PyBDSF after running its source finding task process_image().