pipeline.infrastructure.utils.imaging

The imaging module contains utility functions used by the imaging tasks.

TODO These utility functions should migrate to hif.tasks.common

Functions

chan_selection_to_frequencies(img, selection)

Convert channel selection to frequency tuples for a given CASA cube.

equal_to_n_digits(x, y[, numdigits])

Approximate equality check up to a given number of digits.

freq_selection_to_channels(img, selection)

Convert frequency selection to channel tuples for a given CASA cube.

intersect_ranges(ranges)

Compute intersection of ranges.

intersect_ranges_by_weight(ranges, delta, …)

Compute intersection of ranges through weight arrays and a threshold.

merge_ranges(ranges)

Merge overlapping and adjacent ranges and yield the merged ranges in order.

set_nested_dict(dct, keys, value)

Set a hierarchy of dictionaries with given keys and value for the lowest level key.

spw_intersect(spw_range, line_regions)

This utility function takes a frequency range (as numbers with arbitrary but common units) and computes the intersection with a list of frequency ranges defining the regions of spectral lines.

update_beams_dict(dct, udct)

Update a beams dictionary.

update_sens_dict(dct, udct)

Update a sensitivity dictionary.