pint.utils

Miscellaneous potentially-helpful functions.

Functions

ELL1_check(A1, E, TRES, NTOA[, outstring])

Check for validity of assumptions in ELL1 binary model

FTest(chi2_1, dof_1, chi2_2, dof_2)

Run F-test.

add_dummy_distance(c[, distance])

Adds a dummy distance to a SkyCoord object for applying proper motion

akaike_information_criterion(model, toas)

Compute the Akaike information criterion (AIC).

bayesian_information_criterion(model, toas)

Compute the Bayesian information criterion (BIC).

check_all_partials(f, args[, delta, atol, rtol])

Check the partial derivatives of a function that returns derivatives.

check_longdouble_precision()

Check whether long doubles have adequate precision.

colorize(text[, fg_color, bg_color, attribute])

Colorizes a string (including unicode strings) for printing on the terminal

compute_hash(filename)

Compute a unique hash of a file.

convert_dispersion_measure(dm[, dmconst])

Convert dispersion measure to a different value of the DM constant.

divide_times(t, t0[, offset])

Divide input times into years relative to t0

dmwavex_setup(model, T_span[, freqs, ...])

Set-up a DMWaveX model based on either an array of user-provided frequencies or the wave number frequency calculation.

dmx_ranges(toas[, divide_freq, binwidth, ...])

Compute initial DMX ranges for a set of TOAs

dmx_ranges_old(toas[, divide_freq, offset, ...])

Compute initial DMX ranges for a set of TOAs

dmx_setup(t[, minwidth, mintoas])

Set up DMX bins with a minimal binning strategy

dmxparse(fitter[, save])

Run dmxparse in python using PINT objects and results.

dmxselections(model, toas)

Map DMX selections to TOAs

dmxstats(model, toas[, file])

Print DMX statistics

find_optimal_nharms(model, toas, component)

Find the optimal number of harmonics for WaveX/DMWaveX using the Akaike Information Criterion.

find_prefix_bytime(model, prefixname, t)

Identify matching index(es) for a prefix parameter like DMX

get_conjunction(coord, t0[, precision, ecl])

Find first time of Solar conjuction after t0 and approximate elongation at conjunction

get_prefix_timerange(model, prefixname)

Get time range for a prefix quantity like DMX or SWX

get_prefix_timeranges(model, prefixname)

Get all time ranges and indices for a prefix quantity like DMX or SWX

get_unit(parname)

Return the unit associated with a parameter

get_wavex_amps(model[, index, quantity])

Return the WaveX amplitudes for a timing model.

get_wavex_freqs(model[, index, quantity])

Return the WaveX frequencies for a timing model.

group_iterator(items)

An iterator to step over identical items in a numpy.ndarray

has_astropy_unit(x)

Test whether x has a unit attribute containing an astropy unit.

info_string([prefix_string, comment, detailed])

Returns an informative string about the current state of PINT.

interesting_lines(lines[, comments])

Iterate over lines skipping whitespace and comments.

lines_of(f)

Iterate over the lines of a file, an open file, or an iterator.

list_parameters([class_])

List parameters understood by PINT.

merge_dmx(model, index1, index2[, value, frozen])

Merge two DMX bins

normalize_designmatrix(M, params)

Normalize each row of the design matrix.

numeric_partial(f, args[, ix, delta])

Compute the partial derivative of f numerically.

numeric_partials(f, args[, delta])

Compute all the partial derivatives of f numerically.

open_or_use(f[, mode])

Open a filename or use an open file.

parse_time(input[, scale, precision])

Parse an astropy.time.Time object from a range of input types

pldmnoise_from_dmwavex(model[, ignore_fyr])

Convert a DMWaveX representation of red noise to a PLDMNoise representation.

plrednoise_from_wavex(model[, ignore_fyr])

Convert a WaveX representation of red noise to a PLRedNoise representation.

pmtot(model)

Compute and return the total proper motion from a model object

print_color_examples()

Print example terminal colors and attributes for/using colorize()

remove_dummy_distance(c)

Removes a dummy distance from a SkyCoord object after applying proper motion

require_longdouble_precision()

Raise an exception if long doubles do not have enough precision.

sherman_morrison_dot(Ndiag, v, w, x, y)

Compute an inner product of the form

split_dmx(model, time)

Split an existing DMX bin at the desired time

split_prefixed_name(name)

Split a prefixed name.

split_swx(model, time)

Split an existing SWX bin at the desired time

taylor_horner(x, coeffs)

Evaluate a Taylor series of coefficients at x via the Horner scheme.

taylor_horner_deriv(x, coeffs[, deriv_order])

Evaluate the nth derivative of a Taylor series.

translate_wave_to_wavex(model)

Go from a Wave model to a WaveX model

translate_wavex_to_wave(model)

Go from a WaveX timing model to a Wave timing model.

wavex_setup(model, T_span[, freqs, n_freqs, ...])

Set-up a WaveX model based on either an array of user-provided frequencies or the wave number frequency calculation.

weighted_mean(arrin, weights_in[, ...])

Compute weighted mean of input values

woodbury_dot(Ndiag, U, Phidiag, x, y)

Compute an inner product of the form

xxxselections(model, toas[, prefix])

Map DMX/SWX/other selections to TOAs

Classes

PosVel(pos, vel[, obj, origin])

Position/Velocity class.

dmxrange(lofreqs, hifreqs)

Internal class for building DMX ranges

Exceptions

PINTPrecisionError

PrefixError