ssapy.io

Collection of functions to read from and write to various file formats.

Functions

append_csv(file_names[, save_path, sep, ...])

Appends multiple CSV files into a single CSV file.

append_csv_on_disk(csv_files, output_file)

Append multiple CSV files into a single CSV file.

append_dict_to_csv(file_name, data_dict[, ...])

Append data from a dictionary to a CSV file.

append_h5(filename, pathname, append_data)

Append data to key in HDF5 file.

b3obs2pos(b3line)

Return an SGP4 Satellite imported from B3OBS data.

combine_h5(filename, files[, verbose, overwrite])

Combine multiple HDF5 files into a single HDF5 file.

exists(pathname)

Check if a file or directory exists.

exists_in_csv(csv_file, column, number[, sep])

Checks if a number exists in a specific column of a CSV file.

exists_in_csv_old(csv_file, column, number)

Check if a specific value exists in a given column of a CSV file.

file_exists_extension_agnostic(filename)

Check if a file with the given name and any extension exists.

get_all_files_recursive([path_name])

Recursively retrieve all file paths from a directory and its subdirectories.

get_memory_usage()

Print the memory usage of the current process.

get_tel_pos_itrf_to_gcrs(time[, tel_label])

Convert telescope locations in ITRF (i.e., fixed to the earth) to GCRS (i.e., geocentric celestial frame)

guess_csv_delimiter(file_name)

Guess the delimiter used in a CSV file.

h5_key_exists(filename, key)

Checks if a key exists in an HDF5 file.

h5_keys(file_path)

List all groups in HDF5 file.

h5_root_keys(file_path)

Retrieve the keys in the root group of an HDF5 file.

listdir([dir_path, files_only, exclude, ...])

Lists files and directories in a specified path with optional filtering and sorting.

load_b3obs_file(file_name)

Convenience function to load all entries in a B3OBS file

load_np(filename_)

Load a NumPy array from a binary file.

load_pickle(filename_)

Load data from a pickle file.

make_tle(a, e, i, pa, raan, trueAnomaly, t)

Create a TLE from Kozai mean orbital elements

makedf(df)

Convert an input into a pandas DataFrame.

merge_dicts(file_names, save_path)

Merge multiple dictionaries stored in pickle files into a single dictionary and save the result.

mkdir(pathname)

Creates a directory if it does not exist.

overwrite_h5(filename, pathname, new_data)

Overwrite key in HDF5 file.

parseB3(filename)

Load data from a B3 observation file

parseB3Line(line)

Read one line of a B3 file and parse into distinct catalog components

parse_overpunched(line)

Parse and adjust a string containing overpunched numeric values.

parse_tle(tle)

Parse a TLE returning Kozai mean orbital elements.

pd_flatten(data[, factor])

Flatten and process a list of data values.

pdstr_to_arrays(df)

Convert a pandas Series or DataFrame with string representations of arrays into a NumPy array of actual arrays.

read_csv(file_name[, sep, dtypes, col, ...])

Read a CSV file with options.

read_csv_header(file_name[, sep])

Get the header of a CSV file.

read_h5(filename, pathname)

Load data from HDF5 file.

read_h5_all(file_path)

Read all datasets from an HDF5 file into a dictionary.

read_tle(sat_name, tle_filename)

Get the TLE data from the file for the satellite with the given name

read_tle_catalog(fname[, n_lines])

Read in a TLE catalog file

rmdir(source_)

Deletes a directory and its contents if it exists.

rmfile(pathname)

Deletes a file if it exists.

save_csv(file_name, df[, sep, dtypes])

Save a Pandas DataFrame to a CSV file.

save_csv_array_to_line(filename, array[, ...])

Appends a single row of data to a CSV file with a specified delimiter.

save_csv_header(filename, header[, delimiter])

Saves a header row to a CSV file with a specified delimiter.

save_csv_line(file_name, df[, sep, dtypes])

Save a Pandas DataFrame to a CSV file, appending the DataFrame to the file if it exists.

save_h5(filename, pathname, data)

Save data to HDF5 file with recursive attempt in case of write errors.

save_np(filename_, data_)

Save a NumPy array to a binary file.

save_pickle(filename_, data_)

Save data to a pickle file.

str_to_array(s)

Convert a string representation of an array back into a NumPy array.