'Write out SIP keywords.  Returns a dictionary of key-value
pairs.'

def _write_sip_kw(self):

    if (self.sip is None):
        return {}
    keywords = {}
    def write_array(name, a):
        if (a is None):
            return
        size = a.shape[0]
        keywords[str(u'{0}_ORDER').format(name)] = (size - 1)
        for i in range(size):
            for j in range((size - i)):
                if (a[(i, j)] != 0.0):
                    keywords[str(u'{0}_{1:d}_{2:d}').format(name, i, j)] = a[(i, j)]
    write_array(str(u'A'), self.sip.a)
    write_array(str(u'B'), self.sip.b)
    write_array(str(u'AP'), self.sip.ap)
    write_array(str(u'BP'), self.sip.bp)
    return keywords
