API Reference#

madcubapy.utils Package#

The madcubapy.utils package provides utility functions to help the user work with astronomical data.

Functions#

calculate_polygon_centroid(vertices)

Return the centroid of a polygon.

convert_spectral_resolution(spectral_res, ...)

Convert a channel width between velocity and frequency.

create_spectral_array(nchan, cdelt, crpix, crval)

Create a spectral axis array.

estimate_rms_peak(peak_int, snr)

Estimate the rms for a given peak intensity and desired SNR of a line

estimate_rms_profile_fit(area, fwhm, dv, snr)

Measure the SNR of a line by integrating the emission on the fitted gaussian profile

measure_snr_peak(peak_int, rms)

Measure the peak SNR of a line by providing peak intensity and rms

measure_snr_profile_fit(area, fwhm, dv, rms)

Measure the SNR of a line by integrating the emission on the fitted gaussian profile

measure_snr_profile_observed(x_array, ...[, ...])

Measure the SNR of a line by integrating the emission on the observed channels.

obs_to_rest(obs_freq, radial_velocity[, ...])

Convert observed frequency to rest frequency.

obs_to_vel(obs_freq, doppler_rest[, ...])

Convert observed frequency to velocity.

polygon_area(vertices)

Measure the area of a polygon's vertices.

polygon_signed_area(vertices)

Compute the signed area of a polygon.

rest_to_obs(rest_freq, radial_velocity[, ...])

Convert rest frequency to observed frequency.

rest_to_vel(rest_freq, radial_velocity, ...)

Convert rest frequency to velocity.

vel_to_obs(vel, doppler_rest[, ...])

Convert velocity to observed frequency.

vel_to_rest(vel, radial_velocity, doppler_rest)

Convert velocty to rest frequency.