sourcefinder.utility.cli#

Simple interface to TKP source identification & measurement code. John Sanders & John Swinbank, 2011.

This is a simplified script for running source finding with a minimal set of arguments. It does not provide a full configuration interface or access to all features.

Run as:

$ pyse file …

For help with command line options:

$ pyse –help

See chapters 2 & 3 of Spreeuw, PhD Thesis, University of Amsterdam, 2010, <http://dare.uva.nl/en/record/340633> for details.

Functions#

bailout(reason)

construct_argument_parser()

csv(sourcelist, conf)

Return a string containing a csv from the extracted sources.

get_beam(bmaj, bmin, bpa)

get_detection_labels(filename, det, anl, beam, ...[, ...])

handle_args([args])

Parses command line options & arguments using OptionParser.

main()

parse_monitoringlist_positions(args[, str_name, list_name])

Load a list of monitoring list (RA, Dec) tuples from command

parse_none(value)

regions(sourcelist)

Return a string containing a DS9-compatible region file describing all the

run_sourcefinder(files, conf, mode)

Iterate over the list of files, running a sourcefinding step on each in

skymodel(sourcelist[, ref_freq])

Return a string containing a skymodel from the extracted sources for use

summary(filename, sourcelist)

Return a string containing a human-readable summary of all sources in

writefits(filename, data[, header])

Module Contents#

sourcefinder.utility.cli.bailout(reason)[source]#
sourcefinder.utility.cli.construct_argument_parser()[source]#
sourcefinder.utility.cli.csv(sourcelist, conf)[source]#

Return a string containing a csv from the extracted sources.

sourcefinder.utility.cli.get_beam(bmaj, bmin, bpa)[source]#
sourcefinder.utility.cli.get_detection_labels(filename, det, anl, beam, configuration, plane=0)[source]#
sourcefinder.utility.cli.handle_args(args=None)[source]#

Parses command line options & arguments using OptionParser. Options & default values for the script are defined herein.

sourcefinder.utility.cli.main()[source]#
sourcefinder.utility.cli.parse_monitoringlist_positions(args, str_name='monitor_coords', list_name='monitor_list')[source]#

Load a list of monitoring list (RA, Dec) tuples from command line arguments.

This function processes the flags –monitor-coords and –monitor-list. It does not handle units, which should be matched against the requirements of the consuming code.

Parameters:
argsargparse.Namespace

The command line arguments object.

str_namestr, default: “monitor_coords”

The name of the argument containing the JSON string of coordinates.

list_namestr, default: “monitor_list”

The name of the argument containing the file path to a JSON file with coordinates.

Returns:
list[tuple[float, float]]

A list of (RA, Dec) tuples parsed from the input arguments.

Raises:
json.JSONDecodeError

If the JSON string or file content cannot be parsed.

sourcefinder.utility.cli.parse_none(value)[source]#
sourcefinder.utility.cli.regions(sourcelist)[source]#

Return a string containing a DS9-compatible region file describing all the sources in sourcelist.

sourcefinder.utility.cli.run_sourcefinder(files, conf, mode)[source]#

Iterate over the list of files, running a sourcefinding step on each in turn. If specified, a DS9-compatible region file and/or a FITS file showing the residuals after Gaussian fitting are dumped for each file. A string containing a human readable list of sources is returned.

sourcefinder.utility.cli.skymodel(sourcelist, ref_freq=73800000)[source]#

Return a string containing a skymodel from the extracted sources for use in self-calibration.

sourcefinder.utility.cli.summary(filename, sourcelist)[source]#

Return a string containing a human-readable summary of all sources in sourcelist.

sourcefinder.utility.cli.writefits(filename, data, header={})[source]#