pipeline.infrastructure.utils.utils

The utils module contains general-purpose uncategorised utility functions and classes.

Functions

approx_equal(x, y[, tol])

Return True if two numbers are equal within the given tolerance.

are_equal(a, b)

Return True if the contents of the given arrays are equal.

dict_merge(a, b)

Recursively merge dictionaries.

fieldname_clean(field)

Indicate if the fieldname is allowed as-is.

fieldname_for_casa(field)

Prepare field string to be used as CASA argument.

find_ranges(data)

Identify numeric ranges in string or list.

flagged_intervals(vec)

Idendity isnads of ones in input array or list.

get_casa_quantity(value)

Wrapper around quanta.quantity() that handles None input.

get_field_accessor(ms, field)

Returns accessor to field name or field ID, if field name is ambiguous.

get_field_identifiers(ms)

Maps numeric field IDs to field names.

get_num_caltable_polarizations(caltable)

Obtain number of polarisations from calibration table.

get_receiver_type_for_spws(ms, spwids)

Return dictionary of receiver types for requested spectral window IDs.