PVCorr_AT — Determines position-velocity correlations in a map.¶
Defines the PVCorr_AT class.
-
class
admit.at.PVCorr_AT.
PVCorr_AT
(**keyval)[source]¶ PV correllation in a PVSlice map.
PVCorr_AT computes a cross-correlation of a feature in a PVSlice with the whole PVSlice, looking for repeated patterns to detect spectral lines. Much like the output from CubeStats_AT and CubeSpectrum_AT, this table can then be given to LineID_AT to attempt a line identification.
See also PVCorr_AT for the design document.
Keywords
- numsigma: float
- Minimum intensity, in terms of sigma, above which a selected portion of the spectrum will be used for cross-correlation. Default: 3.0.
- range: integer list
- If given, it has to be a list with 2 channel numbers, the first and last channel (0-based channels) of the range which to use for the cross-correlation. Default: [].
- nchan: integer
- The number of channels (in case range= was not used) that defines the line. The line is centers on the strongest point in the input PV-map. If 0 is given, it will watershed down from the strongest line. Default: 0.
Input BDPs
- PVSlice_BDP: count: 1
- Input PV slice, normally from a PVSlice_AT.
- CubeStats_BDP: count: 1
- Input cube statistics from which the RMS is taken, received from a CubeStats_AT.
Output BDPs
- PVCorr_BDP: count: 1
- Output table.
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. mode3
(data, v0, v1[, dmin])v0..v1 (both inclusive) are channel selections newId
(tid)Assigns the task a new ID number. reset
(a)Performs an in-place shallow copy. run
()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.
-
admit.at.PVCorr_AT.
mode1
(data, v0, v1, dmin=0.0, normalize=False)[source]¶ faster 1D version of mode2 This works by forcing mode=’valid’ and making the X (position) dimension of the template the same as the PV diagram. We then pad the ends of the PV with zero’s. Introduces some complexity how to return the correct shape v0..v1 (both inclusive) are channel selections threshold on dmin @todo the frequency axis may not be properly calibrated here
@todo plot the template for debug, like in mode3
-
admit.at.PVCorr_AT.
mode2
(data, v0, v1, dmin=0.0)[source]¶ v0..v1 (both inclusive) are channel selections threshold on dmin for odd number of channels, center line in mode2 will be same as mode1 @todo the frequency axis is not properly calibrated here @todo a full 2D is slow, we only need the 1D version