How to use the function in georinex

To help you get started, we’ve selected a few georinex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scivision / georinex / georinex / View on Github external
yield f
    elif fn.suffix == '.gz':
        with, 'rt') as f:
            yield f
    elif fn.suffix == '.zip':
        with zipfile.ZipFile(fn, 'r') as z:
            flist = z.namelist()
            for rinexfn in flist:
                with, 'r') as bf:
                    f = io.TextIOWrapper(bf, newline=None)
                    yield f
    elif fn.suffix == '.Z':
        if unlzw is None:
            raise ImportError('pip install unlzw')
        with'rb') as zu:
            with io.StringIO(unlzw.unlzw('ascii')) as f:
                yield f

        with'r') as f:
            yield f
github scivision / georinex / georinex / View on Github external
def rinexinfo(f: Union[Path, TextIO]) -> Dict[str, Any]:
    """verify RINEX version"""
    if isinstance(f, (str, Path)):
        fn = Path(f).expanduser()

        if fn.suffixes == ['.crx', '.gz']:
            with, 'rt') as z:
                return rinexinfo(io.StringIO(
        elif fn.suffix == '.crx':
            with'r') as f:
                return rinexinfo(io.StringIO(
            with opener(fn) as f:
                return rinexinfo(f)

        line = f.readline(80)  # don't choke on binary files
        if not isinstance(line, str) or line[60:80] not in ('RINEX VERSION / TYPE', 'CRINEX VERS   / TYPE'):
            raise ValueError

        info = {'version': float(line[:9]),  # yes :9
                'filetype': line[20],
                'systems': line[40],
                'hatanaka': line[20:40] == 'COMPACT RINEX FORMAT'}