def phase_edit_process(h5_fname, rinex_fname, nav_fname, work_path=None, preprocess=True, discfix_args=[]): """ ??? """ with SmartTempDir(work_path) as work_path: # preprocess if preprocess: logger.info('preprocessing {}'.format(rinex_fname)) unprocessed_rinex = rinex_fname rinex_fname = replace_path(work_path, rinex_fname) normalize_rinex(rinex_fname, unprocessed_rinex) # phase edit logger.info('phase edit {}'.format(rinex_fname)) (time_reject_map, phase_adjust_map) = phase_edit(rinex_fname, work_path=work_path, discfix_args=discfix_args) # dump RINEX and read in ObsMap logger.info('dumping {}'.format(rinex_fname)) rinex_dump_fname = replace_path(work_path, rinex_fname + '.dump') dump_rinex(rinex_dump_fname, rinex_fname, nav_fname) obs_map = read_rindump(rinex_dump_fname) # apply phase edit adjustments to ObsMap # CHANGE: OUTPUT IS ARCMAP!!! logger.info('applying phase edit adjustments') edited_obs_map = filter_obs_map(obs_map, time_reject_map, phase_adjust_map) # store ObsMap to file # CHANGE: NO, OUTPUT IS ARCMAP!!! logger.info('storing output to {}'.format(h5_fname)) edited_obs_map.dump(h5_fname, title='pyrsss.gps.phase_edit output') return h5_fname
def dump_preprocessed_rinex(dump_fname, obs_fname, nav_fname, work_path=None, decimate=None): """ Dump RINEX *obs_fname* and *nav_fname* to *dump_fname*. Preprocess the RNIEX file (i.e., normalization). Use *work_path* for intermediate files (use an automatically cleaned up area if not specified). Reduce the time interval to *decimate* [s] if given. Return *dump_fname*. """ with SmartTempDir(work_path) as work_path: output_rinex_fname = replace_path(work_path, obs_fname) normalize_rinex(output_rinex_fname, obs_fname, decimate=decimate) dump_rinex(dump_fname, output_rinex_fname, nav_fname) return dump_fname
FRONTEND = False # pkl_fname = '/tmp/jplm0010.14o.gps.pkl' pkl_fname = '/tmp/algo0010.14o.gps.pkl' ionex_jpl_fname = '/Users/butala/Documents/IARPA/absolute_tec/JPLH0010.14I' ionex_code_fname = '/Users/butala/Documents/IARPA/absolute_tec/codg0010.14i' if FRONTEND: # preprocess rinex_fname = '/Users/butala/Documents/IARPA/absolute_tec/algo0010.14o' normalized_rinex_fname = '/tmp/algo0010.14o' normalize_rinex(normalized_rinex_fname, rinex_fname, gps=True, glonass=True) # dump GLONASS dump_fname = '/tmp/algo0010.14o.glonass.dump' nav_fname = '/Users/butala/Documents/IARPA/absolute_tec/algo0010.14n' gnav_fname = '/Users/butala/Documents/IARPA/absolute_tec/algo0010.14g' receiver_position = get_receiver_position(normalized_rinex_fname, nav_fname) data_keys = [ 'RC1C', 'RC1P', 'RC2P', 'RL1C', 'RL2C', 'AZI', 'ELE', 'SVX', 'SVY', 'SVZ' ]
FRONTEND = True # pkl_fname = '/tmp/jplm0010.14o.gps.pkl' pkl_fname = '/tmp/algo0010.14o.gps.pkl' ionex_jpl_fname = '/Users/butala/Documents/IARPA/absolute_tec/JPLH0010.14I' ionex_code_fname = '/Users/butala/Documents/IARPA/absolute_tec/codg0010.14i' if FRONTEND: # preprocess # rinex_fname = '/Users/butala/Documents/IARPA/absolute_tec/jplm0010.14o' rinex_fname = '/Users/butala/Documents/IARPA/absolute_tec/algo0010.14o' # normalized_rinex_fname = '/tmp/jplm0010.14o' normalized_rinex_fname = '/tmp/algo0010.14o' normalize_rinex(normalized_rinex_fname, rinex_fname) # dump GPS # dump_fname = '/tmp/jplm0010.14o.gps.dump' dump_fname = '/tmp/algo0010.14o.gps.dump' # nav_fname = '/Users/butala/Documents/IARPA/absolute_tec/jplm0010.14n' nav_fname = '/Users/butala/Documents/IARPA/absolute_tec/algo0010.14n' receiver_position = get_receiver_position(normalized_rinex_fname, nav_fname) dump_rinex(dump_fname, normalized_rinex_fname, nav_fname, receiver_position=receiver_position)