def write(self, filename='same'):
        """
        write object to an ENVI header file
        """
        if filename == 'same':
            filename = self.filename
        if not filename.endswith('.hdr'):
            filename += '.hdr'
        with open(filename, 'w') as out:
            out.write(self.__str__())
def write ( self , filename = 'same' ) : if filename == 'same' : filename = self . filename if not filename . endswith ( '.hdr' ) : filename += '.hdr' with open ( filename , 'w' ) as out : out . write ( self . __str__ ( ) )
write object to an ENVI header file