Example #1
0
def rinex_iri_stec(obs_fname,
                   nav_fname,
                   work_path=None,
                   decimate=None,
                   processes=cpu_count()):
    """ ??? """
    with SmartTempDir(work_path) as work_path:
        dump_fname = replace_path(work_path, obs_fname + '.dump')
        dump_preprocessed_rinex(dump_fname,
                                obs_fname,
                                nav_fname,
                                work_path=work_path,
                                decimate=decimate)
        obs_map = read_rindump(dump_fname)
        obs_map_iter = ObsMapFlatIterator(obs_map)

        pool = Pool(processes)
        stec_output = pool.map(iri_stec_wrap,
                               izip(repeat(obs_map.xyz), obs_map_iter))
        pool.close()
        pool.join()

        stec_map = STecMap()
        stec_map.xyz = obs_map.xyz
        stec_map.llh = obs_map.llh
        for sat, dt, stec_info in stec_output:
            stec_map[sat][dt] = stec_info
    return stec_map
Example #2
0
def rinex_iri_stec(obs_fname,
                   nav_fname,
                   work_path=None,
                   decimate=None,
                   processes=cpu_count()):
    """ ??? """
    with SmartTempDir(work_path) as work_path:
        dump_fname = replace_path(work_path, obs_fname + '.dump')
        dump_preprocessed_rinex(dump_fname,
                                obs_fname,
                                nav_fname,
                                work_path=work_path,
                                decimate=decimate)
        obs_map = read_rindump(dump_fname)
        obs_map_iter = ObsMapFlatIterator(obs_map)

        pool = Pool(processes)
        stec_output = pool.map(iri_stec_wrap, izip(repeat(obs_map.xyz), obs_map_iter))
        pool.close()
        pool.join()

        stec_map = STecMap()
        stec_map.xyz = obs_map.xyz
        stec_map.llh = obs_map.llh
        for sat, dt, stec_info in stec_output:
            stec_map[sat][dt] = stec_info
    return stec_map
Example #3
0
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
Example #4
0
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
Example #5
0
                                                     obs.satx,
                                                     obs.saty,
                                                     obs.satz)
    return processed_obs_map


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    logging.getLogger('sh').setLevel(logging.WARNING)

    rinex_fname = '/Users/butala/src/absolute_tec/jplm0010.14o'
    nav_fname = '/Users/butala/src/absolute_tec/jplm0010.14n'

    info = rinex_info(rinex_fname,
                      nav_fname)
    interval = info['interval']

    (time_reject_map,
     phase_adjust_map) = phase_edit(rinex_fname, interval, work_path='/tmp')

    rinex_dump_fname = '/tmp/jplm0010.14o.dump'
    dump_rinex(rinex_dump_fname,
               rinex_fname,
               nav_fname)

    obs_map = read_rindump(rinex_dump_fname)

    obs_map = filter_obs_map(obs_map,
                             time_reject_map,
                             phase_adjust_map)