ra_where='(c1.ra BETWEEN %f AND 360 OR c1.ra BETWEEN 0 AND %f)'%(ra_st,ra_end)
conn=db.connect(hostname=db_host \
,port=db_port \
,database=db_dbase \
,username=db_user \
,password=db_passwd \
)
# Remove output file if already existing.
ifos.path.isfile(outfile):
os.remove(outfile)
try:
cursor=conn.cursor()
# This query concatenates the requested columns per row in a single string in the correct BBS format.
cursor.execute(#"COPY " + \
"SELECT t.line "+ \
" FROM (SELECT CAST('format = Name, Type, Ra, Dec, I, Q, U, V, MajorAxis, MinorAxis, Orientation, ReferenceFrequency=\\'60e6\\', SpectralIndexDegree=\\'0\\', SpectralIndex:0=\\'0.0\\', SpectralIndex:1=\\'0.0\\'' AS VARCHAR(300)"+ \