SFind2D_AT — Finds sources in a 2D map.¶

This module defines the SFind2D_AT class.

class admit.at.SFind2D_AT.SFind2D_AT(**keyval)[source]

Find sources in a 2-D map – Sources are found based on peak flux density (Jy/beam) and fitted with a Gaussian to determine source parameters. The AT uses the CASA findsources task. The key words allow the cutoff level for source discovery to be limited either by N times the RMS noise or by a dynamic range. The latter is important when a strong source in the image increases noise local to that source. SFind2d_AT can be used on continuum maps, moment maps, or other 2-D images. It is likely to give poor fits for sources that extend over many beams.

Keywords

sigma: float
The noise level to be used for calculating the cutoff value. Negative value: the RMS is obtained from the CubeStats_BDP, if provided; otherwise it is calculated via call to imstat using the region parameter. Positive value: override CubeStats, the user provided value is utilized. Default: -1.0.
numsigma: float
The lower cutoff level for source finder in terms of sigma. Default: 6.0.
robust: list

A compound list keyword describing how robust statistics is used. By default all data are used, with CASA’s “medabsdevmed” (MAD) statistic as the robust noise estimator. For normal (gaussian) noise, RMS = 1.4826 * MAD.

For more flexible noise statistics see CASA::imstat for a detailed background, but the current valid algorithms and their optional additional arguments are:

‘classic’,clmethod{‘auto’,’tiled’,’framework’}

‘chauvenet’,zscore[-1],maxiter[-1]

‘fit-half’,center{‘mean’,’median’,’zero’},lside{True,False}

‘hinges-fences’,fence[-1]

Examples:

robust=[‘classic’,’auto’]

robust=[‘fit-half’,’zero’]

robust=[‘hin’,1.5]

Used only if sigma is negative and there is no CubeStats_BDP given.

snmax: float

Maximum dynamic range between strongest source in map and sigma computed or provided. Used to calculate a new sigma if the previously computed sigma implies a larger dynamic range [(map max)/”sigma”] than requested here. Negative – use the (nsgima * sigma) value for limiting flux density Default: 35

Example:

snmax= 35.0

Limits search to 1/35th brightness of max source in map – good default for pipeline ALMA images which have not been selfcaled.

nmax: int
Maximum sources that will be searched for in the map. Default: 30
region: string

Region to search for sources. Format is CASA region specification. Default: entire image.

Example:

region=’box[[10pix,10pix],[200pix,200pix]]’

region=’circle[[19h58m52.7s,+40d42m06.04s ],30.0arcsec]’

zoom: int
Image zoom ratio applied to the source map plot. This does not affect the base (CASA) image itself. Default: 1.

Input BDPs

SpwCube_BDP: count: 1
Input 2-D map, typically from Moment_AT. Needs to be a noise-flat map. Ingest_AT has the option for creating a noise-flat map from a primary beam corrected map and a primary beam.
CubeStats_BDP: count: 1 (optional)
Output from CubeStats_AT executed on the input image cube. Optional, see description of sigma keyword.

Output BDPs

SourceList_BDP: count: 1
An image and table with source information, ordered by peak flux density. Can be input to CubeStats_AT to produce spectra at each source position.
Parameters: keyval : dictionary, optional

Attributes

 _version (string)

Methods

 addinput(item[, slot]) Add a BDP input to an AT. addinputbdp(item[, slot, insert]) Add a BDP to the _bdp_in list. addoutput(item[, slot]) Add a BDP output product to an AT. addoutputbdp(item[, slot, insert]) Add a BDP to the _bdp_out list. baseDir([path]) Get/set project base directory. bestMatch(at1, at2) Determines the better match of two tasks to the current one. checkfiles() Check if the files from all the BDP_out’s in an AT exist. checktype(item) Check the type of an object to see if it is a BDP. clearinput() Clear the input BDP list. clearoutput([delete]) Clear the output BDP list. copy() Creates an independent duplicate of the task. delete() Method to delete the AT and underlying BDPs. delinput(slot) Delete a specific BDP in the _bdp_in list. deloutput(slot) Delete a specific BDP in the _bdp_out list. dir([filename]) Absolute directory reference of the ADMIT project. dryrun() Method to do a dry run of the AT, generally just checks input values for errors. enabled([state]) Returns current task enabled setting, with optional reset. execute([args]) Executes the task. freeAlias(aliases[, alias]) Deletes alias reservation, if present. get(attrib) Method to get the given attributes value getProject() Retrieves project ID associated with the task. getVersion() Return the version string. getdtd(fl) Method to write out the dtd data. geteffectivelevel() Method to get the effective logging level of the logging subsystem getkey(key) Retrieval value for a key. getloggername() Method to get the name of the logger for this AT instance getlogginglevel() Method to get the current logging level of the AT haskey(key) Query if a key exists for an AT. html(inheader) Method to represent the current AT in HTML format. id([strip]) Returns task ID number. isAutoAlias([withEmpty, compat]) Whether the task alias appears to be auto-generated. isequal(at) Method to determine if two ATs are the same. isstale() Returns whether the AT is out of date. len2() Returns the length of _bdp_in and _bdp_out in a tuple. link() Increments the task link count. markChanged() Mark an AT that it’s state was changed, so it would need to be rerun. markUpToDate() Resets _stale to indicate that the AT does not need to be run. merge(at[, aliases]) Merges attributes from another task. mkdir(dirname) Make a directory in the ADMIT hierarchy. mkext(filename, ext[, alias]) Return a new filename with a new extension with optional ADMIT alias. newId(tid) Assigns the task a new ID number. reset(a) Performs an in-place shallow copy. run() The run method creates the BDP running([state]) Returns current task execution flag, with optional reset. save() Save (write) any BDPs connected to this AT. set(item, val) Method to set protected attributes, rather than direct access setAlias(aliases[, alias, auto]) Sets and registers the task alias, guaranteed unique among registered aliases. setProject(pid) Adds a project ID to task ID. set_bdp_in([bdpin]) Validate the _valid_bdp_in list and digest it into the appropriate attributes. set_bdp_out([bout]) Validate the _valid_bdp_out list and digest it into the appropriate attributes. seteffectivelevel(level) Method to set the effective logging level of the logging subsystem setkey([name, value, isinit]) Set keyword value. setloggername(name) Method to set the name of the logger for this AT instance setlogginglevel(level) Method to set the logging level show() Return the AT type. statusicons() return some html icons representing the enabled/stale status of this task summary() Returns the summary dictionary from the AT, for merging into the ADMIT Summary object. unlink() Decrements the task link count. userdata() Returns the user dictionary from the AT, for merging into the ADMIT userdata object. validateinput([describe]) Method to validate the _bdp_in’s against a dictionary of expected types. validatekeys() Method to error check all input keys. write(node) Method to write the AT to disk.
run()[source]

The run method creates the BDP

Parameters: None None
summary()[source]

Returns the summary dictionary from the AT, for merging into the ADMIT Summary object.