sprit.sprit_utils module

sprit.sprit_utils.assert_check(var, cond=None, var_type=None, error_message='Output not valid', verbose=False)[source]
sprit.sprit_utils.check_gui_requirements()[source]
sprit.sprit_utils.check_mark(incolor=False, interminal=False)[source]

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

sprit.sprit_utils.check_tsteps(hvsr_data)[source]

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

sprit.sprit_utils.check_xvalues(ppsds)[source]

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

sprit.sprit_utils.checkifpath(filepath, sample_list='', verbose=False)[source]

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

Parameters:
filepathstr or pathlib.Path, or anything

Filepath to check. If not a valid filepath, will not convert and raises error

Returns:
filepathpathlib.Path

pathlib.Path of filepath

sprit.sprit_utils.format_time(inputDT, tzone='UTC')[source]

Private function to format time, used in other functions

Formats input time to datetime objects in utc

Parameters:
inputDTstr 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)

tzonestr=’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:
outputTimeObjdatetime object in UTC

Output datetime.datetime object, now in UTC time.

sprit.sprit_utils.get_char(in_char)[source]

Outputs character with proper encoding/decoding

sprit.sprit_utils.has_required_channels(stream)[source]
sprit.sprit_utils.make_it_classy(input_data, verbose=False)[source]
sprit.sprit_utils.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')[source]
sprit.sprit_utils.time_it(_t, proc_name='', verbose=True)[source]

Computes elapsed time since the last call.

sprit.sprit_utils.x_mark(incolor=False, inTerminal=False)[source]

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