Module sprit.sprit_utils

Functions

def assert_check(var, cond=None, var_type=None, error_message='Output not valid', verbose=False)
def check_gui_requirements()
def check_mark(incolor=False, interminal=False)

The default Windows terminal is not able to display the check mark character correctly. This function returns another displayable character if platform is Windows

def check_tsteps(hvsr_data)

Check time steps of PPSDS to make sure they are all the same length

def check_xvalues(ppsds)

Check x_values of PPSDS to make sure they are all the same length

def checkifpath(filepath, sample_list='', verbose=False, raise_error=False)

Support function to check if a filepath is a pathlib.Path object and tries to convert if not

Parameters

filepath : str or pathlib.Path, or anything
Filepath to check. If not a valid filepath, will not convert and raises error

Returns

filepath : pathlib.Path
pathlib.Path of filepath
def format_time(inputDT, tzone='UTC')

Private function to format time, used in other functions

Formats input time to datetime objects in utc

Parameters

inputDT : str or datetime obj
Input datetime. Can include date and time, just date (time inferred to be 00:00:00.00) or just time (if so, date is set as today)

tzone : str='utc' or int {'utc', 'local'} Timezone of data entry. If string and not utc, assumed to be timezone of computer running the process. If int, assumed to be offset from UTC (e.g., CST in the United States is -6; CDT in the United States is -5)

Returns

outputTimeObj : datetime object in UTC
Output datetime.datetime object, now in UTC time.
def get_char(in_char)

Outputs character with proper encoding/decoding

def has_required_channels(stream)
def make_it_classy(input_data, verbose=False)
def read_from_RS(dest, src='SHAKENAME@HOSTNAME:/opt/data/archive/YEAR/AM/STATION/', opts='az', username='myshake', password='shakeme', hostname='rs.local', year='2023', sta='RAC84', sleep_time=0.1, verbose=True, save_progress=True, method='scp')
def time_it(_t, proc_name='', verbose=True)

Computes elapsed time since the last call.

def x_mark(incolor=False, inTerminal=False)

The default Windows terminal is not able to display the check mark character correctly. This function returns another displayable character if platform is Windows