pyroSAR/gamma/auxil.py
def envidict(self):
        """
        export relevant metadata to a ENVI HDR file compliant format
        
        Returns
        -------
        dict
        """
        out = dict(bands=1,
                   header_offset=0,
                   file_type='ENVI Standard',
                   interleave='bsq',
                   sensor_type='Unknown',
                   byte_order=1,
                   wavelength_units='Unknown')
        
        out['samples'] = getattr(self, union(['width', 'range_samples', 'samples'], self.keys)[0])
        out['lines'] = getattr(self, union(['nlines', 'azimuth_lines', 'lines'], self.keys)[0])
        
        dtypes_lookup = {'FCOMPLEX': 6, 'FLOAT': 4, 'REAL*4': 4, 'INTEGER*2': 2, 'SHORT': 12}
        dtype = getattr(self, union(['data_format', 'image_format'], self.keys)[0])
        
        if dtype == 'SCOMPLEX':
            raise TypeError('unsupported data type: SCOMPLEX (2x16 bit complex)')
        
        out['data_type'] = dtypes_lookup[dtype]
        
        if out['data_type'] == 6:
            out['complex_function'] = 'Power'
        # projections = ['AEAC', 'EQA', 'LCC', 'LCC2', 'OMCH', 'PC', 'PS', 'SCH', 'TM', 'UTM']
        if hasattr(self, 'DEM_projection'):
            if self.DEM_projection == 'UTM':
                hem = 'North' if float(self.false_northing) == 0 else 'South'
                out['map_info'] = ['UTM', '1.0000', '1.0000',
                                   self.corner_east, self.corner_north,
                                   str(abs(float(self.post_east))), str(abs(float(self.post_north))),
                                   self.projection_zone, hem, 'WGS-84', 'units=Meters']
            elif self.DEM_projection == 'EQA':
                out['map_info'] = ['Geographic Lat/Lon', '1.0000', '1.0000',
                                   self.corner_lon, self.corner_lat,
                                   str(abs(float(self.post_lon))), str(abs(float(self.post_lat))),
                                   'WGS-84', 'units=Degrees']
            else:
                raise RuntimeError('unsupported projection')
        return out

        export relevant metadata to a ENVI HDR file compliant format
        
        Returns
        -------
        dict
        
export relevant metadata to a ENVI HDR file compliant format
Returns

dict
export relevant metadata to a ENVI HDR file compliant format Returns dict
def envidict(self):
        out = dict(bands=1,
                   header_offset=0,
                   file_type='ENVI Standard',
                   interleave='bsq',
                   sensor_type='Unknown',
                   byte_order=1,
                   wavelength_units='Unknown')
        out['samples'] = getattr(self, union(['width', 'range_samples', 'samples'], self.keys)[0])
        out['lines'] = getattr(self, union(['nlines', 'azimuth_lines', 'lines'], self.keys)[0])
        dtypes_lookup = {'FCOMPLEX': 6, 'FLOAT': 4, 'REAL*4': 4, 'INTEGER*2': 2, 'SHORT': 12}
        dtype = getattr(self, union(['data_format', 'image_format'], self.keys)[0])
        if dtype == 'SCOMPLEX':
            raise TypeError('unsupported data type: SCOMPLEX (2x16 bit complex)')
        out['data_type'] = dtypes_lookup[dtype]
        if out['data_type'] == 6:
            out['complex_function'] = 'Power'
        if hasattr(self, 'DEM_projection'):
            if self.DEM_projection == 'UTM':
                hem = 'North' if float(self.false_northing) == 0 else 'South'
                out['map_info'] = ['UTM', '1.0000', '1.0000',
                                   self.corner_east, self.corner_north,
                                   str(abs(float(self.post_east))), str(abs(float(self.post_north))),
                                   self.projection_zone, hem, 'WGS-84', 'units=Meters']
            elif self.DEM_projection == 'EQA':
                out['map_info'] = ['Geographic Lat/Lon', '1.0000', '1.0000',
                                   self.corner_lon, self.corner_lat,
                                   str(abs(float(self.post_lon))), str(abs(float(self.post_lat))),
                                   'WGS-84', 'units=Degrees']
            else:
                raise RuntimeError('unsupported projection')
        return out
def envidict ( self ) : out = dict ( bands = 1 , header_offset = 0 , file_type = 'ENVI Standard' , interleave = 'bsq' , sensor_type = 'Unknown' , byte_order = 1 , wavelength_units = 'Unknown' ) out [ 'samples' ] = getattr ( self , union ( [ 'width' , 'range_samples' , 'samples' ] , self . keys ) [ 0 ] ) out [ 'lines' ] = getattr ( self , union ( [ 'nlines' , 'azimuth_lines' , 'lines' ] , self . keys ) [ 0 ] ) dtypes_lookup = { 'FCOMPLEX' : 6 , 'FLOAT' : 4 , 'REAL*4' : 4 , 'INTEGER*2' : 2 , 'SHORT' : 12 } dtype = getattr ( self , union ( [ 'data_format' , 'image_format' ] , self . keys ) [ 0 ] ) if dtype == 'SCOMPLEX' : raise TypeError ( 'unsupported data type: SCOMPLEX (2x16 bit complex)' ) out [ 'data_type' ] = dtypes_lookup [ dtype ] if out [ 'data_type' ] == 6 : out [ 'complex_function' ] = 'Power' if hasattr ( self , 'DEM_projection' ) : if self . DEM_projection == 'UTM' : hem = 'North' if float ( self . false_northing ) == 0 else 'South' out [ 'map_info' ] = [ 'UTM' , '1.0000' , '1.0000' , self . corner_east , self . corner_north , str ( abs ( float ( self . post_east ) ) ) , str ( abs ( float ( self . post_north ) ) ) , self . projection_zone , hem , 'WGS-84' , 'units=Meters' ] elif self . DEM_projection == 'EQA' : out [ 'map_info' ] = [ 'Geographic Lat/Lon' , '1.0000' , '1.0000' , self . corner_lon , self . corner_lat , str ( abs ( float ( self . post_lon ) ) ) , str ( abs ( float ( self . post_lat ) ) ) , 'WGS-84' , 'units=Degrees' ] else : raise RuntimeError ( 'unsupported projection' ) return out
export relevant metadata to a ENVI HDR file compliant format
Returns
export relevant metadata to a ENVI HDR file compliant format Returns
"""
        export relevant metadata to a ENVI HDR file compliant format
        
        Returns
        -------
        dict
        """ # projections = ['AEAC', 'EQA', 'LCC', 'LCC2', 'OMCH', 'PC', 'PS', 'SCH', 'TM', 'UTM']
self