#!/usr/bin/env python
# -*- coding:  utf-8  -*-
from astropy.io import fits

hdul = fits.open('mcxc.fits.catalog')
tbdata = hdul[1].data
hdul.close()

with open("../../products/mcxc.reg", 'w') as writer:
    for rec in tbdata:
        writer.write("fk5;point({}, {}) # color=magenta text={{{}}}\n".format(rec['RAJ2000'],
                                                                              rec['DEJ2000'],
                                                                              rec['OName'],))


