How to use the pvl.PVLModule 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
-------
        PVLModule label for the given NumPy array.

        Usage: self.label = _create_label(array)

        """
        if len(array.shape) == 3:
            bands = array.shape[0]
            lines = array.shape[1]
            line_samples = array.shape[2]
        else:
            bands = 1
            lines = array.shape[0]
            line_samples = array.shape[1]
        record_bytes = line_samples * array.itemsize
        label_module = pvl.PVLModule([
            ('PDS_VERSION_ID', 'PDS3'),
            ('RECORD_TYPE', 'FIXED_LENGTH'),
            ('RECORD_BYTES', record_bytes),
            ('LABEL_RECORDS', 1),
            ('^IMAGE', 1),
            ('IMAGE',
                {'BANDS': bands,
                 'LINES': lines,
                 'LINE_SAMPLES': line_samples,
                 'MAXIMUM': 0,
                 'MEAN': 0,
                 'MEDIAN': 0,
                 'MINIMUM': 0,
                 'SAMPLE_BITS': array.itemsize * 8,
                 'SAMPLE_TYPE': 'MSB_INTEGER',
                 'STANDARD_DEVIATION': 0})

pvl

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

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages