kessler.util

kessler.util#

Functions

add_days_to_date_str(date0, days)

Adds a number of days to a date string.

add_megaconstellation_from_file(tles, ...)

This function takes a list of TLEs and a megaconstellation file name, and returns a list of the original TLEs plus the TLEs of the added megaconstellation.

build_megaconstellation(launch_date[, ...])

This function creates a list of TLEs for a given specified megaconstellation.

create_priors_from_tles(tles[, ...])

This function takes a list of TLEs and a dictionary of mixture_components numbers, and returns a dictionary of prior distributions for the TLE elements, by fitting probability density functions to data using the specified number of mixture components for each element.

doy_2_date(value, doy, year, idx)

Based on source code @ nasa/CARA_Analysis_Tools (adapted by Andrew Ng, 18/03/2022) Use the datetime python package.

find_closest(values, t)

Finds the closest value in a list of values to a given value.

fit_mixture(values, *args, **kwargs)

Fit a Gaussian Mixture Model to the given data.

from_TEME_to_ITRF(state, time)

from_cartesian_to_keplerian(r_vec, v_vec, mu)

This function converts the provided state from Cartesian to Keplerian elements.

from_cartesian_to_rtn(state[, ...])

Converts a cartesian state to the RTN frame.

from_date_str_to_days(date[, date0, date_format])

Converts a date string to the number of days since a reference date.

from_datetime_to_cdm_datetime_str(date)

Converts a datetime object to a string in the format 'yyyy-mm-ddTHH:MM:SS.FFF'.

from_jd_to_cdm_datetime_str(jd_date)

Converts a Julian Date to a string in the format 'yyyy-mm-ddTHH:MM:SS.FFF'.

from_jd_to_mjd(jd_date)

Converts a Julian Date to a Modified Julian Date.

from_mjd_to_jd(mjd_date)

Converts a Modified Julian Date to a Julian Date.

from_rtn_to_cartesian(state_rtn, ...)

Converts a RTN state to the cartesian frame.

from_string_to_datetime(string)

Converts a string to a datetime object.

get_ccsds_time_format(time_string)

Original MATLAB source code (adapted by Andrew Ng, 18/3/2022): NASA CARA Analysis Tools

has_nan_or_inf(value)

Checks if a value is NaN or Inf.

is_date(date_string, date_format)

Checks if a string is in a valid date format.

is_number(s)

keplerian_cartesian_partials(state, mu)

Computes the partial derivatives of the cartesian state with respect to the keplerian elements.

progress_bar(i, len)

progress_bar_end([message])

progress_bar_init(message, num_iters[, ...])

progress_bar_update(iter)

propagate_upsample(tle, times_mjd[, ...])

Propagates a TLE object to a set of times, and upsamples the result.

rotation_matrix(state)

Computes the UVW rotation matrix.

seed([seed])

tile_rows_cols(num_items)

tle_elements(tles)

This function takes a list of TLEs as input and extracts their elements as lists.

trace_to_event(trace)

Converts a trace object to an Event object.

transform_date_str(date_string, ...)

Transforms a date string from one format to another.

upsample(s, target_resolution)

Upsamples a tensor to a given resolution, via linear interpolation.

Classes

Categorical([probs, logits, validate_args])

Wraps torch.distributions.categorical.Categorical with TorchDistributionMixin.

MixtureSameFamily(mixture_distribution, ...)

Wraps torch.distributions.mixture_same_family.MixtureSameFamily with TorchDistributionMixin.

TorchDistribution([batch_shape, ...])

Base class for PyTorch-compatible distributions with Pyro support.

TruncatedNormal(loc, scale, low, high)

Truncated Normal distribution with specified lower and upper bounds.

Uniform(low, high[, validate_args])

Wraps torch.distributions.uniform.Uniform with TorchDistributionMixin.