MCALF utils

This sub-package contains:

  • Functions for processing spectra (mcalf.utils.spec).

  • Functions for smoothing n-dimensional arrays (mcalf.utils.smooth).

  • Functions for masking the input data to limit the region computed (mcalf.utils.mask).

  • Functions for helping with plotting (mcalf.utils.plot).

  • Classes for managing collections of data (mcalf.utils.collections).

  • Miscellaneous utility functions (mcalf.utils.misc).

mcalf.utils Package

mcalf.utils.spec Module

Functions

reinterpolate_spectrum(spectrum, …)

Reinterpolate the spectrum.

normalise_spectrum(spectrum[, …])

Normalise an individual spectrum to have intensities in range [0, 1].

generate_sigma(sigma_type, wavelengths, …)

Generate the default sigma profiles.

mcalf.utils.smooth Module

Functions

moving_average(array, width)

Boxcar moving average.

gaussian_kern_3d([width, sigma])

3D Gaussian kernel.

smooth_cube(cube, mask, **kwargs)

Apply Gaussian smoothing to velocities.

mask_classifications(class_map[, vmin, …])

Mask 2D and 3D arrays of classifications.

mcalf.utils.mask Module

Functions

genmask(width, height[, radius, …])

Generate a circular mask of specified size.

radial_distances(n_cols, n_rows)

Generates a 2D array of specified shape of radial distances from the centre.

mcalf.utils.plot Module

Functions

hide_existing_labels(plot_settings[, axes, fig])

Hides labels for each dictionary provided if label already exists in legend.

calculate_axis_extent(resolution, px[, …])

Calculate the extent from a resolution value along a particular axis.

calculate_extent(shape, resolution[, …])

Calculate the extent from a particular data shape and resolution.

class_cmap(style, n)

Create a listed colormap for a specific number of classifications.

mcalf.utils.collections Module

Classes

Parameter(name[, value])

A named parameter with a optional value.

ParameterDict([dict])

An unordered dictionary of Parameter objects.

OrderedParameterDict

An ordered dictionary of Parameter objects.

BaseParameterDict()

A base class for dictionaries of Parameter objects.

SyncedParameters()

Database for keeping Parameter objects in sync.

Class Inheritance Diagram

Inheritance diagram of mcalf.utils.collections.Parameter, mcalf.utils.collections.ParameterDict, mcalf.utils.collections.OrderedParameterDict, mcalf.utils.collections.BaseParameterDict, mcalf.utils.collections.SyncedParameters

mcalf.utils.misc Module

Functions

make_iter(*args)

Returns each inputted argument, wrapping in a list if not already iterable.

load_parameter(parameter[, wl])

Load parameters from file, optionally evaluating variables from strings.

merge_results(filenames, output)

Merges files generated by the mcalf.models.FitResults.save() method.

update_signature(cls)

Update the signature of a model class.