How to use the pvl._collections.Units function in pvl

To help you get started, we’ve selected a few pvl 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 planetarypy / planetaryimage / planetaryimage / pds3image.py View on Github external
elif isinstance(pointer_data, Units):
            if pointer_data.units == 'BYTES':
                return [pointer_data.value, None]
            else:
                raise ValueError(
                    'Expected  as image pointer units but found (%s)'
                    % pointer_data.units)
        elif isinstance(pointer_data, six.string_types):
            return [0, pointer_data]
        elif isinstance(pointer_data, list):
            if len(pointer_data) == 1:
                return [0, pointer_data]
            else:
                if isinstance(pointer_data[1], six.integer_types):
                    return [(pointer_data[1] - 1) * record_bytes, pointer_data[0]]
                elif isinstance(pointer_data[1], Units):
                    if pointer_data[1].units == 'BYTES':
                        return [pointer_data[1].value, pointer_data[0]]
                    else:
                        raise ValueError(
                            'Expected  as image pointer units but found (%s)'
                            % pointer_data.units)
        else:
            raise ValueError('Unsupported pointer type')
github planetarypy / planetaryimage / planetaryimage / pds3image.py View on Github external
record_bytes
            Record multiplier value

        Returns
        -------
        object_location : array
            Returns an array like::

                [start_byte, filename]
                [start_byte, None]
                [0, filename]
        """
        if isinstance(pointer_data, six.integer_types):
            return [(pointer_data - 1) * record_bytes, None]
        elif isinstance(pointer_data, Units):
            if pointer_data.units == 'BYTES':
                return [pointer_data.value, None]
            else:
                raise ValueError(
                    'Expected  as image pointer units but found (%s)'
                    % pointer_data.units)
        elif isinstance(pointer_data, six.string_types):
            return [0, pointer_data]
        elif isinstance(pointer_data, list):
            if len(pointer_data) == 1:
                return [0, pointer_data]
            else:
                if isinstance(pointer_data[1], six.integer_types):
                    return [(pointer_data[1] - 1) * record_bytes, pointer_data[0]]
                elif isinstance(pointer_data[1], Units):
                    if pointer_data[1].units == 'BYTES':

pvl

Python implementation for PVL (Parameter Value Language) parsing and encoding.

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages