luv_finder.catalogue¶
Module Attributes
How the likelihood ratio and the fidelity combine into |
|
Default reliability tests: the S/N floor of the groups, the likelihood ratio |
|
Lowest S/N of the noise peaks the noise model is fitted to (the data's groups start at |
|
Fewest noise peaks above |
|
Width of the Gaussian prior on the exponent |
|
Units of the |
|
|
Functions
|
The detections whose sidelobes reach |
|
Catalogue the line candidates of a search: one row per group of the data, by S/N descending. |
|
Catalogue the continuum sources of a search's continuum per window ( |
|
Id of a brighter group of the same line in another unit (another |
|
Fidelity |
|
Group the local maxima of |
|
Robust spread of the jackknife S/N per template, |
|
|
|
One catalogue of several searches (e.g. one per spectral window), its reliability over their whole volume. |
|
Expected noise peaks at or above |
|
Which groups pass the likelihood ratio and which the fidelity (NaN passes neither). |
|
Exponent |
|
Measure the correlation function of the response under the null on the search's jackknife. |
Classes
|
Local maxima of the S/N merged into one candidate (see |
|
Correlation function of the matched-filter response under the null (see |
- luv_finder.catalogue.DETECTION_RULE = 'and'¶
How the likelihood ratio and the fidelity combine into
detected: “and” (both) or “or” (either).
- luv_finder.catalogue.EXPONENT_PRIOR = 1.0¶
Width of the Gaussian prior on the exponent
m, about the field’s dimension minus one.
- class luv_finder.catalogue.Group(i: int, j: int, t: int, k: int, snr: float, n_peaks: int)[source]¶
Local maxima of the S/N merged into one candidate (see
groups()).
- luv_finder.catalogue.MIN_NOISE = 10¶
Fewest noise peaks above
NOISE_FLOORto fit the model to; fewer, and nothing is detected.
- luv_finder.catalogue.NOISE_FLOOR = 2.5¶
Lowest S/N of the noise peaks the noise model is fitted to (the data’s groups start at
floor).
- luv_finder.catalogue.RELIABILITY = {'fidelity_min': 0.6, 'floor': 4.0, 'k': 3.0, 'rule': 'and'}¶
Default reliability tests: the S/N floor of the groups, the likelihood ratio
k, the fidelity and the rule.
- class luv_finder.catalogue.ResponseCorrelation(spatial: ndarray, lags_ra: ndarray, lags_dec: ndarray, spectral: ndarray, templates: ndarray, hwhm_major: ndarray, hwhm_minor: ndarray, pa: ndarray, spectral_hwhm: ndarray, spectral_hwhm_kms: ndarray, sidelobe: ndarray)[source]¶
Correlation function of the matched-filter response under the null (see
response_correlation()).
- luv_finder.catalogue.SEARCH_META = ('jackknife_spread', 'hwhm_major', 'hwhm_minor', 'pa', 'spectral_hwhm', 'sidelobe')¶
metaofcatalogue()that belongs to one search, kept per part bymerge_catalogues().
- luv_finder.catalogue.UNITS = {'bmaj': 'arcsec', 'bmin': 'arcsec', 'ddec': 'arcsec', 'dec': 'deg', 'dra': 'arcsec', 'error': 'Jy', 'flux': 'Jy', 'freq_ghz': 'GHz', 'line_flux': 'Jy km/s', 'line_flux_error': 'Jy km/s', 'pa': 'deg', 'ra': 'deg', 'width': 'km/s'}¶
Units of the
catalogue()columns.
- luv_finder.catalogue.bright(cat: Table, floor: float) ndarray[source]¶
The detections whose sidelobes reach
floor: S/N at least the brightest’s times the response’s highestsidelobe, none if the brightest’s own sidelobes stay belowfloor. They are subtracted in rounds.
- luv_finder.catalogue.catalogue(result: SearchResult, ref=None, floor: float = 4.0, k: float = 3.0, fidelity_min: float = 0.6, rule: str = 'and', band: tuple[float, float] | None = None) Table[source]¶
Catalogue the line candidates of a search: one row per group of the data, by S/N descending.
The noise correlation of
resultis measured, and the data, the jackknife and the negated data are grouped (groups()) on the filter’s S/N (see the module docstring), the data fromfloor, the jackknife and the negated data fromNOISE_FLOOR. Each data group gets the likelihood ratio and the fidelity against the noise peak counts modelled on the jackknife’s groups of its own kernel (peak_exponent(),likelihood(),fidelity()). It isdetectedifLambda >= kand its fidelity is at leastfidelity_min(rule="and", the default), or either (rule="or"); without a noise model (fewer thanMIN_NOISEnoise peaks) nothing is. Nothing is clipped: the candidates arecat[cat["detected"]].- Parameters:
- resultSearchResult
PB-corrected (and, for a mosaic, combined) search with its jackknife.
- ref(RA, Dec) in rad, optional
The sky frame’s reference (
ref); addsraanddec.- floorfloat
Lowest S/N of a local maximum, and the lower edge of the fidelity bins.
- kfloat
Likelihood-ratio threshold.
- fidelity_minfloat
Fidelity threshold.
- rule{“or”, “and”}
How the two tests combine into
detected.- band(low, high) Hz, optional
Keep only the groups (of the data, the jackknife and the negated data) that peak in
low <= nu < high: the chunk’s own part of a spectrum searched in overlapping chunks.
- Returns:
- astropy.table.Table
Columns
id,dra,ddec(arcsec),ra,dec(deg, withref),freq_ghz, the template’sbmin,bmaj,paandwidth, thesnr,fluxanderror(Jy) andline_flux,line_flux_error(Jy km/s) at the brightest maximum,coverage,n_peaks,likelihood,fidelityanddetected.metaholds thejackknife_spread, the noise correlation’shwhm_major,hwhm_minor,pa,spectral_hwhmandsidelobe, the thresholds, the noise model (noise_floor,noise_exponent,kernels), the lowest data S/N withLambda >= k(snr_likelihood) and with a fidelity of at leastfidelity_min(snr_fidelity), NaN if none, the S/N of every group of the data, the jackknife and the negated data (snr_data,snr_jackknife,snr_negative) and the binned fidelity (fidelity_bins), all as lists and floats.
- Raises:
- ValueError
If
resulthas no jackknife.
- luv_finder.catalogue.continuum_catalogue(windows: SearchResult, ref=None, **reliability) Table[source]¶
Catalogue the continuum sources of a search’s continuum per window (
SearchResult.continuum).Grouped and tested as
catalogue()on the windows combined (continuum(),freq_ghztheir mean frequency), each source has its in-band spectrum, the flux density and error of every window at its position and template (meta["spectra"]), and the spectral indexalpha(S ~ nu^alpha) fitted to it, linearised aboutfreq_ghz.
- luv_finder.catalogue.duplicates(cat: Table, beam: dict, by: str = 'unit') ndarray[source]¶
Id of a brighter group of the same line in another unit (another
by), else 0, for every row ofcat.Two groups are one line when they are within
beam[unit](arcsec) of each other and their templates overlap,|dv| <= (FWHM_a + FWHM_b) / 2: a line wider than the gap it straddles between two windows is found once in each, its halves far apart in frequency.catis sorted by S/N.
- luv_finder.catalogue.fidelity(snr_data, snr_noise, noise, floor: float, step: float = 0.25) tuple[ndarray, dict][source]¶
Fidelity
1 - N_noise / N_dataper S/N bin fromfloor,N_noisefrom the noise modelnoise.Every data group gets its bin’s fidelity. The bins hold the counts of the data and of the noise groups
snr_noise, their binned fidelity with its error (for the eye) and themodelfidelity.
- luv_finder.catalogue.groups(snr: ndarray, result: SearchResult, nc: ResponseCorrelation, floor: float = 4.0) list[Group][source]¶
Group the local maxima of
snrinto candidates, one per source, brightest first.
- luv_finder.catalogue.jackknife_spread(result: SearchResult) ndarray[source]¶
Robust spread of the jackknife S/N per template,
(n_template,): 1 under H0.
- luv_finder.catalogue.likelihood(snr_data, noise) ndarray[source]¶
N_data(>= gamma) / N_noise(>= gamma)at every data S/N (Vio & Andreani 2021);noise(u)the expected noise peaks at or aboveu(noise_above()), infinite where it is zero.
- luv_finder.catalogue.merge_catalogues(cats: Sequence[Table], reliability: dict | None = None, beam: dict | None = None) Table[source]¶
One catalogue of several searches (e.g. one per spectral window), its reliability over their whole volume.
reliability(floor,k,fidelity_min,rule) overrides the searches’ own, so the tests can change without a new search. Withbeam(arcsec perunit), a line found by two searches (duplicates()) counts once: the fainter group getsduplicate_ofand is not detected.
- luv_finder.catalogue.noise_above(u, n: int, m: float, floor: float = 2.5) ndarray[source]¶
Expected noise peaks at or above
uof a kernel withnnoise peaks abovefloor.
- luv_finder.catalogue.passes(ratio, fid, k: float, fidelity_min: float) tuple[ndarray, ndarray][source]¶
Which groups pass the likelihood ratio and which the fidelity (NaN passes neither).
- luv_finder.catalogue.peak_exponent(snr_noise, dim: int, floor: float = 2.5) float[source]¶
Exponent
mof the noise peak countsN(>= u) ~ u^m exp(-u^2 / 2)abovefloor, by unbinned MAP.The expected number of peaks of a smooth Gaussian field of dimension
dimaboveu(its Euler characteristic, Vio & Andreani 2021) is a polynomial inutimesexp(-u^2 / 2), of degreedim - 1: the prior’s centre,EXPONENT_PRIORwide, so a few noise peaks (a continuum) cannot drivemfar off and many (a line search) set it. NaN, with a warning, belowMIN_NOISEpeaks.
- luv_finder.catalogue.response_correlation(result: SearchResult, max_lag: float = 30.0, max_lag_chan: int | None = None) ResponseCorrelation[source]¶
Measure the correlation function of the response under the null on the search’s jackknife.