forked from erosita/uds
20 lines
490 B
Python
Executable File
20 lines
490 B
Python
Executable File
from astropy.io import fits
|
|
import sys
|
|
|
|
filename='Gaia_unWISE_Coma.fits.catalog'
|
|
#filename='Gaia_unWISE_Coma.footprint.fits.catalog'
|
|
fout=filename.replace(".fits.catalog", ".reg")
|
|
|
|
hdul = fits.open(filename)
|
|
#hdul.info()
|
|
|
|
tbdata = hdul[1].data
|
|
hdul.close()
|
|
|
|
|
|
with open("./{}".format(fout), 'w') as writer:
|
|
for rec in tbdata:
|
|
print("fk5;circle({}, {}, 0.008)".format(rec['RA'],rec['DEC']))
|
|
writer.write("fk5;circle({}, {}, {})\n".format(rec['RA'],rec['DEC'],0.0080000))
|
|
|